I’ve been a longtime user of the ADL wrapper (with code from the late Claude Ostyn), and to be honest, it’s pretty much met my needs. But I was never completely comfortable with the wrapper for two reasons: 1) The code is hard to read with confusing and overly complicated looking variable names, and 2) the code made heavy use of global variables, which in this Web 2.0 world is a big no-no. Global variables can easily cause conflicts with other scripts and script libraries, and should be avoided as much as possible.
This past week I decided to roll up my sleeves and make a new SCORM API wrapper that takes care of these issues. [ Download wrapper ]
Examples of the wrapper in action
I have successfully tested the wrapper with the ADL test suites for SCORM 1.2 and SCORM 2004 rev 3.
Now, mind you, I’m not saying the wrapper is perfect — there are still some changes I’m considering — but I think it’s a step in the right direction. I’d love to hear your thoughts on the revised wrapper, especially if you’ve had a chance to test-drive it.
What’s a wrapper?
A “SCORM API wrapper” is a buffer (aka ‘proxy’ or ‘middleman’) that prevents your SCORM course from making direct calls to the SCORM Run-Time Environment (RTE) located on your learning management system.
(For those less familiar with the concept of APIs: API stands for “application programming interface.” An API allows 3rd party developers to tap into specific features of a program or service. For instance, Flickr has become famous for allowing independent developers to create web-based applications that tap into Flickr’s photo hosting services using the Flickr API.)
Why use a wrapper?
There are two really good reasons to use a SCORM API wrapper: 1) advanced error-checking, and 2) ease of maintenance.
If you try to make a call to the SCORM RTE before the course has been initialized (turned on), your call will fail. This means if you try to request the course status or student’s name, your request will not work, and you will most likely NOT receive any error messages telling you what happened.
By using a wrapper, you can build ‘checks’ into your code that ensure certain criteria are met before performing a specified action. For instance, the wrapper can ensure your course is properly connected to the SCORM RTE before asking the RTE to give you data.
You can also add debugging alerts and statements to help you figure out what has happened when something goes wrong:
Another great reason to use a wrapper is ease of maintenance. The SCORM RTE has been steadily evolving over the years; for the last few years, the dominant version has been 1.2. However, version 1.3 (later renamed “2004”) has been gaining ground, thanks largely to mandates by the US military that require all e-learning courses used in military training be SCORM 2004-conformant. That’s a LOT of courses, and those big-money contracts are increasing the pace of SCORM 2004 support in both courseware and learning management systems.
What if you hard-coded your SCORM 1.2 calls into your course? SCORM 1.2’s nomenclature is very different from SCORM 2004. This means you’d have to dig into all of your courses and replace every single SCORM 1.2-specific reference to the newer SCORM 2004 nomenclature. Yuck.
What would be easier is using a wrapper to control the SCORM nomenclature for you. Consider this SCORM 1.2 call wrapped in a custom function:
When you change your course from SCORM 1.2 to SCORM 2004, all you’d need to do is change the call in the function from
api.Commit(""). The code used in your course would be the same (
saveData("")), and you’d only need to update your code in one place. This makes upgrading much less painful.
OK, I’m sold on the value of wrappers. Where do I get one?
Chances are you’re already using a wrapper, but probably not to its potential. The ADL has some sample wrappers available on their website, and most commercial SCORM products come with wrappers.
My revision to the ADL wrapper is intended to make it even easier to use and troubleshoot. Best of all, it’s free. 🙂 Give it a whirl! All I ask is for you to give me some feedback; let me know if it works on your particular LMS, or if you have suggestions for improvements.