Articles on: Export, Monetization
This article is also available in:

📦 Create your SCORM export for your LMS

Making a Celestory Export Compatible with SCORM

To make a Celestory export compatible with the SCORM format, you just need to follow a few steps using Javascript blocks that add the SCORM API to the global environment of your project.
The SCORM format defines:

  • Whether the module is VALID: True or False (unknown or completed)
  • The minimum percentage score required to validate the module
  • The percentage score achieved by the user
    The SCORM format:
  • Is an exported format that is hosted by an LMS-type tool. Therefore, you must recreate it each time you update your project.
  • Does not provide granular tracking of the learner. For that, you should always use Celestory analytics. Make sure that your SCORM host allows the sending of statistics.
  • Does not take into account variables (boolean, numeric, text...) which are a powerful tool for creating simulations. You must always use Voltask to retrieve them (local installation possible).
    You can use the sample graph here: https://creator.celestory.io/project/RJ38Dg_qg
    Only blocks starting with SCORM should be added wherever you want in your graph.


1. Add Javascript Blocks to Trigger SCORM Tracking

Start by copy-pasting the contents of each Javascript block you create:
SCORM API

js
CopierModifierfunction SCORM_ScanParentsForApi(win)
{
/*
Establish an outrageously high maximum number of
parent windows that we are will to search as a
safe guard against an infinite loop. This is
probably not strictly necessary, but different
browsers can do funny things with undefined objects.
*/
var MAX_PARENTS_TO_SEARCH = 500;
var nParentsSearched = 0;

/*
Search each parent window until we either:
-find the API,
-encounter a window with no parent (parent is null
or the same as the current window)
-or, have reached our maximum nesting threshold
*/
while ( (win.API == null || win.API === undefined) &&
(win.parent != null) && (win.parent != win) &&
(nParentsSearched <= MAX_PARENTS_TO_SEARCH)
)
{

nParentsSearched++;
win = win.parent;
}

/*
If the API doesn't exist in the window we stopped looping on,
then this will return null.
*/
return win.API;
}

function SCORM_GetAPI()
{
var API = null;

//Search all the parents of the current window if there are any
if ((window.parent != null) && (window.parent != window))
{
API = SCORM_ScanParentsForApi(window.parent);
}

/*
If we didn't find the API in this window's chain of parents,
then search all the parents of the opener window if there is one
*/
if ((API == null) && (window.top.opener != null))
{
API = SCORM_ScanParentsForApi(window.top.opener);
}

return API;
}

window.API = SCORM_GetAPI()

SCORM: Initialize Session + Step 0

js
CopierModifierconst step = 0

//const candidate = celestoryPoints._get("candidate", "")

//const startTime = celestoryPoints._get("date", 0) //YYYY-MM-DDThh:mm:ss.mmmmZ
//const spentTime = new Date() - new Date(start) // float in days ? seconds ?

API.LMSInitialize("")

API.LMSSetValue("cmi.core.lesson_status", "incomplete");
API.LMSSetValue("cmi.core.score.raw", step); // Saves the user's score
API.LMSCommit(""); // Saves the data

SCORM: Step 1

js
CopierModifierconst step = 70

console.log("raw score to "+step);
API.LMSSetValue("cmi.core.score.raw", step); // Saves the user's score
API.LMSCommit(""); // Saves the data

Note: You can add as many steps as you like by duplicating the "SCORM: Step 1" block and specifying the percentage reached.
The default is 70%, but you can add intermediate steps (e.g., 10%, 20%, 50%).


SCORM: Step 2 + Complete

js
CopierModifierconst step = 100

console.log("raw score to "+step);
API.LMSSetValue("cmi.core.score.raw", step);

console.log("complete course");
API.LMSSetValue("cmi.core.lesson_status", "completed");

API.LMSCommit(""); // Saves the data

SCORM: Finish Session

js
CopierModifierconsole.log("Course finished, window closed");
API.LMSFinish(""); // Ends the SCORM session


2. Export your project in Web or PWA format


3. Unzip the downloaded ZIP file (e.g., SCORM_1.zip)


4. Create a folder in the unzipped directory titled nameofthescormmodule (e.g., module1), and move all content inside


Example scorm folder


5. Download this XML file imsmanifest.xml and add it to your parent folder.



6. Compress your parent SCORM_1 folder into a ZIP file

Here is an example ZIP file:



7. Your SCORM file is now ready!

You can test it on a site like: https://app.cloud.scorm.com/sc/user/Home



Test of the scorm zip format


Upload the zip created


When zip is uploaded, click on Launch


When launching the SCORM test, a new tab appears. Complete the module there so it can close automatically.


The SCORM tracking works: completion and percentage are successfully recorded.


Updated on: 02/07/2025

Was this article helpful?

Share your feedback

Cancel

Thank you!