Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions apps/demo/demo/player-page.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
58 changes: 42 additions & 16 deletions apps/demo/demo/scorm.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Convert H5P to SCORM in your browser — h5p-offline-player</title>
<meta name="description" content="Drop .h5p files, check each one, and download them as SCORM 1.2 packages for Moodle, ILIAS, OpenOLAT, Chamilo or SCORM Cloud. Built in your browser with nothing uploaded; the LMS records the score, the result, each answer, the time and the learner's place." />
<meta name="description" content="Drop .h5p files, check each one, and download them as SCORM 1.2 or 2004 packages for Moodle, ILIAS, OpenOLAT, Chamilo or SCORM Cloud. Built in your browser with nothing uploaded; the LMS records the score, the result, each answer, the time and the learner's place." />
<link rel="canonical" href="%SITE_URL%/demo/scorm.html" />
<meta name="theme-color" content="#2f6df6" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="h5p-offline-player by Missing Elements" />
<meta property="og:locale" content="en_US" />
<meta property="og:title" content="Convert H5P to SCORM in your browser — h5p-offline-player" />
<meta property="og:description" content="Drop .h5p files, check each one, and download them as SCORM 1.2 packages for Moodle, ILIAS, OpenOLAT, Chamilo or SCORM Cloud. Built in your browser with nothing uploaded; the LMS records the score, the result, each answer, the time and the learner's place." />
<meta property="og:description" content="Drop .h5p files, check each one, and download them as SCORM 1.2 or 2004 packages for Moodle, ILIAS, OpenOLAT, Chamilo or SCORM Cloud. Built in your browser with nothing uploaded; the LMS records the score, the result, each answer, the time and the learner's place." />
<meta property="og:url" content="%SITE_URL%/demo/scorm.html" />
<meta property="og:image" content="%SITE_URL%/demo/og-image.png" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:image:alt" content="h5p-offline-player: self-hosted H5P, with no H5P server" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="Convert H5P to SCORM in your browser — h5p-offline-player" />
<meta name="twitter:description" content="Drop .h5p files, check each one, and download them as SCORM 1.2 packages for Moodle, ILIAS, OpenOLAT, Chamilo or SCORM Cloud. Built in your browser with nothing uploaded; the LMS records the score, the result, each answer, the time and the learner's place." />
<meta name="twitter:description" content="Drop .h5p files, check each one, and download them as SCORM 1.2 or 2004 packages for Moodle, ILIAS, OpenOLAT, Chamilo or SCORM Cloud. Built in your browser with nothing uploaded; the LMS records the score, the result, each answer, the time and the learner's place." />
<meta name="twitter:image" content="%SITE_URL%/demo/og-image.png" />
<!-- partial: head -->
<script type="module" src="/demo/scorm-page.js"></script>
Expand All @@ -33,7 +33,7 @@
<h1>H5P to SCORM</h1>
<p class="lede">
Drop <code>.h5p</code> 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.
</p>

Expand All @@ -57,8 +57,32 @@ <h2><span class="step-number">2</span> Review</h2>
<ul class="scorm-rows" id="files"></ul>
</section>

<section class="step" data-step="options" hidden>
<h2><span class="step-number">3</span> Options</h2>
<p>
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.
</p>
<div class="scorm-options">
<fieldset>
<legend>SCORM version</legend>
<label><input type="radio" name="scorm-version" value="1.2" checked /> SCORM 1.2 <span class="step-hint">checked in all six LMSs below</span></label>
<label><input type="radio" name="scorm-version" value="2004" /> SCORM 2004 4th Edition <span class="step-hint">checked in Moodle 4.5 and SCORM Cloud</span></label>
</fieldset>
<div class="scorm-option">
<label for="pass-mark">Pass mark, out of 100</label>
<input type="number" id="pass-mark" min="0" max="100" step="any" placeholder="the content's own" aria-describedby="pass-mark-hint" />
<span class="step-hint" id="pass-mark-hint">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.</span>
</div>
<div class="scorm-option">
<label class="scorm-check"><input type="checkbox" id="completion-score" aria-describedby="completion-score-hint" /> Count content that finishes without a score as 100</label>
<span class="step-hint" id="completion-score-hint">For a gradebook that needs a number: a presentation without questions, finished, records 100. Content that never finishes, such as an Accordion, stays incomplete.</span>
</div>
</div>
</section>

