-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
executable file
·891 lines (827 loc) · 32.5 KB
/
index.php
File metadata and controls
executable file
·891 lines (827 loc) · 32.5 KB
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
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
<?php
header("Access-Control-Allow-Origin: *");
// Load the settings from the central config file
//echo 'PHP version: ' . phpversion();
//require_once 'config.php';
//ini_set('display_errors', 1);
// Load the CAS lib
require_once 'CAS-1.3.4/CAS.php';
require_once 'DBConnect.php';
// Enable debugging
//phpCAS::setDebug();
// Enable verbose error messages. Disable in production!
phpCAS::setVerbose(false);
// Initialize phpCAS
phpCAS::client(CAS_VERSION_2_0, 'cas.byu.edu', 443, 'cas');
// For production use set the CA certificate that is the issuer of the cert
// on the CAS server and uncomment the line below
// phpCAS::setCasServerCACert($cas_server_ca_cert_path);
// For quick testing you can disable SSL validation of the CAS server.
// THIS SETTING IS NOT RECOMMENDED FOR PRODUCTION.
// VALIDATING THE CAS SERVER IS CRUCIAL TO THE SECURITY OF THE CAS PROTOCOL!
phpCAS::setNoCasServerValidation();
if (isset($_REQUEST['logout'])) {
phpCAS::logout();
}
if (isset($_REQUEST['login'])) {
phpCAS::forceAuthentication();
}
// check CAS authentication
$auth = phpCAS::checkAuthentication();
$isThisATA = $auth ? verifyTA(phpCAS::getUser()) : false;
?>
<html>
<head>
<title><?php echo getCourseTitle(); ?> 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">
<!-- ----------------- TA Resources ----------------------->
<link rel="stylesheet" href="static/css/bootstrap-datepicker.css">
<link rel="stylesheet" href="static/css/jquery.timepicker.css">
<link rel="stylesheet" href="static/css/datatables.min.css" />
<link rel="stylesheet" href="static/css/easy-autocomplete.min.css" />
<link rel="stylesheet" href="static/css/easy-autocomplete.themes.min.css" />
<!-- ----------------- End TA Resources ------------------->
<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>
<!-- ----------------- TA Resources ----------------------->
<script src="static/js/Chart.min.js"></script>
<script src="static/js/bootstrap-datepicker.js"></script>
<script src="static/js/jquery.timepicker.min.js"></script>
<script src="static/js/datepair.min.js"></script>
<script src="static/js/jquery.datepair.min.js"></script>
<script src="static/js/datatables.min.js"></script>
<script src="static/js/jquery.easy-autocomplete.min.js"></script>
<!-- ----------------- End TA Resources ------------------->
<script src="static/js/index.js"></script>
</head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<body>
<?php
if ($auth) {
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
// require_once "DBConnect.php";
if ($isThisATA) //TA
{
echo "<script> var pollTimer = '" . getTAPollTime() . "'; </script>"; ?>
<div id="navbarCollapse" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="#" id="viewQueue">View Queue</a></li>
<li><a><input type="checkbox" id="queueActive" />
<span class="checkboxtext"> Queue Active </span>
</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
More<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li><a href="#" id="viewAddTa">Edit TAs <span class="fa fa-edit"></span></a></li>
<li><a href="#" id="viewStats">View Stats <span class="fa fa-eye"></span></a></li>
<li><a href="#" id="extendedStatsButton">View Extended Stats <span class="fa fa-info"></span></a></li>
<li><a href="#" id="clearButton">Clear the help queue <span class="fa fa-times"></span></a></li>
<li><a href="getCSVstats.php" id="csvValues">Get student stats in CSV <span class="fa fa-table"></span></a></li>
<li role="separator" class="divider"></li>
<li><a href="#" id="settings">Settings <span class="fa fa-cog"></span></a></li>
<li><a href="#" id="editRawDataButton"> Edit history <span class="fa fa-exclamation-triangle"></span></a></li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li style="padding-right:20px;"><a href="?logout=">Logout</a></li>
</ul>
</div>
<?php } //Student
else {
echo "<script> var pollTimer = '" . getStudentPollTime() . "'; </script>";
echo "<script> Notification.requestPermission(function (permission) {}); </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>
<?php } ?>
</nav>
<h1 style='text-align:center' id='message'></h1>
<!-- Modal for entering student name -->
<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>
<!-- Modal for editing TA name -->
<div class="modal fade" id="taNameEditModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">A name please:</h4>
</div>
<div class="modal-body">
<center>
<p>Please enter a name:
</p>
<input type="text" id="editTaNameInput" placeholder="Enter the name here" width="70%"></input>
<div id="changeTaNameNetId" style="display: none;"></div>
</center>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" id="editTaNameSubmit">Submit</button>
</div>
</div>
</div>
</div>
<h4>
<center>Please join the <a target="_blank" rel="noopener noreferrer" href="https://cs240.click/slack"> course Slack</a>. See our TA schedule <a target="_blank" rel="noopener noreferrer" href="https://docs.google.com/document/d/12ZrcsQAfVirCuCwzI0TKX_tSPyBOjqB9vDE-sx1n_S0/edit">here</a></center>
</h4>
<?php
//require_once "DBConnect.php";
if ($isThisATA) {
?>
<!-- TA -->
<div style="text-align:center;">
<h2>Welcome TA to the Help Queue!</h2>
<div class="container" id="queue">
<!-- MAIN QUEUE PAGE -->
<div class="row">
<!--<div class="col-xs-3">
<strong>Net Id</strong>
</div>-->
<div class="col-xs-1">
<strong>Name</strong>
</div>
<div class="col-xs-4">
<strong>Question</strong>
</div>
<div class="col-xs-2">
<strong>Zoom Link</strong>
</div>
<div class="col-xs-2">
<strong>Time</strong>
</div>
<div class="col-xs-1">
<strong>Times Helped Today</strong>
</div>
<div class="col-xs-2">
<strong>Action</strong>
</div>
</div>
<hr>
<div id="list"></div>
</div>
<div class="container" id="stats">
<!-- STATS PAGE -->
<!--<div class="row">
<input type="radio" name="statsOrder" value="help"> Help Count
<input type="radio" name="statsOrder" value="passOff"> Pass offs
</div> I thought about doing this...seemed more work than it was worth.
especially with the extended stats section-->
<div class="row">
<div class="col-xs-2">
</div>
<div class="col-xs-3">
<strong>Net Id</strong>
</div>
<div class="col-xs-3">
<strong>Name</strong>
</div>
<div class="col-xs-2">
<strong>Help Count</strong>
</div>
<div class="col-xs-2">
<strong>Pass Off Count</strong>
</div>
</div>
<hr>
<div id="statsList"></div>
</div>
<div class="container" id="editTAs">
<!-- EDIT TAS -->
<div class="row">
<input type="text" id="taInput" placeholder="Enter TA net id to add" style="width:25%;"></input>
<input type="text" id="taInputName" placeholder="Enter TA's name to add" style="width:25%;"></input>
<button class="btn btn-success btn-lg fa fa-plus" id="addTaBtn"></button>
</div>
<div class="row">
<div class="col-xs-3">
<strong>Net Id</strong>
</div>
<div class="col-xs-3">
<strong>Name</strong>
</div>
<div class="col-xs-2">
<strong>Help Count</strong>
</div>
<div class="col-xs-2">
<strong>Pass Off Count</strong>
</div>
<div class="col-xs-2">
<strong>Action</strong>
</div>
</div>
<hr>
<div id="taList"></div>
</div>
<div class="container" id="viewSettings">
<!-- Settings -->
<hr>
<div class="row settingsRow">
<div class="col-xs-9">
Reset the Database. All settings will be set to default and all TA and Student data will be permanently lost.
</div>
<div class="col-xs-3">
<button id="resetDBBtn" class="btn btn-danger fa fa-trash"></button>
</div>
</div>
<div class="row settingsRow">
<div class="col-xs-9">
Course title: <span id="courseTitleField"></span>
</div>
<div class="col-xs-3">
<button id="changeCourseTitleButton" class="btn btn-warning fa fa-edit"></button>
</div>
</div>
<div class="row settingsRow">
<div class="col-xs-9">
Polling time for students: <span id="studentPollTime"></span> miliseconds
</div>
<div class="col-xs-3">
<button id="changeStudentPollTime" class="btn btn-warning fa fa-edit"></button>
</div>
</div>
<div class="row settingsRow">
<div class="col-xs-9">
Polling time for TAs: <span id="taPollTime"></span> miliseconds
</div>
<div class="col-xs-3">
<button id="changeTAPollTime" class="btn btn-warning fa fa-edit"></button>
</div>
</div>
<div class="row settingsRow">
<div class="col-xs-9">
At what spot in line should students be notified to come to the TA office?: <span id="notifyThreshold"> </span><span id=notifyThresholdPostFix></span>
</div>
<div class="col-xs-3">
<button id="changeNotifySpotNumberBtn" class="btn btn-warning fa fa-edit"></button>
</div>
</div>
<div class="row settingsRow">
<div class="col-xs-9">
Show the number of enqueues and dequeues in the last: <span class="lastXMin"> </span> minutes
</div>
<div class="col-xs-3">
<button id="changeLastXMinBtn" class="btn btn-warning fa fa-edit"></button>
</div>
</div>
<div class="row settingsRow">
<div class="col-xs-9">
Current pass off highlight color: <span id="currentPassOffHighlightColor" class="fa fa-square"></span>
</div>
<div class="col-xs-3">
<button id="changePassOffHighlighColorBtn" class="btn btn-warning fa fa-edit"></button>
</div>
</div>
<div class="row settingsRow">
<div class="col-xs-9">
Require Students to enter in a question:
</div>
<div class="col-xs-3">
<input id="requireQuestion" type="checkbox" style="margin-left:15px;"></input>
</div>
</div>
<div class="row settingsRow">
<div class="col-xs-9">
Current Message: "<span id='currentMessage'></span>"
</div>
<div class="col-xs-3">
<button id="changeMessageBtn" class="btn btn-warning fa fa-edit"></button>
</div>
</div>
<div class="row settingsRow">
<div class="col-xs-9">
Display Message:
</div>
<div class="col-xs-3">
<input id="displayMessage" type="checkbox" style="margin-left:15px;"></input>
</div>
</div>
</div>
<div class="container" id="editRawData">
<!-- Update Raw Data -->
<h3>
Be careful! This will update the actual data in the database. It could ruin the integrity
of the database. There is no value checking or verifying and there is no undo button. Once you
click save the update is put into the database.
Be cautious what you do here. This should only be to fix anomalies in the data.
</h3>
<div id="editRawDataRange">
<p id="editRawDataDateInput">
Date: <input id="editRawDataStartDate" type="text" class="date start" />From
<input id="editRawDataStartTime" type="text" class="time start" /> to
<input id="editRawDataEndTime" type="text" class="time end" />
</p>
<button id="editRawDataGetDataBtn"> Submit </button>
</div>
<div id="editRawDataData"></div>
</div>
<div class="container" id="extendedStats">
<!-- Extended Stats -->
<!-- Extended Stats tabs -->
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a id="graphsTab" role="tab" data-toggle="tab">Usage Graphs</a></li>
<li role="presentation"><a id="tableTab" role="tab" data-toggle="tab">Ta to Student Help Table</a></li>
<li role="presentation"><a id="questionsTabBtn" role="tab" data-toggle="tab">Questions</a></li>
<li role="presentation"><a id="profileTabBtn" role="tab" data-toggle="tab">Student Profile</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<!-- Wait time graphs -->
<div role="tabpanel" class="tab-pane active" id="graphs">
<div class="row">
<br />
<p id="extendedStatsDateInput">
Date: <input id="extendedStatsStartDate" type="text" class="date start" /><span id="graphFromWord"> From</span>
<input id="extendedStatsStartTime" type="text" class="time start" /> to
<input id="extendedStatsEndDate" type="text" class="date end" />
<input id="extendedStatsEndTime" type="text" class="time end" />
</p>
<p>
<input type="radio" name="graphSpanning" value="oneDay">Span One Day</input>
<input type="radio" name="graphSpanning" value="multipleDay">Span Multiple Days</input>
</p>
<button id="updateExtendedStatsViews" class="btn btn-success">Update to this date range</button>
</div>
<div id="graphsContent">
<div class="row">
<div style="text-align:center;"><strong> Average and median wait time per <span class="graphUnit"></span></strong></div>
<canvas id="averageWaitTimeGraph" width="500" height="400"></canvas>
<div style="text-align:center;"><span class="graphUnit"></div>
</div>
<br />
<div class="row">
<div style="text-align:center;"><strong> Dequeues Per <span class="graphUnit"></strong></div>
<canvas id="dequeuesPerHourGraph" width="500" height="400"></canvas>
<div style="text-align:center;"><span class="graphUnit"></div>
</div>
<br /> <h2>IF YOU ARE PASSING OFF, BE READY TO BE HELPED AT ANY TIME.</br</h2>
<div class="row">
<div style="text-align:center;"><strong> Average Time Spent with TA <span class="graphUnit"></strong></div>
<canvas id="avgTimeWithTAGraph" width="500" height="400"></canvas>
<div style="text-align:center;">Minutes</div>
</div>
<br />
<div class="row">
<div style="text-align:center;">
<strong> Raw Data </strong>
<center>
<div id="rawGraphData"></div>
</center>
</div>
</div>
</div>
</div>
<div role="tabpanel" class="tab-pane" id="tables">
<!-- TA to Student Help Table -->
<div class="row">
<br />
<p id="extendedStatsDateInputTable">
Date: <input id="extendedStatsStartDateTable" type="text" class="date start" />
<input id="extendedStatsStartTimeTable" type="text" class="time start" /> to
<input id="extendedStatsEndDateTable" type="text" class="date end" />
<input id="extendedStatsEndTimeTable" type="text" class="time end" />
OR <input type="checkbox" id="studentTabAllDataCheckbox" style="margin-left: 10px; margin-right:5px;"> All semester</input>
</p>
<p>
<input type="radio" name="tableType" value="help"> Help Count
<input type="radio" name="tableType" value="passOff"> Pass offs
<input type="radio" name="tableType" value="all"> All
</p>
<button id="updateExtendedStatsViewsTable" class="btn btn-success">Update to this date range</button>
</div>
<!--<canvas id="studentDataTotalTableGraph" width="800" height="400"></canvas>-->
<table id="studentDataTotalTable" class="compact">
<thead></thead>
<tbody></tbody>
<tfoot id="studentDataTotalTableFooter">
<tr>
<th style="text-align:right">Total:</th>
<?php
//this is the easiest and fastest way to insert the <th> needed for the table footer
//it wasn't my first choice but adding them via JS caused a load of headaches and finally
//I had to move on and this would work so I went with it. The biggest weak point here is
//if a new TA is added and then the user goes to this table, the table will look wrong untill
//the page is refreshed.
$tas = getAllTAs(null);
for ($i = 0; $i < count($tas); $i++) {
echo "<th></th>";
}
echo "<th></th>"; //Themselves column
echo "<th></th>"; //Row totals column
?>
</tfoot>
</table>
</div>
<div role="tabpanel" class="tab-pane" id="questionsTab">
<!-- Qustions Table -->
<div class="row">
<br />
<p id="extendedStatsDateInputQuestions">
Date: <input id="extendedStatsStartDateQuestionsTab" type="text" class="date start" />
to
<input id="extendedStatsEndDateQuestionsTab" type="text" class="date end" /> OR
<input type="checkbox" id="questionsTabAllDataCheckbox" style="margin-left: 5px; margin-right:5px;"> All semester</input>
</p>
<button id="updateExtendedStatsViewsQuestionsTable" class="btn btn-success">Update to this date range</button>
</div>
<table id="questionsTable" class="compact">
<thead>
<tr>
<th>Student</th>
<th>Removed By</th>
<th>Question</th>
<th>Removed at</th>
<th>Time Spent With TA</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div role="tabpanel" class="tab-pane" id="profileTab">
<!-- Student Profile -->
<div style="padding-bottom:15px;"></div>
<div class="row">
<div class="col-xs-5">
<input placeholder="Student Name" class="typeahead" type="text" id="profileSearchInput"></input>
</div>
<div class="col-xs-7">
<button id="profileSearch" class="btn btn-lg btn-success fa fa-search" style="float:left;"></button>
</div>
</div>
<div style="padding-bottom:15px;"></div>
<div class="row">
<div class="col-xs-6" style="text-align:left; float:left">
Name: <span id="profileName"></span><br />
NetId: <span id="profileNetId"></span>
</div>
<div class="col-xs-6" style="text-align:left; float:left">
Total Help Count: <span id="profileTotalHelpCount"></span><br />
Total Pass Off Count: <span id="profileTotalPassOffCount"></span><br />
This weeks Help Count: <span id="profileWeekHelpCount"></span><br />
This weeks Pass off Count: <span id="profileWeekPassOffCount"></span><br />
Todays Help Count: <span id="profileTodayHelpCount"></span><br />
Todays Pass Off Count: <span id="profileTodayPassOffCount"></span><br />
Average Time Spent With TA: <span id="profileAverageTimeSpentWithTA"></span><br />
</div>
</div>
<br />
<center>
<h4>TA Help Counts</h4>
</center><br />
<div class="row">
<div id="profileTAHelpCount"></div>
</div>
<br />
<center>
<h4>Questions asked</h4>
</center><br />
<div class="row">
<div id="profileQuestions"></div>
</div>
</div>
</div>
</div>
</div>
<!-- Modal for extended stats end time wrongly formatted-->
<div class="modal fade" id="startTimeAfterEndError" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">ERROR</h4>
</div>
<div class="modal-body">
<center>
<div class="alert alert-danger">The End Time must be after the Start Time</div>
</center>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- Modal for entering class name-->
<div class="modal fade" id="courseNameChangeModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Course Title</h4>
</div>
<div class="modal-body">
<center> <h2>IF YOU ARE PASSING OFF, BE READY TO BE HELPED AT ANY TIME.</br</h2>
<p>What is the name of the course this help queue is for?
</p>
<input type="text" id="courseNameInput" placeholder="Enter name here" width="70%"></input>
</center>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" id="courseSubmit">Submit</button>
</div>
</div>
</div>
</div>
<!-- Modal for changing student polling times-->
<div class="modal fade" id="studentChangePollTimeModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Student Polling interval</h4>
</div>
<div class="modal-body">
<center>
<p>Enter the polling interval in miliseconds
</p>
<input type="text" id="studentPollTimeInput" placeholder="Enter value here" width="70%"></input>
</center>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-success" id="studentPollTimeSubmit">Submit</button>
</div>
</div>
</div>
</div>
<!-- Modal for changing TA polling times-->
<div class="modal fade" id="taChangePollTimeModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">TA Polling interval</h4>
</div>
<div class="modal-body">
<center>
<p>Enter the polling interval in miliseconds
</p>
<input type="text" id="taPollTimeInput" placeholder="Enter value here" width="70%"></input>
</center>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-success" id="taPollTimeSubmit">Submit</button>
</div>
</div>
</div>
</div>
<!-- Modal for changing notify threshold-->
<div class="modal fade" id="notifyThresholdChangeModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Notify Threshold</h4>
</div>
<div class="modal-body">
<center>
<p>At what point should students be notified to come to the TA office?
</p>
<input type="text" id="notifyThresholdInput" placeholder="Enter value here" width="70%"></input>
</center>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-success" id="notifyThresholdSubmit">Submit</button>
</div>
</div>
</div>
</div>
<!-- Modal for changing last X min -->
<div class="modal fade" id="changeLastXMinModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">How many minutes back to go?</h4>
</div>
<div class="modal-body">
<center>
<p>Show number of enqueues and dequeues from how many minutes ago?
</p>
<input type="text" id="changeLastXMinInput" placeholder="Enter value here" width="70%"></input>
</center>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-success" id="changeLastXMinSubmit">Submit</button>
</div>
</div>
</div>
</div>
<!-- Modal for changing passoff highlight color-->
<div class="modal fade" id="changePassOffHighlighColorModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Pick a highlight color</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-xs-4">
<span id="passOff_red" style="background-color:red;" class="aSquare passOffSelector"></span>
</div>
<div class="col-xs-4">
<span id="passOff_blue" style="background-color:blue;" class="aSquare passOffSelector"></span>
</div>
<div class="col-xs-4">
<span id="passOff_transparent" class="aSquare passOffSelector"></span>
</div>
</div>
<div class="row">
<div class="col-xs-4">
<span id="passOff_yellow" style="background-color:yellow;" class="aSquare passOffSelector"></span>
</div>
<div class="col-xs-4">
<span id="passOff_orange" style="background-color:orange;" class="aSquare passOffSelector"></span>
</div>
<div class="col-xs-4">
<span id="passOff_green" style="background-color:green;" class="aSquare passOffSelector"></span>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
<!-- modal for message -->
<div class="modal fade" id="changeMessageModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Message</h4>
</div>
<div class="modal-body">
<center>
<p>What do you want the message to be?
</p>
<input type="text" id="changeMessageInput" placeholder="Enter value here" width="70%"></input>
</center>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-success" id="changeMessageSubmit">Submit</button>
</div>
</div>
</div>
</div>
<!-- END TA -->
<?php } else { ?>
<!-- STUDENT -->
<center>
<div class="container2">
<div class="options">
<div class="passOffOption">
<label for="passOffCheckBox">Pass Off?</label>
<br />
<input type="checkbox" id="passOffCheckBox" />
</div>
</div>
<div class="virtuallink">
<label for="zoomLinkInput">Zoom Link:</label>
<input class="form-control" type="text" id="zoomLinkInput" placeholder="Paste your zoom link here (e.g. https://byu.zoom.us/my/cosmo)" maxlength="300" />
</div>
<div class="question">
<label for="questionInput">Question:</label>
<input class="form-control" type="text" id="questionInput" placeholder="Enter your question here" maxlength="300" />
</div>
<div class="submit">
<button id="getHelpInPersonButton" class="helpButton enqueueButton btn btn-success" style="height:50px;">I'm in person</button>
<button id="getHelpOnZoomButton" class="helpButton enqueueButton btn btn-success" style="height:50px;">I'm on Zoom</button>
<button id="stopGettingHelped" class="helpButton btn btn-success" style="display: none"></button>
<br />
<span id="getHelpError" style="display: none">Enter a question or click Pass Off</span>
</div>
<!--
<div id="questionsRequired">
<!-- This is for when questions are required -- >
<div class="questionTextContainer">
<!-- <span style="float:left; font-size:75%;" id="questionInputLengthLeft"></span> -- >
</div>
<div class="col-xs-1">
<!-- <strong>OR</strong> -- >
</div>
<div class="col-xs-2">
</div><br />
<div style="padding-top: 20px;"></div>
<div class="row">
<!-- wont initally be disabled -- >
</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 class="container">
<div class="row" style="width:80%;">
<div id="questionsRequired"> <!-- This is for when questions are required -- >
<div class="col-xs-9">
<input class="form-control" type="text" id="questionInput" placeholder="Enter your question here" maxlength="300">
</input>
<span style="float:left; font-size:75%;" id="questionInputLengthLeft"></span>
</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>
<!-- END STUDENT -->
<?php
//add to the DB
//require_once 'DBConnect.php';
addStudent(phpCAS::getUser());
} ?>
<p style="padding-left:10px; padding-top:30px;">
<ul>
<li>You are currently logged in as: <b><?php echo phpCAS::getUser(); ?></b>.</li>
<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>
<?php
} else { //go to login page!
?>
<script language="javascript">
window.location.href = "?login="
</script>
<?php
}
?>
</body>
</html>