gabrieldoty / simplify-scorm

Scorm 1.2 Javascript API
MIT License
230 stars 77 forks source link

Trouble defining API handle #38

Closed judodan closed 3 years ago

judodan commented 3 years ago

Hi,

I previously implemented a SCORM course successfully using this library. (Thanks!) Now I am trying to implement another, but I have not been successful in getting the package to identify the API handle. I can confirm it's added to the window BEFORE the course is initialized.

Unfortunately, the file that executes the course is in minified javascript (which, as you know, is hard to follow). If I 'prettify' it in Chrome dev tools, I can set breakpoints and confirm the API is on the window, but the code that looks for it is really cryptic.

There are references to Spark API (and a Spark API class) in the code. Any idea what I might be missing?

xob commented 3 years ago

You need to ensure the course you are trying to use is either SCORM 1.2 or SCORM 2004. From what I've been able to gather, Spark API seems to be another e-learning standard, which I don't think is compatible with SCORM 1.2 or SCORM 2004.

Simplify Scorm only supports 1.2 and 2004.

judodan commented 3 years ago

It specifically says scorm version 1.2 in the code.

I found a reference that says the API should be defined in a PARENT window (this didn't seem to matter in the last course I implemented), and I managed to get it to recognize by putting the course in an iFrame, but now I am getting all kinds of space and sizing issues, LOL.

xob commented 3 years ago

Indeed, placing the API in a parent window, aka launching the course in a popup or an iframe, gives the best results. Not all courses are built equally; some only look in the current window, some only look in a parent window, most do both.

Glad you got it to work!