Skip to content

arahenda/scorm-godot-plugin

Repository files navigation

Godot SCORM Plugin

Offers a channel for communication with the SCORM API and packages the Web exported files into a ZIP archive. The communication can be made with the functions or the signals of the Scorm autoload node. ScormExport do the post-export zip packaging.

Follows the SCORM 1.2 specification.

Installation

  • Install the Scorm plugin.
  • Activate the Scorm plugin (Project > Plugins > Scorm).
  • Export your project for Web.
  • The plugin will detect the export process and do his thing.

Note

Expected to work from Godot v4.2 onwards.

Usage

ScormExport has some configurable options:

  • auto_zip: If the plugin should generate a .zip of the built files or not.
  • default_zip_filename: The name given to the .zip file.

Note

Take note that changing ScormExport's exported values will require you to restart the engine for the changes to take effect.

This plugin takes care of the SCORM's init and finish process, abstracting its quirks for you. The developer should:

  • Set a score for the current learner's attempt.
  • In case the student has reached the end of the exercise, call set_lesson_status(LessonStatus.COMPLETED) to signalize it for the SCORM runtime. In case the lesson should be considered a test, set_lesson_status(LessonStatus.PASSED) can be used in case the learner surpassed the threshold for approval. Otherwise, set_lesson_status(LessonStatus.FAILED) should be called.
  • At the first lesson attempt start, cmi.core.lesson_status has the value not attempted (defined by the LMS), the plugin sets it to incomplete as soon as possible (as suggested by the SCORM reference, see doStart(), doUnload() at scorm.js). This way, the current attempt progression is retained by the LMS if the user closes the browser or exits the SCORM lesson abruptly.

Scorm Data Model

cmi.core.score.raw - score (float RW Persistent*)

Represents the student score in the current SCO attempt.

cmi.core.lesson_status - current attempt status (String RW - “passed”, “completed”, “failed”,“incomplete”, “browsed”, “not attempted”)

'completed' the attempt, and if he 'passed' or 'failed'.

cmi.core.session_time - Current attempt running time (CustomTimeType WO)

Managed at the Javascript routines (scorm.js).

cmi.core.lesson_location (String(255 chars) RW Persistent*)

The learner’s current location in the SCO. A free text field for the SCO to record a bookmark.

cmi.suspend_data (String(4096 chars) RW Persistent*)

Provides space to store and retrieve data between learner sessions.

Note

Attributes marked as Persistent above retain its values between runs in the same attempt (in case the learner chose to continue a previous run).

More info:

Ideas of Improvements

  • Migrate possible functionalities from scorm.js to scorm.gd for better DX and security.
  • Add some Save system to leverage SCORM persistent capabilities and offer it in a standardized way for developers.

Contributing

To extend the functionality you probably will:

  • Adjust the enums/consts (Attributes, ATTRIBUTES_TXT, ...);
  • Create a TXT2<enum>, adjust the _init(), adjust _value_ext2type();
  • Adjust DME._set_safe();
  • Create new API functions if necessary.