Skip to content

Commit

Permalink
reverts changes made in #171 (#176)
Browse files Browse the repository at this point in the history
* Revert "Fixes #1990, update to onQuestionRecordInteraction() to call model functions (#171)"

This reverts commit 69f6ff6.

* trim spaces, reformat comment

* version bump
  • Loading branch information
moloko authored May 2, 2018
1 parent e7b9361 commit ce45656
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Note that due to the data storage limitations of browser cookies, there is less
Currently (officially) only supports SCORM 1.2

----------------------------
**Version number:** 3.0.0 <a href="https://community.adaptlearning.org/" target="_blank"><img src="https://github.com/adaptlearning/documentation/blob/master/04_wiki_assets/plug-ins/images/adapt-logo-mrgn-lft.jpg" alt="adapt learning logo" align="right"></a>
**Version number:** 3.0.1 <a href="https://community.adaptlearning.org/" target="_blank"><img src="https://github.com/adaptlearning/documentation/blob/master/04_wiki_assets/plug-ins/images/adapt-logo-mrgn-lft.jpg" alt="adapt learning logo" align="right"></a>
**Framework versions:** 3.0.0+
**Author / maintainer:** Adapt Core Team with [contributors](https://github.com/adaptlearning/adapt-contrib-spoor/graphs/contributors)
**Accessibility support:** n/a
Expand Down
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": "3.0.0",
"version": "3.0.1",
"framework": ">=3",
"homepage": "https://github.com/adaptlearning/adapt-contrib-spoor",
"issues": "https://github.com/adaptlearning/adapt_framework/issues/new?title=contrib-spoor%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,%20the%20contents%20of%20the%20SCORM%20debug%20window.",
Expand Down
26 changes: 10 additions & 16 deletions js/adapt-stateful-session.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ define([

onTrackingComplete: function(completionData) {
this.saveSessionState();

var completionStatus = completionData.status.asLowerCase;

// The config allows the user to override the completion state.
Expand Down Expand Up @@ -160,30 +160,24 @@ define([

onAssessmentComplete: function(stateModel) {
Adapt.course.set('_isAssessmentPassed', stateModel.isPass);

this.saveSessionState();

this.submitScore(stateModel);
},

onQuestionRecordInteraction:function(questionView) {
var responseType = typeof questionView.model.getResponseType === 'function'
? questionView.model.getResponseType()
: questionView.getResponseType();
var responseType = questionView.getResponseType();

// If responseType doesn't contain any data, assume that the question
// If responseType doesn't contain any data, assume that the question
// component hasn't been set up for cmi.interaction tracking
if (_.isEmpty(responseType)) return;
if(_.isEmpty(responseType)) return;

var id = questionView.model.get('_id');
var response = typeof questionView.model.getResponse === 'function'
? questionView.model.getResponse()
: questionView.getResponse();
var result = typeof questionView.model.isCorrect === 'function'
? questionView.model.isCorrect()
: questionView.isCorrect();
var response = questionView.getResponse();
var result = questionView.isCorrect();
var latency = questionView.getLatency();

Adapt.offlineStorage.set("interaction", id, response, result, latency, responseType);
},

Expand All @@ -197,7 +191,7 @@ define([
this.reattachEventListeners();

this.saveSessionState();

if (this._config._reporting && this._config._reporting._resetStatusOnLanguageChange === true) {
Adapt.offlineStorage.set("status", "incomplete");
}
Expand All @@ -217,7 +211,7 @@ define([
onWindowUnload: function() {
this.removeEventListeners();
}

}, Backbone.Events);

return AdaptStatefulSession;
Expand Down

0 comments on commit ce45656

Please sign in to comment.