Reset individual questions on retry.
Remove finish button if a question is reset. Remove dot styling if a question is reset. HFJ-2044pull/5/head
parent
7bcd2472ba
commit
917a8ed3c4
|
@ -180,9 +180,14 @@ H5P.QuestionSet = function (options, contentId) {
|
||||||
answered = answered && (questionInstances[i]).getAnswerGiven();
|
answered = answered && (questionInstances[i]).getAnswerGiven();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentQuestion === (params.questions.length - 1) && answered &&
|
if (currentQuestion === (params.questions.length - 1) &&
|
||||||
questionInstances[currentQuestion]) {
|
questionInstances[currentQuestion]) {
|
||||||
questionInstances[currentQuestion].showButton('finish');
|
if (answered) {
|
||||||
|
questionInstances[currentQuestion].showButton('finish');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
questionInstances[currentQuestion].hideButton('finish');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -222,7 +227,14 @@ H5P.QuestionSet = function (options, contentId) {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Set currentNess
|
// Set currentNess
|
||||||
$('.progress-dot.current', $myDom).removeClass('current');
|
var $currentQuestion = $('.progress-dot.current', $myDom);
|
||||||
|
var previousQuestion = $currentQuestion.index();
|
||||||
|
$currentQuestion.removeClass('current');
|
||||||
|
if (previousQuestion >= 0 && !questionInstances[previousQuestion].getAnswerGiven()) {
|
||||||
|
$currentQuestion
|
||||||
|
.removeClass('answered')
|
||||||
|
.addClass('unanswered');
|
||||||
|
}
|
||||||
$('.progress-dot:eq(' + questionNumber +')', $myDom).addClass('current');
|
$('.progress-dot:eq(' + questionNumber +')', $myDom).addClass('current');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue