Skip to content

Commit

Permalink
Merge pull request #26 from SergeyYukhnevich/add-configuration-for-ch…
Browse files Browse the repository at this point in the history
…eck-button

Add configuration for check button
  • Loading branch information
icc authored Jun 12, 2017
2 parents 7b1bff3 + 4d35ce3 commit b9901e1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion js/multichoice.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ H5P.MultiChoice = function (options, contentId, contentData) {
noInput: 'Input is required before viewing the solution'
},
behaviour: {
enableCheck: true,
enableRetry: true,
enableSolutionsButton: true,
type: 'auto',
Expand Down Expand Up @@ -612,7 +613,7 @@ H5P.MultiChoice = function (options, contentId, contentData) {
}, false);

// Check solution button
if (!params.behaviour.autoCheck || !params.behaviour.singleAnswer) {
if (params.behaviour.enableCheck && (!params.behaviour.autoCheck || !params.behaviour.singleAnswer)) {
self.addButton('check-answer', params.UI.checkAnswerButton,
function () {
self.answered = true;
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"contentType": "Question",
"majorVersion": 1,
"minorVersion": 9,
"patchVersion": 3,
"patchVersion": 4,
"runnable": 1,
"machineName": "H5P.MultiChoice",
"author": "Joubel",
Expand Down
8 changes: 8 additions & 0 deletions semantics.json
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,14 @@
"description": "These options will let you control how the task behaves.",
"optional": true,
"fields": [
{
"name": "enableCheck",
"type": "boolean",
"label": "Enable \"Check\" button",
"importance": "low",
"default": true,
"optional": true
},
{
"name": "enableRetry",
"type": "boolean",
Expand Down

0 comments on commit b9901e1

Please sign in to comment.