From 163e3140599db7ba6026c7e2280d34ba6e9bdd56 Mon Sep 17 00:00:00 2001 From: Timothy Lim Date: Mon, 14 Nov 2016 15:53:27 +0100 Subject: [PATCH] Make sure styles are not being added twice to questions [HFP-56] --- js/questionset.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/questionset.js b/js/questionset.js index a2bea2e..97ef90b 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -455,7 +455,7 @@ H5P.QuestionSet = function (options, contentId, contentData) { */ var resetTask = function () { - // Clear previous state to ensure questions are created cleanly + // Clear previous state to ensure questions are created cleanly contentData.previousState = []; showingSolutions = false; @@ -827,6 +827,9 @@ H5P.QuestionSet = function (options, contentId, contentData) { for (var i = 0; i < questionInstances.length; i++) { var question = questionInstances[i]; + // Make sure styles are not being added twice + $('.question-container:eq(' + i + ')', $myDom).attr('class', 'question-container'); + question.attach($('.question-container:eq(' + i + ')', $myDom)); // Listen for image resize