From 068fb35c13f09af608e863e8e73a8d8ad1fecf64 Mon Sep 17 00:00:00 2001 From: Ignacio Cinalli Date: Tue, 18 Jun 2024 10:18:28 -0300 Subject: [PATCH] Fix: Adjust condition for sending 'attempted' statement (fixes #129) (#130) --- js/XAPI.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/XAPI.js b/js/XAPI.js index 2c24be1..137270e 100644 --- a/js/XAPI.js +++ b/js/XAPI.js @@ -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 {