fix(author): an Interactive Video ends with a submit screen, from which it sends its score

AL
10h ago
+122-8

Fixes #317.

What changes

  • A build puts a submit screen at the video's end where a source writes no endscreens, as H5P's editor does for a new video. Its time is the length the build reads: an MP4's index, or Vimeo's answer. It is added once the media are read, before the content check.
  • Where no length is read (a WebM, YouTube, Panopto, a video the build page leaves at its address), there is no screen. A note on endscreens says to write [{ "time": <the video's length> }].
  • endscreens: [] in a source is none. A package with none reads back as [], so it builds again without one.
  • A source no longer writes a submit screen's label. The build writes the library's, 0:30 Submit screen, in the content's language, as Interactive Video labels one it moves to the end. Only the editor shows it.
  • The type file gets one line, and its generated section drops label. design/author.md gets the rule.

Tests

  • build.test.ts: the screen at the length, in German, with an hour-long video's label; []; a written screen, labelled; inside a Column; and the note for YouTube.
  • read.test.ts: a package with none reads back as [] and builds again with none. Every type file's example still builds, reads back and builds again the same.
  • layout.test.ts, page.test.ts: the note where no length is read.
  • Measured in Chrome with the learner journeys' harness (#315): the same video, answered right and played to its end, shows the submit screen. Submit sends completed, 1 of 1, and the element dispatches finished. With endscreens: [] it sends nothing, as every build did before.
  • Author: 333 tests and a type check. MCP server: 24. MCP app: 33. apps/skills playback and verify: 75; every type file's example plays untrusted with no warning. pnpm comments.
  • Not run: Firefox and WebKit.

Release: h5p-author. The same source now builds a video that ends with a submit screen.


Summary by cubic

Fixes Interactive Video never sending completed: it sends a learner's score only from a submit screen, and a build added none.

  • A build now puts one at the video's end, as H5P's editor does, where it reads the length (an MP4's index or Vimeo's answer).
  • With no length read, there is none, and a note on endscreens says to write [{ "time": <the video's length> }].
  • endscreens: [] is none, and a package with none reads back as [], so it builds again without one.
  • The screen's label is the library's own, in the content's language; a source no longer writes one.