By Julian Davis, Digital Learning Solutions
An original version of this article was first published at digitallearningsolutions.com.au
If you’re reading this, then chances are you already know how little learning data is captured when using SCORM.
So how can capture xAPI data in an LMS that only supports SCORM?
I originally came across an article by Melissa Melloway that led me down the path to implementing this solution.
So, let’s get started!
We’ll create a simple Storyline file that simply navigates from page to page and open a link or two.
And add the following code:
xAPIstatements to the LRS. Don’t forget to include the semicolon at the end, it won’t work without it!
Let’s break down the code that we’re going to be using:
The list that is in the xapi_adl.js and include the following verbs:
When adding the verb in the statement, make sure you wrap it in single quotes.
So, to add the first part:
shortdesc : This is the short description of what the experience is. Make sure you wrap it in single quotes. For example, ‘YouTube Video’.
So now we would have:
longdesc : This will provide more details on experience. If we look a tour example, this may include a URL to the video and a description of what the video is and make sure you wrap it in single quotes. For example, “ExperienceAPI (aka Tin Can API Demystified)”:
So, our final code that we’ll add will look like:
You can add as many of these as you want to either one trigger or multiple triggers. If adding to one trigger, simply add another
xapistatement function code after the semicolon.
Something to keep in mind: Triggers are fired in a sequential order, so be aware of the order of the triggers. For example, you don’t want to put an exit verb before a complete verb, when the actions are actually the other way around.
We need to add 2 files to the story_content folder. These are the xapi_adl.js and the xapi_scorm.js files (there’s a link at the end to all the files).
In the story_content folder, modify xapi_scorm.js to point to your LRS. You will also need to add the authentication key (or “authkey”) from your LRS. Depending on your LRS, the authkey may be setup as a single string or as a base64(username:password). If you’re going to need this, your authkey may look like: “Basic ” + toBase64(‘username:password’); Check with your LRS as to which one to use.
In the SCORM root folder, modify the following files:
AFTER the line of code
<script src=”lms/API.js”charset=”utf-8″></script> add the following lines in this order:
Now we need to modify the imsmanifest.xml. This is the file that SCORM uses and sets the the files that will be used as part of the SCORM package. We need to include the 2 files we added to the story_content folder.
Open and locate the line where the code is
<file href=”story_content/story.js” />
Directly after this line, insert the following lines of code:
Save all the files.
Next, we need to zip up the folder where all the SCORM files are. Go to the root folder of the published SCORM files, highlight all the files, right-click and compress.
Upload this file to your LMS in the normal manner you would any SCORM package. Run through the SCORM course as a student. If all is correct,your xAPI statements should be being sent to the LRS.
Below are the results as seen in the browser console, LRS and SCORM report.