Making dot-status to answered only when getAnswerGiven() returns true

pull/5/head
Paal Joergensen 2016-05-30 15:04:24 +02:00
parent 5d5c431c1e
commit 5431b4b06a
1 changed files with 6 additions and 1 deletions

View File

@ -267,6 +267,9 @@ H5P.QuestionSet = function (options, contentId) {
// Hide finish button // Hide finish button
questionInstances[questionInstances.length - 1].hideButton('finish'); questionInstances[questionInstances.length - 1].hideButton('finish');
// Mark all tasks as unanswered:
$('.progress-dot').removeClass('answered').addClass('unanswered');
//Force the last page to be reRendered //Force the last page to be reRendered
rendered = false; rendered = false;
}; };
@ -501,7 +504,9 @@ H5P.QuestionSet = function (options, contentId) {
if (shortVerb === 'interacted' || if (shortVerb === 'interacted' ||
shortVerb === 'answered' || shortVerb === 'answered' ||
shortVerb === 'attempted') { shortVerb === 'attempted') {
if (questionInstances[currentQuestion].getAnswerGiven()) {
$('.progress-dot:eq(' + currentQuestion +')', $myDom).removeClass('unanswered').addClass('answered'); $('.progress-dot:eq(' + currentQuestion +')', $myDom).removeClass('unanswered').addClass('answered');
}
_updateButtons(); _updateButtons();
} }
if (shortVerb === 'completed') { if (shortVerb === 'completed') {