diff --git a/README.md b/README.md index a5d83c7..16cd310 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,8 @@ guide the learner’s interaction with the component. **_canShowModelAnswer** (boolean): Setting this to `false` prevents the [**_showCorrectAnswer** button](https://github.com/adaptlearning/adapt_framework/wiki/Core-Buttons) from being displayed. The default is `true`. +**_canShowMarking** (boolean): Setting this to `false` prevents ticks and crosses being displayed on question completion. The default is `true`. + **_recordInteraction** (boolean) Determines whether or not the learner's answers will be recorded to the LMS via cmi.interactions. Default is `true`. For further information, see the entry for `_shouldRecordInteractions` in the README for [adapt-contrib-spoor](https://github.com/adaptlearning/adapt-contrib-spoor). **_items** (array): Each *item* represents one choice for the multiple choice question and contains values for **text**, **_shouldBeSelected**, and **feedback**. diff --git a/bower.json b/bower.json index 90fcc20..2dc2755 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "adapt-contrib-mcq", "version": "2.0.4", - "framework": "^2.0.0", + "framework": "^2.0.11", "homepage": "https://github.com/adaptlearning/adapt-contrib-mcq", "issues": "https://github.com/adaptlearning/adapt_framework/issues/new?title=contrib-mcq%3A%20please%20enter%20a%20brief%20summary%20of%20the%20issue%20here&body=please%20provide%20a%20full%20description%20of%20the%20problem,%20including%20steps%20on%20how%20to%20replicate,%20what%20browser(s)/device(s)%20the%20problem%20occurs%20on%20and,%20where%20helpful,%20screenshots.", "displayName" : "Multiple Choice Question", diff --git a/example.json b/example.json index ef7091b..5ac0229 100644 --- a/example.json +++ b/example.json @@ -11,6 +11,7 @@ "_isRandom":false, "_selectable":1, "_canShowModelAnswer": true, + "_canShowMarking": true, "_recordInteraction":true, "title": "MCQ", "displayTitle": "MCQ", diff --git a/js/adapt-contrib-mcq.js b/js/adapt-contrib-mcq.js index 8222519..d00bd2f 100644 --- a/js/adapt-contrib-mcq.js +++ b/js/adapt-contrib-mcq.js @@ -252,6 +252,8 @@ define(function(require) { // This is important and should give the user feedback on how they answered the question // Normally done through ticks and crosses by adding classes showMarking: function() { + if (!this.model.get('_canShowMarking')) return; + _.each(this.model.get('_items'), function(item, i) { var $item = this.$('.component-item').eq(i); $item.removeClass('correct incorrect').addClass(item._isCorrect ? 'correct' : 'incorrect'); diff --git a/less/mcq.less b/less/mcq.less index 74f8e11..23d2593 100644 --- a/less/mcq.less +++ b/less/mcq.less @@ -132,7 +132,8 @@ .mcq-item-icon { display:none; } - .selected .mcq-correct-icon { + .incorrect .selected .mcq-correct-icon, + .correct .selected .mcq-correct-icon { display:block; } } diff --git a/properties.schema b/properties.schema index 0ecd949..fae9634 100644 --- a/properties.schema +++ b/properties.schema @@ -97,6 +97,14 @@ "validators": [], "help": "Select 'true' to allow the user to view feedback on their answer" }, + "_canShowMarking": { + "type": "boolean", + "default": true, + "title": "Display Marking", + "inputType": { "type": "Boolean", "options": [ true, false ] }, + "validators": [], + "help": "Select 'true' to display ticks and crosses on question completion" + }, "_shouldDisplayAttempts": { "type":"boolean", "required":false, diff --git a/templates/mcq.hbs b/templates/mcq.hbs index ac208cc..fbf823e 100644 --- a/templates/mcq.hbs +++ b/templates/mcq.hbs @@ -2,7 +2,7 @@ {{> component this}}