Skip to content

Commit 068fb35

Browse files
authored
Fix: Adjust condition for sending 'attempted' statement (fixes #129) (#130)
1 parent 29bfb95 commit 068fb35

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

js/XAPI.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ class XAPI extends Backbone.Model {
144144
return this;
145145
}
146146

147-
if (this.get('state').length === 0) {
147+
const state = this.get('state');
148+
if (!state || Object.keys(state).length === 0) {
148149
// This is a new attempt, send 'attempted'.
149150
await this.sendStatement(this.getCourseStatement(window.ADL.verbs.attempted));
150151
} else {

0 commit comments

Comments
 (0)