some improvements

This commit is contained in:
Ross
2020-12-10 22:52:03 +00:00
parent 44a7d72f3a
commit 75891ef7a1
4 changed files with 61 additions and 16 deletions
+24 -8
View File
@@ -135,6 +135,15 @@ async function loadExamList(data) {
})
);
});
if (config.exam_results_url != "") {
let url = config.exam_results_url;
$("#options-link")
.empty()
.append(
`<a href="${url}" target="_blank"><div class="packet-button">Results and answers</div></a>`
);
}
$("#options-panel").show();
}
@@ -252,7 +261,13 @@ function setUpQuestions(load_previous) {
}
});
window.question_order = helper.shuffleArray(window.question_order);
let randomise_order = true;
if (window.config.randomise_order != undefined) {
randomise_order = window.config.randomise_order;
}
if (randomise_order) {
window.question_order = helper.shuffleArray(window.question_order);
}
}
window.number_of_questions = Object.keys(window.questions).length;
window.review = false;
@@ -299,8 +314,8 @@ function setUpQuestions(load_previous) {
$("#start-dialog").addClass("no-close");
$("#start-dialog .exam-time").prop("disabled", "true");
$("#exam-candidate-number").toggle();
$(".packet-database-options").toggle();
$("#exam-candidate-number").show();
$(".packet-database-options").hide();
$("#start-dialog").modal({
closeExisting: false, // Close existing modals. Set this to false if you need to stack multiple modal instances.
escapeClose: false, // Allows the user to close the modal by pressing `ESC`
@@ -1716,13 +1731,12 @@ $("#start-exam-button").click(function (evt) {
$(".start-packet-button").click(function (evt) {
if (window.exam_mode) {
if (!Number.isInteger(parseInt($("#candidate-number2").val()))) {
alert("Please enter a valid candidate number.")
return
}
if (!Number.isInteger(parseInt($("#candidate-number2").val()))) {
alert("Please enter a valid candidate number.");
return;
}
}
if (window.timer != null) {
window.timer.stop();
}
@@ -1913,5 +1927,7 @@ function saveSession() {
});
}
window.saveSession = saveSession;
// Register Key Event Listener
window.addEventListener("keydown", viewer.keydown_handler);