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 // Set overrides for questions
var override; var override;
if (params.override.showSolutionButton || params.override.retryButton || params.override.checkButton) { if (params.override.showSolutionButton || params.override.retryButton || params.override.checkButton === false) {
override = {}; override = {};
if (params.override.showSolutionButton) { if (params.override.showSolutionButton) {
// Force "Show solution" button to be on or off for all interactions // 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); (params.override.retryButton === 'on' ? true : false);
} }
if (params.override.checkButton) { if (params.override.checkButton === false) {
// Force "Retry" button to be on or off for all interactions // Force "Check" button to be on or off for all interactions
override.enableCheckButton = override.enableCheckButton = params.override.checkButton;
(params.override.checkButton === 'on' ? true : false);
} }
} }

View File

@ -512,21 +512,12 @@
}, },
{ {
"name": "checkButton", "name": "checkButton",
"type": "select", "type": "boolean",
"label": "Override \"Check\" button", "label": "Show \"Check\" buttons",
"importance": "low", "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, "optional": true,
"options": [ "default": true
{
"value": "on",
"label": "Enabled"
},
{
"value": "off",
"label": "Disabled"
}
]
} }
] ]
} }