Merge pull request #11 from SergeyYukhnevich/add-override-of-check-button
Add ability to override check buttonrevert-11-add-override-of-check-button
commit
6c86c8ac9d
|
@ -225,20 +225,21 @@ H5P.QuestionSet = function (options, contentId, contentData) {
|
||||||
var $template = $(template.render(params));
|
var $template = $(template.render(params));
|
||||||
|
|
||||||
// Set overrides for questions
|
// Set overrides for questions
|
||||||
var override;
|
var override = {};
|
||||||
if (params.override.showSolutionButton || params.override.retryButton) {
|
|
||||||
override = {};
|
|
||||||
if (params.override.showSolutionButton) {
|
|
||||||
// Force "Show solution" button to be on or off for all interactions
|
|
||||||
override.enableSolutionsButton =
|
|
||||||
(params.override.showSolutionButton === 'on' ? true : false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (params.override.retryButton) {
|
if (params.override.checkButton) {
|
||||||
// Force "Retry" button to be on or off for all interactions
|
// Force "Check" button to be on or off for all interactions
|
||||||
override.enableRetry =
|
override.enableCheck = params.override.checkButton === 'on';
|
||||||
(params.override.retryButton === 'on' ? true : false);
|
}
|
||||||
}
|
|
||||||
|
if (params.override.showSolutionButton) {
|
||||||
|
// Force "Show solution" button to be on or off for all interactions
|
||||||
|
override.enableSolutionsButton = params.override.showSolutionButton === 'on';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (params.override.retryButton) {
|
||||||
|
// Force "Retry" button to be on or off for all interactions
|
||||||
|
override.enableRetry = params.override.retryButton === 'on';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"contentType": "question",
|
"contentType": "question",
|
||||||
"majorVersion": 1,
|
"majorVersion": 1,
|
||||||
"minorVersion": 13,
|
"minorVersion": 13,
|
||||||
"patchVersion": 0,
|
"patchVersion": 1,
|
||||||
"embedTypes": [
|
"embedTypes": [
|
||||||
"iframe"
|
"iframe"
|
||||||
],
|
],
|
||||||
|
|
|
@ -418,10 +418,28 @@
|
||||||
{
|
{
|
||||||
"name": "override",
|
"name": "override",
|
||||||
"type": "group",
|
"type": "group",
|
||||||
"label": "Settings for \"Show solution\" and \"Retry\" buttons",
|
"label": "Override settings for \"Check\", \"Show solution\" and \"Retry\" buttons",
|
||||||
"importance": "low",
|
"importance": "low",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"fields": [
|
"fields": [
|
||||||
|
{
|
||||||
|
"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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "showSolutionButton",
|
"name": "showSolutionButton",
|
||||||
"type": "select",
|
"type": "select",
|
||||||
|
|
Loading…
Reference in New Issue