Fix to allow disabling of backwards navigation

pull/4/head^2
Timothy Lim 2016-10-19 08:22:21 +02:00
parent 207914b411
commit 6fdeb26e0d
1 changed files with 4 additions and 2 deletions

View File

@ -248,7 +248,8 @@ H5P.QuestionSet = function (options, contentId, contentData) {
var _updateButtons = function () { var _updateButtons = function () {
// Verify that current question is answered when backward nav is disabled // Verify that current question is answered when backward nav is disabled
if (params.disableBackwardsNavigation) { if (params.disableBackwardsNavigation) {
if (questionInstances[currentQuestion].getAnswerGiven()) { if (questionInstances[currentQuestion].getAnswerGiven()
&& questionInstances.length-1 !== currentQuestion) {
questionInstances[currentQuestion].showButton('next'); questionInstances[currentQuestion].showButton('next');
} }
else { else {
@ -476,7 +477,8 @@ H5P.QuestionSet = function (options, contentId, contentData) {
} }
if(questionInstances[0] !== question if(questionInstances[0] !== question
&& question.hasButton('prev')) { && question.hasButton('prev')
&& !params.disableBackwardsNavigation) {
question.showButton('prev'); question.showButton('prev');
} }