forked from csev/py4e
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgrade-detail.php
More file actions
49 lines (40 loc) · 1.01 KB
/
grade-detail.php
File metadata and controls
49 lines (40 loc) · 1.01 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
<?php
require_once "../config.php";
\Tsugi\Core\LTIX::getConnection();
use \Tsugi\Grades\GradeUtil;
use \Tsugi\Util\U;
session_start();
// Get the user's grade data also checks session
$row = GradeUtil::gradeLoad($_REQUEST['user_id']);
$menu = new \Tsugi\UI\MenuSet();
$menu->addLeft(__('Back to all grades'), 'index.php');
// View
$OUTPUT->header();
$OUTPUT->bodyStart();
$OUTPUT->topNav($menu);
$OUTPUT->flashMessages();
// Show the basic info for this user
GradeUtil::gradeShowInfo($row, false);
// Unique detail
if ( U::isEmpty($row['json'])) {
echo("<p>No submission</p>\n");
$OUTPUT->footer();
return;
}
echo("<p>Submission:</p>\n");
$json = json_decode($row['json']);
if ( is_object($json) ) {
echo("<pre>\n");
if ( isset($json->code)) {
echo(htmlentities($json->code));
echo("\n");
unset($json->code);
}
if ( count(get_object_vars($json)) > 0 ) {
echo("\nJson:\n");
var_dump($json);
echo("\n");
}
echo("</pre>\n");
}
$OUTPUT->footer();