How to use SCORM packages in Godot

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By 94andrade.flavio

Hello everyone.
I am creating an educational game, and would like to know if there is any way to implement SCORM in Godot. I searched in several places and found virtually nothing about it. Thanks.


Were you able to find a solution to this?

Cr8v Dev | 2020-06-03 12:26

:bust_in_silhouette: Reply From: Anubislg

TLDR Solution; You enable SCORM in Godot by wrapping the Godot exported HTML5 files in a SCORM package, with access to a JS API that acts as a SCORM driver to handle the API calls to the LMS. There’s no short and simple solution here yet. Though in theory it should be possible to make a “SCORM Exporter” to handle manifest generation.

Hey all,

A bit late to the party here, sorry. Good news is, implementing SCORM in Godot is fairly easy once you wrap your head around the SCORM packaging requirements! Thanks to Godot’s HTML5 export allowing you to call JavaScript from script, you can make SCORM API calls super easy once you’ve got your export all packaged up.

The bad news is wrapping your head around the SCORM packaging requirements that allow you to both import the package into an LMS and allow Godot to call the SCORM driver API calls it needs to. But that’s what you’ve got me here for!

I was able to quickly whip together a demo Godot SCORM package that sets and gets SCORM Status, Pass/Fail data, and scoring information to an LMS. You can find the Godot example project here, which also includes a copy of an exported SCORM 2004 4th edition Package to poke around in and upload to an LMS.

Keep in mind this is all pretty rough. I just started learning Godot today like…3 hours ago, so it’s ugly and just a proof of concept to prove you can communicate with SCORM directly from Godot and the basics on how to do it. I went looking for a different engine, and this happened (LMS Engineer by trade, game maker by hobby). The SCORM package itself can most likely be streamlined further. I just wanted to slap something together to test Godot’s SCORM capabilities.

Implementing SCORM in Godot - An overview.

  • We can use the SCORM example files, provided by ADL (stewards of SCORM), for our use here. For this example I used the “Basic Run-Time Calls” example. It’s a basic example that’s pretty bare bones, perfect for our needs since that makes it easy to modify!

  • Modifications are done to the SCORM package on the imsmanifest.xml file (controls which files are loaded, and the basic course architecture), and the index.html file normally used to load the course. If you take a look at the sample package I provided you’ll see the modifications made to the exported game HTML file to include various SCORM mechanisms (such as initializing communications with the LMS on load, and the inclusion of the SCORM Functions JS file responsible for SCORM communications to the LMS.

  • Making use of the example SCORM package’s ScormProcessGetValue and ScormProcessSetValue functions we can use Godot’s ability to call Javascript from script, calling these functions as needed to get and set SCORM data within the game. As an example, here’s a signal function that will mark the game as completed.

func _on_btn_setSuccess_pressed():
		ScormProcessSetValue('cmi.completion_status', 'completed');

Okay, great…we can set and get SCORM, but what are all the SCORM commands?
You can find a full list of handy SCORM Runtime commands, along with expected values and input limitations at the SCORM site, under Runtime Reference Chart.

The basic SCORM commands for marking a course as complete, passing a pass/fail value, and a test score are already provided in the example.