This repository has been archived by the owner on Jun 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
teacher_detail.php
137 lines (132 loc) · 5.6 KB
/
teacher_detail.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
125
126
127
128
129
130
131
132
133
134
135
136
137
<?php
require_once(__DIR__ . "/classes/controllers/TestController.php");
session_start();
if (isset($_SESSION["username"]) && isset($_SESSION["id"])) {
$id = $_SESSION["id"];
$email = $_SESSION["username"];
$testController = new TestController();
$tests = $testController->getIdCodeByProfessor($id);
} else {
header("Location: index.php?role=professor");
die();
}
?>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Testovanie</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/dashboard.css" rel="stylesheet">
<script src="https://code.jquery.com/jquery-3.6.0.min.js" crossorigin="anonymous"></script>
<script src="js/bootstrap.bundle.min.js"></script>
<script src="script/fetch_functions.js"></script>
<script src="script/activation.js"></script>
<script src="script/notification.js"></script>
</head>
<body>
<header class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0 shadow">
<a class="navbar-brand col-md-3 col-lg-2 me-0 px-3" href="index.php">Profesor</a>
<ul class="navbar-nav px-3">
<li class="nav-item text-nowrap">
<a class="nav-link" href="logout.php">Odhlásiť sa</a>
</li>
</ul>
</header>
<div class="container-fluid">
<div class="row">
<nav id="sidebarMenu" class="col-md-3 col-lg-2 d-md-block bg-light sidebar collapse">
<div class="position-sticky pt-3">
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link" href="index.php">
Domov
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="teacher_new_test.php">
Nový test
</a>
</li>
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="teacher_detail.php">
Detaily testov
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="teacher_reports.php">
Rozdelenie úloh
</a>
</li>
</ul>
</div>
</nav>
<main class="col-md-9 ms-sm-auto col-lg-10 px-md-4">
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
<h1 class="h2">Vami vytvorené testy</h1>
<div class="btn-toolbar mb-2 mb-md-0">
<div class="btn-group me-2">
<button type="button" class="btn btn-sm btn-outline-secondary">Test in progress</button>
<button type="button" class="btn btn-sm btn-outline-secondary">Planned test</button>
</div>
</div>
</div>
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3">
<table class="table">
<thead>
<tr>
<th scope="col">ID</th>
<th scope="col">Kód testu</th>
<th scope="col">Časový limit</th>
<th scope="col">Aktivácia</th>
<th scope="col"></th>
<th scope="col"></th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
<?php
foreach ($tests as $test) {
if (strcmp($test['status'], "active") == 0) {
$status = "checked";
} else {
$status = "";
}
echo "<tr>" .
"<td>" .
$test['id'] .
"</td>" .
"<td>" .
$test['code'] .
"</td>" .
"<td>" .
$test['time_limit'] .
"</td>" .
"<td>" .
'<div class="form-check form-switch">
<input class="form-check-input activation" type="checkbox" id="' . $test['code'] . '" ' . $status . ' >
</div>' .
"</td>" .
"<td>" .
"<a href='test_detail.php?code=" . $test['code'] . "'><button class='btn btn-dark'>Detail</button></a>" .
"</td>" .
"<td>" .
"<a href='#''><button class='btn btn-dark'>Export testu</button></a>" .
"</td>" .
"<td>" .
"<a href='csvExport.php?id=" . $test['id'] ."'><button class='btn btn-dark'>Export hodnotenia</button></a>" .
"</td>" .
"</tr>";
}
?>
</tbody>
</table>
</div>
<?php include("partials/notification-html.php")?>
</main>
</div>
</div>
</body>
</html>