About this SCORM_API

This API is used by the SCO's (Shareable Content Object's) to connect with the LMS and communicate thru JavaScript (the way scorm was designed). I've added a "SCOBot" helper, which boils down SCORM API calls, and handles common tasks SCORM does without the guesswork. This assists you with not having to do all longhand SCORM Calls. But make no mistake, there is no magic SCORM drop-in that magically knows you're taking a test or a quiz. You have to make the appropriate calls when needed.

Commonly, within the SCORM Specification its riddled with arbitrary limitations on character limits, and read/write access within the CMI Object. Because SCORM is a Government standard, I did my best to remain true to the specification, but I don't feel LMS's should 100% strictly impose these character limits. What commonly happens is if you go over your suspend data limit or bookmarking etc … the LMS will ignore your setting of the value. This causes data to be lost. Also, they didn't make or let SCORM scale properly. If I want to store a new object, that I want to fetch later, don't hinder me from doing so. So, with this said I took a hybrid approach to warning you when you're breaking the spec, but not stopping you from doing so. These are things I think LMS's should consider in the future, but you NEED to be aware of these limitations.


Without looking at your browsers console, this page will just look like a plain old 'read me' file. Its actually included the SCORM API, SCOBot and made SCORM Calls. Suspend and Finish below will either Suspend and Terminate or Finish and Terminate. You can review the logs to see the console traces.


Debugging this Project

The console is your friend. Review the console to see messages in Chrome and Safari - (right-click, inspect element, console tab)

If you are using IE, but use - (F12 Developer Tools). Note: mileage varies.

If you use FireFox you need the Add-on FireBug, then the console should show up since it supports console.show().

What you should end up seeing is a series of SCORM Debug messages. If you are running this locally, the Local_API_1484_11 will mimic a LMS when one is not present.

I mention this because its important to monitor how your interacting. This is a great place to catch 404 errors (file not found) among script/syntax errors, debug messages as well as inspecting elements and there styling. Developers worked many years in the 'dark', and this is a nice way to bring your project into the light.

Putting this into your project is essentially how this page is set up. If you view the source you'll see the files included. But, lets dive in a little deeper...


Getting Around

This project makes use of JQuery. Using it without will require some subtle re-writing.

SCORM can be as little as initialize and terminate , and ramp up to full quiz, essay, interactions and objectives with the ability to suspend data. Depending on where you fall on the spectrum, it's a good idea to take a solid look at what your needs are so you're not lofting around a lot of overhead to do a simple task.

There is a readme.html file located in js/scorm/readme.html that covers in greater detail what I'm eluding to here. This documentation is being added as the project solidifies, but it covers much of the implementation.

If you were looking for a single file to drop into your project, your seeking the actual "build" of this project. This is the process of merging and packing all JavaScript files. In order to keep things open, and editable for now, I've kept it broken out until I reach a conclusion on the best way to offer the needed edits, with the base code.


Versions

SCORM_API.js version: , Last Change:

SCOBot.js version: , Last Change:


Options and Editing:

Optional - js/scorm/Local_API_1484_11.js :: This mimic's the LMS's Runtime API and can be used for standalone use.

Optional - js/scorm/SCOBot.js :: This essentially groups 'like' SCORM calls into groups of API's like start(), suspend(), finish(). Makes SCORM a little easier.

Its important to note that this project was split up so you could chop off things you don't need or use. However the API's present in SCOBOT are things you will have to do regardless if you were doing SCORM longhand. The support for a Local API_1484_11 will allow you to generate CMI Objects natively within the SCO and run like you would if you were on the LMS, without the ability of persistence after you close the browser.


Project Goals:

JSLint Integration - Better code maintainability and error control.

JSDocs Commenting - Comments formatted for interpretation by jsDocs for instant documentation

Qunit Integration - QUnit is a test suite that allows for Test Driven Development. This more accurately tests existing and new functionality. qunit_SCORM_API.html and qunit_SCOBot.html

Size - < 10KB packed (by itself). Currently loaded with Local_API_1484_11, SCOBot, and SCORM_API is 10,276 bytes (7/5/2011)


Why build this?

Since late 2005 I've seen several groups attempt to create a SCORM API. After failed attempts due to misunderstanding what SCORM was and how it works, you can reach out to 3rd parties to solve things. As I mentioned in my goals above, I was after maintainability, code cleanliness, transparency, Test Driven Development, and lowering the footprint. You don't typically find out your 3rd party code is difficient until your neck deep in it.


Final Build

TBD

I'm still running this API thru the mill. I've tied it into QUnit for validation and tests, as well as put it on Test Track or the SCORM Cloud. As I finish polishing up support at lower levels like Objectives and Interactions I will release a non-beta build.

I've had some requests for a 'single file'. This is much like a series of JQuery Plugins you might locate to bolt on to your webpage. You can do a final build and roll in all your customizations, or you could take a build I make. But keep in mind once you build a SCO, you commonly add in more files, and you should be following a build process that merges, minifies and or packs your CSS, JavaScript and HTML reducing bandwidth and HTTP hits. Its never a good idea to re-pack a packed file. This is much like rezipping a zip file.


Thanks, Mark Statkus


Open the console to review debug messages.