diff --git a/js/questionset.js b/js/questionset.js index dade03b..e46abc0 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -83,7 +83,6 @@ H5P.QuestionSet = function (options, contentId) { var defaults = { randomOrder: false, initialQuestion: 0, - backgroundImage: undefined, progressType: 'dots', passPercentage: 50, questions: [], @@ -109,9 +108,7 @@ H5P.QuestionSet = function (options, contentId) { scoreString: 'You got @score points of @total possible.', finishButtonText: 'Finish', solutionButtonText: 'Show solution', - showAnimations: false, - successVideo: undefined, - failVideo: undefined + showAnimations: false }, postUserStatistics: (H5P.postUserStatistics === true) }; @@ -125,10 +122,6 @@ H5P.QuestionSet = function (options, contentId) { var $myDom; renderSolutions = false; -// if (params.randomOrder) { -// // TODO: Randomize order of questions -// } - // Instantiate question instances for (var i = 0; i < params.questions.length; i++) { var question = params.questions[i]; @@ -313,6 +306,16 @@ H5P.QuestionSet = function (options, contentId) { backgroundSize: '100% auto' }); } + + if (params.introPage.backgroundImage !== undefined) { + var $intro = $myDom.find('.intro-page'); + if ($intro.length) { + $intro.css({ + background: '#000 url("' + H5P.getPath(params.introPage.backgroundImage.path, contentId) + '") no-repeat 50% 50%', + backgroundSize: '100% auto' + }); + } + } // Attach questions for (var i = 0; i < questionInstances.length; i++) { diff --git a/library.json b/library.json index 2dafabb..53abcd2 100644 --- a/library.json +++ b/library.json @@ -3,7 +3,7 @@ "contentType": "question", "majorVersion": 1, "minorVersion": 0, - "patchVersion": 49, + "patchVersion": 50, "runnable": 1, "fullscreen": 0, "machineName": "H5P.QuestionSet", diff --git a/semantics.json b/semantics.json index b10fd20..21583b4 100644 --- a/semantics.json +++ b/semantics.json @@ -97,6 +97,13 @@ "label": "Start button text", "optional": true, "default": "Start Quiz" + }, + { + "name": "backgroundImage", + "type": "image", + "label": "Background image", + "optional": true, + "description": "An optional background image for the introduction." } ] },