This commit is contained in:
Ross
2021-12-11 21:55:31 +00:00
parent 4067b3b2d1
commit cac20b817b
5 changed files with 17 additions and 14 deletions
+3 -1
View File
@@ -6,6 +6,7 @@
Enter your CID in the below box.<br />
<input id="cid-box" type="text" value="Candidate ID">
<input id="passcode-box" type="text" value="Passcode">
<button>Start exam</button>
@@ -13,9 +14,10 @@ Enter your CID in the below box.<br />
$(document).ready(function () {
$("button").click(() => {
let cid = $("#cid-box").val();
let passcode = $("#passcode-box").val();
if (Number.isInteger(parseInt(cid))) {
window.location.replace("{% url 'physics:exam_take' pk=exam.pk sk=0 cid='0000000' %}".replace("0000000", cid));
window.location.replace("{% url 'physics:exam_take' pk=exam.pk sk=0 cid='0000000' passcode='ZZZZZZ' %}".replace("0000000", cid).replace("ZZZZZZ", passcode));
} else {
alert("Please enter a valid Candidate ID (CID).")
}