diff --git a/js/questionset.js b/js/questionset.js index ff08a33..be6968c 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -360,12 +360,21 @@ H5P.QuestionSet = function (options, contentId) { } } + var registerImageLoadedListener = function (question) { + H5P.on(question, 'imageLoaded', function () { + self.trigger('resize'); + }); + }; + // Attach questions for (var i = 0; i < questionInstances.length; i++) { var question = questionInstances[i]; question.attach($('.question-container:eq(' + i + ')', $myDom)); + // Listen for image resize + registerImageLoadedListener(question); + // Disable feedback for question question.setBehaviour({disableFeedback: true});