From 9a68e0c305f8eb4e3324826f7213f3f5a87b87ce Mon Sep 17 00:00:00 2001 From: tomgreenfield Date: Fri, 8 Jul 2016 16:37:46 +0100 Subject: [PATCH 1/2] Hook into _canShowMarking --- bower.json | 2 +- js/adapt-contrib-mcq.js | 2 ++ less/mcq.less | 3 ++- templates/mcq.hbs | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) 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/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/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}}
{{#each _items}} -
+