Skip to content

feat(author): notes for what builds and is almost surely a mistake - #243

Merged
alekswebnet merged 2 commits into
mainfrom
feat/author-mistake-notes
Nov 19, 2026
Merged

alekswebnet merged 2 commits into
mainfrom
feat/author-mistake-notes

Conversation

@alekswebnet

@alekswebnet alekswebnet commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Closes #241. Item 4 of #219.

What changes

A build notes what H5P allows and is almost surely a mistake. Each is a note, not a problem, and each says what to write:

Note Where
No answer marked correct Multiple Choice's answers, Multimedia Choice's options (Find the Hotspot's areas are refused already)
Two answers or statements alike, as a learner reads them: no tags or entities, any case or spacing Multiple Choice, a Single Choice Set question, a Summary set
A text with no gap, *word* Fill in the Blanks (none in any of its texts), Drag the Words, Mark the Words
A picture with no alt text, where its field is optional Dialog Cards, Flashcards, Image Hotspots, Memory Game's and Image Pairing's matching picture, Question Set's intro, Speak the Words Set's introduction, Branching Scenario's start screen
  • lib/mistakes.mjs runs in checkContent, so a build says them, and so does a check of saved content. The read is unchanged: it says nothing of these.
  • The pictures are one table, ALT_TEXTS, which a test holds to the pack's fields: a picture, and an optional text beside it.
  • blanksGaps in types.mjs is exported, so the gap rule stays H5P.Blanks' own.
  • Docs: design/author.md (a rule, and "Not built"), the README, design/layout.md.

The skill and the MCP server already pass every note on, and each note says what to write, so neither text changes.

Tested

  • One test per kind of note, in a Question Set too, by the sub-content's path. Entities and spacing compare as read. One text with a gap is enough for Fill in the Blanks.
  • The table is held to each type's semantics in the pack.
  • No type file's example says any of them: all 32 build with no new note. apps/skills holds them to that.
  • The owner's 88 real packages, checked as saved: 79 checked against their own libraries.
    • 8 have pictures with no alt text: 36 notes.
    • 1 has answers alike: a test package whose answers all read "Test", 4 notes.
    • None has a question with no answer marked correct or a text with no gap.
  • Suites: the author package, 266 tests in Node and Chromium; pnpm typecheck for the package.

Summary by cubic

Adds notes for H5P content that builds but is almost surely a mistake, closing #241 (item 4 of #219). The build now reports these instead of staying silent, and each note says what to write. Text comparison is locale-independent, so a note does not change with the host's locale.

  • Notes cover: no answer marked correct, duplicate answers or statements (compared as a learner reads them), texts with no gap, and pictures with no alt text where the field is optional.
  • Runs in checkContent, so both builds and checks of saved content report them.
  • ALT_TEXTS maps each picture-with-optional-alt-text location to its fields; a test holds it against the pack's semantics.
  • The read of saved content is unchanged; these come back only as notes, never problems.
  • README and design docs now list which notes appear in which content types.

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

View guided diff Turn on auto-fix

)

Item 4 of #219. H5P allows each, so each is a note and not a problem,
and each says what to write:

- no answer marked correct: Multiple Choice's answers, Multimedia
  Choice's options;
- two answers alike as a learner reads them: Multiple Choice, a Single
  Choice Set question, a Summary set;
- a text with no gap: Fill in the Blanks, Drag the Words, Mark the Words;
- a picture with no alt text where its field is optional, in eight types
  (`ALT_TEXTS`, held to the pack's fields by a test).

lib/mistakes.mjs runs in checkContent, so a build says them and so does
a check of saved content. No type file's example says any.

@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 across 7 files

Reply with feedback, questions, or to request a fix.

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

Comment thread packages/author/lib/mistakes.mjs Resolved
Comment thread packages/author/README.md Resolved
Comment thread design/author.md Resolved
…ME and design say which notes, in which types (#241)

From cubic's review of #243: toLowerCase in place of toLocaleLowerCase, so a note does not
change with the host's locale; the README's list qualified (the content types it looks in,
answers or statements alike, an optional alt text left blank); the design says statements
too, as Summary's are.
@alekswebnet
alekswebnet merged commit 8f02b13 into main Nov 19, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

h5p-author: notes for what builds and is almost surely a mistake

1 participant