Repository navigation
embed 1.2.0
@missing-elements/h5p-embed 1.2.0. Nothing else changes: the player stays at 1.1.1, the runtime and the libraries at 1.0.0.
A SCORM 1.2 package of one .h5p, for an LMS
npx @missing-elements/h5p-embed@latest --scorm course.h5p # writes ./course.scorm.zip--scorm writes one package as a SCORM 1.2 zip instead of a site: the package, the player and the H5P runtime, and a launch page that reports to the LMS. Add it to a course as a SCORM activity, in Moodle or another LMS that takes SCORM 1.2, and the LMS records:
- the score out of 100, and
passedorfailedwhen the content says whether it was passed,completedwhen it does not. The content's last result counts, as on an H5P site; - the time spent in each session;
- the learner's place, in
cmi.suspend_data, which the next launch continues from. SCORM 1.2 keeps 4,096 characters, enough for a quiz; a larger state is not saved.
The LMS keeps the results, so no server of yours is involved.
- Exports from h5p.com and h5p.org work. They leave the libraries out, so the zip carries the ones the package needs from the library pack, and only those: 11 libraries and 4 MB for a quiz with formulas. A package that carries its libraries plays with its own.
- A missing library is caught when the zip is written, not when a learner opens it. A package that needs a library neither it nor the pack has, or a newer version than the pack's, is refused, with what is missing named.
- Moodle records the score as the grade, out of the activity's maximum grade, so leave that at 100, its default.
- The LMS has to be served over https, since the player needs its Service Worker, and Moodle has to serve files by path (
slasharguments), which it does by default. - Content that reports no result of its own, an Accordion or a Virtual Tour, stays
incomplete: complete such an activity on viewing it instead. - Replacing the zip with one written from another
.h5p, or with other libraries from the pack, starts learners over, since their saved state belongs to what it was saved in. - The package plays trusted: its own code runs on the LMS's origin, as every SCORM package's does.
Checked in Moodle 4.5: the score reaches the gradebook, and a learner who leaves halfway continues there on the next launch. Other LMSs have not been tried yet.
A second argument names the zip, and --force replaces one already there. The site's own options, such as --packages, are refused with --scorm rather than ignored. For a script, buildScorm({ h5p, out, force }) from @missing-elements/h5p-embed/scorm writes the same zip and returns what it wrote, typed: its path, size and title, the player's version, the libraries taken from the pack, and the build a learner's saved state is kept against.
Also in 1.2.0: the NOTICE.txt a site is written with said both workers carry zip.js. Only the Service Worker, h5p-sw.js, does, and the notice now says so.
Upgrading
- A SCORM package:
npx @missing-elements/h5p-embed@latest --scorm course.h5pruns 1.2.0. It needs Node 22 or later. - An embed site: only its notice changes. Write it again with
npx @missing-elements/h5p-embed@latest <folder> --forcewhen you next deploy.
Full Changelog: verify-v1.2.0...embed-v1.2.0