SCORM and Flash: Getting started

 

This is not a complete guide to implementing SCORM - the full specifications for SCORM and guidance material are available at www.adlnet.org. The purpose of this document is to give an overview of what implementing the SCORM runtime entails. It assumes that you are creating learning content using Shockwave Flash, which is the preferred technology for increasing amounts of content. Note that this tutorial introduces you to SCORM 1.2. There are some slight differences in SCORM 1.3 (now called SCORM 2004) which will be covered in a future tutorial; but as most current LMSs will still be supporting SCORM 1.2, that is probably the protocol you should be working with for the time being.

Creating a Flash movie

For the purposes of this tutorial, we shall create a dummy SCO using Macromedia Flash.

Figure 1. There are three key-frames in this timeline, labelled "start", "body" and "finish". The start and finish frames just display text saying "starting" and "finished!", while the body frame contains two buttons, labelled 'Correct' and 'Incorrect' and a dynamic text field - selected in this screenshot - which displays a variable called 'question'.

This SCO will display three questions, with two marks for each question. For each question, giving an incorrect response will lose a mark; giving a correct response first time will score 2/2 for the question; giving a correct response second time round will score 1/2. Giving two incorrect responses will score 0/2 and move the student on to the next question.

This is a simple scoring scheme which will be sufficient for this tutorial; but bear in mind that SCORM will support much richer assessment models if that is what your learning content requires.

Figure 2. Add the ActionScript shown to the first frame which is labelled 'start'. This code creates two variables: question contains the number of the current question (1, 2 or 3) and is displayed in the dynamic text field mentioned above; current_marks contains the number of marks available for the current question. This starts at 2, and is reset to 2 each time the student moves to a new question; but is decremented by 1 each time an incorrect response is given.

The script also contains two functions. The first, mark(), calls the Flash function fscommand. This provides the standard way of passing data out of the Flash movie to the outside world. It takes two parameters: the first, command is set to 'mark' - this is a bit of text chosen by the author to describe what sort of action is occurring; the second, parameters, is used to pass out a list of comma-separated values to tell the outside world, in this case, what marks are being given. This implementation passes three values: the question number, the number of marks scored, and the total marks for the question, which is always 2. So if the student scores 1/2 on the third question, the following call will be made: 'fscommand("mark", "3, 1, 2")'. Having issued the fscommand, the question number is incremented and the number of marks available is reset to 2. Finally, if we have reached the end of the SCO (question is more than 3), the student is sent to the 'finish' frame, else the student is sent back to the 'body' frame.

The second function, assess(isCorrect), is called each time the student presses a button. If the student has pressed the 'Incorrect' button, then the number of marks available for this question is decremented. If the student has clicked the 'Correct' button, or if the number of marks available is now 0, the mark() function is called.

Figure 3. Wire up the two buttons in the body frame. Each button calls the assess(isCorrect) function when pressed; the Correct button calls assess(true) and the 'Incorrect' button calls assess(false).

Remember also to include a stop() command in this frame, so that the first time the movie runs, it stops on this frame to wait for user input.

In the final frame of the movie, add another fscommand call, this time fscommand("finish", ""). This will allow you to get the LMS to close the unit automatically when the animation has terminated.

Figure 4. You are now ready to publish the movie. Publish to Flash and Html, on the HTML page selecting 'Flash with FSCommand' and turning off the Loop checkbox.

See how the dummy SCO behaves here, or download the editable Flash file at the bottom of this (long) page. So far, of course, the SCO is not linked up to any LMS.

The purpose of the SCORM run-time protocol

The purpose of the SCORM run-time is to allow communication between a learning object (referred to in SCORM terminology as a Shareable Content Object) and a Learning Management System. This communication may comprise:

-Assignment parameters
-Student details (name etc.)
-Student preference data
-Bookmarking data
-Performance data.

Assignment parameters (set by the teacher) and student details are passed from the LMS to the SCO; preference and bookmarking data are initially set in the SCO but may be passed to the LMS to enable persistence; while performance data is passed from the SCO to the LMS and is generally not retrieved again. In this tutorial, we will aim only to pass performance data back to the LMS.

SCORM is designed to work in a browser. An alternative and older mechanism (see www.aicc.org) is available for content which does not run in a browser.
An html page containing SCORM content should assume that it will be opened by another html page, called an adapter, which belongs to the LMS. Your content page may be opened as a separate window (figure 5), or in a frame (figure 6) of the adapter page. In each case, the adapter page contains an object called API and the first job of the content page should be to locate the API object.


For this tutorial, there are essentially three things that need to be done by the html page which has generated automatically by Macromedia Flash as tutorial1.htm:

-Locate the API object in an opener or parent window an initialise it.
-Respond to the fscommand calls embedded in the flash animation.
-Close down correctly when the animation finishes, passing final marks and status information back to the LMS.

These three functions need to be performed using JavaScript embedded in the html page which has been generated automatically by Macromedia Flash. To avoid retyping and allow easier upgrades, it will be more convenient to put the main functions in a central JavaScript file, which we will call alms_sco.js. Comments are highlighted in red. If you do not want use SCORM but are not interested in understanding it, then you download the file and use it as-is.

View alms_sco.js file here.

Having created the scorm support file, we only have to make minimum changes to the html. Below is the html which has been generated automatically by Macromedia Flash. Additions are shown in red.

View tutorial1.htm file here.

Packaging your unit

Your SCO now supports SCORM runtime, but this is of little use unless you also support SCORM Content Packaging, which is used to register your content onto the LMS. Download Reload, a simple SCORM content packager, which is available free from www.reload.ac.uk.

Figure 7. Create a new SCORM 1.2 Package

Figure 8. Select the folder where your SCO files are stored.

Figure 9. Drag the .html file from the left-hand pane onto the resources node in the right-hand pane. If you expand the new resources node, you will see that all required files (including the .swf file and .js file) have been added automatically.

Figure 10. There are two kinds of resources in SCORM: Shareable Content Objects (SCOs), which support the SCORM runtime, and 'assets' which do not. Select the new resource node and, at the botton of the screen, set the scormtype field to 'sco'.

Figure 11. Right click the Orangizations node and add a new organization.

Figure 12. Drag the tutorial node under the Resources section onto your new Organization node. This makes the node visible in the LMS.
Save the manifest file. If you have an LMS to play with, you can load the imsmanifest.xml file into the LMS and run your learning content from.

If you have found this tutorial useful or have any questions, suggestions or corrections, please get in touch with me via the Forum. I will be happy to produce further SCORM tutorials - e.g. on supporting bookmarking, working with objectives, or working with SCORM 2004 - if there is a demand.

Download files

To use any of the files in this tutorial, right click on one of these links and choose 'Save target as...'

tutorial1.fla
tutorial1.swf
alms_sco.js
tutorial1.html

Home Alpha Engage: the learning platform for schools