Repository navigation
Expand file tree
/
Copy pathview.php
More file actions
71 lines (63 loc) · 2.13 KB
/
Copy pathview.php
File metadata and controls
71 lines (63 loc) · 2.13 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title> Grading Exam Papers </title>
<script src="https://d3js.org/d3.v4.min.js"></script>
<!-- bootstrap -->
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<!-- x-editable (bootstrap version) -->
<link href="//cdnjs.cloudflare.com/ajax/libs/x-editable/1.4.6/bootstrap-editable/css/bootstrap-editable.css" rel="stylesheet"/>
<script src="//cdnjs.cloudflare.com/ajax/libs/x-editable/1.4.6/bootstrap-editable/js/bootstrap-editable.min.js"></script>
<script src="fabric/fabric.js"> </script>
<script src="grade.js"> </script>
<script type="text/javascript">
<?php
$urid = "";
$evid = null;
if (array_key_exists("urid", $_GET)) {
$urid = $_GET["urid"];
}
if (array_key_exists("examid", $_GET)) {
$evid = $_GET["examid"];
}
if (array_key_exists("evid", $_GET)) {
$evid = $_GET["evid"];
}
function getExam($evid) {
if ($evid == null) { return null; }
$db = new SQLite3('tmpdir/exams.db');
$results = $db->query("SELECT * FROM versions where id = $evid");
$res = [];
while ($row = $results->fetchArray()) {
$res = [$row["id"], $row["examid"],
$row["name"], $row["dbfile"], $row["scandir"],
$row["pages"], $row["graders"]];
break;
}
return json_encode($res);
}
$exam = getExam($evid);
echo "selectedExam = $exam;\n";
echo "currScan = new ShowID('View', selectedExam);\n";
echo "currScan.init('View:$urid');\n";
?>
</script>
<style>
html, body {
margin: 0px;
background-color: white;
}
.errorInfo {
padding: 10px;
color: #d33;
}
</style>
</head>
<body>
<h1> View Grades </h1>
<div id="templateContainer"> </div>
</body>
</html>