Repository navigation
SCORM page in steps: review each package, title it, build several at once - #139
Merged
Merged
Conversation
…build several at once planScormInPage reads a package and plans its zip, and the plan's write writes it, so a page can show what each zip will hold before anything is built. buildScorm, buildScormInPage and the command's new --title take the title the LMS lists the zip by. The page works in three steps where it holds #files and #build: a row per file with its main library, size, what it takes from the pack or why it is refused, and its title; Build writes the rows one after another; #download is the zip, or one zip holding them all, stored. A page with only the elements of 1.5 builds the first file at once, as before.
This was referenced Nov 5, 2026
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 #137.
What changes
The builder works in two steps (
./scorm/browser)planScormInPage(options)reads the package, plans its parts, and returns what the zip will hold:title;mainLibrary, with the versionpreloadedDependenciesgive it;size;librariesfrom the pack, and theirlibrariesSize;write({ title, onProgress }), which fetches the files and writes the zip. It can be called more than once.It refuses whatever the build would refuse, before fetching anything but the pack's index.
buildScormInPage(options)now runs both steps at once, and takestitle.The teacher can set the title
buildScorm({ title }), and--title <text>on the command.--titlewithout--scormexits with 2.<title>.The page (
startScormPage; the written site'sscorm.html; the demo's/demo/scorm.html)#downloadthen offers the zip. With several, it offers "Download all N as one zip", in which each zip is stored with a complete local header; each row also links its own zip.#file,#status,#downloadand#noticestill builds the first file at once and shows a refusal in#notice, as the README described up to 1.5.ScormPageOptionsis unchanged.Reused, not rewritten
addStoredwas split out ofaddScormEntries. It now writes both the package's stored entries and the zip of all zips, the way h5p-embed --scorm: SCORM Cloud cannot import the zip (data descriptors on stored entries) #92 fixed them.scormTitlenow takes the chosen title, instead of a second function to clean titles.dependenciesInin the player's./plan.readPackage.Docs
design/scorm.md: a new bullet, The page works in steps, and the title is the teacher's, with the tests.design/layout.md.docs/compatibility.md:planScormInPagejoins the covered functions.--title, In the browser, and As a library.Testing
pnpm -r typecheckis clean.scorm-page.test.ts, in Chromium:#notice.scorm-browser.test.ts:imsmanifest.xmlandindex.html;titlegives the same zip as the command'stitle, entry for entry;scorm.test.ts:--titlereaches the manifest and the page, and--titlewithout--scormis refused.Not verified
Release
This adds API (
planScormInPage,title,--title, the page's steps), so it is an embed minor, 1.6.0. Nothing else needs a release.#138 (SCORM 2004, a pass mark, completion as 100) adds its Options step between Review and Download.