Adapt_framework: adapt-contrib-spoor sends status before score which is a problem for Cornerstone

Created on 2 Dec 2019  路  12Comments  路  Source: adaptlearning/adapt_framework

Subject of the issue

A completed/passed status will be sent to the LMS before a score is sent in courses with an assessment. When this occurs it has been found to be a problem for Cornerstone reporting: the correct score is captured in the user's transcript, but not included in general reporting (the score remains 0 in the reports). When the submission of status and score are reversed this problem is resolved.

N.B. in older versions of Adapt score was sent before status, but for quite some time now (certainly the Adapt v3 and v4 era) the score is sent after.

Your environment

  • more recent versions of the framework (v3, v4, v5, possibly earlier)
  • all browsers
  • all devices + operating systems

Most helpful comment

All 12 comments

I suppose there's no possibility of logging this as a bug with Cornerstone since it's quite clearly something wrong at their end?

2590 is related but the LMS in question isn't Cornerstone

If (as is likely) Cornerstone refuse to address this then I guess one option might be to put a _.defer or a _.delay in here

I think a fairly simple solution to this and #2590 could be to move responsibility for setting the score away from spoor and into tracking.js... I don't really see why spoor needs to handle setting it. lesson status is a slightly different matter since what that gets set to is quite specific to SCORM, so it's more appropriate that it takes place in the spoor extension.

Something like this, maybe?

onAssessmentComplete: function(assessmentState) {
  this._assessmentState = assessmentState;
  this.submitScore();
  this.checkCompletion();
},

submitScore: function() {
  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);
}

@chris-steele is this still an issue?

I would say most likely so; I haven't been aware of Cornerstone fixing this - and even if they have some clients may use older unpatched versions.

Any ideas of how to fix?

this in here?

As I recall I was thinking more here but yeah, essentially...

might need to move the check for _shouldSubmitScore to somewhere like here

superb, ta

Can confirm this approach works. Is needed for a client with custom error messages which include the score and lesson_status if an error occurs when saving this data.

Was this page helpful?
0 / 5 - 0 ratings