-
Notifications
You must be signed in to change notification settings - Fork 0
/
exercise_result.php
124 lines (120 loc) · 5.36 KB
/
exercise_result.php
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<?php
session_start();
$exercise_name = null;
$case_result = null;
if (!isset($_SESSION["stu_id"])) {
header("Location: /login.php");
die();
} else {
if (!isset($_SESSION["exercise_result"])) {
header("Location: problem.php");
die();
} else {
$exercise_result = $_SESSION["exercise_result"];
$exercise_data = $_SESSION["exercise_data"];
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>The Judge: Exercise Result</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm"
crossorigin="anonymous">
<link rel="stylesheet" href="css/bsadmin.css">
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.16/css/dataTables.bootstrap4.min.css">
<script defer src="https://use.fontawesome.com/releases/v5.0.6/js/all.js"></script>
</head>
<body>
<nav class="navbar navbar-expand navbar-dark bg-success">
<a class="sidebar-toggle text-light mr-3">
<i class="fa fa-bars"></i>
</a>
<a class="navbar-brand" href="#">
<i class="fa fa-code-branch"></i> The Judge</a>
<div class="navbar-collapse collapse">
<ul class="navbar-nav ml-auto">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="profile-link" data-toggle="dropdown">
<i class="fa fa-address-card"></i> <?php echo $_SESSION["stu_name"]; ?>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="profile-link">
<a class="dropdown-item" href="#">My Profile</a>
<a class="dropdown-item" href="func/logout.php">Logout</a>
</div>
</li>
</ul>
</div>
</nav>
<div class="d-flex">
<nav class="sidebar bg-dark">
<ul class="list-unstyled">
<li>
<a href="dashboard.php">
<i class="fas fa-heartbeat"></i> Dashboard</a>
</li>
<li>
<a href="lesson.php">
<i class="fas fa-book"></i> Judge Lesson</a>
</li>
<li>
<a href="problem.php">
<i class="fas fa-balance-scale"></i> Judge Exercise</a>
</li>
<li>
<a href="submit_history.php">
<i class="fas fa-check-circle"></i> Your Submit History</a>
</li>
</ul>
</nav>
<div class="content p-4">
<h1>Problem: <?php echo $exercise_data["exercise_name"]; ?></h1>
<div class="row">
<div class="col-lg-12">
<table id="case_result" class="display" width="100%" cellspacing="0">
<thead>
<tr>
<th>Case No.</th>
<th>Status</th>
<th>Score</th>
<th>Reason</th>
</tr>
</thead>
<tbody>
<?php foreach ($exercise_result as $result_item) { ?>
<tr>
<td><?php echo $result_item["case_number"]; ?></td>
<td><?php
if($result_item["result"] === "T"){
echo "TIME OUT!";
}else if($result_item["result"] === "true"){
echo "SUCCESS!";
}else if($result_item["result"] === "false"){
echo "FAILED";
}else{
echo "ERROR!";
} ?></td>
<td><?php echo $result_item["score"]; ?></td>
<td><?php echo $result_item["output"]; ?></td>
</tr>
<?php
} ?>
</tbody>
</table>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.js" integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60=" crossorigin="
anonymous "></script>
<script src="js/bsadmin.js"></script>
<script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.16/js/dataTables.bootstrap4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q "
crossorigin="anonymous "></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl "
crossorigin="anonymous "></script>
</body>
</html>