-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbonus.php
More file actions
65 lines (50 loc) · 1.61 KB
/
bonus.php
File metadata and controls
65 lines (50 loc) · 1.61 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
<?php
session_start();
$act = $_GET['action'];
if(!isset($_SESSION['id'])){
if (($act != "check") && ($act != "register") && ($act != "reset"))
{
header("location:login.html");
exit();
}
}
include 'projnum.php';
echo "<h1>Project $projnum Presentations</h1>\n";
if ($groupnum == -1)
{
echo "Reviewing for program $projnum will start shortly!<br>";
exit();
}
echo "Rate each of the presentations (1 is low, 5 is high).<br>\n";
include 'db.php';
include 'util.php';
$id = $_SESSION['id'];
$sql = "SELECT * FROM bonus where groupnum=$groupnum order by entry";
$rs = mysqli_query($cid, $sql);
echo "<a href=\"index.php\">Home</a><br>\n";
echo "<a href=\"bonus.php\">Refresh</a><br>\n";
echo "There are " . mysqli_num_rows($rs) . " assignments to look at.<br>\n";
echo "<form action=\"bonusfile.php\" method=\"post\">";
$counter = 0;
while ($assignment = mysqli_fetch_array($rs, MYSQLI_ASSOC))
{
echo "<hr>\n";
# echo "Review project " . $assignment["entry"] . " " . $assignment["authorid"] . "<br>\n";
$entry = $assignment["entry"];
$id = $_SESSION["id"];
$sql = "select * from bonuspoints where entry=$entry and reviewid=$id";
$scored = mysqli_query($cid, $sql);
if (mysqli_num_rows($scored) == 1)
{
$current = mysqli_fetch_array($scored, MYSQLI_ASSOC);
$value = $current["score"];
}
else
$value = 0;
echo "<b>Score (1 is low, 5 is amazing) : </b>";
echo "<input type=\"number\" name=\"$counter\" value=\"$value\" min=\"1\" max=\"5\">\n";
show_submission($cid, $assignment["entry"], 1);
$counter = $counter + 1;
}
echo "<button type=\"submit\" name=\"Submit\">Upload</button>\n";
?>