This commit is contained in:
Ross
2021-07-29 21:57:26 +01:00
parent 81763af6a9
commit 8aeb0dfa20
+6
View File
@@ -4,6 +4,7 @@
<h2>{{exam.name}}</h2>
Enter your CID in the below box.
<input id="cid-box" type="text" value="Candidate ID">
<button>Start exam</button>
@@ -12,7 +13,12 @@
$(document).ready(function () {
$("button").click(() => {
let cid = $("#cid-box").val();
if (Number.isInteger(cid)) {
window.location.replace("{% url 'sbas:exam_take' pk=exam.pk sk=0 cid='0000000' %}".replace("0000000", cid));
} else {
alert("Please enter a valid Candidate ID (CID).")
}
});
});
</script>