Skip to content

Commit

Permalink
Don't send progress for completed
Browse files Browse the repository at this point in the history
* Clear the set progress value after successful completed send
  • Loading branch information
brianjmiller committed Jul 5, 2016
1 parent 0ec8960 commit 7ff512f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cmi5.js
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@ var Cmi5;
callbackWrapper = function (err) {
this.log("completed - callbackWrapper: " + err);
if (err === null) {
this.setProgress(null);
this._completed = true;
}

Expand All @@ -638,6 +639,7 @@ var Cmi5;
this.log("completed - result: ", result);

if (! callback && result.response.err === null) {
this.setProgress(null);
this._completed = true;
}

Expand Down Expand Up @@ -1346,7 +1348,7 @@ var Cmi5;
stCfg.verb.display = verbDisplay[verbId];
}

if (progress !== null) {
if (verbId !== VERB_COMPLETED_ID && progress !== null) {
stCfg.result = {
extensions: {
"https://w3id.org/xapi/cmi5/result/extensions/progress": progress
Expand Down

0 comments on commit 7ff512f

Please sign in to comment.