Atrixware
Free Demo
1.866.696.8709

SCORM Completion Javascript for E-Learning Software

If you are using SCORM and uploading your Lessons and Activities, the course listing page is not refreshed and updated with the status after a user completes the SCORM activity. Also, if a user closes the browser window before returning to the course, in some circumstances full credit will not be applied. This is due to the way SCORM operates.

However, most E-Learning Authoring software lets you add Javascript code, which is what we will need to do.


Articulate Storyline - the goodbye.html file

In Articulate Storyline, there is a file named goodbye.html, which is designed to be easily modified for situations like this.. This page is rendered when a user finishes a SCORM exercise published with Storyline, so we will want to enter in our custom html and javascript here.

There are two steps for this, since Storyline places limitations on the script that can go into the goodbye.html file (essentially we cannot use { or } brackets, which we need for our Javascript code). So the first step is to create our script file. For this step, simply open up Notepad (or similar plain text editor), add in this code, and save it using the name scorm-helper.txt.

 

try { parent.confirm_close = false; parent.confirmLOClose();} catch(e) { try { parent.parent.confirm_close = false; parent.parent.confirmLOClose(); } catch(e) { try { parent.parent.parent.confirm_close = false; parent.parent.parent.confirmLOClose(); } catch(e) { try { parent.parent.parent.parent.confirm_close = false; parent.parent.parent.parent.confirmLOClose(); } catch(e) { try { window.top.opener.document.location.reload(true); window.top.close(); } catch(e) {}}}}}

 

Once saved, you will need to upload it into Axis LMS. As the admin, go to SYSTEM > FILES > FILE MANAGER, navigate to the _OTHER folder, then upload the text file you just saved. This should put the file into your LMS. Take note of the file path as this is very important. The file path will be ...

https://{your-lms-system-url}/lms/admin/qc_imagerep/_other/scorm-helper.txt

... where {your-lms-system-url} is the url of your system (something like www.xyztraining.com).

Once you have completed this task, you can now move over to the Storyline application, where you will modify the goodbye.html file.

For reference, this article on Articulate's website discusses this file:
https://articulate.com/support/article/Storyline-3-Customizing-or-Suppressing-the-Goodbye-html-Page

In a nutshell, you will need to:
1. Completely close out your Storyline application
2. Navigate to folder where goodbye.html resides using the file browser (location shown in article above)
3. Make a backup of the original (perhaps name the backup goodbye.original.html)
4. Open the goodbye.html file in Notepad (you should be able to right-click > open with > notepad)
5. Remove entire contents of file and then paste in the new contents (see below) and save it, then close it
6. Re-open Storyline, and republish your SCORM (should pick up the new goodbye.html file)

Here is the contents to put into the goodbye.html file. Make sure you replace {your-lms-system-url} with your lms system url as described in step 1. You can modify the rest of this file as you need, but just keep the <script> tag:

<html><body bgcolor="#ffffff"><center><br><br><br><br><font face="Open Sans, articulate, tahoma, arial" size="3" color="#333333">Submitting, please wait ...</font></center></body><script src="https://{your-lms-system-url}/lms/admin/qc_imagerep/_other/scorm-helper.txt"></script></html>

 

If you are using something other than Articulate Storyline, you can use one of the following 2 pieces of generic code. 


Generic Code for the End Screen or End/Exit button

Regardless of if you are using inline or popup delivery of learning items, this code will handle both. It will refresh the course listing page behind the scenes if it's being delivered as a popup window , or, close out the inline frame and refresh the course list if its being delivered inline. The reason the code is so long is it attempts to handle various authoring software as there is no standard where the calling code will be placed in the frames chain of nesting.

Add this code to your EXIT button click event, or, on the final page of your exercise.

 

try { parent.confirm_close = false; parent.confirmLOClose();} catch(e) { try { parent.parent.confirm_close = false; parent.parent.confirmLOClose(); } catch(e) { try { parent.parent.parent.confirm_close = false; parent.parent.parent.confirmLOClose(); } catch(e) { try { parent.parent.parent.parent.confirm_close = false; parent.parent.parent.parent.confirmLOClose(); } catch(e) { try { window.top.opener.document.location.reload(true); } catch(e) {}}}}}

 


Generic Code for the End Screen or End/Exit button (Alternate)
This code is nearly the same as above, but adds an extra task of closing out the popup window (if the SCORM is being delivered in a popup window). The code above leaves the SCORM item open for the user to close out.

Again, add this code to your EXIT button click event, or, on the final page of your exercise.

 

try { parent.confirm_close = false; parent.confirmLOClose();} catch(e) { try { parent.parent.confirm_close = false; parent.parent.confirmLOClose(); } catch(e) { try { parent.parent.parent.confirm_close = false; parent.parent.parent.confirmLOClose(); } catch(e) { try { parent.parent.parent.parent.confirm_close = false; parent.parent.parent.parent.confirmLOClose(); } catch(e) { try { window.top.opener.document.location.reload(true); window.top.close(); } catch(e) {}}}}}

 


The features discussed in this article may or may not be available on your LMS system.
Comments
There are no comments for this article. Be the first to post a comment.
Related Articles RSS Feed
Using the Axis LMS UserConnect Widgets
Viewed 2079 times since Mon, Sep 28, 2015
Adding Media to your Slides in Axis LMS
Viewed 2431 times since Wed, Feb 13, 2013
Immediate Feedback for your LMS Quizzes
Viewed 2000 times since Tue, Oct 13, 2015
Enabling Users to Set Up Learning Site Accounts in Axis LMS
Viewed 2582 times since Fri, Mar 22, 2013
Axis LMS Course Pages
Viewed 2374 times since Tue, Jan 28, 2014
Axis LMS Course Reports and User Reports
Viewed 2411 times since Fri, Apr 5, 2013
Uploading/Using a PDF in Axis LMS
Viewed 2525 times since Fri, Mar 29, 2013
Using Videos that Work on iPad in Axis LMS
Viewed 7388 times since Sun, Mar 31, 2013
Resetting Users in Axis LMS
Viewed 2618 times since Tue, Jan 14, 2014
Axis LMS User Course Tracking Variables
Viewed 2534 times since Tue, Feb 4, 2014