<section class="step" data-step="download" hidden>
<h2><span class="step-number">3</span> Download</h2>
<h2><span class="step-number">4</span> Download</h2>
<form class="controls">
<button type="button" class="primary" id="build">Build the SCORM package</button>
</form>
Expand Down Expand Up @@ -87,23 +111,24 @@ <h2>In the LMS</h2>
</p>
<table class="table">
<thead>
<tr><th>Checked in</th><th>Add the zip as</th><th>Change from the defaults</th></tr>
<tr><th>Checked in</th><th>Add the zip as</th><th>Change from the defaults</th><th>SCORM 2004 and the options</th></tr>
</thead>
<tbody>
<tr><td>Moodle 4.5</td><td>a SCORM package activity</td><td>nothing; keep the maximum grade at 100</td></tr>
<tr><td>ILIAS 11</td><td>a SCORM learning module</td><td>turn Learning Progress on</td></tr>
<tr><td>OpenOLAT 21.1</td><td>a "SCORM 1.2" course element</td><td>the pass mark; in a learning path, the completion criterion</td></tr>
<tr><td>Chamilo 3.0</td><td>an imported learning path</td><td>publish the learning path</td></tr>
<tr><td>SCORM Cloud</td><td>a course</td><td>nothing</td></tr>
<tr><td>Frappe LMS</td><td>a SCORM chapter</td><td>nothing; the content needs a pass mark</td></tr>
<tr><td>Moodle 4.5</td><td>a SCORM package activity</td><td>nothing; keep the maximum grade at 100</td><td>checked</td></tr>
<tr><td>ILIAS 11</td><td>a SCORM learning module</td><td>turn Learning Progress on</td><td>not yet</td></tr>
<tr><td>OpenOLAT 21.1</td><td>a "SCORM 1.2" course element</td><td>the pass mark; in a learning path, the completion criterion</td><td>not yet</td></tr>
<tr><td>Chamilo 3.0</td><td>an imported learning path</td><td>publish the learning path</td><td>not yet</td></tr>
<tr><td>SCORM Cloud</td><td>a course</td><td>nothing</td><td>checked</td></tr>
<tr><td>Frappe LMS</td><td>a SCORM chapter</td><td>nothing; the content needs a pass mark</td><td>not yet</td></tr>
</tbody>
</table>
<p>
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.
</p>

<h2>What goes in the zip</h2>
Expand All @@ -123,7 +148,8 @@ <h2>From the command line</h2>
written by <code>h5p-embed</code> for a player domain of your own carries this page too, at
<code>/scorm.html</code>.
</p>
<pre class="code" data-lang="sh">npx @missing-elements/h5p-embed@latest --scorm course.h5p # writes ./course.scorm.zip</pre>
<pre class="code" data-lang="sh">npx @missing-elements/h5p-embed@latest --scorm course.h5p # writes ./course.scorm.zip
npx @missing-elements/h5p-embed@latest --scorm course.h5p --scorm-version 2004 --pass-mark 80 --completion-score</pre>

<footer>
<nav class="footer-links" aria-label="More on this site">
Expand Down
76 changes: 71 additions & 5 deletions design/scorm.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# The SCORM package

