Skip to content

SCORM page in steps: review each package, title it, build several at once - #139

Merged
alekswebnet merged 1 commit into
mainfrom
feat/scorm-page-steps
Nov 5, 2026
Merged

alekswebnet merged 1 commit into
mainfrom
feat/scorm-page-steps

Conversation

@alekswebnet

Copy link
Copy Markdown
Contributor

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 version preloadedDependencies give it;
    • size;
    • libraries from the pack, and their librariesSize;
    • 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 takes title.

The teacher can set the title

  • buildScorm({ title }), and --title <text> on the command. --title without --scorm exits with 2.
  • The title goes into the manifest's organisation and item, and into the launch page's <title>.
  • An empty title keeps the package's own.
  • The title is not part of the build stamp, so a zip rebuilt under a new title keeps learners' saved places. The package itself goes in unchanged.

The page (startScormPage; the written site's scorm.html; the demo's /demo/scorm.html)

  • Three steps: ① Choose, ② Review, ③ Download. Each appears once it can be reached.
  • Each file gets a row showing:
    • its name and size;
    • its main library and version;
    • "carries its libraries", or "N libraries from the pack, X MB";
    • or the refusal, in its own words;
    • an editable "Title in the LMS".
  • Several files can be chosen or dropped at once. The same file twice gets one row, and rows can be removed.
  • Build writes the rows one after another. A failure stays in its row while the others carry on.
  • #download then 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.
  • Changing a title after a build withdraws that zip until it is rebuilt.
  • Each row's facts sit in a live region from the moment the row appears. Text is written only when it changes, so typing a title does not make a screen reader repeat the other rows.
  • Compatibility: a page that only has #file, #status, #download and #notice still builds the first file at once and shows a refusal in #notice, as the README described up to 1.5. ScormPageOptions is unchanged.

Reused, not rewritten

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: planScormInPage joins the covered functions.
  • The embed README: --title, In the browser, and As a library.
  • The demo page's text.

Testing

  • pnpm -r typecheck is clean.
  • The embed suite passes, 67 tests in 5 files. 6 tests are new.
    • scorm-page.test.ts, in Chromium:
      • One file: read into its row and built on Build. The download matches the command's zip entry for entry and plays unpacked. Focus moves to the link.
      • Three files at once:
        • a refusal in its row beside two that build;
        • a title given, found in the zip's manifest and page;
        • each row's zip, and the zip of all, which holds them stored and byte-identical;
        • a row removed, with focus moving to the row before;
        • a title changed after the build.
      • Dropped files: the same file dropped twice gets one row.
      • A page with only the 1.5 elements: builds at once and refuses in #notice.
      • Typing a title key by key changes no live region. With the guard removed, this test fails with 33 rewrites.
    • scorm-browser.test.ts:
      • the plan's facts match the command's zip;
      • two writes of one plan under two titles differ only in imsmanifest.xml and index.html;
      • title gives the same zip as the command's title, entry for entry;
      • a title of only spaces keeps the package's.
    • scorm.test.ts: --title reaches the manifest and the page, and --title without --scorm is refused.
  • The default zip is unchanged. I built the quiz and the formulas export with main's code in a temporary worktree and with this branch's. Both pairs are byte-identical files (2,838,610 and 5,367,591 bytes, same build stamps).
  • Checked by hand:
    • The demo page, in Chromium on the dev server, with the quiz, the formulas export and a package that needs a missing library: light and dark at 1280 px, and 390 px. There were no console errors and no sideways scroll. "Download all" came to 8.3 MB for the two.
    • The written site's page, at 900 px: the same result.

Not verified

  • Firefox and Safari: dropping files, several downloads, focus.
  • A screen reader on the rows. I only checked that their live regions exist from the start and are not rewritten.
  • A retitled zip imported into an LMS. Only the title text in the manifest changes.
  • Large batches: every zip, and the zip of all, is held as a Blob in the tab.

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.

…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.
@alekswebnet alekswebnet added the enhancement New feature or request label Nov 5, 2026
@alekswebnet
alekswebnet added this pull request to stack #141 November 5, 2026 19:46
@alekswebnet
alekswebnet merged commit dbaee70 into main Nov 5, 2026
8 checks passed
alekswebnet added a commit that referenced this pull request Nov 5, 2026
fix(scorm): six points from the review of #139 and #140
@alekswebnet
alekswebnet deleted the feat/scorm-page-steps branch November 6, 2026 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SCORM page: numbered steps, a review of each package with an editable title, and several files at once

1 participant