From 5af15d2eafd44edda07c698c6a121eb0badaf562 Mon Sep 17 00:00:00 2001 From: Sergey Yuhnevich Date: Fri, 2 Jun 2017 16:06:06 +0300 Subject: [PATCH] Add configuration for check button --- js/dragquestion.js | 21 ++++++++++++--------- library.json | 2 +- semantics.json | 8 ++++++++ 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/js/dragquestion.js b/js/dragquestion.js index 2ca93690..3b82c352 100644 --- a/js/dragquestion.js +++ b/js/dragquestion.js @@ -42,6 +42,7 @@ H5P.DragQuestion = (function ($) { } }, behaviour: { + enableCheck: true, enableRetry: true, preventResize: false, singlePoint: true, @@ -484,15 +485,17 @@ H5P.DragQuestion = (function ($) { C.prototype.addSolutionButton = function () { var that = this; - this.addButton('check-answer', this.options.scoreShow, function () { - that.answered = true; - that.showAllSolutions(); - that.showScore(); - var xAPIEvent = that.createXAPIEventTemplate('answered'); - that.addQuestionToXAPI(xAPIEvent); - that.addResponseToXAPI(xAPIEvent); - that.trigger(xAPIEvent); - }); + if (this.options.behaviour.enableCheck) { + this.addButton('check-answer', this.options.scoreShow, function () { + that.answered = true; + that.showAllSolutions(); + that.showScore(); + var xAPIEvent = that.createXAPIEventTemplate('answered'); + that.addQuestionToXAPI(xAPIEvent); + that.addResponseToXAPI(xAPIEvent); + that.trigger(xAPIEvent); + }); + } }; /** diff --git a/library.json b/library.json index 52b22579..de95de1e 100644 --- a/library.json +++ b/library.json @@ -4,7 +4,7 @@ "contentType": "Question", "majorVersion": 1, "minorVersion": 10, - "patchVersion": 1, + "patchVersion": 2, "embedTypes": [ "iframe" ], diff --git a/semantics.json b/semantics.json index 60d55c8a..8c6f7b1a 100644 --- a/semantics.json +++ b/semantics.json @@ -351,6 +351,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",