From 800222ef0a507fe23375d75d9932ad0c48441478 Mon Sep 17 00:00:00 2001
From: Aleksandr Shevchuk
Date: Thu, 5 Nov 2026 21:21:22 +0200
Subject: [PATCH] feat(scorm): SCORM 2004, a pass mark and completion as 100,
as options
A zip written with none of them is the SCORM 1.2 zip written before: its manifest, launch page and
notice are unchanged, and only the bridge is new code, which plays such a page as it did.
- SCORM 2004 4th Edition (--scorm-version 2004): its manifest, API_1484_11, completion and
success apart, the scaled score, each answer with its words as the description and a urn:uuid
id, ISO 8601 times, 64,000 characters of saved state. A 2004 session always ends suspended:
ended normal after a finish, Moodle 4.5 handed the next launch an empty data model within the
same attempt, and the completion it kept was written over.
- A pass mark (--pass-mark): 1.2's mastery score or 2004's objective measure; the bridge holds the
score to the LMS's mark, else the zip's, in place of the content's own pass.
- Completion as 100 (--completion-score): content that finishes without a score records 100.
The page gets an Options step for all three, page-wide. Checked in Moodle 4.5 and SCORM Cloud.
---
apps/demo/demo/player-page.css | 32 +++
apps/demo/demo/scorm.html | 58 +++--
design/scorm.md | 76 +++++-
docs/compatibility.md | 5 +-
packages/embed/README.md | 73 ++++--
packages/embed/bin/h5p-embed.mjs | 34 ++-
packages/embed/lib/scorm-browser.mjs | 26 +-
packages/embed/lib/scorm-core.mjs | 115 +++++++-
packages/embed/lib/scorm.mjs | 23 +-
packages/embed/scorm/index.html | 2 +-
packages/embed/scorm/scorm.js | 243 +++++++++++++----
packages/embed/site/scorm-page.css | 46 ++++
packages/embed/site/scorm-page.js | 57 +++-
packages/embed/site/scorm.html | 45 +++-
packages/embed/tests/package-types.ts | 9 +-
packages/embed/tests/scorm-browser.test.ts | 23 ++
packages/embed/tests/scorm-page.test.ts | 41 +++
packages/embed/tests/scorm.test.ts | 289 ++++++++++++++++++++-
18 files changed, 1031 insertions(+), 166 deletions(-)
diff --git a/apps/demo/demo/player-page.css b/apps/demo/demo/player-page.css
index 2b326855..fb9e3e44 100644
--- a/apps/demo/demo/player-page.css
+++ b/apps/demo/demo/player-page.css
@@ -705,6 +705,38 @@ button.scorm-row-remove { min-height: 2rem; margin-left: auto; padding: 0.2rem 0
.scorm-row-download { display: inline-block; margin-top: 0.6rem; font-weight: 600; }
.scorm-row-download[hidden] { display: none; }
+/* The options, one card: the version as two radios, the pass mark, and completion as 100, each
+ with a line of what it does. */
+.scorm-options {
+ display: grid;
+ gap: 1rem;
+ padding: 0.95rem 1rem;
+ border: 1px solid var(--line);
+ border-radius: var(--radius);
+ background: var(--surface);
+}
+.scorm-options fieldset { margin: 0; padding: 0; border: 0; }
+.scorm-options legend { margin-bottom: 0.35rem; padding: 0; font-weight: 600; }
+.scorm-options fieldset label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.5rem; margin: 0.3rem 0; }
+.scorm-options input[type="radio"], .scorm-options input[type="checkbox"] { accent-color: var(--accent); }
+.scorm-option { display: grid; gap: 0.35rem; justify-items: start; }
+.scorm-option label[for="pass-mark"], .scorm-check { font-weight: 600; }
+.scorm-check { display: flex; align-items: baseline; gap: 0.5rem; }
+#pass-mark {
+ width: 10rem;
+ min-height: 2.5rem;
+ padding: 0.4rem 0.75rem;
+ border: 1px solid var(--line-strong);
+ border-radius: var(--radius-sm);
+ background: var(--bg);
+ color: inherit;
+ font: inherit;
+ transition: border-color var(--ease), box-shadow var(--ease);
+}
+#pass-mark:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
+#pass-mark[aria-invalid="true"] { border-color: var(--danger); }
+.scorm-options .step-hint { font-size: 0.875rem; }
+
/* ---------------------------------------------------------------- the player's box */
h5p-player {
diff --git a/apps/demo/demo/scorm.html b/apps/demo/demo/scorm.html
index 60e1389a..2edfd784 100644
--- a/apps/demo/demo/scorm.html
+++ b/apps/demo/demo/scorm.html
@@ -4,14 +4,14 @@
Convert H5P to SCORM in your browser — h5p-offline-player
-
+
-
+
@@ -19,7 +19,7 @@
-
+
@@ -33,7 +33,7 @@
H5P to SCORM
Drop .h5p files here, or choose them, check what each zip will hold, and
- download them as SCORM 1.2 packages for your LMS. They are built in your browser with the
+ download them as SCORM packages for your LMS. They are built in your browser with the
player this site serves, and nothing is uploaded: the packages never leave your computer.
@@ -57,8 +57,32 @@
2 Review
+
+
3 Options
+
+ For every zip. Left as they are, a zip is SCORM 1.2 and takes the content's own result, as
+ this page has always written it.
+
+
+
+
+
+
+ A score at or above it passes, whatever the content says, and the LMS gets it as the mastery score. Content with no score gets no pass or fail from it.
+
+
+
+ For a gradebook that needs a number: a presentation without questions, finished, records 100. Content that never finishes, such as an Accordion, stays incomplete.
+
+
+
+
-
3 Download
+
4 Download
@@ -87,23 +111,24 @@
In the LMS
-
Checked in
Add the zip as
Change from the defaults
+
Checked in
Add the zip as
Change from the defaults
SCORM 2004 and the options
-
Moodle 4.5
a SCORM package activity
nothing; keep the maximum grade at 100
-
ILIAS 11
a SCORM learning module
turn Learning Progress on
-
OpenOLAT 21.1
a "SCORM 1.2" course element
the pass mark; in a learning path, the completion criterion
-
Chamilo 3.0
an imported learning path
publish the learning path
-
SCORM Cloud
a course
nothing
-
Frappe LMS
a SCORM chapter
nothing; the content needs a pass mark
+
Moodle 4.5
a SCORM package activity
nothing; keep the maximum grade at 100
checked
+
ILIAS 11
a SCORM learning module
turn Learning Progress on
not yet
+
OpenOLAT 21.1
a "SCORM 1.2" course element
the pass mark; in a learning path, the completion criterion
not yet
+
Chamilo 3.0
an imported learning path
publish the learning path
not yet
+
SCORM Cloud
a course
nothing
checked
+
Frappe LMS
a SCORM chapter
nothing; the content needs a pass mark
not yet
Another LMS that takes SCORM 1.2 may work as well; these are the ones checked, as a learner
in Chrome. The LMS has to be served over https, since the player needs its Service Worker.
- SCORM 1.2 keeps 4,096 characters of saved state; the zip writes it compressed, so a quiz
- takes about 200 and a twelve-chapter Interactive Book about 1,000. One that does not fit is
- not saved, and the learner is told under the content.
+ SCORM 1.2 keeps 4,096 characters of saved state, and 2004 64,000; the zip writes it
+ compressed, so a quiz takes about 200 and a twelve-chapter Interactive Book about 1,000.
+ One that does not fit is not saved, and the learner is told under the content. SCORM 2004
+ and the grading options are checked in Moodle and SCORM Cloud so far.
What goes in the zip
@@ -123,7 +148,8 @@
From the command line
written by h5p-embed for a player domain of your own carries this page too, at
/scorm.html.
-