From 36c5192c1dd719a3489428f2b0da7f8902323526 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ha=CC=8Akon=20Ellingsen?= Date: Wed, 28 Sep 2016 11:28:53 +0200 Subject: [PATCH] HFP-29: Add option to disable solution button --- js/questionset.js | 6 +++++- semantics.json | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/js/questionset.js b/js/questionset.js index b346c51..bab8a12 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -56,6 +56,10 @@ H5P.QuestionSet = function (options, contentId, contentData) { ' ' + ''; + var solutionButtonTemplate = options.endGame.showSolutionButton ? + ' ': + ''; + var resulttemplate = '
' + '
<%= message %>
' + @@ -71,7 +75,7 @@ H5P.QuestionSet = function (options, contentId, contentData) { ' <% } %>' + '
' + ' ' + - ' ' + + solutionButtonTemplate + ' ' + '
' + '
'; diff --git a/semantics.json b/semantics.json index eaaa265..a3ebb19 100644 --- a/semantics.json +++ b/semantics.json @@ -212,6 +212,12 @@ "label": "Display results", "default": true }, + { + "name": "showSolutionButton", + "type": "boolean", + "label": "Display solution button", + "default": true + }, { "name": "noResultMessage", "type": "text",