Book format

Exercises

The six scored exercise types and how their answers are checked.

L is a Localized map (base-language text by locale); ? marks an optional field.

Every exercise: {kind: "exercise", id, exerciseType, instruction: L, prompt, answer, feedback?: {explain: L}, scoring?: {points (default 1), attempts (default 3)}}.

A choice item is {id, fa} (target text) or {id, text: L} (base text), with an optional audio. Order segments are always {id, fa}. The prompt may also carry fa and pron (a target sentence), text L, gloss L, hint L and audio.

exerciseType prompt answer Rule
choice choices choiceIds: [id] Each id is one of the choices.
listenSelect audio, choices choiceIds Needs audio.
dictation audio, hint? L accepted: [string] Needs audio and at least one accepted answer.
match left, right: choice items pairs: [[leftId, rightId]] Every left id is paired exactly once.
order segments: [{id, fa}] order: [id] The order is all segment ids, each once.
fillBlank template with {{1}}, {{2}} …, wordBank?, text? L blanks: [[accepted, …], …] Slots numbered 1..n with no gaps; one non-empty list per slot. The first accepted answer is the one shown.
{ "kind": "exercise", "id": "p3", "exerciseType": "fillBlank",
  "instruction": { "en": "Complete the sentence." },
  "prompt": { "template": "Me {{1}} Ana.", "wordBank": ["llamo", "llama", "llaman"], "text": { "en": "My name is Ana." } },
  "answer": { "blanks": [["llamo"]] },
  "scoring": { "points": 1, "attempts": 3 } }