-
Notifications
You must be signed in to change notification settings - Fork 0
/
waiting.html
143 lines (122 loc) · 6.53 KB
/
waiting.html
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
138
139
140
141
142
143
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<title></title>
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Gaegu:wght@700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Amatic+SC:wght@700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Lilita+One&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Alata&display=swap">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Alatsi&display=swap">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Allerta&display=swap">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Andika+New+Basic&display=swap">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Atkinson+Hyperlegible&display=swap">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Barlow&display=swap">
<link href="https://fonts.googleapis.com/css?family=Raleway:400,300,600,800,900" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="assets/fonts/fontawesome-all.min.css">
<link rel="stylesheet" href="assets/fonts/font-awesome.min.css">
<link rel="stylesheet" href="assets/css/styles.css">
<script src="assets/js/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready( function () {
var first_name = localStorage.getItem('first_name');
var course_id = localStorage.getItem('course_id');
var username = localStorage.getItem('username');
if (first_name == null||course_id == null||username == null) {
localStorage.clear();
sessionStorage.clear();
window.location.replace('login.html');
}
var int_quizID = sessionStorage.getItem('int_quiz_ID');
var player_name = sessionStorage.getItem('player_name');
if (int_quizID == null || player_name == null || !(int_quizID.includes("INTQZ"))) {
window.location.replace('interactive.html');
}
$('#play_music').on('click', function(e){
if ($(this).attr('class') == 'fas fa-volume-mute') {
$('#lobby_music')[0].play();
$(this).attr('class', 'fas fa-volume-up');
} else {
$('#lobby_music')[0].pause();
$(this).attr('class', 'fas fa-volume-mute');
}
});
dot_num = 1;
async function check_started(int_quizID) {
const endpoint = '/data-api/rest/InteractiveQuiz';
const response = await fetch(endpoint);
const data = await response.json();
<!-- data = {"value":[{"id":6,"quiz_id":"INTQZENG1A1","quiz_id_short":"QZENG1","ques_duration":"20","max_player":"0","current_player":"0","started":"N","ended":"N"}]}; -->
if (data.value == '') {
window.location.replace('interactive.html');
} else {
got_flag = "N";
for (var i = 0; i < data.value.length; i++) {
if (data.value[i].quiz_id == int_quizID && data.value[i].started == "Y" && data.value[i].ended == "N") {
got_flag = "Y";
} else if (data.value[i].quiz_id == int_quizID && data.value[i].started == "Y" && data.value[i].ended == "Y") {
got_flag = "E";
}
}
if (got_flag == "Y") {
sessionStorage.setItem('int_quiz_ID', int_quizID);
sessionStorage.setItem('player_name', player_name);
window.location.replace('int_quiz_answer.html');
} else if (got_flag == "E") {
window.location.replace('interactive.html');
}
}
setTimeout(()=> {
check_started(int_quizID);
},500);
}
check_started(int_quizID);
$('a.logout').on('click', function(e){
localStorage.clear();
window.location.replace('login.html');
});
});
</script>
</head>
<body style="background: url('assets/images/purple.jpg'); background-size: 100% 100%; height: 80vh; width: 99vw;">
<audio id="lobby_music" loop src="assets/music/kahoot_lobby.mp3"></audio>
<div class="row" style="border-bottom: 1px solid #cfcfcf; background: white; padding-top: 2px; padding-bottom: 3px;">
<div class="col" style="margin-top: auto; margin-bottom: auto; margin-left: 15px;">
<img src="assets/images/nottingham-university-logo.jpeg" alt="University of Nottingham" style="height: 3.5rem;">
</div>
<div class="col-auto" style="margin-top: auto; margin-bottom: auto;">
<i class="far fa-bell" style="color:#a5a5a5; font-size: 1rem;"></i>
</div>
<div class="col-auto" style="margin-top: auto; margin-bottom: auto;">
<i class="far fa-comment" style="color:#a5a5a5; font-size: 1rem;"></i>
</div>
<div class="col-auto" style="text-align: right; margin-top: auto; margin-bottom: auto;">
<i class="fas fa-user-circle" style="color:#792d85; font-size: 2.2rem;"></i>
</div>
<div class="col-auto" style="margin-top: auto; margin-bottom: auto; margin-right: 25px; margin-left: -15px">
<i class="fas fa-chevron-down" role="button" data-bs-toggle="dropdown" aria-expanded="false" style="color:black; font-size: 0.6rem; cursor: pointer;" id="logout_arrow"></i>
<ul class="dropdown-menu" aria-labelledby="logout_arrow" style="font-size: 1rem; line-height: 25px; font-family: 'Trebuchet MS', Arial, Verdana, Helvetica, sans-serif; border-radius: 0px;">
<li><a class="dropdown-item logout">Log out</a></li>
</ul>
</div>
</div>
<div class="row mt-4 mb-0">
<div class="col"></div>
<div class="col-auto" style="margin-right: 20px;">
<i class="fas fa-volume-mute" style="color:white; font-size: 2rem; cursor: pointer;" id="play_music"></i>
</div>
</div>
<div class="row mt-0 mb-0" style="text-align: center; height: 80vh; width: 99vw; position: fixed;">
<div class="col d-flex align-items-center justify-content-center waviy" style="position: relative;">
<div class="loader" style="position: absolute; width: calc(31vh + 18vw); height: calc(31vh + 18vw);"></div>
<span style="--i:1; font-size: calc(6vh + 3vw); color: white; font-family: 'Amatic SC', sans-serif; position: absolute; z-index: 9;" id="waiting_host">WAITING FOR HOST <span style="--i:2">. <span style="--i:3">. <span style="--i:4">.</span></span></span></span>
</div>
</div>
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
</body>
</html>