This commit is contained in:
Ross
2020-12-28 10:23:03 +00:00
parent 017d2e5b6b
commit 1116755212
+8 -3
View File
@@ -23,7 +23,7 @@ window.number_of_questions = null;
window.question_type = null;
window.loaded_question = null;
window.review = false;
window.exam_time = 60;
window.exam_time = null;
window.date_started = null;
window.score = 0;
@@ -251,7 +251,7 @@ function setUpQuestions(load_previous) {
}
// Set an order for the questions
if (!load_previous) {
if (window.question_order.length != window.questions.length) {
if (window.question_order.length < 1) {
window.question_order = [];
Object.keys(window.questions).forEach(function (e) {
window.question_order.push(e);
@@ -290,7 +290,8 @@ function setUpQuestions(load_previous) {
console.log(window.question_type);
if (!load_previous) {
// exam_time can be defined in packets
if (!load_previous && window.exam_time == null) {
if (window.question_type == "rapid") {
window.exam_time = 35 * 60;
} else if (window.question_type == "anatomy") {
@@ -397,6 +398,10 @@ function setUpPacket(data, packet_name) {
window.question_order = data.exam_order;
}
if (data.hasOwnProperty("exam_time")) {
window.exam_time = data.exam_time;
}
// Either continue session or create a new one
db.session
// .where("status")