From 9f4f325946b08f8d0dc5509312edbc2ced7231b1 Mon Sep 17 00:00:00 2001 From: Benjamin Auder <benjamin.auder@somewhere> Date: Mon, 5 Feb 2018 15:15:08 +0100 Subject: [PATCH] Fix send button when assessment.display == 'all' --- public/javascripts/assessment.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/public/javascripts/assessment.js b/public/javascripts/assessment.js index 9858643..faf159c 100644 --- a/public/javascripts/assessment.js +++ b/public/javascripts/assessment.js @@ -181,7 +181,7 @@ let V = new Vue({ }, 1000); }, // stage 2 - sendAnswer: function() { + sendOneAnswer: function() { const realIndex = this.answers.indices[this.answers.index]; let gotoNext = () => { if (this.answers.index == assessment.questions.length - 1) @@ -216,6 +216,13 @@ let V = new Vue({ }, }); }, + // TODO: I don't like that + sending should not be definitive in exam mode with display = all + sendAnswer: function() { + if (assessment.display == "one") + sendOneAnswer(); + else + assessment.questions.forEach(sendOneAnswer); + }, // stage 2 --> 3 (or 4) // from a message by statements component, or time over endAssessment: function() { -- 2.44.0