This repository was archived by the owner on Mar 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstudents.php
executable file
·323 lines (322 loc) · 8.9 KB
/
students.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
<?php
require_once 'DBConnect.php';
require_once 'index.php';
if ($isTA)
{
header('HTTP/1.0 403 Forbidden');
readfile("static/html/HTTP403.html");
}
else if ($auth)
{
?>
<html>
<head>
<title>
Zoom Help Queue
<!-- In-Lab Help Queue -->
</title>
<link rel="stylesheet" href="static/css/bootstrap.min.css">
<link rel="stylesheet" href="static/css/font-awesome.min.css">
<link rel="stylesheet" href="static/css/myStyleSheet.css">
<link rel="stylesheet" href="static/css/chatstyle.css"/>
<script src="static/js/jquery-2.1.4.min.js">
</script>
<script src="static/js/bootstrap.min.js">
</script>
<script src="static/js/spin.min.js">
</script>
<script src="static/js/chat.js">
</script>
<script src="static/js/index_student.js">
</script>
</head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<body>
<?php
echo "<script> var user = '" . phpCAS::getUser() . "'; var notifyThresholdNum = '" . getNotifyThreshold() . "' </script>";
?>
<nav class="navbar navbar-default" role="navigation">
<div class="navbar-header">
<button type="button" data-target="#navbarCollapse" data-toggle="collapse" class="navbar-toggle">
<span class="sr-only">Toggle navigation
</span>
<span class="icon-bar">
</span>
<span class="icon-bar">
</span>
<span class="icon-bar">
</span>
</button>
<a class="navbar-brand" ui-sref="home">
<span id="courseTitle">
</span> Help Queue
</a>
</div>
<?php
echo "<script> var pollTimer = '" . getStudentPollTime() . "'; </script>";
echo "<script> Notification.requestPermission(function (permission) {}); </script>";
echo "<script> chat = new Chat(user); chat.popfunc = stuChat; </script>";
?>
<div id="navbarCollapse" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li>
<a>
<input type="checkbox" id="queueActive" disabled="true"/>
<span class="checkboxtext"> Queue Active
</span>
</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li style="padding-right:20px;">
<a href="?logout=">Logout
</a>
</li>
</ul>
</div>
</nav>
<div class="modal fade" id="nameChangeModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Your name please:
</h4>
</div>
<div class="modal-body">
<center>
<p>We do not currently have your name in our database. Please provide us with your name.
</p>
<input type="text" id="nameInput" placeholder="Enter your name here" width="70%">
</input>
</center>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" id="nameSubmit">Submit
</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="chatModal" role="dialog">
<div class="modal-dialog chat-cont">
<!-- Modal content-->
<div class="modal-content page-wrap">
<div class="modal-header">
<button type="button" class="close" id="close-chat" data-dismiss="modal">×
</button>
<h3 id="chat-title">Chat
</h3>
</div>
<div class="modal-body">
<div id="chat-wrap">
<div id="chat-area">
</div>
</div>
</div>
<div class="modal-footer">
<form id="send-message-area">
<p>Your message:
</p>
<textarea id="sendie" maxlength = '500' style="resize:none">
</textarea>
</form>
</div>
</div>
</div>
</div>
<center>
<div class="container">
<div class="row" style="width:80%;">
<div id="questionsRequired">
<!-- This is for when questions are required -->
<!--<div class="col-xs-9"> -->
<div class="col-xs-12">
<h1 style="font-size:750%;">
<strong>
<u>
<?php
if (isMOTDLink())
{
echo ("<a href='" . getMOTDLink() . "'>");
}
?>
<?php
echo getMOTD();
?>
<?php
if (isMOTDLink())
{
echo "</a>";
}
?>
</u>
</strong>
</h1>
<div class="row">
<!-- width = 80% for inlab and 100 % for zoom -->
<div class="col-xs-1" style="width:100%;">
<input class="form-control" type="text" id="questionInput" placeholder="Enter your question here" maxlength="200">
<span style="float:left; font-size:75%;" id="questionInputLengthLeft">200 characters remaining
</span>
</div>
<!-- UNCOMMENT FOR INLAB -->
<!-- <div class="col-xs-1" style="width:20%;vertical-align:middle;">
<strong>
<select id="roomSelector" style="height:34px">
<option selected hidden value="invalid">ROOM #</option>
<option value="1119">1119</option>
<option value="1121">1121</option>
<option value="1138">1138</option>
<option value="1102">1102</option>
</select>
</strong>
</div> -->
<!-- COMMENT FOR INLAB -->
<div class="col-xs-1" style="width:20%;vertical-align:middle;" hidden>
<strong>
<select id="roomSelector" style="height:34px" disabled>
<option selected hidden value="ZOOM">ZOOMS</option>
</select>
</strong>
</div>
</div>
</div>
<!--
<div class="col-xs-1">
<strong>OR</strong>
</div>
<div class="col-xs-2">
<input type="checkbox" id="passOffCheckBox"/>
<span class="checkboxtext"> Pass Off </span>
</div><br/>
-->
<div style="padding-top: 20px;">
</div>
<div class="row">
<!-- wont initally be disabled -->
<button id="getHelpButton" class="btn btn-success" style="width:80%; height:50px;" disabled>Get in line for help
</button>
</div>
</div>
<div id="questionsNotRequired">
<button id="getHelpButtonNoQuestion" class="btn btn-success noQuestionRequiredButtons" style="width:45%; height:50px;">Get Help
</button>
<button id="passOffButtonNoQuestion" class="btn btn-info noQuestionRequiredButtons" style="width:45%; height:50px;">Pass Off
</button>
</div>
</div>
</div>
<br/>
<div class="container">
<div class="row">
<div class="col-xs-6">
<span id="queueNum">
</span>
</div>
<div class="col-xs-6">
<span id="timeWaitingLabel">
</span>
<strong>
<span id="timeWaiting">
</span>
</strong>
</div>
</div>
</div>
</center>
<p style="padding-left:10px; padding-top:30px;">
<ul>
<li>You are currently logged in as:
<b>
<?php
echo phpCAS::getUser();
?>
</b>.
</li>
<?php
if (!$isThisATA)
{
?>
<?php
require_once 'DBConnect.php';
if (shouldLimitDaily())
{
?>
<li>You have
<b>
<span id="questionsRemainingDay">
</span> of
<span id="questionsDaily">
</span>
</b> daily questions remaining
</li>
<?php
}
?>
<?php
require_once 'DBConnect.php';
if (shouldLimitWeekly())
{
?>
<li>You have
<b>
<span id="questionsRemainingWeek">
</span> of
<span id="questionsWeekly">
</span>
</b> weekly questions remaining
</li>
<?php
}
?>
<?php
}
?>
<li>The current average wait time for the top
<span id="topCount">
</span> people on the queue is
<span id="topAvg">
</span>
</li>
<li>The current length of the queue is
<span id="queueLen">
</span>.
</li>
<li>The current number of people being helped is
<span id="currentlyBeingHelped">
</span>.
</li>
<li>Number of people who got in line in the last
<span class="lastXMin">
</span> min:
<span id="enqueueInLastXMin">
</span>.
</li>
<li>Number of people who finished receiving help in the last
<span class="lastXMin">
</span> min:
<span id="dequeueInLastXMin">
</span>.
</li>
<span id="refreshText">
</span>
</ul>
</p>
<div id="sexyRexy">
</div>
<div id="easterEggTrigger" style="position:fixed; bottom:0; color:#fefefe; cursor:pointer;">Credits
</div>
</body>
</html>
<?php
}
else
{
?>
<script language="javascript">
window.location.href = "?login="
</script>
<?php
}
?>