Closed james-siteclick closed 6 years ago
When used, the wrapper always assumes it should be trying to connect to a SCORM LMS. Typically as a course developer you would provide some other method for launching your content outside of an LMS. For example in the Adapt Learning OS project (which i’m involved with and which uses this wrapper) we have index.html for launching from a regular webserver and index_lms.html for when launching from an LMS. Articulate/Storyline does something very similar.
Thanks very much for your reply, that makes sense. We make modules with a single index.html that are designed to run on web or SCORM, so I guess this is a feature request rather than a bug.
I usually design my courses to be functional without SCORM, then add the SCORM tracking after the fact. There's no need for code modification or a separate HTML file, the SCORM wrapper won't do anything until you invoke scorm.init
. You can add some conditional code to your HTML file that says if this is being launched in a SCORM-based LMS, invoke the wrapper, otherwise don't touch.
You could also use a JS loading script such as requireJS to only load the wrapper file when certain conditions are met (e.g. if the course is launched in a SCORM environment).
It seems the wrapper assumes that if window.opener is set, then SCORM is being used.
However if a course is not being used with SCORM, and is opened either via an anchor with target attribute set, or window.open, then window.opener is set in the course and SCORM wrapper throws a JS error.