Closed lars-moch closed 2 years ago
From an initial investigation, this looks like a bug in the isCors policy.
For a url https://cloud.scorm.com/lrs/ABC123/
I get back isCORS true because of the condition
location.hostname.toLowerCase() !== urlparts[2]
as this equates to 'cloud.scorm.com' !== 'cloud.scorm.com/lrs/abc123/'
The regex for urlparts is at fault
I implemented the bugfix from issue #103 but instead got an error in this line.
It looked like the same issue as in issue #103, plus a problem with the "result" parameter, which is optional and could be undefined. I tried with this code:
if (result && (Object.keys(result).length > 0)) {
And it seemed to work.
But when I close the course, I get this error in the browser console:
When I look at the Statements in the LRS, there is no "actor terminated course" statement (I get that if I test with version 0.8.3 of the xApi plugin).
I am using framework 5.18.5, and the course is authored in AT 0.10.5.
The course is very minimal. The content is only the default content when you create a new course (one page with one block with a text component). The only installed extension is the adapt-contrib-xapi with the above-mentioned updates and it uses all default settings (except for the Activity ID and Endpoint).
I have tested in SCORM Cloud sandboxed LRS.