Embedding javascript in a page without damaging SCORM

Mar 08, 2011

Is there an easy way to embed Javascript in the header of a page, such as the opening page of a course?

Would this create problems with SCORM?

Here's what we intend to do:

A. We embed a Javascript header line, that runs on loading

B. This references additional Javascript contained in a local .js file (i.e., local in the same folder as our course, on server side)

C. The JS file Javascript is a short routine that compares two variables

D. If variables don't match, Javascript loads a different opening page, instead of the one originally being opened (switcheroo)

The problem we are trying to solve is expiration. We can't find any tools available that work with Articulate to set an expiration date for a course. If we write our own Javascript, we can read system clock and compare this to a date value that we include with the course. The hardest trick will be to have Javascript load an alternate "expiration page" instead of the user-opened page, and do all this without getting SCORM angry.

6 Replies
Brian Batt

Hi Ryan,

Is the other page that the JavaScript is loading another SCORM course or is it a general page stating that the course or subscription has expired?  If it was another SCORM course, I think that you would have a ton of issues.  However, if the other page is just a general page, then it should work fine.  On the SCORM side, it will just appear that the user abandoned the course (incomplete status).

Ryan Bernard

Brian:

Thanks for the reply. In additional to the normal SCORM content, generated by a tool like Articulate, we would have the following extra files, stored in the source object root folder:

1. A Javascript file (.JS) containing a routine that checks expiration date against system clock. This would be external to the courseware for easy maintenance, and repetitive use. The courseware would run this script on loading.

2. An ASCII text file (.TXT) containing an expiration date value, which we would add just before packaging, as an easy way not to have to modify other components at ship time. We just open the text file, enter a date value, save it, and ship the course.

3. An HTML file that would pop up in the user browser to warn of expiration, if the script finds that current system date is later than XX.

That's as brave as I want to get. Ideally, i would love to have the script do virus-like things, such as delete key component files, after popping the warning, but that seems pretty risky in a SCORM environment. I can't imagine other people haven't developed solutions for this already, but we have not been able to find anything, so this is the solution I am proposing for courseware expiration. Maybe I'm just not looking hard enough.

R

Ryan Bernard

One more note... my main question was whether Articulate has a window or feature that allows us to add Javascript to a course opener, that would run the same way a Javascript can run when an HTML page loads.

Or would we have to create that or modify the Articulate output using other tools.

I am a solution architect, but not an Articulate user myself.

This discussion is closed. You can start a new discussion or contact Articulate Support.