'),
+ expect.stringContaining('has '),
+ 'has the style "position: fixed" on , which this field does not allow',
+ 'has href="javascript:alert(1)": only http, https, mailto and ftp addresses are kept',
+ 'has a comment, which H5P removes: take it out'
+ ])
+ })
+
+ it('reads a self-closing tag without its slash, and a comment left open to the end, as a browser does', () => {
+ const problems: string[] = []
+ const field = { tags: ['strong'], font: { color: true } }
+ expect(markupText('a b', field, (message) => problems.push(message))).toBe('a b')
+ expect(problems).toEqual([])
+ markupText('a
+
+## Fields of H5P.Accordion 1.0
+
+- `panels` list 1–100 of, required — Panels
+ - `title` text, required — Title
+ - `content` sub-content: H5P.AdvancedText, required — Content type
+- `hTag` one of "h2" | "h3" | "h4" = "h2" — H tags for labels (does not affect the size of the label): The h tag used on the labels. Normally H2 but if this belongs under an H2 heading use H3. Does not affect the size of the labels, only use…
+
+It has no interface texts of its own.
+
+
diff --git a/skills/h5p-author/references/types/H5P.AdvancedText.md b/skills/h5p-author/references/types/H5P.AdvancedText.md
new file mode 100644
index 00000000..2bfc1dd6
--- /dev/null
+++ b/skills/h5p-author/references/types/H5P.AdvancedText.md
@@ -0,0 +1,28 @@
+# Text (H5P.AdvancedText)
+
+Formatted text, a part other content holds: in a page, a book, a slide, a scenario or an accordion. Not a content type on its own.
+
+- `text` takes the tags the Fields section lists: headings, lists, links, emphasis. Plain text is wrapped in paragraphs, a blank line between two.
+
+## Example
+
+```json
+{
+ "type": "H5P.Column",
+ "params": {
+ "content": [
+ { "content": { "library": "H5P.AdvancedText", "params": { "text": "RiversA river has: " } } }
+ ]
+ }
+}
+```
+
+
+
+## Fields of H5P.AdvancedText 1.1
+
+- `text` html: strong em del a ul ol h2 h3 hr pre code, required — Text
+
+It has no interface texts of its own.
+
+
diff --git a/skills/h5p-author/references/types/H5P.Audio.md b/skills/h5p-author/references/types/H5P.Audio.md
new file mode 100644
index 00000000..78be5865
--- /dev/null
+++ b/skills/h5p-author/references/types/H5P.Audio.md
@@ -0,0 +1,29 @@
+# Audio (H5P.Audio)
+
+An audio player. On its own it suits a listening task beside other content; in a page, a book or on a card it is a part.
+
+- `files` is the recording: a file beside the source (`.mp3`, `.m4a`, `.wav`, `.ogg`) or a web address of one.
+- `playerMode` `"full"` shows the full controls, `"minimalistic"` a play button.
+
+## Example
+
+```json
+{
+ "type": "H5P.Audio",
+ "params": { "files": [{ "path": "river.mp3" }], "playerMode": "full" }
+}
+```
+
+
+
+## Fields of H5P.Audio 1.5
+
+- `files` audio files, required — Source files
+- `playerMode` one of "minimalistic" | "full" | "transparent" = "minimalistic" — Player mode: Select the layout of the player.
+- `fitToWrapper` boolean = false; only when playerMode is "minimalistic" or playerMode is "full" — Fit to wrapper
+- `controls` boolean = true; only when playerMode is "full" — Enable controls
+- `autoplay` boolean — Enable autoplay
+
+4 interface texts are left out: they come from the libraries' translations. `h5p-author schema H5P.Audio --all` lists them, for a source to set one.
+
+
diff --git a/skills/h5p-author/references/types/H5P.Blanks.md b/skills/h5p-author/references/types/H5P.Blanks.md
new file mode 100644
index 00000000..26896951
--- /dev/null
+++ b/skills/h5p-author/references/types/H5P.Blanks.md
@@ -0,0 +1,53 @@
+# Fill in the Blanks (H5P.Blanks)
+
+Text with gaps the learner types the missing words into. For recall of exact words: terms, names, spellings.
+
+- Each item of `questions` is one block of text with its gaps, marked as the Fields section below says: `*answer*`, alternatives with `/`, a tip after `:`.
+- Answers are compared as typed. `behaviour.caseSensitive: false` for names that may be capitalised either way; `behaviour.acceptSpellingErrors: true` forgives a wrong letter.
+- `text` is the instruction above the blocks.
+
+## Example
+
+```json
+{
+ "type": "H5P.Blanks",
+ "params": {
+ "text": "Fill in the names of the rivers.",
+ "questions": [
+ "The *Danube/Donau:It flows through Vienna* reaches the Black Sea.",
+ "Paris lies on the *Seine*, London on the *Thames*."
+ ],
+ "behaviour": { "caseSensitive": false }
+ }
+}
+```
+
+
+
+## Fields of H5P.Blanks 1.14
+
+- `media` group — Media
+ - `type` sub-content: H5P.Image | H5P.Video | H5P.Audio — Type: Optional media to display above the question.
+ - `disableImageZooming` boolean = false; only when type is "H5P.Image 1.1" — Disable image zooming
+- `text` html: strong em u a ul ol h2 h3 hr pre code = "Fill in the missing words" — Task description: A guide telling the user how to answer this task.
+- `questions` list 1–31 of html: strong em del u code, required — Text blocks
+ Blanks are added with an asterisk (*) in front and behind the correct word/phrase. Alternative answers are separated with a forward slash (/). You may add a textual tip, using a colon (:) in front of the tip. Example: H5P content may be edited using a *browser/web-browser:Something you use every day*.
+- `overallFeedback` list 1+ of — Overall Feedback: Click the "Add range" button to add as many ranges as you need. Example: 0-20% Bad score, 21-91% Average Score, 91-100% Great Score!
+ - `from` whole number 0–100 = 0 — Score Range
+ - `to` whole number 0–100 = 100
+ - `feedback` text — Feedback for defined score range
+- `behaviour` group — Behavioural settings.
+ - `enableRetry` boolean = true — Enable "Retry"
+ - `allowRetryIfCorrect` boolean = false; only when enableRetry is true — Allow "Retry" even if all answers were correct
+ - `enableSolutionsButton` boolean = true — Enable "Show solution" button
+ - `autoCheck` boolean = false — Automatically check answers after input
+ - `caseSensitive` boolean = true — Case sensitive
+ - `showSolutionsRequiresInput` boolean = true — Require all fields to be answered before the solution can be viewed
+ - `separateLines` boolean = false — Put input fields on separate lines
+ - `confirmCheckDialog` boolean = false — Show confirmation dialog on "Check"
+ - `confirmRetryDialog` boolean = false — Show confirmation dialog on "Retry"
+ - `acceptSpellingErrors` boolean = false — Accept minor spelling errors
+
+26 interface texts are left out: they come from the libraries' translations. `h5p-author schema H5P.Blanks --all` lists them, for a source to set one.
+
+
diff --git a/skills/h5p-author/references/types/H5P.BranchingScenario.md b/skills/h5p-author/references/types/H5P.BranchingScenario.md
new file mode 100644
index 00000000..c6ab023c
--- /dev/null
+++ b/skills/h5p-author/references/types/H5P.BranchingScenario.md
@@ -0,0 +1,75 @@
+# Branching Scenario (H5P.BranchingScenario)
+
+A story in which the learner's choices lead to different paths and endings: decisions, conversations, procedures.
+
+- `branchingScenario.content` is the list of nodes, numbered from 0 in order; the scenario starts at node 0.
+- A node's `type` is sub-content: text, an image, a video, a presentation, or a choice (H5P.BranchingQuestion). Every node that is not a choice says where it goes in `nextContentId`: the number of the next node, or `-1` to end the scenario there.
+- A choice: `{ "library": "H5P.BranchingQuestion", "params": { "branchingQuestion": { "question": "…", "alternatives": [{ "text": "…", "nextContentId": 3 }] } } }`, each alternative leading to a node or an end.
+- An end shows `endScreens[0]`; give a node `feedback` (`title`, `subtitle`, `endScreenScore`) for an ending of its own. More end screens are numbered `-2`, `-3`… in order, and a `nextContentId` can name one.
+- The build refuses a link to a node that does not exist and a loop with no way out, and notes a node nothing leads to.
+
+## Example
+
+```json
+{
+ "type": "H5P.BranchingScenario",
+ "params": {
+ "branchingScenario": {
+ "title": "Crossing the river",
+ "startScreen": { "startScreenTitle": "Crossing the river", "startScreenSubtitle": "Choose a way across." },
+ "content": [
+ { "type": { "library": "H5P.AdvancedText", "params": { "text": "You reach a river after heavy rain. The water is high and fast." } }, "nextContentId": 1 },
+ {
+ "type": {
+ "library": "H5P.BranchingQuestion",
+ "params": { "branchingQuestion": { "question": "How do you cross?", "alternatives": [{ "text": "Wade across here", "nextContentId": 2 }, { "text": "Walk to the bridge", "nextContentId": 3 }] } }
+ }
+ },
+ { "type": { "library": "H5P.AdvancedText", "params": { "text": "The current knocks you over. Never wade into fast water." } }, "nextContentId": -1, "feedback": { "title": "Swept away", "endScreenScore": 0 } },
+ { "type": { "library": "H5P.AdvancedText", "params": { "text": "The bridge takes longer, and you cross safely." } }, "nextContentId": -1, "feedback": { "title": "Safely across", "endScreenScore": 1 } }
+ ],
+ "endScreens": [{ "endScreenTitle": "The end" }]
+ }
+ }
+}
+```
+
+
+
+## Fields of H5P.BranchingScenario 1.11
+
+- `branchingScenario` group — Branching Scenario Editor
+ - `title` text, required — Title
+ - `startScreen` group — Start screen
+ - `startScreenTitle` html: strong em del code a — Course Title
+ - `startScreenSubtitle` html: strong em del code a — Course Details
+ - `startScreenImage` image file — Course image
+ - `startScreenAltText` text — Image alternative text
+ - `endScreens` list of — List of end screens
+ - `endScreenTitle` html: strong em del code a — Title
+ - `endScreenSubtitle` html: strong em del code a — Text
+ - `endScreenImage` image file — Image
+ - `endScreenScore` number = 0 — Score: The score will be sent to any LMS, LRS or any other connected service that receives scores from H5P for users who reach the default end scenario.
+ - `content` list 1+ of, required — List of branching scenario content
+ - `type` sub-content: H5P.BranchingQuestion | H5P.CoursePresentation | H5P.AdvancedText | H5P.Image | H5P.ImageHotspots | H5P.InteractiveVideo | H5P.Video, required
+ - `showContentTitle` boolean — Show content title in view
+ - `proceedButtonText` text = "Proceed" — Text for the proceed button (max length: 50 characters)
+ - `forceContentFinished` one of "useBehavioural" | "enabled" | "disabled" = "useBehavioural" — Override require content finished: Override the individual settings for requiring the content to be finished before activating the "Proceed" button. Will not have any effect if the content doesn't …
+ - `nextContentId` number, required, hidden in the editor
+ - `feedback` group — Feedback
+ - `title` html: strong em del code a — Feedback title
+ - `subtitle` html: strong em del code a — Feedback text
+ - `image` image file — Feedback image
+ - `endScreenScore` number — Score for this scenario: The score will be sent to any LMS, LRS or any other connected service that receives scores from H5P for users who reach this scenario
+ - `contentBehaviour` one of "useBehavioural" | "enabled" | "disabled" = "useBehavioural" — Navigate back: This will allow user to go back and see the previous content/question in the scenario.
+ - `scoringOptionGroup` group — Scoring options
+ - `scoringOption` one of "static-end-score" | "dynamic-score" | "no-score" = "no-score" — Scoring options: Select type of scoring.
+ - `includeInteractionsScores` boolean = true; only when scoringOption is "dynamic-score" — Include scores from interactions within the Branching Scenario
+ - `behaviour` group — Behavioural settings
+ - `enableBackwardsNavigation` boolean = false — Navigate back
+ - `forceContentFinished` boolean = false — Required to watch
+ - `randomizeBranchingQuestions` boolean = false — Randomize Branching Questions
+
+7 interface texts are left out: they come from the libraries' translations. `h5p-author schema H5P.BranchingScenario --all` lists them, for a source to set one.
+
+
diff --git a/skills/h5p-author/references/types/H5P.Column.md b/skills/h5p-author/references/types/H5P.Column.md
new file mode 100644
index 00000000..6097d578
--- /dev/null
+++ b/skills/h5p-author/references/types/H5P.Column.md
@@ -0,0 +1,33 @@
+# Column (H5P.Column)
+
+A page of content one below another: text, pictures, video and questions, in the order written. Called "Page" in the editor.
+
+- Each item of `content` is `{ "content": { "library": "…", "params": { … } } }`, sub-content of any library the Fields section lists. Write each from its type file: H5P.AdvancedText, H5P.Image and H5P.Video have files of their own.
+- `useSeparator` draws a line between items: `"auto"`, `"enabled"` or `"disabled"`.
+
+## Example
+
+```json
+{
+ "type": "H5P.Column",
+ "params": {
+ "content": [
+ { "content": { "library": "H5P.AdvancedText", "params": { "text": "The water cycleRain falls, rivers carry it to the sea, and the sun lifts it again. " } } },
+ { "content": { "library": "H5P.Image", "params": { "file": { "path": "cycle.png" }, "alt": "Rain, a river and the sea" } } },
+ { "content": { "library": "H5P.TrueFalse", "metadata": { "title": "Rivers and the sea" }, "params": { "question": "Rivers carry water to the sea.", "correct": "true" } } }
+ ]
+ }
+}
+```
+
+
+
+## Fields of H5P.Column 1.22
+
+- `content` list 1+ of, required — List of Column Content
+ - `content` sub-content: H5P.Accordion | H5P.Agamotto | H5P.Audio | H5P.AudioRecorder | H5P.Blanks | H5P.Chart | H5P.Collage | H5P.CoursePresentation | H5P.Dialogcards | H5P.DocumentationTool | H5P.DragQuestion | H5P.DragText | H5P.Essay | H5P.GuessTheAnswer | H5P.Table | H5P.AdvancedText | H5P.IFrameEmbed | H5P.Image | H5P.ImageHotspots | H5P.ImageHotspotQuestion | H5P.ImageSlider | H5P.InteractiveVideo | H5P.Link | H5P.MarkTheWords | H5P.MemoryGame | H5P.MultiChoice | H5P.Questionnaire | H5P.QuestionSet | H5P.Row | H5P.SingleChoiceSet | H5P.Summary | H5P.Timeline | H5P.TrueFalse | H5P.Video | H5P.MultiMediaChoice, required — Content
+ - `useSeparator` one of "auto" | "disabled" | "enabled" = "auto" — Separate content with a horizontal ruler
+
+It has no interface texts of its own.
+
+
diff --git a/skills/h5p-author/references/types/H5P.CoursePresentation.md b/skills/h5p-author/references/types/H5P.CoursePresentation.md
new file mode 100644
index 00000000..5a9b158e
--- /dev/null
+++ b/skills/h5p-author/references/types/H5P.CoursePresentation.md
@@ -0,0 +1,91 @@
+# Course Presentation (H5P.CoursePresentation)
+
+Slides with text, pictures, video and questions; a summary slide with the score follows when there are questions.
+
+- `presentation.slides` is the list of slides; each slide's `elements` are sub-content under `action`: `{ "action": { "library": "H5P.AdvancedText", "params": { … } } }`.
+- Leave out `x`, `y`, `width` and `height` and the build stacks a slide's elements top to bottom: text as tall as its lines, pictures in shape, a question in what is left. It notes a slide that holds too much; split it, or show its question as a button (`"displayAsButton": true`). To place an element by hand, give all four, in percent of the slide's width and height from the top left.
+- A slide's `keywords` (`[{ "main": "…" }]`) name it in the outline.
+- The slide is 16:9; at most a short heading, a paragraph and a picture, or a question, fit one slide.
+
+## Example
+
+```json
+{
+ "type": "H5P.CoursePresentation",
+ "params": {
+ "presentation": {
+ "slides": [
+ {
+ "elements": [
+ { "action": { "library": "H5P.AdvancedText", "params": { "text": "Rivers of EuropeThe Volga is the longest, at about 3,530 km. " } } },
+ { "action": { "library": "H5P.Image", "params": { "file": { "path": "map.png" }, "alt": "A map of Europe's rivers" } } }
+ ],
+ "keywords": [{ "main": "Rivers of Europe" }]
+ },
+ {
+ "elements": [
+ { "action": { "library": "H5P.MultiChoice", "params": { "question": "Which river is the longest in Europe?", "answers": [{ "text": "Volga", "correct": true }, { "text": "Danube", "correct": false }] } } }
+ ],
+ "keywords": [{ "main": "Question" }]
+ }
+ ]
+ }
+ }
+}
+```
+
+
+
+## Fields of H5P.CoursePresentation 1.27
+
+- `presentation` group
+ - `slides` list of
+ - `elements` list of
+ - `action` sub-content: H5P.AdvancedText | H5P.Link | H5P.Image | H5P.Shape | H5P.Video | H5P.Audio | H5P.Blanks | H5P.SingleChoiceSet | H5P.MultiChoice | H5P.TrueFalse | H5P.DragQuestion | H5P.Summary | H5P.DragText | H5P.MarkTheWords | H5P.Dialogcards | H5P.ContinuousText | H5P.ExportableTextArea | H5P.Table | H5P.InteractiveVideo | H5P.TwitterUserFeed | H5P.AudioRecorder | H5P.MultiMediaChoice
+ - `solution` html: strong em del a ul ol h2 h3 hr pre code — Comments: The comments are shown when the user displays the suggested answers for all slides.
+ - `alwaysDisplayComments` boolean — Always display comments
+ - `backgroundOpacity` number 0–100 = 0 — Background Opacity
+ - `displayAsButton` boolean = false — Display as button
+ - `buttonLabel` text — Optional button label
+ - `buttonSize` one of "small" | "big" = "big" — Button size
+ - `title` text — Title
+ - `goToSlideType` one of "specified" | "next" | "previous" = "specified" — Go to
+ - `goToSlide` number 1– — Specific slide number: Only applicable when 'Specific slide number' is selected
+ - `invisible` boolean = false — Invisible
+ - `keywords` list of
+ - `main` text
+ - `subs` list of text
+ - `slideBackgroundSelector` group
+ - `imageSlideBackground` image file — Image
+ - `fillSlideBackground` text — Pick a color
+ - `keywordListEnabled` boolean = true — Keyword list
+ - `keywordListAlwaysShow` boolean = false — Always show
+ - `keywordListAutoHide` boolean = false — Auto hide
+ - `keywordListOpacity` number 0–100 = 100 — Opacity
+ - `globalBackgroundSelector` group
+ - `imageGlobalBackground` image file — Image
+ - `fillGlobalBackground` text — Pick a color
+- `override` group — Behaviour settings.
+ - `activeSurface` boolean = false — Activate Active Surface Mode
+ - `hideSummarySlide` boolean = false — Hide Summary Slide
+ - `showSolutionButton` one of "on" | "off" — Override "Show Solution" button: This option determines if the "Show Solution" button will be configured for each question individually (default) shown for all questions (Enabled) or disabled for a…
+ - `retryButton` one of "on" | "off" — Override "Retry" button: This option determines if the "Retry" button will be configured for each question individually (default) shown for all questions (Enabled) or disabled for all questions (Di…
+ - `summarySlideSolutionButton` boolean = true; only when hideSummarySlide is false — Show "Show solution" button in the summary slide
+ - `summarySlideRetryButton` boolean = true; only when hideSummarySlide is false — Show "Retry" button in the summary slide
+ - `enablePrintButton` boolean = false — Enable print button
+ - `social` group; only when hideSummarySlide is false — Social Settings
+ - `showFacebookShare` boolean = false — Display Facebook share icon
+ - `facebookShare` group; only when showFacebookShare is true — Facebook share settings
+ - `url` text = "@currentpageurl" — Share to Facebook link
+ - `quote` text = "I scored @score out of @maxScore on a task a… — Share to Facebook quote
+ - `showTwitterShare` boolean = false — Display Twitter share icon
+ - `twitterShare` group; only when showTwitterShare is true — Twitter share settings
+ - `statement` text = "I scored @score out of @maxScore on a task a… — Share to Twitter statement
+ - `url` text = "@currentpageurl" — Share to Twitter link
+ - `hashtags` text = "h5p, course" — Share to Twitter hashtags
+ - `showGoogleShare` boolean = false — Display Google+ share icon
+ - `googleShareUrl` text = "@currentpageurl"; only when showGoogleShare is true — Share to Google link
+
+53 interface texts are left out: they come from the libraries' translations. `h5p-author schema H5P.CoursePresentation --all` lists them, for a source to set one.
+
+
diff --git a/skills/h5p-author/references/types/H5P.Dialogcards.md b/skills/h5p-author/references/types/H5P.Dialogcards.md
new file mode 100644
index 00000000..5792cf29
--- /dev/null
+++ b/skills/h5p-author/references/types/H5P.Dialogcards.md
@@ -0,0 +1,49 @@
+# Dialog Cards (H5P.Dialogcards)
+
+Flash cards: a prompt on the front, the answer on the back, turned by the learner. Not scored.
+
+- Each item of `dialogs` is a card: `text` on the front, `answer` on the back, optionally an `image` with its `imageAltText`, an `audio` track and `tips`.
+- `mode: "repetition"` brings back the cards a learner got wrong, until they know them all.
+
+## Example
+
+```json
+{
+ "type": "H5P.Dialogcards",
+ "params": {
+ "title": "Rivers in German",
+ "dialogs": [
+ { "text": "the river", "answer": "der Fluss", "image": { "path": "river.png" }, "imageAltText": "A river between hills" },
+ { "text": "the bridge", "answer": "die Brücke", "tips": { "front": "It crosses the river." } }
+ ]
+ }
+}
+```
+
+
+
+## Fields of H5P.Dialogcards 1.9
+
+- `title` html: strong em code — Heading
+- `mode` one of "normal" | "repetition" = "normal" — Mode: Mode of presenting the dialog cards
+- `description` html: strong em code — Task description
+- `dialogs` list 1+ of, required — Dialogs
+ - `text` html: strong em code = "" — Text: Hint for the first part of the dialogue
+ - `answer` html: strong em code = "" — Answer: Hint for the second part of the dialogue
+ - `image` image file — Image
+ - `imageAltText` text — Alternative text for the image
+ - `audio` audio files — Audio files
+ - `tips` group — Tips
+ - `front` text — Tip for text: Tip for the first part of the dialogue
+ - `back` text — Tip for answer: Tip for the second part of the dialogue
+- `behaviour` group — Behavioural settings
+ - `enableRetry` boolean = true — Enable "Retry" button
+ - `disableBackwardsNavigation` boolean = false; only when mode is "normal" — Disable backwards navigation
+ - `scaleTextNotCard` boolean = false — Scale the text to fit inside the card
+ - `randomCards` boolean = false; only when mode is "normal" — Randomize cards
+ - `maxProficiency` number 3–7 = 5; only when mode is "repetition" — Maximum proficiency level
+ - `quickProgression` boolean = false; only when mode is "repetition" — Allow quick progression
+
+28 interface texts are left out: they come from the libraries' translations. `h5p-author schema H5P.Dialogcards --all` lists them, for a source to set one.
+
+
diff --git a/skills/h5p-author/references/types/H5P.Dictation.md b/skills/h5p-author/references/types/H5P.Dictation.md
new file mode 100644
index 00000000..36ed0a66
--- /dev/null
+++ b/skills/h5p-author/references/types/H5P.Dictation.md
@@ -0,0 +1,64 @@
+# Dictation (H5P.Dictation)
+
+The learner hears sentences and types them; the content compares what was typed word by word.
+
+- Each item of `sentences` is a recording, `sample`, and the `text` it says. A slower recording can go in `sampleAlternative`.
+- Alternative spellings of a word: `colour|color`.
+- `behaviour.tries` limits how often a recording plays.
+
+## Example
+
+```json
+{
+ "type": "H5P.Dictation",
+ "params": {
+ "taskDescription": "Listen, then write what you hear.",
+ "sentences": [
+ { "sample": [{ "path": "sentence1.mp3" }], "text": "The river flows to the sea." },
+ { "sample": [{ "path": "sentence2.mp3" }], "text": "The bridge is old." }
+ ]
+ }
+}
+```
+
+
+
+## Fields of H5P.Dictation 1.3
+
+- `media` group — Media
+ - `type` sub-content: H5P.Image | H5P.Video | H5P.Audio — Type: Optional media to display above the question.
+ - `disableImageZooming` boolean = false; only when type is "H5P.Image 1.1" — Disable image zooming
+- `taskDescription` html: strong em u a ul ol h2 h3 hr pre code, required — Task description: Describe your task here.
+- `sentences` list 1+ of, required — Sentences
+ - `description` text — Description: You can optionally put a simple description above the text input field, useful e.g. for dialogues.
+ - `sample` audio files, required — Sound sample
+ - `sampleAlternative` audio files — Sound sample slow
+ - `text` text, required — Text: Text that should be written. You can add alternate spellings to a word by adding a vertical line (|) behind followed by an alternative.
+- `overallFeedback` list 1+ of — Overall Feedback: Click the "Add range" button to add as many ranges as you need. Example: 0-20% Bad score, 21-91% Average Score, 91-100% Great Score!
+ - `from` whole number 0–100 = 0 — Score Range
+ - `to` whole number 0–100 = 100
+ - `feedback` text — Feedback for defined score range
+- `behaviour` group — Behavioural settings
+ - `tries` whole number 1– — Maximum tries: Will limit the number of times the samples for each sentence can be listened to.
+ - `triesAlternative` whole number 1– — Maximum tries for slow speed: Will limit the number of times the slow samples for each sentence can be listened to.
+ - `disablePause` boolean = false — Disable pause option
+ - `playButtonDelay` whole number 0–3 — Play button delay: Optionally set a time period of up to three seconds that playing a button should be delayed. This is useful if you want to allow students to enter the text field before they star…
+ - `shuffleSentences` one of "never" | "once" | "onRetry" = "never" — Shuffle sentences: Define when the sentences should be shuffled.
+ - `scoring` group — Scoring
+ - `ignorePunctuation` boolean = true — Ignore Punctuation marks
+ - `zeroMistakeMode` boolean = false — Zero mistakes mode
+ - `typoFactor` one of "100" | "50" | "0" = "100" — Value of typos: Determine to which extent typing errors (word with 3-9 characters: up to 1 mistake, word with more than 9 characters: up to 2 mistakes) count as a real mistake.
+ - `textual` group — Text
+ - `wordSeparator` text = " " — Word separator: Define the separator of words different than space character to support alternate solutions with different number of words.
+ - `overrideRTL` one of "auto" | "on" | "off" = "auto" — Writing direction: Set whether the sentences' language is right-to-left or left-to-right.
+ - `autosplit` boolean = true — Splitting of characters
+ - `feedbackPresentation` group — Presentation of feedback
+ - `customTypoDisplay` boolean = false — Custom typo display
+ - `alternateSolution` one of "first" | "all" = "first" — Presentation of alternate solutions: Define which alternatives should be presented for wrong or missing words in the solution.
+ - `enableRetry` boolean = true — Enable "Retry"
+ - `enableSolutionsButton` boolean = true — Enable "Show solution" button
+ - `enableSolutionOnCheck` boolean = false; only when enableSolutionsButton is true — Show solution on check
+
+40 interface texts are left out: they come from the libraries' translations. `h5p-author schema H5P.Dictation --all` lists them, for a source to set one.
+
+
diff --git a/skills/h5p-author/references/types/H5P.DragText.md b/skills/h5p-author/references/types/H5P.DragText.md
new file mode 100644
index 00000000..4116fc33
--- /dev/null
+++ b/skills/h5p-author/references/types/H5P.DragText.md
@@ -0,0 +1,44 @@
+# Drag the Words (H5P.DragText)
+
+Text with gaps the learner fills by dragging words from a list. Easier than typing them: recognition, not recall.
+
+- `textField` is plain text with the words to drag marked `*word*`; a tip after `:`, feedback after `\+` (right) and `\-` (wrong), as the Fields section shows.
+- Each gap has one right word. Line breaks in `textField` are kept.
+- `distractors` adds wrong words to the list, in the same `*word*` form.
+
+## Example
+
+```json
+{
+ "type": "H5P.DragText",
+ "params": {
+ "taskDescription": "Drag each river to the city it flows through.",
+ "textField": "Vienna lies on the *Danube*.\nLondon lies on the *Thames*.\nParis lies on the *Seine*.",
+ "distractors": "*Rhine* *Volga*"
+ }
+}
+```
+
+
+
+## Fields of H5P.DragText 1.10
+
+- `media` group — Media
+ - `type` sub-content: H5P.Image | H5P.Video | H5P.Audio — Type: Optional media to display above the question.
+ - `disableImageZooming` boolean = false; only when type is "H5P.Image 1.1" — Disable image zooming
+- `taskDescription` html: strong em u a ul ol h2 h3 hr pre code = "Drag the words into the correct boxes" — Task description: Describe how the user should solve the task.
+- `textField` text, multi-line, required — Text
+ Droppable words are added with an asterisk (*) in front and behind the correct word/phrase. You may add a textual tip, using a colon (:) in front of the tip. For every empty spot there is only one correct word. You may add feedback to be displayed when a task is completed. Use '\+' for correct and '\-' for incorrect feedback. Example: H5P content may be edited using a *browser:What type of program is Chrome?*. H5P content is *interactive\+Correct! \-Incorrect, try again!*
+- `distractors` text — Distractors: Enter extra solutions that are wrong as distractors. Use the same asterisk (*) scheme as for the text.
+- `overallFeedback` list 1+ of — Overall Feedback: Click the "Add range" button to add as many ranges as you need. Example: 0-20% Bad score, 21-91% Average Score, 91-100% Great Score!
+ - `from` whole number 0–100 = 0 — Score Range
+ - `to` whole number 0–100 = 100
+ - `feedback` text — Feedback for defined score range
+- `behaviour` group — Behavioural settings.
+ - `enableRetry` boolean = true — Enable "Retry"
+ - `enableSolutionsButton` boolean = true — Enable "Show Solution" button
+ - `instantFeedback` boolean = false — Instant feedback
+
+21 interface texts are left out: they come from the libraries' translations. `h5p-author schema H5P.DragText --all` lists them, for a source to set one.
+
+
diff --git a/skills/h5p-author/references/types/H5P.Essay.md b/skills/h5p-author/references/types/H5P.Essay.md
new file mode 100644
index 00000000..f2b5747d
--- /dev/null
+++ b/skills/h5p-author/references/types/H5P.Essay.md
@@ -0,0 +1,69 @@
+# Essay (H5P.Essay)
+
+The learner writes a text, scored by the keywords it contains, with feedback per keyword and a sample answer to compare.
+
+- Each item of `keywords` is a word or phrase to look for, with its `alternatives`, and `options` for its points and feedback. `*` matches any characters; `/…/` is a regular expression.
+- A sample solution: `solution.sample`, shown after the learner submits.
+- `behaviour.minimumLength` and `behaviour.maximumLength` bound the answer in characters.
+- Keyword scoring cannot judge an argument: say so to the user, and keep the essay's weight low where it counts.
+
+## Example
+
+```json
+{
+ "type": "H5P.Essay",
+ "params": {
+ "taskDescription": "In two or three sentences, explain how a river reaches the sea.",
+ "keywords": [
+ { "keyword": "downhill", "alternatives": ["down hill", "gravity"], "options": { "points": 1, "feedbackMissed": "Say what makes the water move." } },
+ { "keyword": "sea", "options": { "points": 1, "feedbackMissed": "Say where the river ends." } }
+ ],
+ "solution": { "sample": "Water flows downhill under gravity, gathering into streams and then a river, which ends in the sea." }
+ }
+}
+```
+
+
+
+## Fields of H5P.Essay 1.5
+
+- `media` group — Media
+ - `type` sub-content: H5P.Image | H5P.Video | H5P.Audio — Type: Optional media to display above the question.
+ - `disableImageZooming` boolean = false; only when type is "H5P.Image 1.1" — Disable image zooming
+- `taskDescription` html: strong em u a ul ol h2 h3 hr pre code, required — Task description: Describe your task here. The task description will appear above text input area.
+- `placeholderText` text — Help text: This text should help the user to get started.
+- `solution` group — Sample solution
+ - `introduction` html: strong em u a ul ol hr code — Introduction: You can optionally leave the students some explanations about your example. The explanation will only show up if you add an example, too.
+ - `sample` html: strong a — Sample solution text: The student will see a "Show solution" button after submitting if you provide some text here.
+- `keywords` list 1+ of, required — Keywords
+ - `keyword` text, required — Keyword: Keyword or phrase to look for. Use an asterisk '*' as a wildcard for one or more characters. Use a slash '/' at the beginning and the end to use a regular expression.
+ - `alternatives` list of text — Variations: Add optional variations for this keyword. Example: For a 'city' add alternatives 'town', 'municipality' etc. Points will be awarded if the user includes any of the specified alternatives.
+ - `options` group — Points, Options and Feedback
+ - `points` whole number 0– = 1 — Points: Points that the user will get if he/she includes this keyword or its alternatives in the answer.
+ - `occurrences` whole number 1– = 1 — Occurrences: Define how many occurrences of the keyword or its variations should be awarded with points.
+ - `caseSensitive` boolean = true — Case sensitive
+ - `forgiveMistakes` boolean — Forgive minor mistakes
+ - `feedbackIncluded` text — Feedback if keyword included: This feedback will be displayed if the user includes this keyword or its alternatives in the answer.
+ - `feedbackMissed` text — Feedback if keyword missing: This feedback will be displayed if the user doesn’t include this keyword or its alternatives in the answer.
+ - `feedbackIncludedWord` one of "keyword" | "alternative" | "answer" | "none" = "keyword" — Feedback word shown if keyword included: This option allows you to specify which word should be shown in front of your feedback if a keyword was found in the text.
+ - `feedbackMissedWord` one of "keyword" | "none" = "none" — Feedback word shown if keyword missing: This option allows you to specify which word should be shown in front of your feedback if a keyword was not found in the text.
+- `overallFeedback` list 1+ of — Overall Feedback: Click the "Add range" button to add as many ranges as you need. Example: 0-20% Bad score, 21-91% Average Score, 91-100% Great Score!
+ - `from` whole number 0–100 = 0 — Score Range
+ - `to` whole number 0–100 = 100
+ - `feedback` text — Feedback for defined score range
+- `behaviour` group — Behavioural settings
+ - `minimumLength` whole number 0– — Minimum number of characters: Specify the minimum number of characters that the user must enter.
+ - `maximumLength` whole number 0– — Maximum number of characters: Specify the maximum number of characters that the user can enter.
+ - `inputFieldSize` one of "1" | "3" | "10" = "10" — Input field size: The size of the input field in amount of lines it will cover
+ - `enableRetry` boolean = true — Enable "Retry"
+ - `ignoreScoring` boolean = false — Ignore scoring
+ - `pointsHost` number 0– = 1; only when ignoreScoring is true — Points in host environment: Used to award points in host environment merely for answering (not shown to learner).
+ - `percentagePassing` number 0–100; only when ignoreScoring is false — Passing percentage: Percentage that's necessary for passing
+ - `percentageMastering` number 0–100; only when ignoreScoring is false — Mastering percentage: Percentage that's necessary for mastering. Setting the mastering percentage below 100 % will lower the maximum possible score accordingly. It's intended to give some leeway to…
+ - `overrideCaseSensitive` one of "on" | "off" — Override case sensitive: This option determines if the "Case sensitive" option will be activated for all keywords.
+ - `overrideForgiveMistakes` one of "on" | "off" — Override forgive mistakes: This option determines if the "Forgive mistakes" option will be activated for all keywords.
+ - `linebreakReplacement` one of " " | "\n" = " " — Replacement for line breaks: By default, line breaks will be replaced with a space character. If you want to check for line breaks, e.g. in regular expressions, you can set a different replacement …
+
+14 interface texts are left out: they come from the libraries' translations. `h5p-author schema H5P.Essay --all` lists them, for a source to set one.
+
+
diff --git a/skills/h5p-author/references/types/H5P.GameMap.md b/skills/h5p-author/references/types/H5P.GameMap.md
new file mode 100644
index 00000000..20f7e3fe
--- /dev/null
+++ b/skills/h5p-author/references/types/H5P.GameMap.md
@@ -0,0 +1,160 @@
+# Game Map (H5P.GameMap)
+
+A map with stages, each holding exercises; finishing a stage opens the stages joined to it.
+
+- `gamemapSteps.backgroundImageSettings.backgroundImage` is the map.
+- Each item of `gamemapSteps.gamemap.elements` is a stage: a `label`, its exercises under `contentsList` (`[{ "contentType": { "library": "…", "params": { … } } }]`), its `neighbors` named by label, and `telemetry.x` and `telemetry.y`, its place in percent of the map from the top left. The build joins neighbours both ways, sets the ids the map keeps, and spreads out stages written without a place.
+- At least one stage has `canBeStartStage: true`.
+- `behaviour.lives` and `behaviour.timeLimitGlobal` make it a game; leave them out for a plain path.
+
+## Example
+
+```json
+{
+ "type": "H5P.GameMap",
+ "params": {
+ "gamemapSteps": {
+ "backgroundImageSettings": { "backgroundImage": { "path": "valley.png" } },
+ "gamemap": {
+ "elements": [
+ {
+ "label": "Source",
+ "canBeStartStage": true,
+ "telemetry": { "x": 15, "y": 20 },
+ "neighbors": ["Mouth"],
+ "contentsList": [{ "contentType": { "library": "H5P.TrueFalse", "params": { "question": "A river can begin at a glacier.", "correct": "true" } } }]
+ },
+ {
+ "label": "Mouth",
+ "telemetry": { "x": 75, "y": 70 },
+ "contentsList": [{ "contentType": { "library": "H5P.MultiChoice", "params": { "question": "Where does a river end?", "answers": [{ "text": "In a sea or a lake", "correct": true }, { "text": "In the mountains", "correct": false }] } } }]
+ }
+ ]
+ }
+ }
+ }
+}
+```
+
+
+
+## Fields of H5P.GameMap 1.5
+
+- `showTitleScreen` boolean = false — Show title screen
+- `titleScreen` group — Title screen
+ - `titleScreenIntroduction` html: sub sup strong em code u del a ul ol hr pre code = "" — Introduction
+ - `titleScreenMedium` sub-content: H5P.Image | H5P.Video — Title screen media
+- `headline` text — Headline: Optional headline for the titlebar.
+- `gamemapSteps` group — Game map editor
+ - `backgroundImageSettings` group — Background
+ - `backgroundImage` image file — Background image
+ - `backgroundColor` text = "rgb(255, 255, 255)" — Background color: Choose a color to use as the background of the game map.
+ - `gamemap` group — Game map
+ - `elements` list of — Elements
+ - `label` text, required — Stage label: This label will be displayed on top of your exercise and will help you to connect different stages with one another.
+ - `canBeStartStage` boolean = false — User can start here
+ - `time` group — Time limit
+ - `timeLimit` number 1– — Time limit: Optional time limit in seconds. If a user exceeds this time, the exercise will close, be reset, and the user will loose a life if lives are limited.
+ - `timeoutWarning` number 1– — Timeout warning time: Optionally set when a timeout warning audio should be played (number of remaining seconds). An audio needs to be set in the audio settings.
+ - `accessRestrictions` group — Access restrictions
+ - `allOrAnyRestrictionSet` one of "all" | "any" = "all" — All or any restriction set: Choose if all or any of the following restrictions need to be met.
+ - `restrictionSetList` list of — Restriction sets
+ - `allOrAnyRestriction` one of "all" | "any" = "any" — All or any restriction: Choose if all or any of the following restrictions need to be met.
+ - `restrictionList` list of — Restrictions
+ - `restrictionType` one of "totalScore" | "stageScore" | "stageProgress" | "time" = "totalScore" — Restriction type
+ - `totalScoreGroup` group — Total score
+ - `totalScoreOperator` one of "lessThan" | "equalTo" | "notEqualTo" | "greaterThan" = "greaterThan" — Operator for total score
+ - `totalScoreValue` number — Value of total score to compare to
+ - `stageScoreGroup` group — Stage score
+ - `stageScoreId` value — Stage to get score from
+ - `stageScoreOperator` one of "lessThan" | "equalTo" | "notEqualTo" | "greaterThan" = "before" — Operator for stage score
+ - `stageScoreValue` number — Score score to compare to
+ - `stageProgressGroup` group — Stage progress
+ - `stageProgressId` value — Stage to get progress from
+ - `stageProgressOperator` one of "is" | "isNot" = "is" — Operator for stage progress
+ - `stageProgressValue` one of "unstarted" | "opened" | "completed" | "cleared" = "open" — Progress to compare to
+ - `timeGroup` group — Time
+ - `timeOperator` one of "before" | "is" | "is not" | "after" = "before" — Operator for time
+ - `timeValue` text — Time to compare to
+ - `contentsList` list 1+ of, required — Contents
+ - `contentType` sub-content: H5P.Accordion | H5P.Agamotto | H5P.Audio | H5P.AudioRecorder | H5P.CoursePresentation | H5P.Crossword | H5P.Dialogcards | H5P.DragQuestion | H5P.DragText | H5P.Essay | H5P.Blanks | H5P.ImageHotspotQuestion | H5P.Image | H5P.MultiMediaChoice | H5P.ImageHotspots | H5P.ImageSlider | H5P.InteractiveVideo | H5P.MarkTheWords | H5P.MemoryGame | H5P.MultiChoice | H5P.QuestionSet | H5P.SingleChoiceSet | H5P.AdvancedText | H5P.TrueFalse | H5P.Video, required — Stage content: Choose the type of content you would like to add.
+ - `specialStageType` one of "finish" | "extra-life" | "extra-time" | "link", required — Special stage type
+ - `specialStageExtraLives` number 1– = 1 — Number of extra lives: Set how many lives the user will get when entering this stage.
+ - `specialStageExtraTime` number 1– = 1 — Number of seconds of extra time: Set how many seconds the user will gain for the global time limit when entering this stage.
+ - `specialStageLinkURL` text, required — URL to link to: Set where the user should be sent to when opening this stage.
+ - `specialStageLinkTarget` one of "_blank" | "_parent" = "_blank" — Place to open link in
+ - `alwaysVisible` boolean = false — Always visible
+ - `overrideSymbol` boolean = false — Override lock symbol
+ - `neighbors` list of values, required — Connected stages
+ - `telemetry` group, hidden in the editor — Telemetry
+ - `x` text, required
+ - `y` text, required
+ - `height` text, required
+ - `width` text, required
+ - `paths` list of — Paths
+ - `visualsType` one of "global" | "custom" = "global" — Visual settings
+ - `customVisuals` group — Custom visual settings
+ - `colorPath` text = "rgba(0, 0, 0, 0.7)" — Color path
+ - `pathWidth` one of "0.1" | "0.2" | "0.3" = "0.2" — Path width
+ - `pathStyle` one of "solid" | "dotted" | "dashed" | "double" = "dotted" — Path style
+- `endScreen` group — End screen
+ - `noSuccess` group — User not successful
+ - `endScreenTextNoSuccess` html: sub sup strong em code u del a ul ol hr pre code = "" — Message (user not successful)
+ - `endScreenMediumNoSuccess` sub-content: H5P.Image | H5P.Video — End screen media (user not successful)
+ - `success` group — User successful
+ - `endScreenTextSuccess` html: sub sup strong em code u del a ul ol hr pre code = "" — Message (user successful)
+ - `endScreenMediumSuccess` sub-content: H5P.Image | H5P.Video — End screen media (user successful)
+ - `overallFeedback` list 1+ of — Overall Feedback: Click the "Add range" button to add as many ranges as you need. Example: 0-20% Bad score, 21-91% Average Score, 91-100% Great Score!
+ - `from` whole number 0–100 = 0 — Score Range
+ - `to` whole number 0–100 = 100
+ - `feedback` text — Feedback for defined score range
+- `visual` group — Visual settings
+ - `stages` group — Stages
+ - `colorStage` text = "rgba(250, 223, 10, 0.7)" — Color not visited stage
+ - `colorStageLocked` text = "rgba(153, 0, 0, 0.7)" — Color locked stage
+ - `colorStageCleared` text = "rgba(0, 130, 0, 0.7)" — Color cleared stage
+ - `showScoreStars` one of "never" | "onHover" | "always" = "never" — Show stars for scores: Choose if and when stars will be displayed on the map for the scores of the stages. Please note that stages without scored exercises will not get the stars.
+ - `paths` group — Paths
+ - `displayPaths` boolean = true — Display paths
+ - `style` group — Style
+ - `colorPath` text = "rgba(0, 0, 0, 0.7)" — Color path
+ - `colorPathCleared` text = "rgba(0, 130, 0, 0.7)" — Color path cleared
+ - `pathWidth` one of "0.1" | "0.2" | "0.3" = "0.2" — Path width
+ - `pathStyle` one of "solid" | "dotted" | "dashed" | "double" = "dotted" — Path style
+ - `misc` group — Miscellaneous
+ - `useAnimation` boolean = true — Animate map
+- `audio` group — Audio settings
+ - `backgroundMusic` group — Background music
+ - `music` audio files — Background music
+ - `muteDuringExercise` boolean = true — Mute when taking exercises
+ - `ambient` group — Events
+ - `clickStageLocked` audio files — Click on locked stage
+ - `checkExerciseNotFullScore` audio files — Check exercise (not full score)
+ - `checkExerciseFullScore` audio files — Check exercise (full score)
+ - `unlockStage` audio files — Unlocking a stage
+ - `openExercise` audio files — Open exercise
+ - `closeExercise` audio files — Close exercise
+ - `showDialog` audio files — Show dialog
+ - `fullScore` audio files — Full score
+ - `lostLife` audio files — Lost a life
+ - `gainedLife` audio files — Gained life
+ - `gameOver` audio files — Game over
+ - `extraTime` audio files — Gained extra time
+ - `timeoutWarning` audio files — Timeout warning
+ - `endscreenNoSuccess` audio files — End screen (not full score)
+ - `endscreenSuccess` audio files — End screen (full score)
+- `behaviour` group — Behavioural settings
+ - `lives` whole number 1– — Lives: Set the number of lives for a user or leave empty for unlimited lives. Users will lose a life when they do not get full score and they cannot continue once all lives are lost.
+ - `timeLimitGlobal` whole number 1– — Global time limit: Optional time limit in seconds for the whole game. If a user exceeds this time, the game will be over immediately.
+ - `timeoutWarningGlobal` whole number 1– — Timeout warning time: Optionally set when a timeout warning audio should be played (number of remaining seconds). An audio needs to be set in the audio settings.
+ - `finishScore` whole number 0– — Finish score: Optional score that can be lower than the summed maximum score of all exercises, so users can receive full score without completing all exercises.
+ - `enableRetry` boolean = true — Enable "Retry" button
+ - `enableSolutionsButton` boolean = true — Enable "Show solutions" button
+ - `map` group — Map
+ - `showLabels` boolean = true — Show stage labels
+ - `roaming` one of "free" | "complete" | "success" = "free" — Roaming: Choose whether users can roam all stages freely, need to finish a stage to get access to that stage's neighbors, or need to pass a stage to get access to that stage's neigbors.
+ - `fog` one of "all" | "1" | "0" = "all" — Visibility range: Select how far the user can see ahead
+
+75 interface texts are left out: they come from the libraries' translations. `h5p-author schema H5P.GameMap --all` lists them, for a source to set one.
+
+
diff --git a/skills/h5p-author/references/types/H5P.Image.md b/skills/h5p-author/references/types/H5P.Image.md
new file mode 100644
index 00000000..f9ef9120
--- /dev/null
+++ b/skills/h5p-author/references/types/H5P.Image.md
@@ -0,0 +1,32 @@
+# Image (H5P.Image)
+
+A picture, a part other content holds: in a page, a book, a slide, a hotspot or an answer. Not a content type on its own.
+
+- `file` is the picture, a file beside the source (`.png`, `.jpg`, `.gif`) or a web address of one; the build reads its size.
+- `alt` is required: what the picture shows, for a learner who cannot see it. A picture that only decorates is `"decorative": true` instead.
+
+## Example
+
+```json
+{
+ "type": "H5P.Column",
+ "params": {
+ "content": [
+ { "content": { "library": "H5P.Image", "params": { "file": { "path": "delta.png", "copyright": { "license": "CC BY", "author": "Ann Author" } }, "alt": "A river delta seen from above" } } }
+ ]
+ }
+}
+```
+
+
+
+## Fields of H5P.Image 1.1
+
+- `file` image file, required — Image
+- `decorative` boolean = false — Decorative only
+- `alt` text, required; only when decorative is false — Alternative text: Required. If the browser can't load the image this text will be displayed instead. Also used by "text-to-speech" readers.
+- `title` text — Hover text: Optional. This text is displayed when the users hover their pointing device over the image.
+
+3 interface texts are left out: they come from the libraries' translations. `h5p-author schema H5P.Image --all` lists them, for a source to set one.
+
+
diff --git a/skills/h5p-author/references/types/H5P.ImageHotspotQuestion.md b/skills/h5p-author/references/types/H5P.ImageHotspotQuestion.md
new file mode 100644
index 00000000..ba24422b
--- /dev/null
+++ b/skills/h5p-author/references/types/H5P.ImageHotspotQuestion.md
@@ -0,0 +1,53 @@
+# Find the Hotspot (H5P.ImageHotspotQuestion)
+
+A picture in which the learner clicks the right area: a part of a diagram, a place on a map.
+
+- `imageHotspotQuestion.backgroundImageSettings` is the picture.
+- Each item of `imageHotspotQuestion.hotspotSettings.hotspot` is an area: `computedSettings` holds `x`, `y`, `width` and `height` in percent of the picture from its top left, and `figure`, `"rectangle"` or `"circle"`; `userSettings.correct` says whether it is the right one, and `userSettings.feedbackText` what a click on it says. At least one is correct.
+- `hotspotSettings.noneSelectedFeedback` is said for a click outside every area.
+
+## Example
+
+```json
+{
+ "type": "H5P.ImageHotspotQuestion",
+ "params": {
+ "imageHotspotQuestion": {
+ "backgroundImageSettings": { "path": "delta.png" },
+ "hotspotSettings": {
+ "taskDescription": "Click the river's mouth.",
+ "hotspot": [
+ { "computedSettings": { "x": 60, "y": 55, "width": 20, "height": 20, "figure": "circle" }, "userSettings": { "correct": true, "feedbackText": "Yes: here it meets the sea." } },
+ { "computedSettings": { "x": 10, "y": 10, "width": 25, "height": 25, "figure": "rectangle" }, "userSettings": { "correct": false, "feedbackText": "That is upstream." } }
+ ],
+ "noneSelectedFeedback": "Look where the river widens into the sea."
+ }
+ }
+ }
+}
+```
+
+
+
+## Fields of H5P.ImageHotspotQuestion 1.8
+
+- `imageHotspotQuestion` group — Image Hotspot Question Editor
+ - `backgroundImageSettings` image file, required — Background image
+ - `hotspotSettings` group — Hotspots
+ - `taskDescription` text — Task description: Instructions to the user.
+ - `hotspot` list of — Hotspot
+ - `userSettings` group — userSettings
+ - `correct` boolean — Correct
+ - `feedbackText` text — Feedback
+ - `computedSettings` group — computedSettings
+ - `x` number
+ - `y` number
+ - `width` number
+ - `height` number
+ - `figure` text
+ - `noneSelectedFeedback` text — Feedback if the user selects an empty spot:
+ - `showFeedbackAsPopup` boolean = true — Show feedback as a popup
+
+4 interface texts are left out: they come from the libraries' translations. `h5p-author schema H5P.ImageHotspotQuestion --all` lists them, for a source to set one.
+
+
diff --git a/skills/h5p-author/references/types/H5P.ImageHotspots.md b/skills/h5p-author/references/types/H5P.ImageHotspots.md
new file mode 100644
index 00000000..9ea76442
--- /dev/null
+++ b/skills/h5p-author/references/types/H5P.ImageHotspots.md
@@ -0,0 +1,50 @@
+# Image Hotspots (H5P.ImageHotspots)
+
+A picture with spots that open text, a picture, audio or video when clicked: a labelled diagram, a map to explore. Not scored.
+
+- `image` is the picture; `backgroundImageAltText` describes it.
+- Each item of `hotspots` sits at `position.x` and `position.y`, in percent of the picture's width and height from its top left. Look at the picture to place them; the preview shows where they landed.
+- A hotspot's `content` is a list of sub-content: H5P.Text, H5P.Image, H5P.Audio or H5P.Video. `header` titles its popup.
+
+## Example
+
+```json
+{
+ "type": "H5P.ImageHotspots",
+ "params": {
+ "image": { "path": "delta.png" },
+ "backgroundImageAltText": "A river delta seen from above",
+ "hotspots": [
+ { "position": { "x": 30, "y": 40 }, "header": "Main channel", "content": [{ "library": "H5P.Text", "params": { "text": "Most of the water flows here." } }] },
+ { "position": { "x": 70, "y": 65 }, "header": "Mouth", "content": [{ "library": "H5P.Text", "params": { "text": "Here the river meets the sea." } }] }
+ ]
+ }
+}
+```
+
+
+
+## Fields of H5P.ImageHotspots 1.11
+
+- `image` image file, required — Background image
+- `backgroundImageAltText` text — Alternative text for background image: If the browser can't load the image this text will be displayed instead. Also used by assistive technologies.
+- `globalIconType` one of "icon" | "image" | "numbers" = "icon" — Global hotspot Icon
+- `globalIcon` one of "plus" | "minus" | "times" | "check" | "question" | "info" | "exclamation" = "plus"; only when globalIconType is "icon" — Predefined icon: Using a predefined icon for the hotspots.
+- `globalIconImage` image file; only when globalIconType is "image" — Uploaded image
+- `globalColor` text = "#981d99"; only when globalIconType is "icon" or "numbers" — Hotspot color: The color of the hotspots
+- `hotspots` list 1+ of, required — Hotspots
+ - `position` group — Hotspot position
+ - `x` number, required
+ - `y` number, required
+ - `legacyPositioning` boolean
+ - `hotspotIconType` one of "default" | "icon" | "image" = "default" — Custom hotspot icon
+ - `hotspotIcon` one of "plus" | "minus" | "times" | "check" | "question" | "info" | "exclamation" = "plus"; only when hotspotIconType is "icon" — Predefined icon: Using a predefined icon for the hotspot.
+ - `hotspotIconImage` image file; only when hotspotIconType is "image" — Uploaded image
+ - `hotspotColor` text = "#981d99"; only when hotspotIconType is "icon" — Hotspot color: The color of the hotspot
+ - `alwaysFullscreen` boolean — Cover entire background image
+ - `header` text — Header: Optional header for the popup. This is used by assistive technologies.
+ - `content` list of sub-content: H5P.Text | H5P.Video | H5P.Image | H5P.Audio, required — Popup content
+
+3 interface texts are left out: they come from the libraries' translations. `h5p-author schema H5P.ImageHotspots --all` lists them, for a source to set one.
+
+
diff --git a/skills/h5p-author/references/types/H5P.ImagePair.md b/skills/h5p-author/references/types/H5P.ImagePair.md
new file mode 100644
index 00000000..8397479c
--- /dev/null
+++ b/skills/h5p-author/references/types/H5P.ImagePair.md
@@ -0,0 +1,37 @@
+# Image Pairing (H5P.ImagePair)
+
+Two columns of pictures; the learner drags each one on the left onto its match on the right.
+
+- Each item of `cards` is a pair: `image` with `imageAlt`, and `match` with `matchAlt`.
+- `behaviour` is one setting, whether to offer Retry: `true` or `false`.
+
+## Example
+
+```json
+{
+ "type": "H5P.ImagePair",
+ "params": {
+ "taskDescription": "Match each river to its city.",
+ "cards": [
+ { "image": { "path": "danube.png" }, "imageAlt": "The Danube", "match": { "path": "budapest.png" }, "matchAlt": "Budapest" },
+ { "image": { "path": "thames.png" }, "imageAlt": "The Thames", "match": { "path": "london.png" }, "matchAlt": "London" }
+ ]
+ }
+}
+```
+
+
+
+## Fields of H5P.ImagePair 1.4
+
+- `taskDescription` text = "Drag images from the left to match them with… — Task Description: A guide telling the user how to solve this task.
+- `cards` list 2–100 of, required — Cards
+ - `image` image file, required — Image
+ - `imageAlt` text, required — Alternative text for Image: Describe what can be seen in the photo. The text is read by text-to-speech tools needed by visually impaired users.
+ - `match` image file — Matching Image
+ - `matchAlt` text — Alternative text for Matching Image: Describe what can be seen in the photo. The text is read by text-to-speech tools needed by visually impaired users.
+- `behaviour` boolean = true — Behavioural settings
+
+4 interface texts are left out: they come from the libraries' translations. `h5p-author schema H5P.ImagePair --all` lists them, for a source to set one.
+
+
diff --git a/skills/h5p-author/references/types/H5P.ImageSequencing.md b/skills/h5p-author/references/types/H5P.ImageSequencing.md
new file mode 100644
index 00000000..3ae58cec
--- /dev/null
+++ b/skills/h5p-author/references/types/H5P.ImageSequencing.md
@@ -0,0 +1,40 @@
+# Image Sequencing (H5P.ImageSequencing)
+
+Pictures shown shuffled, which the learner puts in order: stages of a process, ages of a thing.
+
+- Write `sequenceImages` in the right order, at least three, each with `image` and `imageDescription`; the content shuffles them.
+
+## Example
+
+```json
+{
+ "type": "H5P.ImageSequencing",
+ "params": {
+ "taskDescription": "Put the river's course in order, from source to sea.",
+ "sequenceImages": [
+ { "image": { "path": "source.png" }, "imageDescription": "A spring in the mountains" },
+ { "image": { "path": "valley.png" }, "imageDescription": "A river in a valley" },
+ { "image": { "path": "delta.png" }, "imageDescription": "A delta at the sea" }
+ ]
+ }
+}
+```
+
+
+
+## Fields of H5P.ImageSequencing 1.1
+
+- `taskDescription` text = "Drag to arrange the images in the correct se… — Task Description: A guide telling the user how to solve this task.
+- `altTaskDescription` text = "Make the following list be ordered correctly… — Alternate Task Description: A guide intended for visually impaired users on how to solve this task.
+- `sequenceImages` list 3+ of, required — Images
+ - `image` image file, required — Image
+ - `imageDescription` text, required — Image Description: An image description for users who cannot recognize the image
+ - `audio` audio files — Audio files
+- `behaviour` group — Behavioural settings
+ - `enableSolution` boolean = true — Add a show solution button for the game
+ - `enableRetry` boolean = true — Add button for retrying when the game is over
+ - `enableResume` boolean = true — Add button for resuming from the current state
+
+11 interface texts are left out: they come from the libraries' translations. `h5p-author schema H5P.ImageSequencing --all` lists them, for a source to set one.
+
+
diff --git a/skills/h5p-author/references/types/H5P.InteractiveBook.md b/skills/h5p-author/references/types/H5P.InteractiveBook.md
new file mode 100644
index 00000000..795c68b4
--- /dev/null
+++ b/skills/h5p-author/references/types/H5P.InteractiveBook.md
@@ -0,0 +1,50 @@
+# Interactive Book (H5P.InteractiveBook)
+
+A book of chapters with a table of contents, each chapter a page of text, media and questions, and a summary of the learner's progress at the end.
+
+- Each item of `chapters` is a page, sub-content of H5P.Column: `{ "library": "H5P.Column", "metadata": { "title": "…" }, "params": { "content": [ … ] } }`. Its `metadata.title` is the chapter's name in the table of contents, and is required. Write the page's `content` as H5P.Column's file says.
+- A cover: `showCoverPage: true`, with `bookCover.coverDescription` and, optionally, `bookCover.coverMedium` (H5P.Image or H5P.Video).
+- The summary page lists every question and its score. Played on a site that records results, the book reports its own result only with the site's reporting turned on.
+
+## Example
+
+```json
+{
+ "type": "H5P.InteractiveBook",
+ "params": {
+ "chapters": [
+ {
+ "library": "H5P.Column",
+ "metadata": { "title": "Where rivers begin" },
+ "params": { "content": [{ "content": { "library": "H5P.AdvancedText", "params": { "text": "A river begins at its source: a spring, a lake or a glacier." } } }] }
+ },
+ {
+ "library": "H5P.Column",
+ "metadata": { "title": "Check yourself" },
+ "params": { "content": [{ "content": { "library": "H5P.TrueFalse", "metadata": { "title": "Sources" }, "params": { "question": "Every river begins at a spring.", "correct": "false" } } }] }
+ }
+ ]
+ }
+}
+```
+
+
+
+## Fields of H5P.InteractiveBook 1.15
+
+- `showCoverPage` boolean = false — Enable book cover
+- `bookCover` group; only when showCoverPage is true — Cover Page
+ - `coverDescription` html: sub sup strong em code u del a ul ol h1 h2 h3 h4 h5 h6 pre hr table = "" — Cover description: This text will be the description of your book.
+ - `coverMedium` sub-content: H5P.Image | H5P.Video — Cover media: Optional media to display on the cover.
+- `chapters` list 1–50 of sub-content: H5P.Column, required — Pages
+- `behaviour` group — Behavioural settings
+ - `baseColor` text = "#1768c4" — Base color: Set the base color that will define the overall color scheme of the book. Please ensure a high enough contrast.
+ - `defaultTableOfContents` boolean = true — Display table of contents as default
+ - `progressIndicators` boolean = true — Display Progress Indicators
+ - `progressAuto` boolean = true; only when progressIndicators is true — Enable automatic progress
+ - `displaySummary` boolean = true — Display summary
+ - `enableRetry` boolean = true — Enable "Restart" button
+
+35 interface texts are left out: they come from the libraries' translations. `h5p-author schema H5P.InteractiveBook --all` lists them, for a source to set one.
+
+
diff --git a/skills/h5p-author/references/types/H5P.InteractiveVideo.md b/skills/h5p-author/references/types/H5P.InteractiveVideo.md
new file mode 100644
index 00000000..a821a1c6
--- /dev/null
+++ b/skills/h5p-author/references/types/H5P.InteractiveVideo.md
@@ -0,0 +1,111 @@
+# Interactive Video (H5P.InteractiveVideo)
+
+A video with questions, text and links appearing over it at set times, a bookmark menu, and a summary task at the end.
+
+- `interactiveVideo.video.files` is the video: a file beside the source (`.mp4` or `.webm`), a web address of one, or the address of a video on YouTube, Vimeo, Panopto or Echo360, which plays from there.
+- Each item of `interactiveVideo.assets.interactions` shows its `action` (sub-content) from `duration.from` to `duration.to`, in seconds. `pause: true` stops the video for it; `displayType` `"button"` shows an icon to open it, `"poster"` shows it open over the video. The build places each interaction; give `x` and `y` (percent of the picture) to place one yourself.
+- The build sizes a poster by what it holds: a question 17 by 16, room for four short answers and its buttons; a text as wide as keeps it short; a picture in its own shape. `width` and `height` size one yourself, in em: the video is 40 wide and 22.5 tall at 16:9. Check posters in the preview; on a phone they show as buttons.
+- Bookmarks: `interactiveVideo.assets.bookmarks`, `[{ "time": 30, "label": "…" }]`.
+- The summary task at the end is H5P.Summary at `interactiveVideo.summary.task`, shown at `interactiveVideo.summary.displayAt` seconds before the end; leave it out and there is none.
+- Know the video's length, and keep every time within it.
+
+## Example
+
+```json
+{
+ "type": "H5P.InteractiveVideo",
+ "params": {
+ "interactiveVideo": {
+ "video": { "files": [{ "path": "clip.mp4" }], "startScreenOptions": { "title": "A river in spring" } },
+ "assets": {
+ "interactions": [
+ { "duration": { "from": 2, "to": 6 }, "label": "Where does it go?", "action": { "library": "H5P.Text", "params": { "text": "All of this water ends in the sea." } } },
+ {
+ "duration": { "from": 7, "to": 9 },
+ "pause": true,
+ "displayType": "poster",
+ "action": { "library": "H5P.TrueFalse", "params": { "question": "This river flows uphill.", "correct": "false" } }
+ }
+ ],
+ "bookmarks": [{ "time": 7, "label": "Question" }]
+ }
+ }
+ }
+}
+```
+
+
+
+## Fields of H5P.InteractiveVideo 1.28
+
+- `interactiveVideo` group — Interactive Video Editor
+ - `video` group — Upload/embed video
+ - `files` video files, required — Add a video
+ - `startScreenOptions` group — Start screen options (unsupported for YouTube videos)
+ - `title` text = "Interactive Video" — The title of this interactive video: Used in summaries, statistics etc.
+ - `hideStartTitle` boolean = false — Hide title on video start screen
+ - `shortStartDescription` text — Short description (Optional): Optional. Display a short description text on the video start screen. Does not work for YouTube videos.
+ - `poster` image file — Poster image
+ - `textTracks` group — Text tracks (unsupported for YouTube videos)
+ - `videoTrack` list of — Available text tracks
+ - `label` text = "Subtitles" — Track label: Used if you offer multiple tracks and the user has to choose a track. For instance 'Spanish subtitles' could be the label of a Spanish subtitle track.
+ - `kind` one of "subtitles" | "captions" | "descriptions" = "subtitles" — Type of text track
+ - `srcLang` text = "en" — Source language, must be defined for subtitles: Must be a valid BCP 47 language tag. If 'Subtitles' is the type of text track selected, the source language of the track must be defined.
+ - `track` file, required — Track source (WebVTT file)
+ - `defaultTrackLabel` text — Default text track: If left empty or not matching any of the text tracks the first text track will be used as the default.
+ - `assets` group — Add interactions
+ - `interactions` list of
+ - `duration` group — Display time
+ - `from` number, required
+ - `to` number, required
+ - `pause` boolean — Pause video
+ - `displayType` one of "button" | "poster" = "button" — Display as: Button is a collapsed interaction the user must press to open. Poster is an expanded interaction displayed directly on top of the video
+ - `buttonOnMobile` boolean = false — Turn into button on small screens
+ - `label` html — Label: Label displayed next to interaction icon.
+ - `action` sub-content: H5P.Nil | H5P.Text | H5P.Table | H5P.Link | H5P.Image | H5P.Summary | H5P.SingleChoiceSet | H5P.MultiChoice | H5P.TrueFalse | H5P.Blanks | H5P.DragQuestion | H5P.MarkTheWords | H5P.DragText | H5P.GoToQuestion | H5P.IVHotspot | H5P.Questionnaire | H5P.FreeTextQuestion | H5P.MultiMediaChoice, required
+ - `adaptivity` group — Adaptivity
+ - `correct` group — Action on all correct
+ - `seekTo` number, required — Seek to: Enter timecode in the format M:SS
+ - `allowOptOut` boolean — Allow the user to opt out and continue
+ - `message` html: strong em del a code, required — Message
+ - `seekLabel` text, required — Label for seek button
+ - `wrong` group — Action on wrong
+ - `seekTo` number, required — Seek to: Enter timecode in the format M:SS
+ - `allowOptOut` boolean — Allow the user to opt out and continue
+ - `message` html: strong em del a code, required — Message
+ - `seekLabel` text, required — Label for seek button
+ - `requireCompletion` boolean — Require full score for task before proceeding
+ - `visuals` group — Visuals
+ - `backgroundColor` text = "rgb(255, 255, 255)" — Background color
+ - `boxShadow` boolean = true — Box shadow
+ - `goto` group — Go to on click
+ - `type` one of "timecode" | "url" — Type
+ - `time` number — Go To: The target time the user will be taken to upon pressing the hotspot. Enter timecode in the format M:SS.
+ - `url` group — URL
+ - `protocol` one of "http://" | "https://" | "/" | "other" = "http://" — Protocol
+ - `url` text — URL
+ - `visualize` boolean — Visualize
+ - `bookmarks` list of
+ - `time` number, required
+ - `label` text, required
+ - `endscreens` list of
+ - `time` number, required
+ - `label` text, required
+ - `summary` group — Summary task
+ - `task` sub-content: H5P.Summary = {"library":"H5P.Summary 1.10","params":{}}
+ - `displayAt` number = 3 — Display at: Number of seconds before the video ends.
+- `override` group — Behavioural settings
+ - `startVideoAt` number — Start video at: Enter timecode in the format M:SS
+ - `autoplay` boolean = false — Auto-play video
+ - `loop` boolean = false — Loop the video
+ - `hasNoAutoPause` boolean = false — Deactivate auto-pause
+ - `showSolutionButton` one of "on" | "off" — Override "Show Solution" button: This option determines if the "Show Solution" button will be shown for all questions, disabled for all or configured for each question individually.
+ - `retryButton` one of "on" | "off", required — Override "Retry" button: This option determines if the "Retry" button will be shown for all questions, disabled for all or configured for each question individually.
+ - `showBookmarksmenuOnLoad` boolean = false — Start with bookmarks menu open
+ - `showRewind10` boolean = false — Show button for rewinding 10 seconds
+ - `preventSkippingMode` one of "none" | "forward" | "both" = "none" — Disable navigation: These options will disable user video navigation as specified.
+ - `deactivateSound` boolean = false — Deactivate sound
+
+47 interface texts are left out: they come from the libraries' translations. `h5p-author schema H5P.InteractiveVideo --all` lists them, for a source to set one.
+
+
diff --git a/skills/h5p-author/references/types/H5P.MarkTheWords.md b/skills/h5p-author/references/types/H5P.MarkTheWords.md
new file mode 100644
index 00000000..475c0a33
--- /dev/null
+++ b/skills/h5p-author/references/types/H5P.MarkTheWords.md
@@ -0,0 +1,41 @@
+# Mark the Words (H5P.MarkTheWords)
+
+A text in which the learner clicks the words that fit a rule: every verb, every misspelt word.
+
+- Mark the right words in `textField` with asterisks: `*word*`. Single words only, not phrases.
+- `taskDescription` says what to mark; it is required.
+
+## Example
+
+```json
+{
+ "type": "H5P.MarkTheWords",
+ "params": {
+ "taskDescription": "Click every name of a river.",
+ "textField": "The *Danube* rises in the Black Forest and the *Rhine* in the Alps; both cross Germany."
+ }
+}
+```
+
+
+
+## Fields of H5P.MarkTheWords 1.11
+
+- `media` group — Media
+ - `type` sub-content: H5P.Image | H5P.Video | H5P.Audio — Type: Optional media to display above the question.
+ - `disableImageZooming` boolean = false; only when type is "H5P.Image 1.1" — Disable image zooming
+- `taskDescription` html: strong em u a ul ol h2 h3 hr pre code, required — Task description: Describe how the user should solve the task.
+- `textField` html: strong em code, required — Textfield
+ Correct words are marked with asterisks (*) before and after the word. Asterisks can be added within marked words by adding another asterisk, *correctword*** => correctword*. Only words may be marked as correct. Not phrases. Example: The correct words are marked like this: *correctword*, an asterisk is written like this: *correctword***.
+- `overallFeedback` list 1+ of — Overall Feedback: Click the "Add range" button to add as many ranges as you need. Example: 0-20% Bad score, 21-91% Average Score, 91-100% Great Score!
+ - `from` whole number 0–100 = 0 — Score Range
+ - `to` whole number 0–100 = 100
+ - `feedback` text — Feedback for defined score range
+- `behaviour` group — Behavioural settings.
+ - `enableRetry` boolean = true — Enable "Retry"
+ - `enableSolutionsButton` boolean = true — Enable "Show solution" button
+ - `showScorePoints` boolean = true — Show score points
+
+16 interface texts are left out: they come from the libraries' translations. `h5p-author schema H5P.MarkTheWords --all` lists them, for a source to set one.
+
+
diff --git a/skills/h5p-author/references/types/H5P.MemoryGame.md b/skills/h5p-author/references/types/H5P.MemoryGame.md
new file mode 100644
index 00000000..df0c58eb
--- /dev/null
+++ b/skills/h5p-author/references/types/H5P.MemoryGame.md
@@ -0,0 +1,45 @@
+# Memory Game (H5P.MemoryGame)
+
+Cards face down, turned two at a time, until every pair is found.
+
+- Each item of `cards` is a pair: `image` and `imageAlt`, and, for a pair of two different pictures, `match` and `matchAlt`. Without `match` the pair is two copies of `image`.
+- `description` is shown when the pair is found: say what it shows.
+- Square-ish pictures work best; at least two cards.
+
+## Example
+
+```json
+{
+ "type": "H5P.MemoryGame",
+ "params": {
+ "cards": [
+ { "image": { "path": "danube.png" }, "imageAlt": "The Danube in Budapest", "description": "The Danube flows through four capitals." },
+ { "image": { "path": "thames.png" }, "imageAlt": "The Thames in London", "description": "The Thames flows through London." }
+ ]
+ }
+}
+```
+
+
+
+## Fields of H5P.MemoryGame 1.3
+
+- `cards` list 2–100 of, required — Cards
+ - `image` image file, required — Image
+ - `imageAlt` text, required — Alternative text for Image: Describe what can be seen in the photo. The text is read by text-to-speech tools needed by visually impaired users.
+ - `audio` audio files — Audio Track
+ - `match` image file — Matching Image
+ - `matchAlt` text — Alternative text for Matching Image: Describe what can be seen in the photo. The text is read by text-to-speech tools needed by visually impaired users.
+ - `matchAudio` audio files — Matching Audio Track
+ - `description` text — Description: An optional short text that will pop up once the two matching cards are found.
+- `behaviour` group — Behavioural settings
+ - `useGrid` boolean = true — Position the cards in a square
+ - `numCardsToUse` whole number 2– — Number of cards to use: Setting this to a number greater than 2 will make the game pick random cards from the list of cards.
+ - `allowRetry` boolean = true — Add button for retrying when the game is over
+- `lookNFeel` group — Look and feel
+ - `themeColor` text = "#707070" — Theme Color: Choose a color to create a theme for your card game.
+ - `cardBack` image file — Card Back
+
+14 interface texts are left out: they come from the libraries' translations. `h5p-author schema H5P.MemoryGame --all` lists them, for a source to set one.
+
+
diff --git a/skills/h5p-author/references/types/H5P.MultiChoice.md b/skills/h5p-author/references/types/H5P.MultiChoice.md
new file mode 100644
index 00000000..38cdf9a9
--- /dev/null
+++ b/skills/h5p-author/references/types/H5P.MultiChoice.md
@@ -0,0 +1,61 @@
+# Multiple Choice (H5P.MultiChoice)
+
+One question, two or more answers, one or several of them correct, with feedback per answer.
+
+- Mark the right answers with `"correct": true`. `behaviour.type` is `"single"` (radio buttons, exactly one correct), `"multi"` (checkboxes) or `"auto"`, which picks by how many are correct.
+- Feedback for an answer goes in its `tipsAndFeedback.chosenFeedback`, shown after Check when it was chosen. Write it for every answer, wrong ones especially: say why.
+- A pass mark: `behaviour.passPercentage`, with `overallFeedback` ranges for each score band, `{ "from": 0, "to": 99, "feedback": "…" }`.
+- Answers are shuffled unless `behaviour.randomAnswers` is false.
+
+## Example
+
+```json
+{
+ "type": "H5P.MultiChoice",
+ "params": {
+ "question": "Which river is the longest in Europe?",
+ "answers": [
+ { "text": "Volga", "correct": true, "tipsAndFeedback": { "chosenFeedback": "Right: about 3,530 km." } },
+ { "text": "Danube", "correct": false, "tipsAndFeedback": { "chosenFeedback": "The Danube is second, about 2,850 km." } },
+ { "text": "Rhine", "correct": false, "tipsAndFeedback": { "chosenFeedback": "The Rhine is about 1,230 km." } }
+ ],
+ "behaviour": { "type": "single" }
+ }
+}
+```
+
+
+
+## Fields of H5P.MultiChoice 1.16
+
+- `media` group — Media
+ - `type` sub-content: H5P.Image | H5P.Video | H5P.Audio — Type: Optional media to display above the question.
+ - `disableImageZooming` boolean = false; only when type is "H5P.Image 1.1" — Disable image zooming
+- `question` html: strong em sub sup h2 h3 pre code, required — Question
+- `answers` list 1+ of, required — Available options
+ - `text` html: strong em sub sup code, required — Text
+ - `correct` boolean — Correct
+ - `tipsAndFeedback` group — Tips and feedback
+ - `tip` html: strong em a code — Tip text: Hint for the user. This will appear before user checks his answer/answers.
+ - `chosenFeedback` html: strong em sub sup a code — Message displayed if answer is selected: Message will appear below the answer on "check" if this answer is selected.
+ - `notChosenFeedback` html: strong em sub sup a code — Message displayed if answer is not selected: Message will appear below the answer on "check" if this answer is not selected.
+- `overallFeedback` list 1+ of — Overall Feedback: Click the "Add range" button to add as many ranges as you need. Example: 0-20% Bad score, 21-91% Average Score, 91-100% Great Score!
+ - `from` whole number 0–100 = 0 — Score Range
+ - `to` whole number 0–100 = 100
+ - `feedback` text — Feedback for defined score range
+- `behaviour` group — Behavioural settings
+ - `enableRetry` boolean = true — Enable "Retry" button
+ - `enableSolutionsButton` boolean = true — Enable "Show Solution" button
+ - `type` one of "auto" | "multi" | "single" = "auto" — Question Type: Select the look and behaviour of the question.
+ - `singlePoint` boolean = false — Give one point for the whole task
+ - `randomAnswers` boolean = true — Randomize answers
+ - `showSolutionsRequiresInput` boolean = true — Require answer before the solution can be viewed
+ - `confirmCheckDialog` boolean = false — Show confirmation dialog on "Check"
+ - `confirmRetryDialog` boolean = false — Show confirmation dialog on "Retry"
+ - `autoCheck` boolean = false — Automatically check answers
+ - `passPercentage` whole number 0–100 = 100 — Pass percentage: This setting often won't have any effect. It is the percentage of the total score required for getting 1 point when one point for the entire task is enabled, and for getting result…
+ - `showScorePoints` boolean = true — Show score points
+
+25 interface texts are left out: they come from the libraries' translations. `h5p-author schema H5P.MultiChoice --all` lists them, for a source to set one.
+
+
diff --git a/skills/h5p-author/references/types/H5P.MultiMediaChoice.md b/skills/h5p-author/references/types/H5P.MultiMediaChoice.md
new file mode 100644
index 00000000..dc5617d4
--- /dev/null
+++ b/skills/h5p-author/references/types/H5P.MultiMediaChoice.md
@@ -0,0 +1,53 @@
+# Image Choice (H5P.MultiMediaChoice)
+
+A multiple-choice question whose answers are pictures.
+
+- Each item of `options` holds its picture as sub-content under `media`, `{ "library": "H5P.Image", "params": { "file": { "path": "…" }, "alt": "…" } }`, and `correct`. The alternative text is what a screen reader reads as the answer: write it as the answer.
+- `behaviour.questionType` `"single"` or `"multi"`, as for Multiple Choice; `behaviour.aspectRatio` fits pictures of different shapes.
+
+## Example
+
+```json
+{
+ "type": "H5P.MultiMediaChoice",
+ "params": {
+ "question": "Which picture shows a river delta?",
+ "options": [
+ { "media": { "library": "H5P.Image", "params": { "file": { "path": "delta.png" }, "alt": "A delta" } }, "correct": true },
+ { "media": { "library": "H5P.Image", "params": { "file": { "path": "source.png" }, "alt": "A spring" } }, "correct": false }
+ ]
+ }
+}
+```
+
+
+
+## Fields of H5P.MultiMediaChoice 0.3
+
+- `media` group — Media
+ - `type` sub-content: H5P.Image | H5P.Video | H5P.Audio — Type: Optional media to display above the question.
+ - `disableImageZooming` boolean = false; only when type is "H5P.Image 1.1" — Disable image zooming
+- `question` html: strong em sub sup h2 h3 pre code, required — Question
+- `options` list 2–20 of, required — Available options
+ - `media` sub-content: H5P.Image | H5P.Video | H5P.Audio, required — Media: Media to display as a choice.
+ - `poster` image file, required; only when media is "H5P.Audio 1.5" — Poster image
+ - `correct` boolean — Correct
+- `overallFeedback` list 1+ of — Overall Feedback: Click the "Add range" button to add as many ranges as you need. Example: 0-20% Bad score, 21-91% Average Score, 91-100% Great Score!
+ - `from` whole number 0–100 = 0 — Score Range
+ - `to` whole number 0–100 = 100
+ - `feedback` text — Feedback for defined score range
+- `behaviour` group — Behavioural settings
+ - `enableRetry` boolean = true — Enable "Retry" button
+ - `enableSolutionsButton` boolean = true — Enable "Show Solution" button
+ - `confirmCheckDialog` boolean = false — Show confirmation dialog on "Check"
+ - `confirmRetryDialog` boolean = false — Show confirmation dialog on "Retry"
+ - `singlePoint` boolean = false — Give one point for the whole question
+ - `showSolutionsRequiresInput` boolean = true — Require answer before the solution can be viewed
+ - `questionType` one of "auto" | "multi" | "single" = "auto" — Question Type: Select the look and behaviour of the question.
+ - `aspectRatio` one of "auto" | "16to9" | "4to3" | "3to2" | "1to1" = "auto" — Aspect ratio: Select the aspect ratio of the alternatives
+ - `maxAlternativesPerRow` one of "1" | "2" | "3" | "4" = "4" — Maximum alternatives per row: Set the maximum number of alternatives per row to ensure the questions look alright.
+ - `passPercentage` whole number 0–100 = 100 — Pass percentage: This setting often won't have any effect. It is the percentage of the total score required for getting 1 point when one point for the entire task is enabled, and for getting result…
+
+23 interface texts are left out: they come from the libraries' translations. `h5p-author schema H5P.MultiMediaChoice --all` lists them, for a source to set one.
+
+
diff --git a/skills/h5p-author/references/types/H5P.QuestionSet.md b/skills/h5p-author/references/types/H5P.QuestionSet.md
new file mode 100644
index 00000000..e231b816
--- /dev/null
+++ b/skills/h5p-author/references/types/H5P.QuestionSet.md
@@ -0,0 +1,98 @@
+# Question Set (H5P.QuestionSet)
+
+A quiz: questions one after another, then a result page with the score.
+
+- Each item of `questions` is sub-content: `{ "library": "H5P.MultiChoice", "params": { … }, "metadata": { "title": "…" } }`. Write each question's `params` from its own type file. The result page lists questions by `metadata.title`; without one a question is "Question 2" in the content's language.
+- `passPercentage` is the pass mark; `endGame.overallFeedback` holds the score ranges' messages. Question Set 1.21 draws neither on its result page, an H5P bug (h5p/h5p-question-set#183): screen readers announce the message, and a learner sees only the score. Tell the user.
+- An intro screen: `introPage.showIntroPage: true`, with `title` and `introduction`.
+- `randomQuestions` shuffles them; `poolSize` draws that many from the list each time.
+- Its navigation and result screen ("Previous", "Next", "Results", "Score") are English in all but one or two of its 48 translations; the build lists what stayed English.
+
+## Example
+
+```json
+{
+ "type": "H5P.QuestionSet",
+ "params": {
+ "passPercentage": 50,
+ "questions": [
+ {
+ "library": "H5P.MultiChoice",
+ "metadata": { "title": "The longest river" },
+ "params": {
+ "question": "Which river is the longest in Europe?",
+ "answers": [
+ { "text": "Volga", "correct": true },
+ { "text": "Danube", "correct": false }
+ ]
+ }
+ },
+ {
+ "library": "H5P.TrueFalse",
+ "metadata": { "title": "The Rhine" },
+ "params": { "question": "The Rhine flows into the North Sea.", "correct": "true" }
+ }
+ ],
+ "endGame": {
+ "overallFeedback": [
+ { "from": 0, "to": 49, "feedback": "Not yet: read about the rivers again, then retry." },
+ { "from": 50, "to": 100, "feedback": "Passed." }
+ ]
+ }
+ }
+}
+```
+
+
+
+## Fields of H5P.QuestionSet 1.21
+
+- `introPage` group — Quiz introduction
+ - `showIntroPage` boolean — Display introduction
+ - `title` html: sub sup strong em code — Title: This title will be displayed above the introduction text.
+ - `introduction` html: sub sup strong em code — Introduction text: This text will be displayed before the quiz starts.
+ - `startButtonText` text = "Start Quiz" — Start button text
+ - `backgroundImage` image file — Cover image
+ - `backgroundImageAltText` text — Alternative text: If the browser can't load the image this text will be displayed instead. Also used by "text-to-speech" readers.
+- `progressType` one of "textual" | "dots" = "dots" — Progress indicator: Question set progress indicator style. Will be Textual if backwards navigation is disabled.
+- `passPercentage` whole number 0–100 = 50 — Pass percentage: Percentage of Total score required for passing the quiz.
+- `questions` list 1+ of sub-content: H5P.MultiChoice | H5P.DragQuestion | H5P.Blanks | H5P.MarkTheWords | H5P.DragText | H5P.TrueFalse | H5P.Essay | H5P.MultiMediaChoice, required — Questions: Library for this question.
+- `disableBackwardsNavigation` boolean = false — Disable backwards navigation
+- `randomQuestions` boolean = false — Randomize questions
+- `poolSize` whole number 1– — Number of questions to be shown:: Create a randomized batch of questions from the total.
+- `endGame` group — Quiz finished
+ - `showResultPage` boolean = true — Display results
+ - `showSolutionButton` boolean = true — Display solution button
+ - `showRetryButton` boolean = true — Display retry button
+ - `noResultMessage` text = "Finished" — No results message: Text displayed on end page when "Display results" is disabled
+ - `message` html: strong em code = "Results" — Results heading: This heading will be displayed at the end of the quiz when the user has answered all questions.
+ - `amountCorrect` text = "@finals of @totals correct" — Amount correct heading: Header to show the final score to the user on the end screen
+ - `scoreBarLabel` text = "You got @finals out of @totals points" — Score announcer: This label will be used for announcing the final score to the user on the end screen
+ - `scoreHeader` text = "Score" — Score heading: Header for the score part of the results table
+ - `overallFeedback` list 1+ of — Overall Feedback: Click the "Add range" button to add as many ranges as you need. Example: 0-20% Bad score, 21-91% Average Score, 91-100% Great Score!
+ - `from` whole number 0–100 = 0 — Score Range
+ - `to` whole number 0–100 = 100
+ - `feedback` text — Feedback for defined score range
+ - `oldFeedback` group — Old Feedback
+ - `successGreeting` html: strong em code — Quiz passed greeting: This text will be displayed above the score if the user has successfully passed the quiz.
+ - `successComment` html: sub sup strong em a code — Passed comment: This comment will be displayed after the score if the user has successfully passed the quiz.
+ - `failGreeting` html: strong em code — Quiz failed title: This text will be displayed above the score if the user has failed the quiz.
+ - `failComment` html: sub sup strong em a code — Failed comment: This comment will be displayed after the score if the user has failed the quiz.
+ - `solutionButtonText` text = "Show solution" — Solution button label: Text for the solution button.
+ - `retryButtonText` text = "Retry" — Retry button label: Text for the retry button.
+ - `finishButtonText` text = "Finish" — Finish button text
+ - `submitButtonText` text = "Submit" — Submit button text
+ - `showAnimations` boolean — Display video before quiz results
+ - `skippable` boolean — Enable skip video button
+ - `skipButtonText` text = "Skip video" — Skip video button label
+ - `successVideo` video files — Passed video
+ - `failVideo` video files — Fail video
+- `override` group — Behavioural settings
+ - `checkButton` boolean = true — Show "Check" buttons
+ - `showSolutionButton` one of "on" | "off"; only when checkButton is true — Override "Show Solution" button: This option determines if the "Show Solution" button will be shown for all questions, disabled for all or configured for each question individually.
+ - `retryButton` one of "on" | "off"; only when checkButton is true — Override "Retry" button: This option determines if the "Retry" button will be shown for all questions, disabled for all or configured for each question individually.
+ - `backgroundImage` image file — Background image
+
+15 interface texts are left out: they come from the libraries' translations. `h5p-author schema H5P.QuestionSet --all` lists them, for a source to set one.
+
+
diff --git a/skills/h5p-author/references/types/H5P.Questionnaire.md b/skills/h5p-author/references/types/H5P.Questionnaire.md
new file mode 100644
index 00000000..0b737787
--- /dev/null
+++ b/skills/h5p-author/references/types/H5P.Questionnaire.md
@@ -0,0 +1,57 @@
+# Questionnaire (H5P.Questionnaire)
+
+A survey: open questions and multiple-choice questions with no right answer, then a thank-you screen. Not scored.
+
+- Each item of `questionnaireElements` holds its question under `library`, which is itself sub-content: `{ "library": { "library": "H5P.SimpleMultiChoice", "params": { … } }, "requiredField": true }`.
+- H5P.SimpleMultiChoice: `question` (plain text), `inputType` `"radio"` (one answer) or `"checkbox"` (several), `alternatives` of `{ "text": "…" }`.
+- H5P.OpenEndedQuestion: `question`, `placeholderText`, `inputRows` `"1"`, `"2"`, `"3"` or `"10"`.
+- The answers go out as xAPI statements; nothing stores them unless the site does.
+
+## Example
+
+```json
+{
+ "type": "H5P.Questionnaire",
+ "params": {
+ "questionnaireElements": [
+ {
+ "library": {
+ "library": "H5P.SimpleMultiChoice",
+ "params": { "question": "How often do you walk by a river?", "inputType": "radio", "alternatives": [{ "text": "Every week" }, { "text": "Sometimes" }, { "text": "Never" }] }
+ },
+ "requiredField": true
+ },
+ { "library": { "library": "H5P.OpenEndedQuestion", "params": { "question": "Which river do you know best, and why?", "inputRows": "3" } } }
+ ]
+ }
+}
+```
+
+
+
+## Fields of H5P.Questionnaire 1.3
+
+- `questionnaireElements` list 1+ of, required — Questionnaire elements
+ - `library` sub-content: H5P.OpenEndedQuestion | H5P.SimpleMultiChoice, required — Library: Choose a library
+ - `requiredField` boolean = false — Required field
+- `successScreenOptions` group — Success screen options
+ - `enableSuccessScreen` boolean = true — Enable success screen
+ - `successScreenImage` sub-content: H5P.Image — Add success screen image
+ - `successMessage` text = "You have completed the questionnaire." — Text to display on submit
+- `uiElements` group — UI Elements
+ - `buttonLabels` group — Button labels
+ - `prevLabel` text = "Back" — Previous button label
+ - `continueLabel` text = "Continue" — Continue button label
+ - `nextLabel` text = "Next" — Next button label
+ - `submitLabel` text = "Submit" — Submit button label
+ - `accessibility` group — Accessibility
+ - `requiredTextExitLabel` text = "Close error message" — Required message exit button label
+ - `progressBarText` text = "Question %current of %max" — Progress bar text: Used to tell assistive technologies what question it is. Variables: [ %current, %max ]
+ - `requiredMessage` text = "This question requires an answer" — Required message: Will display if this field is unanswered and required by a wrapper content type
+ - `requiredText` text = "required" — Required symbol text: Text that will accompany an asterisk to signal that a question is required
+ - `submitScreenTitle` text = "You successfully answered all of the questions" — Title for the submit screen
+ - `submitScreenSubtitle` text = "Click below to submit your answers" — Subtitle for the submit screen
+
+It has no interface texts of its own.
+
+
diff --git a/skills/h5p-author/references/types/H5P.SingleChoiceSet.md b/skills/h5p-author/references/types/H5P.SingleChoiceSet.md
new file mode 100644
index 00000000..f5e10000
--- /dev/null
+++ b/skills/h5p-author/references/types/H5P.SingleChoiceSet.md
@@ -0,0 +1,44 @@
+# Single Choice Set (H5P.SingleChoiceSet)
+
+Quick questions, one after another, each with one right answer of two to four; the learner moves on at the first click.
+
+- In each item of `choices`, the first of `answers` is the right one; the set shuffles them when shown.
+- Keep answers short: they are buttons.
+
+## Example
+
+```json
+{
+ "type": "H5P.SingleChoiceSet",
+ "params": {
+ "choices": [
+ { "question": "Which sea does the Danube reach?", "answers": ["Black Sea", "North Sea", "Baltic Sea"] },
+ { "question": "Which river flows through Paris?", "answers": ["Seine", "Loire", "Rhône"] }
+ ]
+ }
+}
+```
+
+
+
+## Fields of H5P.SingleChoiceSet 1.11
+
+- `choices` list 1+ of, required — List of questions
+ - `question` html: strong em code, required — Question
+ - `answers` list 2–4 of html: strong em code, required — Alternatives - first alternative is the correct one.
+- `overallFeedback` list 1+ of — Overall Feedback: Click the "Add range" button to add as many ranges as you need. Example: 0-20% Bad score, 21-91% Average Score, 91-100% Great Score!
+ - `from` whole number 0–100 = 0 — Score Range
+ - `to` whole number 0–100 = 100
+ - `feedback` text — Feedback for defined score range
+- `behaviour` group — Behavioural settings
+ - `autoContinue` boolean = true — Auto continue
+ - `timeoutCorrect` number = 2000; only when autoContinue is true — Timeout on correct answers: Value in milliseconds
+ - `timeoutWrong` number = 3000; only when autoContinue is true — Timeout on wrong answers: Value in milliseconds
+ - `soundEffectsEnabled` boolean = true — Enable sound effects
+ - `enableRetry` boolean = true — Enable retry button
+ - `enableSolutionsButton` boolean = true — Enable show solution button
+ - `passPercentage` whole number 0–100 = 100 — Pass percentage: Percentage of Total score required for passing the quiz.
+
+21 interface texts are left out: they come from the libraries' translations. `h5p-author schema H5P.SingleChoiceSet --all` lists them, for a source to set one.
+
+
diff --git a/skills/h5p-author/references/types/H5P.SortParagraphs.md b/skills/h5p-author/references/types/H5P.SortParagraphs.md
new file mode 100644
index 00000000..82961119
--- /dev/null
+++ b/skills/h5p-author/references/types/H5P.SortParagraphs.md
@@ -0,0 +1,48 @@
+# Sort the Paragraphs (H5P.SortParagraphs)
+
+Paragraphs shown shuffled, which the learner puts in order: steps of a process, events of a story.
+
+- Write `paragraphs` in the right order, at least three; the content shuffles them.
+- Scoring: `behaviour.scoringMode` `"positions"` counts paragraphs in the right place, `"transitions"` each one that follows the right one.
+
+## Example
+
+```json
+{
+ "type": "H5P.SortParagraphs",
+ "params": {
+ "taskDescription": "Put the journey of a raindrop in order.",
+ "paragraphs": [
+ "Rain falls on the mountains.",
+ "Streams gather the water.",
+ "A river carries it through the valley.",
+ "The river reaches the sea."
+ ]
+ }
+}
+```
+
+
+
+## Fields of H5P.SortParagraphs 0.11
+
+- `media` group — Media
+ - `type` sub-content: H5P.Image | H5P.Video | H5P.Audio — Type: Optional media to display above the question.
+ - `disableImageZooming` boolean = false; only when type is "H5P.Image 1.1" — Disable image zooming
+- `taskDescription` html: strong em u a ul ol h2 h3 hr pre code, required — Task description: What your students should know.
+- `paragraphs` list 3+ of html: strong em u ul ol h2 h3 hr pre code, required — Paragraphs
+- `overallFeedback` list 1+ of — Overall Feedback: Click the "Add range" button to add as many ranges as you need. Example: 0-20% Bad score, 21-91% Average Score, 91-100% Great Score!
+ - `from` whole number 0–100 = 0 — Score Range
+ - `to` whole number 0–100 = 100
+ - `feedback` text — Feedback for defined score range
+- `behaviour` group — Behavioural settings
+ - `scoringMode` one of "positions" | "transitions" = "positions" — Scoring mode: Decide whether to give points for each correctly placed paragraph or for each paragraph that is placed after the paragraph it is supposed to be placed after ("correct sequence")
+ - `applyPenalties` boolean = true; only when scoringMode is "positions" — Apply penalties
+ - `duplicatesInterchangeable` boolean = true — Duplicate parapraphs interchangeable
+ - `addButtonsForMovement` boolean = true — Add buttons for movement
+ - `enableRetry` boolean = true — Enable "Retry" button
+ - `enableSolutionsButton` boolean = true — Enable "Show Solution" button
+
+29 interface texts are left out: they come from the libraries' translations. `h5p-author schema H5P.SortParagraphs --all` lists them, for a source to set one.
+
+
diff --git a/skills/h5p-author/references/types/H5P.Summary.md b/skills/h5p-author/references/types/H5P.Summary.md
new file mode 100644
index 00000000..ac8bf706
--- /dev/null
+++ b/skills/h5p-author/references/types/H5P.Summary.md
@@ -0,0 +1,38 @@
+# Summary (H5P.Summary)
+
+The learner builds a summary statement by statement, picking the true one from each group.
+
+- In each item of `summaries`, the first of `summary` is the true statement; the others are false. The content shuffles them.
+- Each group should test one point; the true statements, in order, read as the summary.
+
+## Example
+
+```json
+{
+ "type": "H5P.Summary",
+ "params": {
+ "intro": "Choose the correct statement.",
+ "summaries": [
+ { "summary": ["Rivers flow from higher to lower ground.", "Rivers flow from lower to higher ground."] },
+ { "summary": ["Most rivers end in a sea or a lake.", "Most rivers end in a mountain spring."] }
+ ]
+ }
+}
+```
+
+
+
+## Fields of H5P.Summary 1.10
+
+- `intro` html: strong em u a ul ol h2 h3 hr pre code = "Choose the correct statement." — Introduction text: Will be displayed above the summary task.
+- `summaries` list 1–100 of, required — Summary
+ - `summary` list 2+ of html, required — List of statements for the summary - the first statement is correct.
+ - `tip` html: strong em code — Tip
+- `overallFeedback` list 1+ of — Overall Feedback: Click the "Add range" button to add as many ranges as you need. Example: 0-20% Bad score, 21-91% Average Score, 91-100% Great Score!
+ - `from` whole number 0–100 = 0 — Score Range
+ - `to` whole number 0–100 = 100
+ - `feedback` text — Feedback for defined score range
+
+10 interface texts are left out: they come from the libraries' translations. `h5p-author schema H5P.Summary --all` lists them, for a source to set one.
+
+
diff --git a/skills/h5p-author/references/types/H5P.Text.md b/skills/h5p-author/references/types/H5P.Text.md
new file mode 100644
index 00000000..4d95a80d
--- /dev/null
+++ b/skills/h5p-author/references/types/H5P.Text.md
@@ -0,0 +1,28 @@
+# Text in a video or a hotspot (H5P.Text)
+
+Formatted text, the part Interactive Video and Image Hotspots hold. Elsewhere, use H5P.AdvancedText.
+
+- `text` takes the tags the Fields section lists.
+
+## Example
+
+```json
+{
+ "type": "H5P.ImageHotspots",
+ "params": {
+ "image": { "path": "delta.png" },
+ "backgroundImageAltText": "A river delta",
+ "hotspots": [{ "position": { "x": 50, "y": 50 }, "header": "Delta", "content": [{ "library": "H5P.Text", "params": { "text": "The river splits into channels. " } }] }]
+ }
+}
+```
+
+
+
+## Fields of H5P.Text 1.1
+
+- `text` html: strong em del a ul ol h2 h3 hr pre code, required — Text
+
+It has no interface texts of its own.
+
+
diff --git a/skills/h5p-author/references/types/H5P.Timeline.md b/skills/h5p-author/references/types/H5P.Timeline.md
new file mode 100644
index 00000000..67d25da1
--- /dev/null
+++ b/skills/h5p-author/references/types/H5P.Timeline.md
@@ -0,0 +1,63 @@
+# Timeline (H5P.Timeline)
+
+Events along a time line, each with a date, a headline and a text, browsed in order.
+
+- `timeline.headline` and `timeline.text` make the title slide; each item of `timeline.date` is an event.
+- Dates are written `YYYY,MM,DD`, the month and day optional: `"1888"`, `"1888,7,22"`. An event with an `endDate` spans a period; `timeline.era` shades longer periods.
+- An event's `asset.media` is a web address (a YouTube video, a Wikipedia article, a picture's URL) that the timeline loads from that site when shown. That site then learns who views it; tell the user, or leave media out.
+
+## Example
+
+```json
+{
+ "type": "H5P.Timeline",
+ "params": {
+ "timeline": {
+ "headline": "Bridges over the Danube in Budapest",
+ "text": "From the first permanent bridge to the newest.",
+ "date": [
+ { "startDate": "1849,11,20", "headline": "Chain Bridge", "text": "The first permanent bridge between Buda and Pest." },
+ { "startDate": "1876,4,30", "headline": "Margaret Bridge", "text": "The second permanent bridge." },
+ { "startDate": "1896", "headline": "Liberty Bridge", "text": "Opened for the millennium celebrations." }
+ ]
+ }
+ }
+}
+```
+
+
+
+## Fields of H5P.Timeline 1.1
+
+- `timeline` group — Timeline
+ - `headline` text, required — Headline: Main timeline heading goes here (first page)
+ - `text` html: strong em del a ul ol hr code — Body Text: The main timeline body goes here (first page).
+ - `defaultZoomLevel` text = "0" — Default zoom level: This will tweak the default zoom level. Equivilent to pressing the zoom in or zoom out button the specified number of times. Negative numbers zoom out. default is 0
+ - `backgroundImage` image file — Background image
+ - `height` whole number = 600 — Height: The height in pixels
+ - `asset` group — Asset
+ - `media` text — Media: Link to media URL (Twitter, YouTube, Flickr, Vimeo, Google Maps and SoundCloud are currently supported)
+ - `credit` text — Credits: Credits to the media
+ - `caption` text — Caption: Caption description goes here
+ - `date` list 1+ of, required — Dates: Add some dates to your timeline!
+ - `startDate` text, required — Start date: YYYY,MM,DD (Minimum YYYY required)
+ - `endDate` text — End date: YYYY,MM,DD (Minimum YYYY required)
+ - `headline` text, required — Headline: Headline for the date entry
+ - `text` html: strong em del a ul ol h2 h3 hr pre code — Body text: Body for the date entry
+ - `tag` text — Tags: Enter Tags (categories)
+ - `asset` group — Asset
+ - `media` text — Media: URL to the media (Twitter, YouTube, Flickr, Vimeo, Wikipedia, Google Maps and SoundCloud are currently supported).
+ - `thumbnail` image file — Thumbnail
+ - `credit` text — Credit: Credits to the media
+ - `caption` text — Caption: Caption text
+ - `era` list of — Eras: Add an era to your timeline
+ - `startDate` text, required — Start date: YYYY,MM,DD (Minimum YYYY required)
+ - `endDate` text — End date: YYYY,MM,DD (Minimum YYYY required)
+ - `headline` text, required — Headline: Era headline
+ - `text` html: strong em del a ul ol hr code — Text: Era body
+ - `tag` text — Tag: Era tags (categories)
+ - `language` one of "af" | "ar" | "hy" | "eu" | "bg" | "ca" | "zh-cn" | "hr" | "cz" | "da" | "nl" | "en" | "en-24hr" | "eo" | "et" | "fo" | "fa" | "fi" | "fr" | "gl" | "ka" | "de" | "el" | "he" | "hu" | "is" | "id" | "it" | "ja" | "ko" | "lv" | "lt" | "lb" | "ms" | "ne" | "no" | "pl" | "pt" | "pt-br" | "rm" | "ru" | "sr-cy" | "sr" | "si" | "sk" | "sl" | "es" | "sv" | "tl" | "ta" | "zh-tw" | "te" | "tr" | "uk" = "en" — Language: The language of the user interface
+
+It has no interface texts of its own.
+
+
diff --git a/skills/h5p-author/references/types/H5P.TrueFalse.md b/skills/h5p-author/references/types/H5P.TrueFalse.md
new file mode 100644
index 00000000..cc4627eb
--- /dev/null
+++ b/skills/h5p-author/references/types/H5P.TrueFalse.md
@@ -0,0 +1,45 @@
+# True/False Question (H5P.TrueFalse)
+
+One statement the learner marks true or false.
+
+- `correct` is the text `"true"` or `"false"`, not a boolean.
+- Write the statement as a claim, not a question, so either answer is a judgement of it.
+- `behaviour.feedbackOnCorrect` and `behaviour.feedbackOnWrong` replace the default messages; say why.
+
+## Example
+
+```json
+{
+ "type": "H5P.TrueFalse",
+ "params": {
+ "question": "The Danube flows through four capital cities.",
+ "correct": "true",
+ "behaviour": {
+ "feedbackOnCorrect": "Yes: Vienna, Bratislava, Budapest and Belgrade.",
+ "feedbackOnWrong": "It does: Vienna, Bratislava, Budapest and Belgrade."
+ }
+ }
+}
+```
+
+
+
+## Fields of H5P.TrueFalse 1.8
+
+- `media` group — Media
+ - `type` sub-content: H5P.Image | H5P.Video | H5P.Audio — Type: Optional media to display above the question.
+ - `disableImageZooming` boolean = false; only when type is "H5P.Image 1.1" — Disable image zooming
+- `question` html: strong em sub sup h2 h3 pre code, required — Question
+- `correct` one of "true" | "false" = "true" — Correct answer
+- `behaviour` group — Behavioural settings
+ - `enableRetry` boolean = true — Enable "Retry" button
+ - `enableSolutionsButton` boolean = true — Enable "Show Solution" button
+ - `confirmCheckDialog` boolean = false — Show confirmation dialog on "Check"
+ - `confirmRetryDialog` boolean = false — Show confirmation dialog on "Retry"
+ - `autoCheck` boolean = false — Automatically check answer
+ - `feedbackOnCorrect` text — Feedback on correct answer: This will override the default feedback text. Variables available: @score and @total
+ - `feedbackOnWrong` text — Feedback on wrong answer: This will override the default feedback text. Variables available: @score and @total
+
+21 interface texts are left out: they come from the libraries' translations. `h5p-author schema H5P.TrueFalse --all` lists them, for a source to set one.
+
+
diff --git a/skills/h5p-author/references/types/H5P.Video.md b/skills/h5p-author/references/types/H5P.Video.md
new file mode 100644
index 00000000..8ac0ada2
--- /dev/null
+++ b/skills/h5p-author/references/types/H5P.Video.md
@@ -0,0 +1,42 @@
+# Video (H5P.Video)
+
+A video player, a part other content holds: in a page, a book, a slide or a scenario. Not a content type on its own; Interactive Video is the one with questions over a video.
+
+- `sources` is the video: a file beside the source (`.mp4`, `.webm`), a web address of one, or the address of a video on YouTube, Vimeo, Panopto or Echo360, which plays from there and shares the viewing with that site.
+- Captions: `a11y`, `[{ "label": "English", "kind": "captions", "srcLang": "en", "track": { "path": "captions.vtt" } }]`.
+
+## Example
+
+```json
+{
+ "type": "H5P.Column",
+ "params": {
+ "content": [
+ { "content": { "library": "H5P.Video", "params": { "sources": [{ "path": "clip.mp4" }], "a11y": [{ "label": "English", "kind": "captions", "srcLang": "en", "track": { "path": "captions.vtt" } }] } } }
+ ]
+ }
+}
+```
+
+
+
+## Fields of H5P.Video 1.6
+
+- `sources` video files, required — Video sources
+- `visuals` group — Visuals
+ - `poster` image file, required — Poster image
+ - `fit` boolean = true — Fit video player to use all available space
+ - `controls` boolean = true — Show video player controls
+- `playback` group — Playback
+ - `autoplay` boolean = false — Auto-play video
+ - `loop` boolean = false — Loop video
+ - `hasNoAutoPause` boolean = false — Deactivate auto-pause
+- `a11y` list of — Accessibility
+ - `label` text — Track label
+ - `kind` one of "subtitles" | "captions" | "descriptions" | "chapters" = "descriptions" — Type kind, refer to HTML living standard
+ - `srcLang` text = "en" — Source language, must be defined for subtitles: Must be a valid BCP 47 language tag. If the kind attribute is set to subtitles, then srclang must be defined.
+ - `track` file, required — Track file (WebVTT)
+
+13 interface texts are left out: they come from the libraries' translations. `h5p-author schema H5P.Video --all` lists them, for a source to set one.
+
+
diff --git a/skills/h5p-author/scripts/build-quiz.mjs b/skills/h5p-author/scripts/build-quiz.mjs
deleted file mode 100644
index c45ea3eb..00000000
--- a/skills/h5p-author/scripts/build-quiz.mjs
+++ /dev/null
@@ -1,446 +0,0 @@
-import { constants, createReadStream } from 'node:fs'
-import { copyFile, mkdtemp, open, readFile, realpath, rm } from 'node:fs/promises'
-import { createRequire } from 'node:module'
-import { dirname, join, resolve } from 'node:path'
-import { Readable, Writable } from 'node:stream'
-import { fileURLToPath, pathToFileURL } from 'node:url'
-import { createHash, randomUUID } from 'node:crypto'
-
-/**
- * @typedef {{ text: string, correct: boolean, feedback?: string }} Answer
- * @typedef {{ title?: string, prompt: string, multipleAnswers?: boolean, answers: Answer[] }} Question
- * @typedef {{
- * kind: 'multiple-choice' | 'question-set', title: string, language: string, license: string,
- * authors: { name: string, role: 'Author' }[], passPercentage?: number,
- * passedFeedback?: string, failedFeedback?: string, questions: Question[]
- * }} Quiz
- * @typedef {{
- * name: string, type: string, optional?: boolean, default?: unknown,
- * fields?: Field[], field?: Field, min?: number, defaultNum?: number, tags?: string[]
- * }} Field
- */
-
-function record(value, path, keys) {
- if (!value || typeof value !== 'object' || Array.isArray(value)) throw new Error(`${path}: expected an object`)
- for (const key of Object.keys(value)) {
- if (!keys.includes(key)) throw new Error(`${path}.${key}: unsupported field`)
- }
-}
-
-function text(value, path) {
- if (typeof value !== 'string' || !value.trim()) throw new Error(`${path}: expected non-empty text`)
-}
-
-/** @param {unknown} source @returns {asserts source is Quiz} */
-export function validateQuiz(source) {
- record(source, 'quiz', ['kind', 'title', 'language', 'license', 'authors', 'passPercentage', 'passedFeedback', 'failedFeedback', 'questions'])
- const quiz = /** @type {Quiz} */ (source)
- if (!['multiple-choice', 'question-set'].includes(quiz.kind)) throw new Error('quiz.kind: use "multiple-choice" or "question-set"')
- for (const key of ['title', 'language', 'license']) text(quiz[key], `quiz.${key}`)
- if (quiz.title.length > 255) throw new Error('quiz.title: at most 255 characters')
- try {
- Intl.getCanonicalLocales(quiz.language)
- } catch {
- throw new Error('quiz.language: expected a BCP 47 language tag, such as "en"')
- }
- if (!['U', 'CC BY', 'CC BY-SA', 'CC BY-ND', 'CC BY-NC', 'CC BY-NC-SA', 'CC BY-NC-ND', 'CC0 1.0', 'PD', 'C'].includes(quiz.license)) {
- throw new Error('quiz.license: use an H5P license code (for example "U", "CC BY", or "CC0 1.0")')
- }
- if (!Array.isArray(quiz.authors) || !quiz.authors.length) throw new Error('quiz.authors: name at least one author')
- quiz.authors.forEach((author, i) => {
- record(author, `quiz.authors[${i}]`, ['name', 'role'])
- text(author.name, `quiz.authors[${i}].name`)
- if (author.role !== 'Author') throw new Error(`quiz.authors[${i}].role: use "Author"`)
- })
- if (quiz.passPercentage !== undefined && (!Number.isInteger(quiz.passPercentage) || quiz.passPercentage < 0 || quiz.passPercentage > 100)) {
- throw new Error('quiz.passPercentage: expected an integer from 0 to 100')
- }
- if (quiz.passedFeedback !== undefined || quiz.failedFeedback !== undefined) {
- // One without the other leaves some learners with no word on the result.
- for (const key of ['passedFeedback', 'failedFeedback']) {
- if (quiz[key] === undefined) throw new Error(`quiz.${key}: set passedFeedback and failedFeedback together`)
- text(quiz[key], `quiz.${key}`)
- }
- if (quiz.passPercentage === undefined) throw new Error('quiz.passPercentage: set it with passedFeedback and failedFeedback; the library defaults differ by kind')
- }
- if (!Array.isArray(quiz.questions) || !quiz.questions.length) throw new Error('quiz.questions: at least one question is required')
- if (quiz.kind === 'multiple-choice' && quiz.questions.length !== 1) throw new Error('quiz.questions: multiple-choice requires exactly one question')
- quiz.questions.forEach((question, i) => {
- const path = `quiz.questions[${i}]`
- record(question, path, ['title', 'prompt', 'multipleAnswers', 'answers'])
- text(question.prompt, `${path}.prompt`)
- if (question.title !== undefined) text(question.title, `${path}.title`)
- if (question.multipleAnswers !== undefined && typeof question.multipleAnswers !== 'boolean') throw new Error(`${path}.multipleAnswers: expected a boolean`)
- if (!Array.isArray(question.answers) || question.answers.length < 2) throw new Error(`${path}.answers: at least two answers are required`)
- question.answers.forEach((answer, j) => {
- const answerPath = `${path}.answers[${j}]`
- record(answer, answerPath, ['text', 'correct', 'feedback'])
- text(answer.text, `${answerPath}.text`)
- if (typeof answer.correct !== 'boolean') throw new Error(`${answerPath}.correct: expected a boolean`)
- if (answer.feedback !== undefined) text(answer.feedback, `${answerPath}.feedback`)
- })
- const correct = question.answers.filter(answer => answer.correct).length
- if (question.multipleAnswers ? correct === 0 : correct !== 1) {
- throw new Error(`${path}.answers: ${question.multipleAnswers ? 'at least one' : 'exactly one'} answer must be correct`)
- }
- })
-}
-
-/** Fill only the field kinds these two content types use; a changed schema must fail loudly.
- * @param {Field[]} fields @param {Record} written
- * @returns {Record}
- */
-function parameters(fields, written) {
- for (const key of Object.keys(written)) {
- if (!fields.some(field => field.name === key)) throw new Error(`Installed semantics do not name "${key}"`)
- }
- return Object.fromEntries(fields.map(field => [field.name, valueFor(field, written[field.name])]).filter(([, value]) => value !== undefined))
-}
-
-/** @param {Field} field @param {unknown} written @returns {unknown} */
-function valueFor(field, written) {
- if (field.type === 'group') {
- const fields = field.fields
- if (!fields?.length) throw new Error(`Invalid group semantics: ${field.name}`)
- // H5P saves a group with one field as that field, without the group's wrapper.
- if (fields.length === 1) return valueFor(fields[0], written)
- return parameters(fields, /** @type {Record} */ (written ?? field.default ?? {}))
- }
- if (field.type === 'list') {
- const list = written ?? field.default
- if (list !== undefined) {
- if (!Array.isArray(list)) throw new Error(`Expected a list: ${field.name}`)
- return list.map(item => valueFor(field.field, item))
- }
- if (field.optional) return undefined
- throw new Error(`Missing required list: ${field.name}`)
- }
- if (field.type === 'library' && written !== undefined) return written
- if (written !== undefined) return written
- if (field.default !== undefined) return structuredClone(field.default)
- if (field.type === 'boolean') return false
- if (field.optional) return undefined
- throw new Error(`No authoring value or default for required field: ${field.name} (${field.type})`)
-}
-
-/** Plain text as H5P stores a text field: escaped, since the libraries insert it as HTML. */
-function escape(value) {
- return value.replaceAll('&', '&').replaceAll('<', '<').replaceAll('>', '>').replaceAll('"', '"').replaceAll("'", ''')
-}
-
-function html(value) {
- return `${escape(value).replaceAll('\n', ' ')} `
-}
-
-/**
- * The pass mark as two score ranges for the content's overall feedback. The libraries pick a
- * range by the floored percentage and judge `success` by the exact one, which agree for a whole
- * number, so the message a learner gets matches the result an LMS records.
- * @param {Quiz} quiz
- */
-function passFeedback(quiz) {
- if (quiz.passedFeedback === undefined || quiz.failedFeedback === undefined || quiz.passPercentage === undefined) return undefined
- const pass = quiz.passPercentage
- return [
- ...(pass > 0 ? [{ from: 0, to: pass - 1, feedback: escape(quiz.failedFeedback) }] : []),
- { from: pass, to: 100, feedback: escape(quiz.passedFeedback) }
- ]
-}
-
-/** A tag's canonical form in lower case, as H5P names its files; a name that is no tag as it is. */
-function canonical(tag) {
- try {
- return Intl.getCanonicalLocales(tag)[0].toLowerCase()
- } catch {
- return tag.toLowerCase()
- }
-}
-
-/** The script a tag is written in, its own or the likely one: `Cyrl` for `sr`. */
-function scriptOf(tag) {
- try {
- return new Intl.Locale(tag).maximize().script
- } catch {
- return undefined
- }
-}
-
-/**
- * Which of a library's translation files serve a language tag, best first: RFC 4647 lookup over
- * the files' names, so `de-AT` takes `de.json` and `pt-BR` `pt-br.json`. A shorter tag written in
- * another script is passed over: `sr.json` is Cyrillic, so `sr-Latn` takes none. Names are compared
- * in canonical form, since H5P names Northern Sami `sme`, which is `se` as a tag. Two exceptions
- * follow H5P's own naming. Norwegian Bokmål is `nb`. Chinese goes by script and never to a bare
- * `zh.json`, which is Traditional in Question Set 1.21 where the tag means Simplified.
- * @param {string[]} files the files' names, without `.json`
- * @param {string} language
- */
-export function translationFiles(files, language) {
- const tag = Intl.getCanonicalLocales(language)[0]
- const { language: base, script } = new Intl.Locale(tag).maximize()
- let names
- if (base === 'zh') names = script === 'Hant' ? ['zh-hant', 'zh-tw'] : ['zh-hans', 'zh-cn']
- else {
- const subtags = tag.toLowerCase().split('-')
- names = subtags.map((_, i) => subtags.slice(0, subtags.length - i).join('-')).filter(name => scriptOf(name) === script)
- if (base === 'no') names.push('nb')
- }
- return names.flatMap(name => files.filter(file => canonical(file) === name))
-}
-
-/** What the libraries fill into their own texts: `:num`, `@total`, `%d`. */
-const PLACEHOLDER = /[:@%][A-Za-z]+/g
-
-/**
- * A translation file's `semantics` laid over a library's, position by position, as an H5P editor
- * lays it: the text defaults it replaces, and those that stay English. Only a text field's default
- * is replaced, never a select's value. The English stays where the translation has no text, the
- * same text, or text without a placeholder the library fills in, which a learner would otherwise
- * meet as `@finals`.
- * @param {Field[]} fields @param {unknown} translation
- */
-export function translateDefaults(fields, translation) {
- /** @type {{ field: Field, text: string }[]} */
- const translated = []
- /** @type {{ field: string, text: string, dropped?: string[] }[]} */
- const english = []
- /** @param {Field[]} fields @param {unknown} translation @param {string} path @param {string} [item] */
- const walk = (fields, translation, path, item) => fields.forEach((field, i) => {
- const entry = Array.isArray(translation) && translation[i] && typeof translation[i] === 'object' ? translation[i] : undefined
- const name = item ?? (path ? `${path}.${field.name}` : field.name)
- if (field.type === 'text' && typeof field.default === 'string') {
- const text = entry?.default
- const kept = typeof text === 'string' ? text.match(PLACEHOLDER) ?? [] : []
- const dropped = typeof text === 'string' ? (field.default.match(PLACEHOLDER) ?? []).filter(placeholder => !kept.includes(placeholder)) : []
- if (typeof text === 'string' && text.trim() && text !== field.default && !dropped.length) translated.push({ field, text })
- else english.push({ field: name, text: field.default, ...(dropped.length ? { dropped } : {}) })
- }
- if (field.fields) walk(field.fields, entry?.fields, name)
- if (field.field) walk([field.field], entry ? [entry.field] : undefined, name, `${name}[]`)
- })
- walk(fields, translation, '')
- return { strings: translated.length + english.length, translated, english }
-}
-
-/** The versions the helper is tested with; a missing or older install is refused with this command. */
-const INSTALL = 'npm install --save-dev @missing-elements/h5p-libraries@^1 @zip.js/zip.js@^2.24'
-
-/**
- * Dependencies are resolved from the caller's project, not from the installed skill directory.
- * @param {string} project
- */
-async function dependencies(project) {
- const require = createRequire(join(resolve(project), 'package.json'))
- try {
- // appendZip has no filter before zip.js 2.20, so each part's own h5p.json would be copied too.
- const { version } = require('@zip.js/zip.js/package.json')
- const [major, minor] = version.split('.').map(Number)
- if (major < 2 || (major === 2 && minor < 24)) throw new Error(`@zip.js/zip.js ${version} is older than 2.24`)
- const [zip, { pack }] = await Promise.all([
- import(pathToFileURL(require.resolve('@zip.js/zip.js')).href),
- import(pathToFileURL(require.resolve('@missing-elements/h5p-libraries')).href)
- ])
- return { zip, pack }
- } catch (error) {
- throw new Error(`Cannot load authoring dependencies from the current project. Run: ${INSTALL}`, { cause: error })
- }
-}
-
-/** @param {unknown} source @param {string} output @param {string} [project] */
-export async function buildQuiz(source, output, project = process.cwd()) {
- validateQuiz(source)
- const { zip, pack } = await dependencies(project)
- const { ZipReader, ZipWriter, Reader, TextReader, TextWriter } = zip
- const selected = new Map()
- const readers = new Map()
-
- // The pack's largest library need not fit in memory.
- class FileReader extends Reader {
- constructor(path) { super(); this.path = path }
- async init() {
- await super.init()
- this.file = await open(this.path, 'r')
- this.size = (await this.file.stat()).size
- }
- async readUint8Array(offset, length) {
- const bytes = new Uint8Array(length)
- let read = 0
- while (read < length) {
- const { bytesRead } = await this.file.read(bytes, read, length - read, offset + read)
- if (!bytesRead) throw new Error(`Short read from library part: ${this.path}`)
- read += bytesRead
- }
- return bytes
- }
- createReadable({ offset = 0, size = this.size - offset } = {}) {
- if (!size) return new ReadableStream({ start(controller) { controller.close() } })
- return Readable.toWeb(createReadStream(this.path, { start: offset, end: offset + size - 1 }))
- }
- }
-
- async function use(machineName, major, minor = 0) {
- const candidates = pack.libraries.filter(lib => lib.machineName === machineName && (major === undefined || lib.majorVersion === major) && lib.minorVersion >= minor)
- candidates.sort((a, b) => b.majorVersion - a.majorVersion || b.minorVersion - a.minorVersion || b.patchVersion - a.patchVersion)
- const candidate = candidates[0]
- if (!candidate) throw new Error(`Installed pack cannot supply ${machineName} ${major ?? ''}.${minor}`)
- if (selected.has(candidate.folder)) return selected.get(candidate.folder)
- const library = { ...candidate }
- selected.set(library.folder, library)
- const path = new URL(library.url)
- const hash = createHash('sha256')
- for await (const chunk of createReadStream(path)) hash.update(chunk)
- if (hash.digest('hex') !== library.sha256) throw new Error(`Library part failed SHA-256: ${library.folder}. Reinstall the library pack.`)
- const file = new FileReader(path)
- const reader = new ZipReader(file, { checkSignature: true })
- readers.set(library.folder, { reader, file })
- const entries = (await reader.getEntries()).filter(entry => !entry.directory && entry.filename.startsWith(`${library.folder}/`))
- const metadata = entries.find(entry => entry.filename === `${library.folder}/library.json`)
- if (!metadata) throw new Error(`Library part has no library.json: ${library.folder}`)
- const info = JSON.parse(await metadata.getData(new TextWriter()))
- if (info.machineName !== library.machineName || Number(info.majorVersion) !== library.majorVersion || Number(info.minorVersion) !== library.minorVersion || Number(info.patchVersion) !== library.patchVersion) {
- throw new Error(`Library part disagrees with pack index: ${library.folder}`)
- }
- const semantics = entries.find(entry => entry.filename === `${library.folder}/semantics.json`)
- if (semantics) library.semantics = JSON.parse(await semantics.getData(new TextWriter()))
- const languages = `${library.folder}/language/`
- library.translations = new Map(entries.filter(entry => entry.filename.startsWith(languages) && entry.filename.endsWith('.json'))
- .map(entry => [entry.filename.slice(languages.length, -'.json'.length), entry]))
- for (const dependency of [...(info.preloadedDependencies ?? []), ...(info.dynamicDependencies ?? [])]) {
- await use(dependency.machineName, Number(dependency.majorVersion), Number(dependency.minorVersion))
- }
- return library
- }
-
- /**
- * The library's interface texts in the quiz's language, from the first of its own translations
- * that translates any. An H5P editor fills new content's defaults from these files: every field
- * from the translation for the editor's own language, then the fields a library marks `common`
- * from the one for the content's. With no editor here, the quiz's language fills all of them.
- */
- async function localize(library) {
- const label = `${library.machineName} ${library.majorVersion}.${library.minorVersion}`
- for (const name of translationFiles([...library.translations.keys()], source.language)) {
- const entry = library.translations.get(name)
- let translation
- try {
- translation = JSON.parse(await entry.getData(new TextWriter())).semantics
- } catch (error) {
- throw new Error(`Library translation is not JSON: ${entry.filename}`, { cause: error })
- }
- const { strings, translated, english } = translateDefaults(library.semantics, translation)
- if (!translated.length) continue
- // Plain text as H5P stores it; a field with `tags` holds markup, which the content check filters.
- for (const { field, text } of translated) field.default = field.tags ? text : escape(text)
- return { library: label, translation: name, strings, english }
- }
- const { strings, english } = translateDefaults(library.semantics, undefined)
- return { library: label, translation: null, strings, english }
- }
-
- let temporary
- try {
- const choice = await use('H5P.MultiChoice', 1)
- const set = source.kind === 'question-set' ? await use('H5P.QuestionSet', 1) : null
- if (!choice.semantics || (set && !set.semantics)) throw new Error('The installed quiz libraries must carry semantics.json')
- const translations = []
- for (const library of set ? [set, choice] : [choice]) translations.push(await localize(library))
- // The whole quiz's result, never a question's inside a set, which shows its own after Check.
- const overallFeedback = passFeedback(source)
- // An untitled question is named as the set labels it itself, in the quiz's language; its
- // result screen lists each question by this title. A default is stored as it stands.
- const label = set?.semantics.find(field => field.name === 'texts')?.fields?.find(field => field.name === 'questionLabel')?.default ?? 'Question'
- // A question's title and authors as H5P stores a text field: the platforms check sub-content
- // metadata as they check its parameters, and Question Set draws the title as HTML.
- const authors = source.authors.map(author => ({ ...author, name: escape(author.name) }))
- const questions = source.questions.map((question, i) => {
- const written = {
- question: html(question.prompt),
- answers: question.answers.map(answer => ({
- text: html(answer.text), correct: answer.correct,
- tipsAndFeedback: answer.feedback ? { chosenFeedback: html(answer.feedback) } : {}
- })),
- behaviour: {
- type: question.multipleAnswers ? 'multi' : 'single',
- ...(!set && source.passPercentage !== undefined ? { passPercentage: source.passPercentage } : {})
- },
- ...(!set && overallFeedback ? { overallFeedback } : {})
- }
- return {
- library: `${choice.machineName} ${choice.majorVersion}.${choice.minorVersion}`,
- params: parameters(choice.semantics, written),
- subContentId: randomUUID(),
- metadata: { title: question.title === undefined ? `${label} ${i + 1}` : escape(question.title), license: source.license, authors }
- }
- })
- const content = set
- ? parameters(set.semantics, {
- questions,
- ...(source.passPercentage === undefined ? {} : { passPercentage: source.passPercentage }),
- ...(overallFeedback ? { endGame: { overallFeedback } } : {})
- })
- : questions[0].params
- const root = set ?? choice
- // As H5P's exports write it, unescaped: the platforms check it when they load content.
- const manifest = {
- title: source.title, language: source.language, defaultLanguage: source.language,
- license: source.license, authors: source.authors, mainLibrary: root.machineName, embedTypes: ['div'],
- preloadedDependencies: [...selected.values()].map(lib => ({
- machineName: lib.machineName, majorVersion: String(lib.majorVersion), minorVersion: String(lib.minorVersion)
- }))
- }
-
- output = resolve(output)
- temporary = await mkdtemp(join(dirname(output), '.h5p-author-'))
- const staged = join(temporary, 'quiz.h5p')
- const file = await open(staged, 'wx')
- try {
- const writer = new ZipWriter(Writable.toWeb(file.createWriteStream()), { useWebWorkers: false })
- await writer.add('h5p.json', new TextReader(JSON.stringify(manifest)))
- for (const library of selected.values()) {
- await writer.appendZip(readers.get(library.folder).file, {
- filter: entry => !entry.directory && entry.filename.startsWith(`${library.folder}/`)
- })
- }
- await writer.add('content/content.json', new TextReader(JSON.stringify(content)))
- await writer.close()
- } finally {
- await file.close()
- }
- // Unlike a hard link, an exclusive copy also works on FAT/exFAT destinations.
- await copyFile(staged, output, constants.COPYFILE_EXCL)
- return { output, manifest, content, libraries: [...selected.keys()], translations }
- } finally {
- for (const { reader, file } of readers.values()) {
- try { await reader.close() } finally { await file.file?.close() }
- }
- if (temporary) await rm(temporary, { recursive: true, force: true })
- }
-}
-
-if (process.argv[1] && await realpath(process.argv[1]) === fileURLToPath(import.meta.url)) {
- const args = process.argv.slice(2)
- if (args.length === 1 && args[0] === '--help') {
- console.log(`Usage: node /scripts/build-quiz.mjs \nRun from a project with the dependencies installed: ${INSTALL}\nBuilds a self-contained, text-only Multiple Choice or Question Set. Refuses to overwrite output.`)
- } else {
- try {
- if (args.length !== 2 || args.some(arg => arg.startsWith('--'))) throw new Error('Usage: node /scripts/build-quiz.mjs ')
- const source = JSON.parse(await readFile(resolve(args[0]), 'utf8'))
- const result = await buildQuiz(source, args[1])
- console.log(`Built ${result.output}\n${result.manifest.mainLibrary}; ${result.libraries.length} libraries from the installed pack.\nNot verified: run h5p-verify and inspect its screenshot before handing this package over.`)
- if (!/^en(?:-|$)/i.test(source.language)) {
- for (const { library, translation, strings, english } of result.translations) {
- if (!translation) console.warn(`${library} has no translation for ${source.language}: its ${strings} interface texts are English.`)
- else if (!english.length) console.log(`${library}: interface texts from its translation language/${translation}.json.`)
- else {
- const list = english.map(({ field, text, dropped }) => ` ${field}: ${JSON.stringify(text)}${dropped ? ` (its translation drops ${dropped.join(' and ')})` : ''}`)
- console.warn(`${library}: interface texts from its translation language/${translation}.json; ${english.length} of ${strings} as in English, untranslated or the same word:\n${list.join('\n')}`)
- }
- }
- }
- } catch (error) {
- console.error(`h5p-author: ${error.message}`)
- if (error.cause) console.error(error.cause.message)
- process.exitCode = 1
- }
- }
-}
|