Skip to content

test(journeys): real content types answered as a learner, with what they then do checked (#314) - #315

Merged
alekswebnet merged 4 commits into
mainfrom
test/learner-journeys
Dec 1, 2026
Merged

alekswebnet merged 4 commits into
mainfrom
test/learner-journeys

Conversation

@alekswebnet

@alekswebnet alekswebnet commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Part of #314: the harness, and the first five content types.

A journey builds a real package of a content type with h5p-author, plays it in the element and answers it in a browser as a learner does. Each case was written from the type's own script, read first: what it scores, what a wrong answer costs, when it offers Retry and Show solution, and what it saves.

What each type's cases hold

  • Multiple Choice 1.16 (8): radios when one answer is right, else boxes; a point for each right answer less one for each wrong, never below nothing; one point for the whole task where the author asked, from the pass mark up; Retry; Show solution; the answers come back by their place in the source.
  • True/False 1.8 (5): one point; the author's words for right and wrong, with @score and @total; Retry and Show solution only after a wrong answer; a check with nothing chosen; checking as the learner chooses.
  • Fill in the Blanks 1.14 (5): a point a blank; any of a blank's alternatives; compared as typed unless the author let case pass; one wrong letter in a word of more than three; the solution only once every blank is filled.
  • Drag the Words 1.10 (6): a point for each zone that holds a word with its text, so two words with the same text are either's; nothing off for a wrong word or an empty zone; the author's words for the score's range; each drop judged at once where asked.
  • Question Set 1.21 (9): reports once, on Finish, the sum of its questions' points, each of which says it is a part; passes from its pass mark up; offers Finish only once every question has an answer; Retry; no way back where the author closed it; no Check buttons; a pool; the order it shuffled its questions into kept when a learner comes back.
  • Each type has a case for resume: the state it saves, and what a learner sees on coming back.

What the scripts and the first runs showed

How it is built

  • apps/journeys, a test project of its own, as apps/skills is. tests/harness.ts reuses h5p-author's buildPackage and the verifier's server, serves the repository's copy of the pack, and reaches no network.
  • CI: a lane of its own on a pull request, in Chromium, when a package it plays changes, so the run takes no longer; Firefox and WebKit with the weekly run (pnpm test:engine).
  • design/testing.md: the rules. AGENTS.md, design/layout.md, docs/development.md: the third app.

Tests

  • 33 cases: Chromium 33 passed, five runs in a row and two under a load of three processes a core; WebKit 33 passed; Firefox 27 passed and 6 not run. On a Mac.
  • 45 s on a laptop, of which the resume cases wait about 5 s each for the content to save.
  • Type check and pnpm comments.
  • On CI: the pull request's run, with test (journeys) at 1m17s in Chromium; and the whole of CI run by hand on this branch, green, with the journeys in Firefox and WebKit on Linux.

Not done, and next under #314: Course Presentation and Interactive Video, each read first; both were played here while the harness was written.


Summary by cubic

Adds apps/journeys, a new test project that builds real H5P content packages with h5p-author, plays them in the element, and answers them in a browser as a learner does. Each case checks the score, the xAPI statements, and the saved state a reload with resume brings back.

  • Covers Multiple Choice 1.16, True/False 1.8, Fill in the Blanks 1.14, Drag the Words 1.10, and Question Set 1.21: 33 cases, written from each type's own script.
  • Runs in a lane of its own on pull requests, in Chromium; Firefox and WebKit join the weekly run. Nothing reaches a network.
  • Negative checks wait for the change that comes with them: Retry and Show solution are counted once Check has gone, Finish once the question's dot is marked.

Findings

  • An Interactive Video built by h5p-author reports no result: it sends completed only from a submit screen, which a source lacks (not fixed here).
  • In Firefox, a second drag fails because the first leaves text selected, starting the browser's own text drag; the 6 Drag the Words cases are skipped there, and Question Set's fourth question is typed instead.
  • Fill in the Blanks 1.14 sends no success in its result, and its cases pin that.
  • The browser acts at a learner's pace (60 ms an action), since a click within 150 ms of a press was lost in Firefox while a question rebuilds its buttons.

Written for commit 1b6d1a7. Summary will update on new commits.

View guided diff Turn on auto-fix

…hey then do checked (#314)

apps/journeys builds a package of a content type with h5p-author, plays it in the element and answers it in a browser at a learner's pace. Each case comes from the type's own script: what it scores, what a wrong answer costs, when it offers Retry, what it saves.

Multiple Choice, True/False, Fill in the Blanks, Drag the Words and Question Set: 33 cases. A lane of its own on a pull request, in Chromium; Firefox and WebKit with the weekly run.
@alekswebnet

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review this pull request

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this pull request

@alekswebnet cubic can't start this review because your workspace has reached its free monthly review limit. cubic has reviewed 40,199 of the 40,000 allowed lines of code this month. Reviews resume on 8 December 2026 (in 8 days). Paid plans include much higher monthly review limits. Upgrade now to resume reviews.

To help optimise your usage, you can tune cubic to get the most out of your usage limits:

Learn more →

…mes with it

Retry and Show solution are counted once Check has gone, Finish once the question's dot is
marked, and Drag the Words' one result is read after both drops. The design no longer says
h5p-author's Interactive Video lacks a submit screen (#317).
…lanks' missing success pinned

Question Set's fourth question is typed where words do not drag, so its reporting, pass mark,
Retry, Finish and resume cases run in Firefox too: 27 there, 6 skipped, where 21 ran. Fill in
the Blanks 1.14 sends no success, and its cases now say so. The design note says what the
installed Firefox 161 does with a second word drag, reported upstream as h5p/h5p-drag-text#231.
@alekswebnet
alekswebnet merged commit d946f08 into main Dec 1, 2026
14 checks passed
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.

1 participant