-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstudentMainPage.php
98 lines (94 loc) · 2.81 KB
/
studentMainPage.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
<?php
// This is the main page for the student. They can vote on the lesson speed.
require 'init.php';
$sessionId = "";
if (!empty($_GET)) {
$sessionId = $_GET["q"];
}else{
if(isset($_POST['session'])){
$sessionId = $_POST['session'];
}
}
if(isset($_POST['session']))
{
$sql = "SELECT * FROM sessions WHERE id ='$sessionId'";
$result = $_SESSION['conn']->query($sql);
$count = $result->num_rows;
if ($count == 0){
header('Location: feeba404.html');
}
}else{
echo("The session number wasn't specified!!");
}
?>
<html class="feeba_survey">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Echtzeit Klassen Feedback</title>
<link rel="stylesheet" href="styles.css" />
<!-- jQuery Ajax CDN -->
<script src=
"https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js">
</script>
<script>
function speed(code){
alert("Vielen Dank für die Rückmeldung!");
$.post('setStats.php', {
speed: code,
session:"<?php echo($sessionId); ?>"},
(response) => {
console.log(response);
});
}
</script>
</head>
<body>
<header>
<div class="logo">
<img src="logo.png" />
</div>
</header>
<main class="content feeba_survey">
<div>
Wie ist die Unterrichtsgeschwindigkeit für dich?
</div>
<div class="main">
<div class="survey">
<button onclick="speed(1)" class="btn vote">
<div id="button_container">
<div id="button_img_wrap">
<img src="icons/rabbit.png" width="30" height="30" />
</div>
<div id="button_text_wrap">
zu schnell
</div>
</div>
</button>
<button onclick="speed(0)" class="btn vote">
<div id="button_container">
<div id="button_img_wrap">
<img src="icons/smiley.png" width="30" height="30" />
</div>
<div id="button_text_wrap">
genau richtig
</div>
</div>
</button>
<button onclick="speed(-1)" class="btn vote">
<div id="button_container">
<div id="button_img_wrap">
<img src="icons/snail.png" width="45" height="30" />
</div>
<div id="button_text_wrap">
zu langsam
</div>
</div>
</button>
</div>
</div>
</main>
<footer>
<a href="impressum.html" class="impressum">Impressum</a>
</footer>
</body>
</html>