HFP-29: Add option to disable solution button

pull/4/merge
Håkon Ellingsen 2016-09-28 11:28:53 +02:00
parent a601a1014c
commit 36c5192c1d
2 changed files with 11 additions and 1 deletions

View File

@ -56,6 +56,10 @@ H5P.QuestionSet = function (options, contentId, contentData) {
' </div>' + ' </div>' +
'</div>'; '</div>';
var solutionButtonTemplate = options.endGame.showSolutionButton ?
' <button type="button" class="h5p-joubelui-button h5p-button qs-solutionbutton"><%= solutionButtonText %></button>':
'';
var resulttemplate = var resulttemplate =
'<div class="questionset-results">' + '<div class="questionset-results">' +
' <div class="greeting"><%= message %></div>' + ' <div class="greeting"><%= message %></div>' +
@ -71,7 +75,7 @@ H5P.QuestionSet = function (options, contentId, contentData) {
' <% } %>' + ' <% } %>' +
' <div class="buttons">' + ' <div class="buttons">' +
' <button type="button" class="h5p-joubelui-button h5p-button qs-finishbutton"><%= finishButtonText %></button>' + ' <button type="button" class="h5p-joubelui-button h5p-button qs-finishbutton"><%= finishButtonText %></button>' +
' <button type="button" class="h5p-joubelui-button h5p-button qs-solutionbutton"><%= solutionButtonText %></button>' + solutionButtonTemplate +
' <button type="button" class="h5p-joubelui-button h5p-button qs-retrybutton"><%= retryButtonText %></button>' + ' <button type="button" class="h5p-joubelui-button h5p-button qs-retrybutton"><%= retryButtonText %></button>' +
' </div>' + ' </div>' +
'</div>'; '</div>';

View File

@ -212,6 +212,12 @@
"label": "Display results", "label": "Display results",
"default": true "default": true
}, },
{
"name": "showSolutionButton",
"type": "boolean",
"label": "Display solution button",
"default": true
},
{ {
"name": "noResultMessage", "name": "noResultMessage",
"type": "text", "type": "text",