HFP-30 Added showWhen widget and made retry/show solution to toggle by new field checkButton

pull/19/merge
Andreas Nergaard 2017-10-12 15:09:12 +02:00
parent c8531f60f0
commit b10c1354e2
2 changed files with 33 additions and 10 deletions

View File

@ -64,6 +64,11 @@
"machineName": "H5PEditor.QuestionSetTextualEditor", "machineName": "H5PEditor.QuestionSetTextualEditor",
"majorVersion": 1, "majorVersion": 1,
"minorVersion": 2 "minorVersion": 2
},
{
"machineName": "H5PEditor.ShowWhen",
"majorVersion": 1,
"minorVersion": 0
} }
] ]
} }

View File

@ -474,6 +474,15 @@
"importance": "low", "importance": "low",
"optional": true, "optional": true,
"fields": [ "fields": [
{
"name": "checkButton",
"type": "boolean",
"label": "Show \"Check\" buttons",
"importance": "low",
"description": "This option determines if the \"Check\" button will be shown for all questions.",
"optional": true,
"default": true
},
{ {
"name": "showSolutionButton", "name": "showSolutionButton",
"type": "select", "type": "select",
@ -481,6 +490,15 @@
"importance": "low", "importance": "low",
"description": "This option determines if the \"Show Solution\" button will be shown for all questions, disabled for all or configured for each question individually.", "description": "This option determines if the \"Show Solution\" button will be shown for all questions, disabled for all or configured for each question individually.",
"optional": true, "optional": true,
"widget": "showWhen",
"showWhen": {
"rules": [
{
"field": "checkButton",
"equals": true
}
]
},
"options": [ "options": [
{ {
"value": "on", "value": "on",
@ -499,6 +517,15 @@
"importance": "low", "importance": "low",
"description": "This option determines if the \"Retry\" button will be shown for all questions, disabled for all or configured for each question individually.", "description": "This option determines if the \"Retry\" button will be shown for all questions, disabled for all or configured for each question individually.",
"optional": true, "optional": true,
"widget": "showWhen",
"showWhen": {
"rules": [
{
"field": "checkButton",
"equals": true
}
]
},
"options": [ "options": [
{ {
"value": "on", "value": "on",
@ -509,15 +536,6 @@
"label": "Disabled" "label": "Disabled"
} }
] ]
},
{
"name": "checkButton",
"type": "boolean",
"label": "Show \"Check\" buttons",
"importance": "low",
"description": "This option determines if the \"Check\" button will be shown for all questions.",
"optional": true,
"default": true
} }
] ]
} }