Skip to content

Commit 59f6d28

Browse files
edit proctor info
1 parent dd2db18 commit 59f6d28

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const error = (res, text) => {
3333
console.log("ERROR!");
3434
res.status(500).render("pages/error.ejs", {
3535
errorText:
36-
text || "There was an unexpected error. Please contact your proctor.",
36+
text || "There was an unexpected error. Please contact your proctor, who will inform the JHMC team.",
3737
});
3838
};
3939

@@ -116,9 +116,12 @@ app.get("/test/:recordId", async (req, res) => {
116116
record,
117117
competition.fields.Code
118118
);
119+
119120
let available = tests.validateTime(competition, record, false),
120121
currentQuestion = record.fields["Current Question Index"];
121122

123+
console.log(available)
124+
122125
if (!testBegun && currentQuestion && currentQuestion != 0) {
123126
currentQuestion = 0;
124127
testsTable.update(record.id, { "Current Question Index": 0 });

tests.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ const validateTime = (competition, record, allowExtra=false) => {
7878
duration = competition.fields["Max Duration"] * 1000,
7979
expireTime = new Date(startTime.getTime() + duration + (allowExtra ? (1000 * 5) : 0)); // Add 5 seconds grace period to get last question in
8080

81+
// console.log(startTime)
82+
// console.log(expireTime)
83+
// console.log(currentTime)
84+
8185
let currentTime = new Date();
8286
if (openTime > currentTime) {
8387
return "Test not open yet"

views/pages/tests.ejs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -409,16 +409,16 @@
409409
410410
$(".remainingTime").text((individualQuestions ? " - " : '') + minutes + ":" + secondsText + " Remaining");
411411
412+
console.log(minutes + " " + seconds)
412413
if (minutes == 5 && seconds == 0) {
413414
$(".toast-header-text").text("5 Minutes Remaining")
414415
$(".toast-body").text("Your test will be automatically submitted in 5 minutes.")
415416
mainToast.show();
416417
}
417418
418-
419-
420-
421-
if (minutes < 0) {
419+
// FIX THIS BUG
420+
if (minutes == 0 && seconds == 1) {
421+
console.log("HEY")
422422
// TODO: MAKE SURE THIS ACTUALLY SUBMIT
423423
$(".next-button").click();
424424
clearInterval(counterInterval);

0 commit comments

Comments
 (0)