forked from csev/py4e
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfreebie.php
More file actions
77 lines (65 loc) · 2.24 KB
/
freebie.php
File metadata and controls
77 lines (65 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
use \Tsugi\Core\LTIX;
use \Tsugi\Util\LTI;
use \Tsugi\Util\Net;
$oldgrade = $RESULT->grade;
if ( isset($_POST['grade']) ) {
$grade = $_POST['grade'] ?? null;
if (!is_numeric($grade) ) {
$_SESSION['error'] = "A QA Engineer walks into restaraunt ...";
header('Location: '.addSession('index.php'));
return;
}
$grade = $grade * 1.0;
if ( $grade < 0.0 ) {
$_SESSION['error'] = "No need to be so negative about yourself ...";
header('Location: '.addSession('index.php'));
return;
}
if ( $grade < 1.0 ) {
$_SESSION['error'] = "The range is 0-100 ...";
header('Location: '.addSession('index.php'));
return;
}
if ( $grade == 42.0 ) {
$_SESSION['error'] = "Achievement unlocked ...";
$grade = 100.0;
LTIX::gradeSendDueDate($grade/100.0, $oldgrade, $dueDate);
header('Location: '.addSession('index.php'));
return;
}
if ( $grade < 51.0 ) {
$_SESSION['error'] = "You should have more confidence ...";
header('Location: '.addSession('index.php'));
return;
}
if ( $grade > 100.0 ) {
$_SESSION['error'] = "I like your confidence but the protocol does not support numbers > 100 ...";
header('Location: '.addSession('index.php'));
return;
}
LTIX::gradeSendDueDate($grade/100.0, $oldgrade, $dueDate);
header('Location: '.addSession('index.php'));
return;
}
?>
<p>
<b>Choose your own grade!</b>
</p>
<p>
Congratulations - this assignment gives you a grade with no work. Frankly, you have been working very hard
to get to this point and you deserve to relax and let this tool give you the grade you deserve!
You can choose any grade you want (we recommend 100).
</p>
<form method="post">
Grade you want (0-100): <input type="text" size="10" name="grade">
<input type="submit" value="Submit Grade"><br/>
</form>
<p>
Actually we use this placeholder assignment when we are going to delete an assignment from a
future verison of the course but need a place holder for that assignment until the course is revised :).
And we also give you a free look at one of Dr. Chuck's race cars - the "Forarri".
</p>
<center>
<img src="Forarri_2MB.png" style="width: 50%;">
</center>