From b10c1354e2ef8992a6ca4ebcc176d5af1b45383b Mon Sep 17 00:00:00 2001 From: Andreas Nergaard Date: Thu, 12 Oct 2017 15:09:12 +0200 Subject: [PATCH] HFP-30 Added showWhen widget and made retry/show solution to toggle by new field checkButton --- library.json | 7 ++++++- semantics.json | 36 +++++++++++++++++++++++++++--------- 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/library.json b/library.json index 8be26d3..790a771 100644 --- a/library.json +++ b/library.json @@ -64,6 +64,11 @@ "machineName": "H5PEditor.QuestionSetTextualEditor", "majorVersion": 1, "minorVersion": 2 + }, + { + "machineName": "H5PEditor.ShowWhen", + "majorVersion": 1, + "minorVersion": 0 } ] -} \ No newline at end of file +} diff --git a/semantics.json b/semantics.json index 49134cb..0b85910 100644 --- a/semantics.json +++ b/semantics.json @@ -474,6 +474,15 @@ "importance": "low", "optional": true, "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", "type": "select", @@ -481,6 +490,15 @@ "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.", "optional": true, + "widget": "showWhen", + "showWhen": { + "rules": [ + { + "field": "checkButton", + "equals": true + } + ] + }, "options": [ { "value": "on", @@ -499,6 +517,15 @@ "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.", "optional": true, + "widget": "showWhen", + "showWhen": { + "rules": [ + { + "field": "checkButton", + "equals": true + } + ] + }, "options": [ { "value": "on", @@ -509,15 +536,6 @@ "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 } ] }