From bf4e552f35f9087020862f079bd76d052a943e5d Mon Sep 17 00:00:00 2001 From: moloko Date: Thu, 17 Sep 2015 19:52:12 +0100 Subject: [PATCH] Implement randomisation as per #83 Bump version --- bower.json | 2 +- js/adapt-contrib-gmcq.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bower.json b/bower.json index 5234a5d..a1e8349 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "adapt-contrib-gmcq", - "version": "2.0.0", + "version": "2.0.1", "framework": "^2.0.0", "homepage": "https://github.com/adaptlearning/adapt-contrib-gmcq", "issues": "https://adaptlearning.atlassian.net/secure/CreateIssueDetails!init.jspa?pid=10100&issuetype=1&priority=6&components=10508", diff --git a/js/adapt-contrib-gmcq.js b/js/adapt-contrib-gmcq.js index a80faa6..6039ccc 100644 --- a/js/adapt-contrib-gmcq.js +++ b/js/adapt-contrib-gmcq.js @@ -20,7 +20,6 @@ define(function(require) { }; events = _.extend(events, ie8Events); - } return events; @@ -38,12 +37,15 @@ define(function(require) { }, setupQuestion: function() { - // Radio button or checkbox + // if only one answer is selectable, we should display radio buttons not checkboxes this.model.set("_isRadio", (this.model.get("_selectable") == 1) ); this.model.set('_selectedItems', []); this.setupQuestionItemIndexes(); + + this.setupRandomisation(); + this.restoreUserAnswers(); this.listenTo(Adapt, 'device:changed', this.resizeImage); @@ -71,6 +73,7 @@ define(function(require) { }, + // hack for IE8 forceChangeEvent: function(event) { $("#" + $(event.currentTarget).closest("label").attr("for")).change();