Skip to content

Commit

Permalink
Merge pull request #60 from adaptlearning/issue/#59
Browse files Browse the repository at this point in the history
Adds a defer to setting the components to complete
  • Loading branch information
oliverfoster committed Apr 2, 2015
2 parents bc41858 + 38432af commit f699e7e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "adapt-contrib-spoor",
"version": "1.1.8",
"version": "1.1.9",
"homepage": "https://github.com/adaptlearning/adapt-contrib-spoor",
"authors": [
"Kevin Corry <[email protected]>",
Expand Down
14 changes: 9 additions & 5 deletions js/serialisers/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,16 @@ define(['coreJS/adapt'], function (Adapt) {

deserialise: function (data) {
var suspendData = JSON.parse(data);

_.defer(_.bind(function() {

_.each(this.deserialiseSaveState(suspendData.spoor.completion), function(state, blockTrackingId) {
if (state === 1) {
this.markBlockAsComplete(Adapt.blocks.findWhere({_trackingId: blockTrackingId}));
}
}, this);
_.each(this.deserialiseSaveState(suspendData.spoor.completion), function(state, blockTrackingId) {
if (state === 1) {
this.markBlockAsComplete(Adapt.blocks.findWhere({_trackingId: blockTrackingId}));
}
}, this);

}, this));

Adapt.course.set('_isComplete', suspendData.spoor._isCourseComplete);
Adapt.course.set('_isAssessmentPassed', suspendData.spoor._isAssessmentPassed);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "adapt-contrib-spoor",
"version": "1.1.8",
"version": "1.1.9",
"description": "A basic scorm tracking plugin for Adapt",
"main": "",
"scripts": {
Expand Down

0 comments on commit f699e7e

Please sign in to comment.