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.

Hi.

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():
	JavaScript.eval("""
		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.

This is great! I work with developing digital learning, and I’m really excited about using Godot for this.

Anubislg gave a good starting point for figuring out how to do it, but it took me a while to understand all the different parts that needed to work together. Understanding the SCORM packaging requirements was particularly challenging, especially since I’m not a developer or engineer. I couldn’t get the example project in this post to work correctly either, but I imagine maybe things have changed since it was posted.

I managed to get my own project to work using Godot 3.5 by making some changes to the files mentioned in this post, mainly linking the ScormProcess.js functions with the main HTML file output from Godot - as in the example. I’ve been able to connect with an LMS and mark the course/project as passed. However, I’m still working on getting the score and completion to function correctly.

I discovered that someone named EsdrasCaleb created a plugin for Godot 4.2 as well. This is really interesting and would probably simplify the project export process, if I understand how to use it. However, as of now, Godot 4.2 doesn’t support creating a HTML output that is playable in most(any?) browsers.

I know this is an older topic, but has anyone else experimented more with this and had success?

1 Like

Hi! I’m also trying to figure out how to use this plugin (Godot Asset Library). Does somebody know? I tried to reach him on YouTube, no answer so far.
After 4.3 release we actually can run games in browsers. Just need to figure out how to package games as a scorm object.
Please let me know if you figured it out!