Skip to content

Commit

Permalink
Fix: Adjust condition for sending 'attempted' statement (fixes #129) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
nachocinalli authored Jun 18, 2024
1 parent 29bfb95 commit 068fb35
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/XAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ class XAPI extends Backbone.Model {
return this;
}

if (this.get('state').length === 0) {
const state = this.get('state');
if (!state || Object.keys(state).length === 0) {
// This is a new attempt, send 'attempted'.
await this.sendStatement(this.getCourseStatement(window.ADL.verbs.attempted));
} else {
Expand Down

0 comments on commit 068fb35

Please sign in to comment.