Merge branch 'release'

pull/4/head
Paal Joergensen 2016-05-03 11:32:35 +02:00
commit c129a71217
3 changed files with 24 additions and 14 deletions

View File

@ -115,6 +115,7 @@ H5P.QuestionSet = function (options, contentId) {
var up; var up;
renderSolutions = false; renderSolutions = false;
var $template = $(template.render(params));
// Set overrides for questions // Set overrides for questions
var override; var override;
if (params.override.showSolutionButton || params.override.retryButton) { if (params.override.showSolutionButton || params.override.retryButton) {
@ -141,6 +142,12 @@ H5P.QuestionSet = function (options, contentId) {
// Extend subcontent with the overrided settings. // Extend subcontent with the overrided settings.
$.extend(question.params.behaviour, override); $.extend(question.params.behaviour, override);
} }
question.params = question.params || {};
question.params.overrideSettings = question.params.overrideSettings || {};
question.params.overrideSettings.$confirmationDialogParent = $template;
question.params.overrideSettings.instance = this;
var questionInstance = H5P.newRunnable(question, contentId, undefined, undefined, {parent: self}); var questionInstance = H5P.newRunnable(question, contentId, undefined, undefined, {parent: self});
questionInstance.on('resize', function () { questionInstance.on('resize', function () {
up = true; up = true;
@ -422,7 +429,8 @@ H5P.QuestionSet = function (options, contentId) {
} }
// Render own DOM into target. // Render own DOM into target.
$myDom.html(template.render(params)); $myDom.children().remove();
$myDom.append($template);
if (params.backgroundImage !== undefined) { if (params.backgroundImage !== undefined) {
$myDom.css({ $myDom.css({
overflow: 'hidden', overflow: 'hidden',

View File

@ -4,7 +4,7 @@
"contentType": "question", "contentType": "question",
"majorVersion": 1, "majorVersion": 1,
"minorVersion": 8, "minorVersion": 8,
"patchVersion": 0, "patchVersion": 1,
"embedTypes": [ "embedTypes": [
"iframe" "iframe"
], ],
@ -61,4 +61,4 @@
"minorVersion": 1 "minorVersion": 1
} }
] ]
} }

View File

@ -28,18 +28,20 @@ H5PUpgrades['H5P.QuestionSet'] = (function ($) {
*/ */
8: function (parameters, finished) { 8: function (parameters, finished) {
if (parameters.override.overrideButtons) { if (parameters.override) {
// Set new variables if (parameters.override.overrideButtons) {
parameters.override.showSolutionButton = // Set new variables
(parameters.override.overrideShowSolutionButton ? 'on' : 'off'); parameters.override.showSolutionButton =
parameters.override.retryButton = (parameters.override.overrideShowSolutionButton ? 'on' : 'off');
(parameters.override.overrideRetry ? 'on' : 'off'); parameters.override.retryButton =
} (parameters.override.overrideRetry ? 'on' : 'off');
}
// Remove old field variables // Remove old field variables
delete parameters.override.overrideButtons; delete parameters.override.overrideButtons;
delete parameters.override.overrideShowSolutionButton; delete parameters.override.overrideShowSolutionButton;
delete parameters.override.overrideRetry; delete parameters.override.overrideRetry;
}
// Move copyright dialog question label // Move copyright dialog question label
if (parameters.questionLabel) { if (parameters.questionLabel) {