From 14d84ec9498c495bb1db4d3fd78f2c70330f85bf Mon Sep 17 00:00:00 2001 From: William Almnes Date: Mon, 26 Jan 2026 13:36:01 +0100 Subject: [PATCH 1/2] VA-1542 listen for question reset event to update navigation --- js/questionset.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/questionset.js b/js/questionset.js index e01600dd..090db951 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -886,6 +886,12 @@ H5P.QuestionSet = function (options, contentId, contentData) { this.trigger('resize'); + $myDom.on('h5p-question-reset', () => { + for (var i = 0; i < questionInstances.length; i++) { + toggleAnsweredDot(i, questionInstances[i].getAnswerGiven()); + } + }) + return this; }; From e21c75014c8cc49b92d8f323c544de84db7a556c Mon Sep 17 00:00:00 2001 From: William Almnes Date: Mon, 26 Jan 2026 16:49:35 +0100 Subject: [PATCH 2/2] VA-1542 listen to xAPI reset event and handle reset --- js/questionset.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/js/questionset.js b/js/questionset.js index 090db951..a4117731 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -817,6 +817,10 @@ H5P.QuestionSet = function (options, contentId, contentData) { question.on('xAPI', function (event) { var shortVerb = event.getVerb(); + if (shortVerb === 'reset') { + toggleAnsweredDot(currentQuestion, questionInstances[currentQuestion].getAnswerGiven()); + _updateButtons(); + } if (shortVerb === 'interacted' || shortVerb === 'answered' || shortVerb === 'attempted') { @@ -886,12 +890,6 @@ H5P.QuestionSet = function (options, contentId, contentData) { this.trigger('resize'); - $myDom.on('h5p-question-reset', () => { - for (var i = 0; i < questionInstances.length; i++) { - toggleAnsweredDot(i, questionInstances[i].getAnswerGiven()); - } - }) - return this; };