From 86d542f75546a46b109d53d95c574acb3bbc3bfe Mon Sep 17 00:00:00 2001 From: Chris Steele Date: Mon, 1 Nov 2021 16:51:39 +0000 Subject: [PATCH 1/5] #2604 ensure score sent to LMS before status --- js/tracking.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/js/tracking.js b/js/tracking.js index 2cacf6bf..240ba088 100644 --- a/js/tracking.js +++ b/js/tracking.js @@ -36,9 +36,21 @@ class Tracking extends Backbone.Controller { onAssessmentComplete(assessmentState) { this._assessmentState = assessmentState; + this.submitScore(); this.checkCompletion(); } + submitScore() { + if (!this._config._shouldSubmitScore) return; + + if (this._assessmentState.isPercentageBased) { + Adapt.offlineStorage.set('score', this._assessmentState.scoreAsPercent, 0, 100); + return; + } + + Adapt.offlineStorage.set('score', this._assessmentState.score, 0, this._assessmentState.maxScore); + } + /** * Restores the _assessmentState object when an assessment is registered. * @param {object} assessmentState - An object representing the overall assessment state From 0672eb00f471b1f291e7acb4e3b1ef289263c5ff Mon Sep 17 00:00:00 2001 From: Chris Steele Date: Wed, 3 Nov 2021 13:11:28 +0000 Subject: [PATCH 2/5] Support assessment minScore --- js/tracking.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/tracking.js b/js/tracking.js index 240ba088..48ae6ee1 100644 --- a/js/tracking.js +++ b/js/tracking.js @@ -48,7 +48,7 @@ class Tracking extends Backbone.Controller { return; } - Adapt.offlineStorage.set('score', this._assessmentState.score, 0, this._assessmentState.maxScore); + Adapt.offlineStorage.set('score', this._assessmentState.score, this._assessmentState.minScore, this._assessmentState.maxScore); } /** From 303ceb6d499725ef00f474443ebdf07fd1ead67b Mon Sep 17 00:00:00 2001 From: Chris Steele Date: Wed, 3 Nov 2021 13:13:30 +0000 Subject: [PATCH 3/5] Bump version --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6d237e63..6d0e2deb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "adapt-contrib-core", - "version": "6.0.0", - "framework": ">=5.17.0", + "version": "6.0.5", + "framework": ">=5.17.7", "description": "Adapt Framework kernel. Responsible for boot loading, data loading and core APIs.", "repository": { "type": "git", From 5d9d870a1a3da56051f130353c2659c7421322cb Mon Sep 17 00:00:00 2001 From: Chris Steele Date: Wed, 3 Nov 2021 13:15:11 +0000 Subject: [PATCH 4/5] Undo FW version change --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6d0e2deb..6c9f9e72 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "adapt-contrib-core", "version": "6.0.5", - "framework": ">=5.17.7", + "framework": ">=5.17.0", "description": "Adapt Framework kernel. Responsible for boot loading, data loading and core APIs.", "repository": { "type": "git", From f18317808e679e54951a606e8b00db8bc2b38369 Mon Sep 17 00:00:00 2001 From: Chris Steele Date: Wed, 3 Nov 2021 13:34:27 +0000 Subject: [PATCH 5/5] Minor version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6c9f9e72..a7933446 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "adapt-contrib-core", - "version": "6.0.5", + "version": "6.1.0", "framework": ">=5.17.0", "description": "Adapt Framework kernel. Responsible for boot loading, data loading and core APIs.", "repository": {