Skip to content

feat(skills): h5p-to-scorm, an H5P package as a SCORM zip for an LMS - #161

Merged
alekswebnet merged 5 commits into
mainfrom
feat/h5p-to-scorm-skill
Nov 8, 2026
Merged

alekswebnet merged 5 commits into
mainfrom
feat/h5p-to-scorm-skill

Conversation

@alekswebnet

@alekswebnet alekswebnet commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Closes #159
Closes #160

The skill

skills/h5p-to-scorm/SKILL.md takes an agent from an .h5p to a SCORM zip in the user's LMS:

  • What to ask first: which LMS. A pass mark, completion as 100 and SCORM 2004 come up only when they matter.
  • A check that plays the package as the zip will: --libraries pack --no-refresh-libraries --no-downgrade-libraries.
  • The command in its three forms, and what to do about each refusal.
  • The Supported LMSs table, with the setting each LMS needs.
  • What to tell the user: the LMS must be https; the package's code runs on the LMS's site; how to try the zip as a student; 1.2's 4,096-character limit.

It only names options that are on npm now (embed 1.6.2, verify 1.4.1), since a skill installs from main.

Also in this PR:

  • The README's skills section is a table, like the packages one.
  • h5p-author's hand-over mentions the new skill.
  • The embed README points to the skill.

Found by the tests: --completion-score's example never finishes (#160)

The help, the embed README and the SCORM page all said the option was for content like "a presentation without questions". But such a presentation never finishes. Played to its last slide, it sends only progressed, so the activity stays incomplete whether or not the option is set. Course Presentation 1.27 and Interactive Book 1.15 send completed only from their summary page, and they only show that page when they contain tasks.

The content that really finishes without a score is a questionnaire, or a branching scenario with no scoring. The zip records both as 100.

