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
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ Read it before changing entry names, `untrusted`, the content check (`packages/r
- **The verifier** (`packages/verify/`): [`design/verify.md`](design/verify.md).
- **The author package** (`packages/author/`, `skills/h5p-author/`): [`design/author.md`](design/author.md).
- **The VS Code extension** (`packages/vscode/`): [`design/vscode.md`](design/vscode.md).
- **The SCORM package** (`packages/embed/lib/scorm*.mjs`, `packages/embed/scorm/`, the SCORM page): [`design/scorm.md`](design/scorm.md).
- **The SCORM package** (`packages/embed/lib/scorm*.mjs`, `packages/embed/scorm/`, the SCORM page, `skills/h5p-to-scorm/`): [`design/scorm.md`](design/scorm.md).
- **The embed site** (`packages/embed/` but its SCORM side, the demo's `/embed`): [`design/embed.md`](design/embed.md).
- **cmi5** (`packages/cmi5/`, the demo's cmi5 page, CATAPULT): [`design/cmi5.md`](design/cmi5.md).
- **The hosted demo and the app** (`apps/demo/`, `vercel.json`, `api/`): [`design/demo.md`](design/demo.md). It compiles the element from the player's source, not from `dist/`, as [`design/layout.md`](design/layout.md) explains.
Expand Down
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,18 +131,21 @@ reads the `.h5p` itself, with nothing to unzip, and

[![skills.sh](https://skills.sh/b/missing-elements/h5p-offline-player)](https://skills.sh/missing-elements/h5p-offline-player)

Four skills for Claude Code and other agents that can read files and run commands, installed
with [skills](https://skills.sh/):
Five skills for Claude Code and other agents that can read files and run commands, installed
with [skills](https://skills.sh/); add `--skill <name>` for one of them. None needs a provider API
key or an H5P server.

```bash
npx skills add missing-elements/h5p-offline-player
```

[`h5p-author`](https://github.com/missing-elements/h5p-offline-player/tree/main/skills/h5p-author)
turns a prompt or a lesson into H5P content of any of 28 types, chosen with you first, checks it
in the real player and opens it for you to play. `h5p-player-setup` puts H5P on a site,
`h5p-normalize` fixes video that will not stream, and `h5p-verify` checks that a package plays.
None needs a provider API key or an H5P server.
| Skill | What it does |
|---|---|
| [`h5p-author`](https://github.com/missing-elements/h5p-offline-player/tree/main/skills/h5p-author) | Turns a prompt or a lesson into H5P content of any of 28 types, chosen with you first, checks it in the real player and opens it for you to play |
| [`h5p-verify`](https://github.com/missing-elements/h5p-offline-player/tree/main/skills/h5p-verify) | Checks that a package plays, and opens it in your browser for you to try |
| [`h5p-to-scorm`](https://github.com/missing-elements/h5p-offline-player/tree/main/skills/h5p-to-scorm) | Turns a package into a SCORM zip that an LMS plays, grades and resumes, and says what to set in yours |
| [`h5p-player-setup`](https://github.com/missing-elements/h5p-offline-player/tree/main/skills/h5p-player-setup) | Puts H5P on a website, from the player on the site itself or framed from a domain of your own |
| [`h5p-normalize`](https://github.com/missing-elements/h5p-offline-player/tree/main/skills/h5p-normalize) | Rewrites a package whose video will not stream |

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion apps/demo/demo/scorm.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ <h2><span class="step-number">3</span> Options</h2>
</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>
<span class="step-hint" id="completion-score-hint">For a gradebook that needs a number: a questionnaire, submitted, records 100. Content that never finishes, such as an Accordion or a presentation without questions, stays incomplete.</span>
</div>
</div>
</section>
Expand Down
1 change: 1 addition & 0 deletions apps/skills/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
},
"devDependencies": {
"@missing-elements/h5p-author": "workspace:*",
"@missing-elements/h5p-embed": "workspace:*",
"@missing-elements/h5p-libraries": "workspace:*",
"@missing-elements/h5p-verify": "workspace:*",
"@types/node": "^26.6.6",
Expand Down
449 changes: 449 additions & 0 deletions apps/skills/tests/to-scorm.test.ts

Large diffs are not rendered by default.

18 changes: 14 additions & 4 deletions design/layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@ apps/demo/ the demo app: the dev server for the whole repository,
site root -> dist-demo/

apps/skills/ the skills' test project, a project of the kind a skill's user runs it in:
it installs the commands the skills run with npx, the author package and
the verifier, and the library pack; nothing in it ships. Out of the demo
it installs the commands the skills run with npx, the author package,
the verifier and the embed command, and the library pack; nothing in it ships. Out of the demo
since 2026-10-23, by the owner's choice
tests/author-verify.test.ts every h5p-author type file's example built, with sample media, checked
as saved content against the libraries it carries with nothing reported
Expand All @@ -366,6 +366,14 @@ apps/skills/ the skills' test project, a project of the kind a skil
result's screen-reader announcement, since Question Set 1.21 draws
neither on its result page (h5p/h5p-question-set#183), and drawn
after Check on a question on its own; Chromium only
tests/to-scorm.test.ts the h5p-to-scorm skill's commands as it writes them, run on packages
h5p-author builds, and their zips played as a learner under a stand-in
LMS (#159): a quiz over two sessions in SCORM 1.2, which the skill's
pass mark fails where the quiz's own passes; a questionnaire, a
branching scenario without scoring and a presentation without questions
in 2004 with completion as 100; the content it names as keeping the
learner's place or starting over, held to whether the pack's library
has getCurrentState(); and its LMS table held to the embed README's

README.md what npm shows; ACCESSIBILITY.md, SECURITY.md, CONTRIBUTING.md, GLOSSARY.md,
CODE_OF_CONDUCT.md beside it
Expand All @@ -391,8 +399,10 @@ docs/ the README's longer sections, one file each: the eleme
skills/ agent skills, one directory per skill, at the root because that is where
`npx skills add <owner/repo>` looks: h5p-verify (when to run the verifier and how
to read its report), h5p-player-setup (putting the player on a site), h5p-normalize (when
a package needs rewriting to stream, and how to read the dry run)
and h5p-author (any of 28 content types from a prompt, since #100: the
a package needs rewriting to stream, and how to read the dry run),
h5p-to-scorm (a package as a SCORM zip for an LMS, since #159: what to ask,
the check, the command and its refusals, each LMS's setting; tested from
apps/skills) and h5p-author (any of 28 content types from a prompt, since #100: the
type chosen with the user first, a source of only what differs from the
defaults, written from references/types/<Type>.md — notes, a tested
example and the fields, their section generated from the pack — built
Expand Down
32 changes: 27 additions & 5 deletions design/scorm.md
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,14 @@ one row each; an LMS added here gets a row there.
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.
0, as a questionnaire or a branching scenario without scoring 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. So does a
presentation or book with no questions in it, which the README and the command's help gave as the
example until #160 (2026-11-08): Course Presentation 1.27 and Interactive Book 1.15 send their
`completed` from a summary page they show only when they hold tasks. Played to its last slide,
the presentation sent `progressed` alone; the book's chapters say `completed` as sub-content,
which is not the book's result.
- **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
Expand All @@ -396,7 +401,8 @@ one row each; an LMS added here gets a row there.
as 100, 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. Completion as 100 without a mark ran in no LMS: it gives `completed`
finished without one; since #160 the h5p-to-scorm skill's test plays real ones under a stand-in
LMS. Completion as 100 without a mark ran in no LMS: it gives `completed`
and 100, and in 2004 leaves success `unknown`, which a test holds (#142).

`scorm-page.test.ts` drives the written site's page in Chromium: a chosen file read into its row
Expand All @@ -409,6 +415,21 @@ one row each; an LMS added here gets a row there.
for the manifest and the page, a title given to the page's builder to the command's `--title`,
entry for entry, and a title given to the plan to its writes, which hash the package once.

- **`skills/h5p-to-scorm/SKILL.md` is the contract with an agent** (#159, 2026-11-08), as
`skills/h5p-verify/SKILL.md` is the verifier's: what to ask first (the LMS, then a pass mark,
completion as 100 and 2004 only where they matter), the check that plays a package as the zip
plays it (`--libraries pack --no-refresh-libraries --no-downgrade-libraries`), the command and
its refusals, the *Supported LMSs* table with the setting each LMS needs, and what to tell the
user. It names only options on npm, since a skill is installed from `main`.
`apps/skills/tests/to-scorm.test.ts` runs its commands as it writes them on packages h5p-author
builds, plays their zips under a stand-in LMS as a learner (a quiz over two sessions in 1.2,
where its mark of 80 fails the 66.67 the quiz's own 50% passes; a questionnaire, a branching
scenario without scoring and a presentation without questions in 2004 with completion as 100),
holds the content it names as keeping the learner's place or starting over to the pack's
libraries (the player saves what `getCurrentState()` returns, and a type without it starts
over, `docs/resume.md`), and holds its table to the README's, so an LMS checked later is added
to both.

`tests/scorm.test.ts` checks the zip, the parts it carries, its stored entries' local headers and
its refusals in Node. In Chromium it plays the unpacked zip under a page that holds the API and
frames the launch page, as Moodle's player does. It covers:
Expand Down Expand Up @@ -442,7 +463,8 @@ Not covered:

- any LMS but Moodle 4.5, Frappe LMS, SCORM Cloud, ILIAS 11, OpenOLAT 21.1 and Chamilo 3.0, and
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;
- content that finishes without a score, in a real LMS: it has played to its end only under the
skill's stand-in;
- 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
15 changes: 9 additions & 6 deletions design/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,15 @@ package's behaviour, the test moved into the package: the embed page asking befo
package that needs its own code, and `resizer.js` answering a frame that loaded before it, are in
`packages/embed/tests/site.test.ts`; the cmi5 page's were already in `packages/cmi5/tests/`.
The skills are source too, tested from `apps/skills`, a project of their own (2026-10-23, the
owner's choice): what they tell an agent to write builds and plays. h5p-author's own code is the
author package's since #100, tested with it. Its tests were first in the demo, which had the pack
and zip.js installed, and in the verifier's tests, and the playback test played the quiz through
the installable app. It plays it in the verifier's preview now, the page the skill hands a person to
review it in, and in Chromium only, where in the demo the `engines` job ran it in Firefox and
WebKit too; the player's own suite covers the engines.
owner's choice): what they tell an agent to write builds and plays. For h5p-to-scorm (#159) that is
its commands, run as it writes them, and their zips, played as a learner under a stand-in LMS with
real content; that is how a presentation without questions, the example `--completion-score` gave,
was found never to finish (#160). h5p-author's own code is the author package's since #100, tested
with it. Its tests were first in the demo, which had the pack and zip.js installed, and in the
verifier's tests, and the playback test played the quiz through the installable app. It plays it in
the verifier's preview now, the page the skill hands a person to review it in, and in Chromium
only, where in the demo the `engines` job ran it in Firefox and WebKit too; the player's own suite
covers the engines.

The app's tests follow the same variable (`apps/demo/tests/engine.ts`; `tests/harness.ts`
starts the dev server and the second-origin package host and waits on the element for all of
Expand Down
3 changes: 2 additions & 1 deletion docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ A pnpm workspace: `packages/player`, `packages/runtime`, `packages/libraries`,
`packages/normalize`, `packages/verify`, `packages/author`, `packages/cmi5`, `packages/embed`,
`packages/vscode`, the demo site in `apps/demo`, and in `apps/skills` the tests of the agent
skills, run from a project the way a skill's user runs them: every h5p-author type file's example
built and played.
built and played, and the h5p-to-scorm skill's commands run and their zips played under a stand-in
LMS.

```bash
pnpm install
Expand Down
22 changes: 15 additions & 7 deletions packages/embed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ package, the player and the H5P runtime, and a launch page that reports to the L
never read them; the LMS's reports do;
- the time spent in each session;
- the learner's place: the content's saved state goes into `cmi.suspend_data`, compressed, and
the next launch continues from it. SCORM 1.2 keeps 4,096 characters; compressed, a quiz's state
the next launch continues from it, for a content type that saves one, as Question Set, Course
Presentation, Interactive Book, Interactive Video and most single questions do. An Accordion,
Image Hotspots, Flashcards or a Timeline starts over, as on any H5P site. SCORM 1.2 keeps 4,096 characters; compressed, a quiz's state
takes about 200, a twelve-chapter Interactive Book about 1,000, and none of 23 real packages
measured passed 1,100. One that does not fit is not saved, the last that fitted stays, and
the page says so under the content, once. Moodle keeps 64,000 when its administrator turns
Expand All @@ -167,10 +169,15 @@ missing named.
The package plays trusted: its own code runs on the LMS's origin, as every SCORM package's does.
The LMS has to be served over https, since the player needs its Service Worker.

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.
Content that reports no result of its own stays `incomplete`, such as an Accordion, a Virtual
Tour, or a presentation or book with no questions in it: 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.

An [agent skill](https://github.com/missing-elements/h5p-offline-player/tree/main/skills/h5p-to-scorm)
takes an agent through it, from checking the package to the setting each LMS needs:
`npx skills add missing-elements/h5p-offline-player --skill h5p-to-scorm`.

### Options of the zip

Expand All @@ -186,8 +193,9 @@ Three, each off unless asked for; a zip written with none is the SCORM 1.2 zip d
a mark the LMS holds of its own wins. Content that reports no score gets no pass or fail from
it.
- **Completion as 100** (`--completion-score`): content that finishes without a score, such as a
presentation without questions, is recorded as 100, for a gradebook that needs a number; with a
pass mark, that passes. Content that never finishes still stays `incomplete`.
questionnaire or a branching scenario without scoring, is recorded as 100, for a gradebook that
needs a number; with a pass mark, that passes. Content that never finishes, such as a
presentation or book with no questions in it, still stays `incomplete`.

### In the browser

Expand Down
2 changes: 1 addition & 1 deletion packages/embed/bin/h5p-embed.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Options:
--pass-mark <0-100> with --scorm, the score out of 100 that passes, in place of the
content's own pass or fail; the LMS gets it as the mastery score
--completion-score with --scorm, count content that finishes without a score, such as a
presentation with no questions, as 100
questionnaire, as 100
--packages <origins> play packages, and fetch library bundles, only from these origins
(comma or space separated; this site's own is always allowed). Add
any host a package URL redirects to, and https://cdn.jsdelivr.net for
Expand Down
2 changes: 1 addition & 1 deletion packages/embed/site/scorm.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ <h2><span class="step-number">3</span> Options</h2>
</p>
<p>
<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>
<span class="step-hint" id="completion-score-hint">For a gradebook that needs a number: a questionnaire, submitted, records 100. Content that never finishes, such as an Accordion or a presentation without questions, stays incomplete.</span>
</p>
</section>

Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading