HFP-30 Added checkButton override to semantic and logic for buttons.

pull/19/merge
Andreas Nergaard 2017-10-04 15:00:58 +02:00
parent 61583c4cf6
commit e903f96ead
2 changed files with 25 additions and 1 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) { if (params.override.showSolutionButton || params.override.retryButton || params.override.checkButton) {
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
@ -244,6 +244,12 @@ H5P.QuestionSet = function (options, contentId, contentData) {
override.enableRetry = override.enableRetry =
(params.override.retryButton === 'on' ? true : false); (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);
}
} }
/** /**

View File

@ -509,6 +509,24 @@
"label": "Disabled" "label": "Disabled"
} }
] ]
},
{
"name": "checkButton",
"type": "select",
"label": "Override \"Check\" button",
"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.",
"optional": true,
"options": [
{
"value": "on",
"label": "Enabled"
},
{
"value": "off",
"label": "Disabled"
}
]
} }
] ]
} }