`npx @missing-elements/h5p-embed --scorm course.h5p` writes `course.scorm.zip`, SCORM 1.2. It holds
`npx @missing-elements/h5p-embed --scorm course.h5p` writes `course.scorm.zip`, SCORM 1.2 unless
`--scorm-version 2004` asks for 2004 4th Edition (#138, below). It holds
the package as `package.h5p`, the player's three files, the runtime as `frame-assets/`, `embed.css`
and the launch page with its bridge, for a package that does not carry its libraries the library
pack's parts it needs in `libraries/`, and `imsmanifest.xml` lists every file. Built on 2026-10-28
Expand Down Expand Up @@ -292,8 +293,9 @@ one row each; an LMS added here gets a row there.
`pnpm build`; CI now builds the demo straight after the install, as Vercel does. Aliased to the
player's source instead, as the element is, the plan shared its modules with the element, and
the build split them into a chunk `h5p-player.js` imports, a file the page's zip carries alone.
Decided with the owner that day: SCORM 1.2 only, H5P's result rule kept,
the tested LMSs the supported ones. Canvas, the audience's LMS, runs its SCORM on Rustici's
Decided with the owner that day, and amended on 2026-11-05 by #137 and #138, which made 2004, a
pass mark and completion as 100 options and kept the defaults: SCORM 1.2 only, H5P's result
rule kept, the tested LMSs the supported ones. Canvas, the audience's LMS, runs its SCORM on Rustici's
SCORM Cloud by all accounts and cannot be tested here, since Canvas Free-for-Teacher has no SCORM
upload.
- **The page works in steps, and the title is the teacher's** (#137, 2026-11-05). The University
Expand Down Expand Up @@ -329,7 +331,64 @@ one row each; an LMS added here gets a row there.
contents list, a SCORM Cloud link, an export of the settings, switches for playing offline and
for resume, since every zip here carries all it plays and always resumes, and an accessibility
check, which would need knowledge of each content type. The SCORM version and the grading
options are #138's.
options are #138's, below.
- **SCORM 2004, a pass mark and completion as 100, each an option** (#138, 2026-11-05). The
owner's call, after the same converter offered all three: options, page-wide on the page and a
flag each on the command (`--scorm-version 2004`, `--pass-mark`, `--completion-score`), the
defaults as they were, and each offered for the LMSs it was checked in. A zip written with none
is the one written before them: its manifest, its launch page and its notice are byte for byte
what main wrote, and only the bridge is new code, which plays a page that names no option as it
did. The bridge learns the options from the launch page: a `<meta>` after the build's for each
one set (`h5p-scorm-version`, `h5p-scorm-pass-mark`, `h5p-scorm-completion-score`), none
otherwise. A template that has no place for them (`%SCORM%`), as a page that bundled 1.5's
launch files has, is refused with an option set, since its bridge would play a 2004 zip as 1.2.
`scormOptions` checks them once for both writers: 1.2 or 2004, a mark from 0 to 100 kept to the
hundredth.
- **SCORM 2004 4th Edition.** The manifest in the 2004 namespaces (`imscp_v1p1`, `adlcp_v1p3`,
`imsss`), `schemaversion` `2004 4th Edition`, `adlcp:scormType`. The bridge finds
`API_1484_11` where it finds 1.2's `API`, and speaks the same steps through one set of calls:
`cmi.completion_status` and `cmi.success_status` apart, a result that says nothing of a pass
leaving success `unknown`; `cmi.score.scaled` beside `raw`, `min` and `max`; the session time
and each answer's latency as ISO 8601 durations to the hundredth; each answer with its
words in `description` (250 characters, as text, the character references a question writes
read: `&rsquo;` came through as itself in Moodle until then), an id that is a URI as 2004 asks,
`urn:uuid:` and the part's id, `learner_response`, `incorrect` where 1.2 says `wrong`,
`timestamp` in UTC, and `long-fill-in` and `other` kept as themselves; `suspend_data` up to
64,000 characters, compressed as in 1.2. **A 2004 session always ends `suspend`**, finished
or not, where 1.2 ends a finished one with nothing. Measured in Moodle 4.5 with `normal`
after a finish: the next launch got an empty data model within the same attempt (`entry`
`ab-initio`, completion `unknown`, no state), so the `incomplete` the bridge writes at
launch replaced the `completed` Moodle kept, and the content started over. Suspended, the
relaunch resumed: completed and passed kept, the content back on its result, and a retry
counted, as on an H5P site.
- **A pass mark.** In 1.2 the item's `adlcp:masteryscore`; in 2004 its primary objective
(`objectiveID="primary"`, `satisfiedByMeasure`, `minNormalizedMeasure` the mark over 100 to
the ten-thousandth), from which the LMS sets `cmi.scaled_passing_score`. The bridge reads the
LMS's mark at launch, `cmi.student_data.mastery_score` or `cmi.scaled_passing_score`, which an
administrator may change, else the page's, for an LMS that reads none from the manifest, and
holds the score as written to it, so 66.67 passes a mark of 66.67 as the LMS judges it. A
result with no score gets no verdict from the mark, and keeps the content's own. A zip
written without a mark reads none, so an LMS's own mastery score never changes a default
zip's status.
- **Completion as 100.** A result with no score, neither `scaled` nor `raw` over a `max` above
0, as content without questions finishes, is reported as 100 (`scaled` 1) beside completed,
and passes a mark. H5P invents no score, so this is off unless asked; content that never
finishes, an Accordion or a Virtual Tour, stays incomplete.
- **Checked on 2026-11-05.** In Moodle 4.5.15 (Docker, `notes/scorm-spike`, the 2004 runs by
`drive-options.mjs`): Moodle took the 2004 zips as `SCORM_1.3`, kept the objective (0.8,
satisfied by measure) and the 1.2 mastery score (80). The quiz over two sessions resumed on
its second question, finished completed and passed at 66.67 (scaled 0.6667), the gradebook
66.67, the total time the two sessions' sum, the four answers with their ids and words; a
launch after the finish resumed with the result kept. With a mark of 80, the same 66.67
failed in 2004 and in 1.2, the gradebook still 66.67; with completion as 100, a finish with
no score recorded 100 and passed in both, the gradebook 100. In SCORM Cloud, through its v2
API: both 2004 zips imported as `SCORM20044THEDITION` with no parser warnings; the same two
sessions resumed on the second question, the registration completed and passed at 66.67, and
a launch after the finish kept it; a mark of 80 failed at 66.67 with completion still
completed, where 1.2 shows a failed attempt as incomplete; a finish with no score, completed,
passed and 100; and 1.2 with a mark of 80 failed at 66.67, the registration incomplete as for
any failed 1.2 attempt there. The finishes with no score were the element's `finished`
dispatched in the SCO's frame, as the tests do, since no package here finishes without one.

`scorm-page.test.ts` drives the written site's page in Chromium: a chosen file read into its row
and built on Build, the download, which is the command's zip and plays unpacked; three files at
Expand Down Expand Up @@ -360,12 +419,19 @@ frames the launch page, as Moodle's player does. It covers:
dispatched as it dispatches them, since no package here reaches either headless;
- the formulas export played from the zip's parts: the parts the element fetched are compared
with those the writer planned, and the test waits for the LaTeX to be typeset;
- the options (#138): none written unless asked; a pass mark as 1.2's mastery score and as 2004's
objective; an option refused, by the function and by the command; a mark that fails the
content's pass, and an LMS's own mark that wins over the zip's; completion as 100, passing a
mark; and, under a page that holds `API_1484_11`, the quiz played to the end in 2004 with its
answers, the session suspended and resumed with the result kept, a state past 4,096
characters kept, and a score held to the LMS's passing score;
- playing with no LMS.

Not covered:

- any LMS but Moodle 4.5, Frappe LMS, SCORM Cloud, ILIAS 11, OpenOLAT 21.1 and Chamilo 3.0, and
SCORM 2004;
SCORM 2004 and the grading options in any but Moodle 4.5 and SCORM Cloud;
- content that finishes without a score, in an LMS: the finish was dispatched;
- SCORM Cloud's launch in a frame of its player page, where it launched in its pop-up;
- Firefox and Safari;
- Moodle with `slasharguments` off, its popup window and its mobile app;
Expand Down
Loading
Loading