From 5431b4b06a425fdba93ecd206e74b283157dfce4 Mon Sep 17 00:00:00 2001 From: Paal Joergensen Date: Mon, 30 May 2016 15:04:24 +0200 Subject: [PATCH] Making dot-status to answered only when getAnswerGiven() returns true --- js/questionset.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/questionset.js b/js/questionset.js index 0c255a5..acd9afb 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -267,6 +267,9 @@ H5P.QuestionSet = function (options, contentId) { // Hide finish button questionInstances[questionInstances.length - 1].hideButton('finish'); + // Mark all tasks as unanswered: + $('.progress-dot').removeClass('answered').addClass('unanswered'); + //Force the last page to be reRendered rendered = false; }; @@ -501,7 +504,9 @@ H5P.QuestionSet = function (options, contentId) { if (shortVerb === 'interacted' || shortVerb === 'answered' || shortVerb === 'attempted') { - $('.progress-dot:eq(' + currentQuestion +')', $myDom).removeClass('unanswered').addClass('answered'); + if (questionInstances[currentQuestion].getAnswerGiven()) { + $('.progress-dot:eq(' + currentQuestion +')', $myDom).removeClass('unanswered').addClass('answered'); + } _updateButtons(); } if (shortVerb === 'completed') {