So the bridge was right and the example was wrong. It's corrected in the command's help, the embed README, both copies of the SCORM page (packages/embed/site/ and the demo's) and design/scorm.md.

Tests

apps/skills/tests/to-scorm.test.ts has three tests and runs in about 21 s. They take the skill's commands exactly as it writes them, run them on packages built by h5p-author, then play each zip as a learner. The zip is served as an LMS serves it, and the launch page runs under a stand-in LMS page that keeps the values between launches.

  1. SCORM 1.2 with the skill's pass mark. A quiz played over two sessions.
    • The stand-in reads the mark from the manifest, as Moodle does.
    • Session 1: the learner answers question 1, moves on, and leaves. The LMS holds incomplete and suspend, plus base64 saved state under 4,096 characters.
    • Session 2: the quiz resumes on question 2. The learner scores 2 of 3, a score the quiz's own 50% passes and the mark of 80 fails.
    • Result: failed at 66.67, one interaction per question, and the session ends with nothing left to resume.
  2. SCORM 2004 with completion as 100.
    • A questionnaire submitted, and a branching scenario played to an ending, are each recorded as completed with a score of 100.
    • The questionnaire keeps that result after a relaunch.
    • A presentation without questions, every slide seen, stays incomplete with no score.
  3. The skill's LMS table matches the embed README's Supported LMSs: the same LMSs, added the same way, with the same 2004 column.

Mutation check: I made the bridge ignore the pass mark, then made it write the state as UTF-16 instead of base64. Test 1 failed both times.

Runs:

  • Three runs in a row all passed.
  • The whole apps/skills suite passes: 76 tests in 61 s.
  • apps/skills and embed typechecks pass.

Not verified

  • A real LMS. LMS testing is paused, and the skill tells the agent it can't check one.
  • The skill's prose in an agent session.

Release

The skill reaches users from main once this merges. The corrected help text and SCORM page reach npm with the next embed release; with #158 that's 1.7.0, and this goes under fixes.


Summary by cubic

Adds h5p-to-scorm, a fifth agent skill that turns an .h5p into a SCORM zip for an LMS, and fixes --completion-score's example: tests showed a presentation without questions never finishes, so it now names a questionnaire or a branching scenario without scoring.

New Features

  • The skill asks which LMS the zip goes to, checks the package as the zip will play it, runs the command in its three forms, and gives the setting each supported LMS needs. The check distinguishes a package that does not play (exit 1, to fix) from a check that could not run (exit 2, never change the package); ${'No such file'} from the zip's command is a wrong path or folder, checked before asking for the file.
  • apps/skills/tests/to-scorm.test.ts runs the skill's commands as written and plays the zips under a stand-in LMS: a two-session quiz in SCORM 1.2 that the skill's pass mark decides, and in 2004 a questionnaire and a branching scenario counted as 100 while a presentation without questions stays incomplete; a third test holds the content the skill names as resuming or restarting to the pack's libraries.
  • The README's skills section is now a table; h5p-author's hand-over points to the new skill.

Bug Fixes

  • The example is corrected in the command's help, the embed README, both SCORM pages, and design/scorm.md, and the wording now says "a presentation or book with no questions in it".
  • The skill and README now say only content types with getCurrentState() resume; an Accordion, Image Hotspots, Flashcards, or a Timeline starts over.
  • A CodeQL string-escaping warning in the new test is fixed.

Closes #159 and #160.

Written for commit bb65c98. Summary will update on new commits.

View guided diff Turn on auto-fix

A fifth agent skill: what to ask first, a check that plays the package as the zip will, the
command and its refusals, the setting each supported LMS needs, and what to tell the user. It is
tested from apps/skills: its commands run as written, their zips are played as a learner under a
stand-in LMS in SCORM 1.2 and 2004, and its LMS table is held to the embed README's. The README's
skills section is now a table, like the packages one, and h5p-author's hand-over names the skill.

Those tests found that --completion-score's example, a presentation without questions, never
finishes: Course Presentation and Interactive Book send `completed` only from a summary page,
which they show only when they contain tasks. The command's help, the embed README, both copies
of the SCORM page and design/scorm.md now name a questionnaire or a branching scenario without
scoring instead.

Closes #159
Closes #160
Comment thread apps/skills/tests/to-scorm.test.ts Fixed
…caping or encoding'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed

Reply to a comment to ask cubic a question or push back. It learns from your replies.
Click Fix with cubic on a comment, or reply @cubic-dev-ai fix this, and cubic writes the fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread skills/h5p-to-scorm/SKILL.md Resolved
Comment thread skills/h5p-to-scorm/SKILL.md Resolved
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed

Tip: Get a Slack DM when cubic finishes reviewing your PRs. Connect Slack

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread packages/embed/README.md Resolved
Comment thread skills/h5p-to-scorm/SKILL.md Resolved
Comment thread skills/h5p-to-scorm/SKILL.md Resolved
… content keeps one

The zip saves what the content's getCurrentState() returns, and a content type without it,
such as an Accordion, Image Hotspots, Flashcards or a Timeline, starts over at every launch, as
on any H5P site (docs/resume.md). The skill's opening and its "how to try it" said every launch
continues where the learner was, a promise taken from the embed README, which said the same.
Both now say which content keeps its place. The skill's test holds the content it names to the
pack's libraries, so a library that gains or loses getCurrentState() in a pack refresh shows up
in the weekly run.
…ntations never finish

- The check's exit 1 is a package that does not play, to be fixed. Exit 2 is a check that
  could not run, for want of a browser or a file, and the package is never changed for it.
- `No such file` from the zip's command is a wrong path or folder, checked before the user is
  asked for the file again.
- "A presentation or a book without questions" read as if any presentation stayed incomplete,
  though one with questions finishes from its summary slide. The skill, the embed README and
  design/scorm.md now say "a presentation or book with no questions in it".
@alekswebnet
alekswebnet merged commit 836772a into main Nov 8, 2026
9 checks passed
@alekswebnet
alekswebnet deleted the feat/h5p-to-scorm-skill branch November 12, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants