fix(author): settings that go stale when a chat changes a content are noted, and the outline says what a draw shows (#268)
Closes #268.
The build checks each source on its own, so a setting that was right before a content was changed, and is wrong after, passes unsaid. In ChatGPT a Question Set of six questions came with poolSize: 3 after the chat was asked to add questions, and went on showing three. This adds a note for each setting of that kind a scan of the pack found, and the outline now says what a draw shows.
The scan
The 80 libraries with semantics in the pack: all 156 number fields, the fields drawn by a widget of the type's own, and the fields whose name or description says they name another part.
| Kind | Fields | Now |
|---|---|---|
| Items drawn at random | Question Set poolSize, Memory Game behaviour.numCardsToUse, Crossword behaviour.poolSize | a note, by one rule (draws) |
| Items to find | Find Multiple Hotspots numberHotspots | a note |
| A part named by what is not there | Course Presentation goToSlide; Drag and Drop a zone's correctElements and an element's dropZones; Agamotto startImage; Virtual Tour startSceneId and a "go to scene"'s nextSceneId; Personality Quiz an answer's personality | a note |
| Already checked | Branching Scenario nextContentId (in range), Game Map paths (by stage label) | as before |
| Found, not covered | Advanced Blanks' gaps against its list, and its snippets by name; a Game Map restriction's stage id; Interactive Video's times against the video's length (#260); positions; Game Map finishScore | not here |
| Not looked for | a select tied to the content, as Multiple Choice's single or multiple answers; links inside a text | not here |
What changes
Each is a note, never a problem: a draw may be meant, and a package from elsewhere must still build. Each says what its library does with the value, read in the library's script.
- Draws (
lib/mistakes.mjs): one function,drawOf, works out what each draw shows as its library does, for the notes and the outline both. Below the list's length, both numbers ("shows 3 of the 6 questions each time, drawn at random, and leaves the rest out: leave it out to show them all, or tell the user that it draws"); at its length, "so it leaves none out, and one added later would leave one out at random"; above it, "until more than N are". Question Set shuffles wheneverpoolSizeis set, which the note says; Memory Game draws pairs, at least 2; Crossword keeps the words fixed on the grid and draws only among the rest ("shows 3 of the 4 words each time, the 2 fixed on the grid and 1 of the other 2 drawn at random", or "shows only the 2 words fixed on the grid, and never the other 2"). - Items to find (Find Multiple Hotspots): above the hotspots there are, the library does not use it; above those marked correct, "no learner can finish"; below, "ends the task once 2 of the 3 correct hotspots are found"; as many, "one added later would not be asked for".
- Course Presentation: a button to a slide past the last, "goes to slide 3, and there are 2 slides".
- Drag and Drop: a zone's right element, or an element's zone, that is not there; and an element that can be dropped in none of the zones it is right in, "so no learner can put it right". One that can be dropped in some of them is left unsaid.
- Agamotto: a start image below 1 or past the last. The library holds it to those there are, so the note says where it starts; a fraction is refused by the build already.
- Virtual Tour: a start scene, or a "go to scene", whose id no scene has.
- Personality Quiz: an answer's name that no personality is called exactly. The library parts the names at a comma and a space and counts one only as its personality has it, capitals too; the answer's other names still count, and an empty part after a comma at the end is not said.
- The outline's first line says how many of how many a quiz, a memory game or a crossword shows, where it draws: "Shows 3 of the 6 questions each time, drawn at random".
- Type files: Question Set and Memory Game say their draw setting is not the number of items, and to leave it out unless a random draw is asked for.
- design/author.md: the rule, under What builds and is almost surely a mistake is a note, with what the scan did not look for.
Review of the issue
A review of #268 after the second commit found, and the third fixes:
- The notes were written from the fields' labels. Read in the scripts, three were wrong or loose: Personality Quiz (the note took another capital, or a comma with no space, as fine), Find Multiple Hotspots (a number above the hotspots is not used; the note said no learner could finish), Agamotto (held to the images there are).
- The scan had missed a Drag and Drop element's
dropZones. - (cubic, after) Crossword's fixed words and Question Set's shuffle were not counted; fixed in the fourth commit, with
drawOf. - (cubic, after) A Personality Quiz answer with one unknown name was said to count for none, and Agamotto's note read a fraction the build refuses; fixed in the fifth.
- The issue told the ChatGPT case as known where part was inferred: whether the first source had
poolSizeis not known. - "None fires in the 88 real packages" said nothing for the four types the 88 do not hold.
Testing
build.test.ts: the three cases of a draw (2, 3 and 5 of 3 questions); a memory game; a crossword, with and without words fixed on the grid; a Course Presentation button to slide 3 of 2; a Drag and Drop with a right element and a zone that are not there and an element that cannot be put right; a Personality Quiz answer with a renamed personality, one in another case, one ending in a comma, and one with a known and an unknown name; an Agamotto start image past the last, and a fraction refused.confine.test.ts: the outline's first line for a quiz, a crossword with and without a fixed word, and a memory game that draw, and none at the list's length.- The author package's unit tests (287) and its type check pass.
- The owner's 88 real packages: none of the notes fires. 18 hold a Course Presentation, 15 a Drag and Drop, 12 a Question Set, 2 a Virtual Tour, 1 a Crossword. None holds a Memory Game, a Personality Quiz, an Agamotto or a Find Multiple Hotspots, so for those four this says nothing. One Drag and Drop names two elements right in a zone they cannot be dropped in, beside the one they can: the first form of the note fired there twice, and it now notes only an element that can never be put right.
- On Haiku, as a chat with the type files only:
- Four runs writing a three-question quiz and then adding two or three questions, two with the old type file and two with the new: none wrote
poolSize, and "random order" still gaverandomQuestions. Haiku does not make this mistake either way. - One run handed a six-question source with
poolSize3 and the build's answer with the note: it removedpoolSize, keptrandomQuestions, and told the user all six now show every time.
- Four runs writing a three-question quiz and then adding two or three questions, two with the old type file and two with the new: none wrote
Not verified
- No note was played: what each library does was read in its script (Memory Game 1.3.53, Crossword 0.5.13, Find Multiple Hotspots 1.0.1, Course Presentation 1.27.27, Drag and Drop 1.15.37, Agamotto 1.6.8, Virtual Tour 0.5.8, Personality Quiz 1.0.8), not seen in a browser. What a Course Presentation button to a slide past the last, or a tour's unknown scene id, does when pressed was not run, and the notes do not say.
- ChatGPT reading the notes and the outline: the app's server uses the published author package, so this needs a release.
- The notes other than a Question Set's draw, on a model.
- The browser tests and the other packages' tests: nothing outside
lib/mistakes.mjsandlib/outline.mjschanges in code.
Release
@missing-elements/h5p-author 0.17.0 (notes and an outline line added, nothing breaks), and the org site's pin after it.
Summary by cubic
Says what goes stale when a chat changes a content, and the outline's first line says how many of how many a quiz, a memory game, or a crossword shows where it draws.
- Notes cover draws below, at, or above a list's length, Find Multiple Hotspots'
numberHotspots, and a part named by a number, id, or name that is not there: Course Presentation slides, Drag and Drop zones and elements, Agamotto's start image, Virtual Tour scene ids, and a Personality Quiz answer's personality. - One function,
drawOf, works out what each draw shows as its library does, read in its script: Question Set shuffles wheneverpoolSizeis set, Memory Game draws pairs (at least 2), and Crossword keeps words fixed on the grid and draws only among the rest. drawOfdrops a fraction as Question Set'sslice(0, poolSize)and Crossword'ssplicedo; a build holds both fields to whole numbers, so this matters only for a check of saved content.- Personality Quiz counts each answer name on its own, and an empty part after a comma names nothing and is not said.
- The type files say draw settings are not the item count;
design/author.mdrecords the rule, the ChatGPT case, and what the scan left out; tests cover draws at, below, and above the count, a crossword's fixed words, and each named-part note.