Repository navigation
An H5P-to-SCORM page in the browser: drop a .h5p, download the SCORM 1.2 zip (#122) - #123
Merged
Merged
Conversation
…corm (#122) The people who need a SCORM package do not run npx, and their route, H5P through Lumi, has had Lumi's export broken since April. A page on every written site, and on the demo at /demo/scorm.html, now builds the zip the command writes from a picked or dropped .h5p, in the browser, with nothing uploaded. lib/scorm.mjs is split as #108 split h5p-author's build: scorm-core.mjs reads the package, plans its parts, lays out the entries and writes them, and imports no Node; scorm.mjs is the Node side, unchanged for callers; scorm-browser.mjs, ./scorm/browser, builds in a page from the site's own copies, each part checked against the index's SHA-256, and returns a Blob. scripts/build.mjs bundles the page's script with zip.js and the player's ./plan for the written site, which has no bundler. The demo runs the same script in the site's own design. scorm-browser.test.ts holds the page's zip to the command's entry for entry, in Node; scorm-page.test.ts drives the page in Chromium. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #122.
h5p-embed --scormwrites a SCORM 1.2 zip that six LMSs play and grade, and the people who need one — designers and teachers with Canvas, Moodle or Blackboard — do not runnpx. Their route, H5P → Lumi → SCORM, has had Lumi's export broken since April, and no converter ran in the browser. This adds a page that does: a.h5pchosen or dropped becomes the same zip, built in the browser from the site's own copies of the player, the runtime and the library pack, with nothing uploaded.What changed
lib/scorm.mjsis split as h5p-author: an entry that runs in a browser #108 split h5p-author's build.lib/scorm-core.mjsreads the package, plans its parts with the player's./plan, lays out the entries and writes them into a zip.js writer, and imports no Node.lib/scorm.mjsis the Node side, the files from the installed packages and the zip to a path;buildScorm()is unchanged for callers.lib/scorm-browser.mjs, exported as./scorm/browser, is the page's:buildScormInPage({ file, base, pack | packBase, assets, version, packVersion, onProgress })fetches the player's files, the runtime (its file list fromMANIFEST.json, since a folder on a server cannot be listed) and the parts the plan names, checks each part against the index's SHA-256, and returns the zip as aBlob.lib/shared.mjsholdsEmbedErrorand the player's file names for the modules that import no Node;build.mjsre-exports the error.site/scorm.html, withsite/scorm-page.js(startScormPage(), exported as./scorm-page.js),scorm-main.jsandscorm-page.css. A written site has no bundler, soscripts/build.mjsbundles the script with zip.js and the player's./planintodist/scorm-page.js(zip.js's licence in its header);buildSitecopies it, the launch page's template asscorm-launch.htmland the bridge asscorm.js, writesscorm.htmlwith the policy, and puts the player's and the pack's versions intoconfig.jsfor the zip's notice. The page says which LMSs the zip is checked in and what each needs./demo/scorm.html, in the site's own design, running the package's script with the demo's copies: the pack's parts as Vite emits them, the launch page, the bridge,embed.cssandlibraries.txtas?rawstrings, the player's version from adefine, and the player's built files from the site root, which a dev middleware serves from the player'sdist/.tests/scorm-browser.test.tsruns the builder in Node, which hasfetch,Fileandcrypto.subtle, against a written site, and holds its zip to the command's entry for entry — names, stored or deflated, bytes — for the quiz and for the export without its libraries; the pack given as its export; the refusals, in the command's words; a part served with the wrong bytes; a site without the pack; a file the site lacks.tests/scorm-page.test.tsdrives the page in Chromium: a chosen file, the download, which is the command's zip and plays unpacked, a refusal, and the next file after it.scorm.test.ts's quiz helpers moved totests/helpers/for the three to share.docs/compatibility.md.Decided (2026-11-03)
SCORM 1.2 only; H5P's own result rule holds, so content that reports no result stays incomplete; the supported LMSs are the ones tested. Canvas, the audience's LMS, runs its SCORM on Rustici's SCORM Cloud by all accounts and cannot be tested here: Canvas Free-for-Teacher has no SCORM upload.
Checked
pnpm preview:demo), in Chromium: the quiz and the formulas export each built, downloaded and compared with the command's zip, entry for entry; a refusal shown; no console error or policy violation but/_vercel/insights/script.js, which the preview does not serve.Release
Embed gets a minor (1.4.0): two new entries and a new page in every written site. Nothing else changes version. The demo deploys with
main.🤖 Generated with Claude Code