HFP-30 Made checkButton into a boolean instead of select.

Updated checkButton logic.
pull/19/merge
Andreas Nergaard 2017-10-12 13:51:54 +02:00
parent e903f96ead
commit c8531f60f0
2 changed files with 8 additions and 18 deletions

View File

@ -231,7 +231,7 @@ H5P.QuestionSet = function (options, contentId, contentData) {
// Set overrides for questions
var override;
if (params.override.showSolutionButton || params.override.retryButton || params.override.checkButton) {
if (params.override.showSolutionButton || params.override.retryButton || params.override.checkButton === false) {
override = {};
if (params.override.showSolutionButton) {
// Force "Show solution" button to be on or off for all interactions
@ -245,10 +245,9 @@ H5P.QuestionSet = function (options, contentId, contentData) {
(params.override.retryButton === 'on' ? true : false);
}
if (params.override.checkButton) {
// Force "Retry" button to be on or off for all interactions
override.enableCheckButton =
(params.override.checkButton === 'on' ? true : false);
if (params.override.checkButton === false) {
// Force "Check" button to be on or off for all interactions
override.enableCheckButton = params.override.checkButton;
}
}

View File

@ -512,21 +512,12 @@
},
{
"name": "checkButton",
"type": "select",
"label": "Override \"Check\" button",
"type": "boolean",
"label": "Show \"Check\" buttons",
"importance": "low",
"description": "This option determines if the \"Check\" button will be shown for all questions, disabled for all or configured for each question individually.",
"description": "This option determines if the \"Check\" button will be shown for all questions.",
"optional": true,
"options": [
{
"value": "on",
"label": "Enabled"
},
{
"value": "off",
"label": "Disabled"
}
]
"default": true
}
]
}