From 1badb3b68b041f8e95989852a700245bfafb56b0 Mon Sep 17 00:00:00 2001 From: Oliver Tacke Date: Wed, 7 Feb 2024 11:22:30 +0100 Subject: [PATCH] HFP-3856 Fix retrieving previous score --- js/summary.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/summary.js b/js/summary.js index e0b46b9..75312fe 100644 --- a/js/summary.js +++ b/js/summary.js @@ -93,6 +93,8 @@ H5P.Summary = (function ($, Question, XApiEventBuilder, StopWatch) { // Prevent the score bar from interrupting the progress counter this.setBehaviour({disableReadSpeaker: true}); + this.createQuestion(); + // Required questiontype contract function this.showSolutions = function() { // intentionally left blank, no solution view exists @@ -135,7 +137,7 @@ H5P.Summary = (function ($, Question, XApiEventBuilder, StopWatch) { */ Summary.prototype.registerDomElements = function () { // Register task content area - this.setContent(this.createQuestion()); + this.setContent(this.$myDom); }; // Function for attaching the multichoice to a DOM element. @@ -640,7 +642,7 @@ H5P.Summary = (function ($, Question, XApiEventBuilder, StopWatch) { this.userResponses = []; this.dataBitMap = []; - if (this.$myDom) { + if (this.$myDom[0].isConnected) { const contentWrapper = this.$myDom[0].parentNode; contentWrapper.innerHTML = ''; this.createQuestion();