Repository navigation
fix: finished skips a part the core marks as sub-content, parent or not - #25
Merged
Merged
Conversation
H5P's rule counts a completed or answered statement with no parent as the content's result. Interactive Book 1.15 runs its chapters, Game Map 1.5 its exercises and Virtual Tour 0.5 its interactions without a parent, so a part's result was raised as the content's, and a cmi5 unit completed on its first chapter or stage. The core writes h5p-subContentId on every statement from sub-content and never on the content's own; isResult now refuses those too. Closes #24. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… never completes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 #24.
finishedno longer treats a part's result as the content's when the part was created without a parent. That happens with Interactive Book's chapters, Game Map's exercises and Virtual Tour's interactions.The rule
isResultin the runtime'ssrc/finished.tsstill requires acompletedoransweredstatement with nocontext.contextActivities.parent, which is H5P core's rule. It now also refuses a statement whose object carrieshttp://h5p.org/x-api/h5p-subContentId:XAPIEvent.setObjectwrites that extension for every instance that has asubContentId.This departs from H5P's
setFinishedon purpose. Checking for a parent was core's stand-in for "from the content itself"; the extension says that directly.Measured
On 2026-10-14, against the library pack:
finishedbeforefinishednowreportingfinishedchanged. The walk doesn't open a Game Map stage, so Game Map was played with the first cut's steps from git history, twice. All of these numbers come from Chromium.Behaviour change for hosts
reporting) or Game Map now completes on the content's result. Before, it completed on its first chapter or stage.finished. This covers Interactive Book withoutreportingand Virtual Tour.reporting, and one holding a Virtual Tour never completes;docs/cmi5.mdand the README now say so.subContentIdhas no marker, so it still counts as the content, as under H5P's rule. That covers content from before H5P's editor wrote one, and content written by hand or by a tool that writes none.Changes
packages/runtime/src/finished.ts: the rule, withSUB_CONTENT_EXTENSIONexported.packages/runtime/tests/finished.test.ts: two new tests, covering a marked part without a parent and an object without the marker.looseChild, which is sub-content run without a parent.finished.h5pcarries one.tests/browser/finished.test.ts: pressing Complete in that part raises anxapiwith no parent and the marker, and nofinished.*now means a statement with a parent or the marker. The Interactive Book and Game Map notes are updated.finishedinvariant and the layout line.finishedrow.docs/cmi5.md.Testing
finished.test.ts, Chromium, on the old rule (control)finished.test.ts, Chromium, on the new rulepnpm sweep, all 55 types, trusted, with the marker recordedpnpm sweepon Interactive Book, Multiple Choice, Question Set and Column, both modes, new rulefinishedeachpnpm typecheckRelease
Runtime patch, 0.2.3. The rule is in the boot script, which the runtime ships, so the player, embed and verify don't change. Embed 0.6.1 accepts runtime 0.2.3. The README row reaches npm with the next player release.
🤖 Generated with Claude Code