@lernapps/tooling 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +67 -2
  3. package/archetypes/shared/a11y.ts +38 -0
  4. package/archetypes/shared/hooks/pre-commit +22 -0
  5. package/archetypes/shared/hooks/pre-push +4 -0
  6. package/archetypes/shared/i18n.ts +25 -0
  7. package/archetypes/shared/install-hooks.ts +63 -0
  8. package/archetypes/shared/playwright.ts +54 -0
  9. package/archetypes/shared/preset.ts +81 -0
  10. package/archetypes/shared/storage.ts +167 -0
  11. package/archetypes/shared/tsconfig.json +27 -0
  12. package/check/validation-report.v1.schema.json +116 -0
  13. package/dist/a11y.mjs +30 -0
  14. package/dist/check/rules/accessible.mjs +18 -0
  15. package/dist/check/rules/app-content-guide.mjs +69 -0
  16. package/dist/check/rules/dependency-licence.mjs +82 -0
  17. package/dist/check/rules/entry-fitness-matches.mjs +22 -0
  18. package/dist/check/rules/entry-links-resolve.mjs +44 -0
  19. package/dist/check/rules/explainer-readable-without-js.mjs +66 -0
  20. package/dist/check/rules/links-resolve.mjs +10 -0
  21. package/dist/check/rules/lockfile-matches.mjs +57 -0
  22. package/dist/check/rules/no-request-before-click.mjs +17 -0
  23. package/dist/check/rules/no-tracking.mjs +17 -0
  24. package/dist/check/rules/own-data-only.mjs +66 -0
  25. package/dist/check/rules/pages-reachable.mjs +25 -0
  26. package/dist/check/rules/usable-at-360px.mjs +19 -0
  27. package/dist/check-cv4I6CCH.mjs +28 -0
  28. package/dist/cli.mjs +3118 -0
  29. package/dist/i18n.mjs +11 -0
  30. package/dist/lint.mjs +528 -0
  31. package/dist/plan-DWKayEnY.mjs +75 -0
  32. package/dist/playwright.mjs +47 -0
  33. package/dist/preset.mjs +60 -0
  34. package/dist/skills/lernapps-app/SKILL.md +49 -0
  35. package/dist/skills/lernapps-cli/SKILL.md +156 -0
  36. package/dist/skills/lernapps-cli/references/platform-rules.md +258 -0
  37. package/dist/skills/lernapps-commit/SKILL.md +39 -0
  38. package/dist/skills/lernapps-content-growth/SKILL.md +33 -0
  39. package/dist/skills/lernapps-content-questions/SKILL.md +133 -0
  40. package/dist/skills/lernapps-content-questions/references/question-types.md +69 -0
  41. package/dist/skills/lernapps-content-research/SKILL.md +50 -0
  42. package/dist/skills/lernapps-content-research/references/sources.md +16 -0
  43. package/dist/skills/lernapps-exercise-patterns/SKILL.md +74 -0
  44. package/dist/skills/lernapps-exercise-patterns/references/biology-geography.md +13 -0
  45. package/dist/skills/lernapps-exercise-patterns/references/chemistry.md +16 -0
  46. package/dist/skills/lernapps-exercise-patterns/references/computer-science.md +13 -0
  47. package/dist/skills/lernapps-exercise-patterns/references/figures.md +10 -0
  48. package/dist/skills/lernapps-exercise-patterns/references/history.md +13 -0
  49. package/dist/skills/lernapps-exercise-patterns/references/mathematics.md +19 -0
  50. package/dist/skills/lernapps-exercise-patterns/references/page-structures.md +8 -0
  51. package/dist/skills/lernapps-exercise-patterns/references/physics.md +18 -0
  52. package/dist/skills/lernapps-exercise-patterns/references/success.md +28 -0
  53. package/dist/skills/lernapps-explainer/SKILL.md +33 -0
  54. package/dist/skills/lernapps-explainer/references/blocks.md +83 -0
  55. package/dist/skills/lernapps-explainer/references/components.md +66 -0
  56. package/dist/skills/lernapps-explainer/references/exercises.md +115 -0
  57. package/dist/skills/lernapps-explainer/references/rules.md +285 -0
  58. package/dist/skills/lernapps-explainer/references/runtime.md +79 -0
  59. package/dist/skills/lernapps-explainer/references/structure.md +24 -0
  60. package/dist/skills/lernapps-explainer-design/SKILL.md +57 -0
  61. package/dist/skills/lernapps-explainer-design/references/rules.md +75 -0
  62. package/dist/skills/lernapps-explainer-self-assessment/SKILL.md +93 -0
  63. package/dist/skills/lernapps-github/SKILL.md +102 -0
  64. package/dist/skills/lernapps-interactive/SKILL.md +141 -0
  65. package/dist/skills/lernapps-interactive/references/frame.md +30 -0
  66. package/dist/skills/lernapps-interactive-design/SKILL.md +58 -0
  67. package/dist/skills/lernapps-listing/SKILL.md +44 -0
  68. package/dist/skills/lernapps-listing/references/keeping-updated.md +33 -0
  69. package/dist/skills/lernapps-quiz/SKILL.md +100 -0
  70. package/dist/skills/lernapps-quiz-design/SKILL.md +48 -0
  71. package/dist/status-CXoQBgfU.mjs +76 -0
  72. package/dist/storage.mjs +113 -0
  73. package/generator/app/.agents/skills/app-content/SKILL.md +63 -0
  74. package/generator/app/.github/ISSUE_TEMPLATE/inhaltsfehler.yml +25 -0
  75. package/generator/app/.github/workflows/pages.yml +61 -0
  76. package/generator/app/LICENSE +21 -0
  77. package/generator/app/renovate.json +4 -0
  78. package/generator/architecture.ts +212 -0
  79. package/generator/create.ts +462 -0
  80. package/generator/init.ts +186 -0
  81. package/generator/update.ts +429 -0
  82. package/guidance/AGENTS.md +26 -0
  83. package/guidance/increment-template.md +194 -0
  84. package/guidance/plan-front-matter.v1.schema.json +36 -0
  85. package/guidance/plan-template.md +233 -0
  86. package/guidance/subagent-brief.md +25 -0
  87. package/guidance/workflow-rules.md +109 -0
  88. package/package.json +135 -4
  89. package/review/verdict.v1.schema.json +134 -0
  90. package/skills/archetypes/lernapps-explainer/SKILL.md +33 -0
  91. package/skills/archetypes/lernapps-explainer/references/blocks.md +83 -0
  92. package/skills/archetypes/lernapps-explainer/references/components.md +66 -0
  93. package/skills/archetypes/lernapps-explainer/references/exercises.md +115 -0
  94. package/skills/archetypes/lernapps-explainer/references/rules.md +285 -0
  95. package/skills/archetypes/lernapps-explainer/references/runtime.md +79 -0
  96. package/skills/archetypes/lernapps-explainer/references/structure.md +24 -0
  97. package/skills/archetypes/lernapps-explainer-design/SKILL.md +57 -0
  98. package/skills/archetypes/lernapps-explainer-design/references/rules.md +75 -0
  99. package/skills/archetypes/lernapps-explainer-self-assessment/SKILL.md +93 -0
  100. package/skills/archetypes/lernapps-interactive/SKILL.md +141 -0
  101. package/skills/archetypes/lernapps-interactive/references/frame.md +30 -0
  102. package/skills/archetypes/lernapps-interactive-design/SKILL.md +58 -0
  103. package/skills/archetypes/lernapps-quiz/SKILL.md +100 -0
  104. package/skills/archetypes/lernapps-quiz-design/SKILL.md +48 -0
  105. package/skills/content/lernapps-content-questions/SKILL.md +133 -0
  106. package/skills/content/lernapps-content-questions/references/question-types.md +69 -0
  107. package/skills/content/lernapps-content-research/SKILL.md +50 -0
  108. package/skills/content/lernapps-content-research/references/sources.md +16 -0
  109. package/skills/content/lernapps-exercise-patterns/SKILL.md +74 -0
  110. package/skills/content/lernapps-exercise-patterns/references/biology-geography.md +13 -0
  111. package/skills/content/lernapps-exercise-patterns/references/chemistry.md +16 -0
  112. package/skills/content/lernapps-exercise-patterns/references/computer-science.md +13 -0
  113. package/skills/content/lernapps-exercise-patterns/references/figures.md +10 -0
  114. package/skills/content/lernapps-exercise-patterns/references/history.md +13 -0
  115. package/skills/content/lernapps-exercise-patterns/references/mathematics.md +19 -0
  116. package/skills/content/lernapps-exercise-patterns/references/page-structures.md +8 -0
  117. package/skills/content/lernapps-exercise-patterns/references/physics.md +18 -0
  118. package/skills/content/lernapps-exercise-patterns/references/success.md +28 -0
  119. package/skills/process/lernapps-app/SKILL.md +49 -0
  120. package/skills/process/lernapps-commit/SKILL.md +39 -0
  121. package/skills/process/lernapps-content-growth/SKILL.md +33 -0
  122. package/skills/process/lernapps-github/SKILL.md +102 -0
  123. package/skills/process/lernapps-listing/SKILL.md +44 -0
  124. package/skills/process/lernapps-listing/references/keeping-updated.md +33 -0
  125. package/skills/tooling/lernapps-cli/SKILL.md +156 -0
  126. package/skills/tooling/lernapps-cli/references/platform-rules.md +258 -0
@@ -0,0 +1,133 @@
1
+ ---
2
+ name: lernapps-content-questions
3
+ description: Use in Code whenever you write or review questions with options and feedback for a lernapps.net app - the question bank of a quiz, or the quiz-type exercises of an explainer. The fields of the six question types, and how to write one clear question, options a learner could believe, feedback that explains, further reading, numbers with unit and rounding, and how to check every fact.
4
+ license: MIT
5
+ ---
6
+
7
+ # Writing questions
8
+
9
+ - Read [references/question-types.md](references/question-types.md) before you write the first question of a type:
10
+ the fields of each type, the same in a quiz and in an explainer.
11
+ - Write all questions of a round, then check every fact against its linked page, then commit.
12
+
13
+ ## Gotchas
14
+
15
+ - Read every page you link before you commit: the meant article (no "Begriffsklärung"), saying what question and
16
+ options say.
17
+ - Never guess an address. Never fill a fact from memory.
18
+ - Link resolution is the check's job: no scraper, script or API loop over the links.
19
+
20
+ ## `quiz-bank-valid`: The question bank validates
21
+
22
+ ```rule
23
+ id: quiz-bank-valid
24
+ scope: [archetype:quiz, archetype:explainer]
25
+ severity: error
26
+ ```
27
+
28
+ - Valid against the schema. Build also checks: exactly one correct in single choice, at least one in multiple
29
+ choice; unique ids and options.
30
+ - Broken bank: one line per problem (position, id); fix in `src/quiz.json`. Explainer exercise: named by file and
31
+ block path.
32
+
33
+
34
+ ## `quiz-clear-question`: One clear question at a time
35
+
36
+ ```rule
37
+ id: quiz-clear-question
38
+ scope: [archetype:quiz, archetype:explainer]
39
+ severity: warning
40
+ ```
41
+
42
+ - One thing per question, answerable before reading the options.
43
+ - Positive; avoid "nicht", never two negations. No trick questions.
44
+ - Plain, short sentences in every language (`learner-text-german`).
45
+
46
+ ## `quiz-plausible-options`: Options a learner could believe
47
+
48
+ ```rule
49
+ id: quiz-plausible-options
50
+ scope: [archetype:quiz, archetype:explainer]
51
+ severity: warning
52
+ ```
53
+
54
+ - Wrong options are real things of the same kind (a river for a river), with true background.
55
+ - Options alike in length and form. No "Alle genannten", "Keine davon" or jokes. Three or four options.
56
+
57
+ ## `quiz-feedback-explains`: Background and explanation say why
58
+
59
+ ```rule
60
+ id: quiz-feedback-explains
61
+ scope: [archetype:quiz, archetype:explainer]
62
+ severity: hint
63
+ ```
64
+
65
+ - Every option has an `info` of 1–3 sentences about the option, true either way ("Der Nil fließt durch mehrere
66
+ Länder Afrikas und mündet in Ägypten ins Mittelmeer."). A wrong option's `info` also says why it does not fit.
67
+ - `explanation`: 1–3 sentences why the answer is right; for true-false, number, ordering and matching also the
68
+ background.
69
+ - `number`: typical wrong numbers as `mistakes` (`answer`, `message`). Any question: an optional `hint`, not the
70
+ answer.
71
+ - A wrong answer's `message` (and an exercise component's `reason`) says what does not fit and where to look, never
72
+ the solution itself: the solution comes after the answer, with "Lösung" or the tutor.
73
+
74
+ ## `quiz-further-reading`: Every question links to further reading
75
+
76
+ ```rule
77
+ id: quiz-further-reading
78
+ scope: archetype:quiz
79
+ severity: warning
80
+ ```
81
+
82
+ - At least one link per question, best the German Wikipedia (`https://de.wikipedia.org/wiki/...`).
83
+ - `title` names the page ("Uluru (Wikipedia)").
84
+ - HTTP 429 → tell the creator which; mark the facts "not checked" in the plan; go on.
85
+
86
+ ## `quiz-own-words`: Write in your own words
87
+
88
+ ```rule
89
+ id: quiz-own-words
90
+ scope: archetype:quiz
91
+ severity: warning
92
+ ```
93
+
94
+ - Take facts, never sentences: Wikipedia is CC BY-SA (copying needs attribution and relicenses).
95
+ - `info` and `explanation`: new, shorter, plainer, for the app's school year. Sources in `sources`
96
+ (`third-party-licence`).
97
+
98
+ ## `quiz-number-precision`: Numbers with unit and rounding
99
+
100
+ ```rule
101
+ id: quiz-number-precision
102
+ scope: [archetype:quiz, archetype:explainer]
103
+ severity: warning
104
+ ```
105
+
106
+ - The text says how exact the answer must be ("Bis zu 100 m daneben zählt noch als richtig"); `tolerance` matches
107
+ it.
108
+ - The unit goes into `unit`, not into the answer.
109
+ - Sources differ → the tolerance covers them.
110
+
111
+ ## `quiz-fitting-type`: The type that fits the question
112
+
113
+ ```rule
114
+ id: quiz-fitting-type
115
+ scope: [archetype:quiz, archetype:explainer]
116
+ severity: hint
117
+ ```
118
+
119
+ - One fact among things of a kind: `single-choice`; several facts: `multiple-choice`; estimate a size: `number`;
120
+ compare sizes or dates: `ordering`; connect: `matching`; judge a statement: `true-false`.
121
+ - Mix the types. The type must accept every answer the text allows (`ordering` only for a fixed order).
122
+
123
+ ## `quiz-answers-checked`: Check every fact
124
+
125
+ ```rule
126
+ id: quiz-answers-checked
127
+ scope: archetype:quiz
128
+ severity: hint
129
+ ```
130
+
131
+ - Check every marked option, number and `info` against the linked article before you commit.
132
+ - A source does not open → say so in the plan, mark it "not checked"; never fill it from memory.
133
+ - Learners report errors through `.github/ISSUE_TEMPLATE/inhaltsfehler.yml`.
@@ -0,0 +1,69 @@
1
+ # Question types
2
+
3
+ | `type` | You write |
4
+ |---|---|
5
+ | `single-choice` | `options`: exactly one `"correct": true`; `info` each, `link` where useful |
6
+ | `multiple-choice` | `options`: at least one correct; `info` each, `link` where useful |
7
+ | `true-false` | `answer` (true or false) |
8
+ | `number` | `answer`, `tolerance` (0 = exact), `unit` if any; the learner may type a comma or a point |
9
+ | `ordering` | `items` in the right order; the page mixes them |
10
+ | `matching` | `pairs` as they belong; the page mixes the right side. `distractors` (1 to 4): wrong right entries that match no left one. `pairsFrom: material` instead of `pairs` takes them from the `labelled-figure` in `material` (marker left, text right; the figure needs `legend: false`) |
11
+
12
+ - Every question: `id`, `text`, `explanation`, at least one link in `links`. Optional quiz `sources`.
13
+ - Types without options carry their background in `explanation`.
14
+ - Optional `material`: what the question shows between its text and its answers, a list of blocks: `text` (restricted
15
+ Markdown), `formula`, `figure`, `labelled-figure`, `table`, `quote`, `code`. A `figure` is `image: images/<name>.svg`
16
+ (or `.png`, `.jpg`, `.webp`; the file is in `src/images/`) or drawn from numbers (`draw`), with `alt` (what it
17
+ shows), `caption` (what to look at) and, for an image, `source` and `licence` (`third-party-licence`). Use it where
18
+ the question needs the content (what does the image show, what does the table say); not as decoration. The build
19
+ fails for a missing file, a text missing in a language, raw HTML or a link to a page of the app.
20
+ - Optional `examples: { accepted, rejected }`: options and items by index from 0 or German text; numbers as number or
21
+ as typed (`"12,5"`; point = decimal mark: `8900`, never `8.900`). Build checks them; learners never see them.
22
+ Mistakes and wrong options' `info` already count as rejected.
23
+
24
+ ```json
25
+ {
26
+ "id": "ring",
27
+ "type": "single-choice",
28
+ "text": "Welche Form zeigt das Bild?",
29
+ "material": [
30
+ {
31
+ "type": "figure",
32
+ "image": "images/kreis.svg",
33
+ "alt": "Ein blauer Kreis mit einem weißen Kreis in der Mitte",
34
+ "caption": "Zwei Kreise mit demselben Mittelpunkt.",
35
+ "source": "eigene Zeichnung",
36
+ "licence": "CC0-1.0"
37
+ }
38
+ ],
39
+ "options": [
40
+ { "text": "Ein Ring", "correct": true, "info": "Ein Ring liegt zwischen zwei Kreisen mit demselben Mittelpunkt." },
41
+ { "text": "Eine Ellipse", "correct": false, "info": "Eine Ellipse hat zwei Brennpunkte." }
42
+ ],
43
+ "explanation": "Die weiße Fläche in der Mitte macht aus der Kreisscheibe einen Ring.",
44
+ "links": [{ "title": "Kreisring (Wikipedia)", "url": "https://de.wikipedia.org/wiki/Kreisring" }]
45
+ }
46
+ ```
47
+
48
+ ```json
49
+ {
50
+ "id": "grand-canyon",
51
+ "type": "single-choice",
52
+ "text": "Welcher Fluss hat den Grand Canyon in den USA geformt?",
53
+ "options": [
54
+ {
55
+ "text": "Colorado",
56
+ "correct": true,
57
+ "info": "Der Colorado ist der größte Fluss im Südwesten Nordamerikas. Er ist gut 2300 km lang.",
58
+ "link": { "title": "Colorado River (Wikipedia)", "url": "https://de.wikipedia.org/wiki/Colorado_River" }
59
+ },
60
+ {
61
+ "text": "Nil",
62
+ "correct": false,
63
+ "info": "Der Nil fließt durch mehrere Länder Afrikas und mündet in Ägypten ins Mittelmeer. Mit rund 6650 km gilt er als längster Fluss der Erde."
64
+ }
65
+ ],
66
+ "explanation": "Der Grand Canyon ist eine steile Schlucht in Arizona, etwa 450 km lang. Der Colorado hat sie über Millionen von Jahren in das Gestein gegraben.",
67
+ "links": [{ "title": "Grand Canyon (Wikipedia)", "url": "https://de.wikipedia.org/wiki/Grand_Canyon" }]
68
+ }
69
+ ```
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: lernapps-content-research
3
+ description: Use in Explore whenever you need to know what a lernapps.net app teaches - school year, Lehrplan, competencies, sources - even if the creator only names a topic; in the first version and in each increment that adds a chapter. How to use the Lehrplan as orientation, write competencies as "Ich kann …", verify sources by opening them, and keep the creator's material private. For every archetype.
4
+ license: MIT
5
+ ---
6
+
7
+ # Content research
8
+
9
+ - A filled-in content guide `.agents/skills/app-content/SKILL.md` comes first: its decisions stand; research only
10
+ the gaps.
11
+ - Content comes from the curriculum, the creator and sources you opened, never from memory.
12
+ - The questions to the creator are the plan's interview. Read every file the creator gives you.
13
+
14
+ ## 1. Lehrplan
15
+
16
+ - Orientation for grade and order, not a condition. None found → say so once; go on.
17
+ - Only the Land's official document (Kerncurriculum, Lehrplan, Bildungsplan, Rahmenlehrplan) from the ministry or
18
+ state institute. No publisher, schoolbook or portal. No Land known → KMK-Bildungsstandards.
19
+ - Download and read it yourself.
20
+ - Cite it under "Notes": title, issuer, year, address; page and unit (Inhaltsfeld, Lernbereich, Kompetenz).
21
+ - The creator's material differs → follow the material; say so in one sentence.
22
+
23
+ ## 2. Competencies
24
+
25
+ - One per line: "Ich kann …" with one observable verb (berechnen, zuordnen, erklären, unterscheiden, ablesen,
26
+ zeichnen). Never "verstehen" or "kennen".
27
+ - Yes: "Ich kann die Stromstärke in einem Reihenstromkreis berechnen."
28
+ - No: "Ich verstehe den elektrischen Strom."
29
+ - Group them into chapters, in the order of the Lehrplan or the material. Many chapters are still one app.
30
+ - Write them under "Notes". Show them at the checkpoint "research".
31
+
32
+ ## 3. Second sources
33
+
34
+ - Per competency one article or video (serlo.org, a channel the creator trusts, Wikipedia).
35
+ - Read [references/sources.md](references/sources.md) before you choose, cite or rely on a source.
36
+
37
+ ## 4. The creator's material and privacy
38
+
39
+ - The creator's material stays local: never commit or quote it. Only the competencies derived from it go into the
40
+ repo.
41
+ - No learner's name, class, school, grades, picture, or one learner's goal such as a test date
42
+ (`no-learner-data-in-texts`). School year, school type and Lehrplan may stay.
43
+
44
+ ## Gotchas
45
+
46
+ - Read the primary source before you write a fact. A secondary text that seems to fit is no proof.
47
+ - Several sources disagree → report the disagreement to the creator. Never bend a fact to fit the plan.
48
+ - Never guess a Lehrplan unit, a wording or an id (video, article, unit number): look it up or leave it out, and
49
+ mark it unchecked.
50
+ - HTTP 429 or a site down → tell the creator which; mark it "not checked"; go on. No scraper, no loop.
@@ -0,0 +1,16 @@
1
+ # Verifying a second source
2
+
3
+ ## Check by opening
4
+
5
+ 1. It loads: no error, no empty page, no redirect to a start or search page.
6
+ 2. It is the article or video itself: no search result, category, list or disambiguation.
7
+ 3. It covers exactly this competency: resistance for "Ich kann den Widerstand berechnen", not electricity in
8
+ general.
9
+
10
+ ## Rules
11
+
12
+ - No weak matches. Nothing fits → leave it out and say so under "Notes".
13
+ - Video: check channel and title through the platform's metadata (YouTube: oEmbed), never through a search result.
14
+ - A video loads only after a click (`no-request-before-click`).
15
+ - Note per source: address, exact title, "verified".
16
+ - Take facts, never sentences. Name source and licence of what you take (`third-party-licence`).
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: lernapps-exercise-patterns
3
+ description: Use in Explore, after the goal and the learners are known and before you choose the archetype - how learners of a lernapps.net app practise each kind of competency, which points to the archetype - and again in Plan to choose a pattern per competency, share material as data and say what a wrong answer is told. In an increment, for a kind of exercise the app's content guide lacks. For every archetype.
4
+ license: MIT
5
+ ---
6
+
7
+ # Exercise patterns
8
+
9
+ - Learners act on every page or screen (`learners-act`).
10
+ - Learners derive, not only read off: show how a value comes about (tree diagram, step, model), then let them do it.
11
+ - The content guide `.agents/skills/app-content/SKILL.md` names the app's patterns. It takes precedence.
12
+ - Three levels. Take the next level only when the one before cannot express the competency.
13
+
14
+ ## The kind of practice and the archetype
15
+
16
+ - In Explore, read the patterns of the subject before the archetype is chosen. How learners practise points to the
17
+ archetype; the README of each template decides:
18
+ - every competency fits a question with options or an input and feedback per answer, no page needs to explain
19
+ first → `quiz`;
20
+ - learners need explanations, figures or derivations on pages before they practise, with exercises in between →
21
+ `explainer`;
22
+ - learners act in a model of their own: a game, a simulation, a timed drill, something they move or build →
23
+ `interactive`.
24
+ - Mixed: the kind most competencies need decides; tell the creator what the others become.
25
+
26
+ ## 1. Data files
27
+
28
+ - Each fact once, as a record with the same fields as its neighbours (elements, circuit parts, events, organs).
29
+ - The skill `lernapps-<archetype>-design` says where data lives in the archetype.
30
+
31
+ ## 2. Patterns
32
+
33
+ - A pattern is a kind of exercise for one kind of competency, written down once and varied per use (values,
34
+ records, context).
35
+ - Choose by the competency's verb:
36
+
37
+ | The learner can … | Pattern |
38
+ |---|---|
39
+ | compute, convert, estimate | a computed task with unit; typical mistakes diagnosed; numbers drawn where possible |
40
+ | assign, name, recognise | match pairs, or pick one of things of the same kind |
41
+ | order, compare | put items in order by size, date or step |
42
+ | judge, decide | true or false with the reason in the feedback, or pick the right statement |
43
+ | read off, interpret | a figure or table given, a value or statement asked |
44
+ | explain | pick the right explanation among plausible wrong ones, each with background |
45
+
46
+ - Read the patterns of your subject before you choose: [mathematics](references/mathematics.md),
47
+ [physics](references/physics.md), [chemistry](references/chemistry.md),
48
+ [biology and geography](references/biology-geography.md), [history](references/history.md),
49
+ [computer science](references/computer-science.md). Another subject: the one closest to it.
50
+ - Explainer: read [references/page-structures.md](references/page-structures.md) when you plan the sections of a
51
+ page; any archetype with figures: [references/figures.md](references/figures.md).
52
+ - Write each pattern into "Content method": name, kind of competency, form in the archetype (what is fixed, what
53
+ varies), one example, data file. In Code it goes into the content guide.
54
+
55
+ ## 3. Beyond the notation
56
+
57
+ - What the archetype's notation cannot express: the skill `lernapps-<archetype>-design` says the way out (a component
58
+ of the explainer; code of an interactive app). Say in the plan why no pattern fits.
59
+ - A need other apps share (figure kind, block, question type) → an issue at
60
+ <https://github.com/lernapps/app-templates/issues> with an example. Tell the creator; use the nearest pattern.
61
+ - Never code beyond the archetype; note the gap under "Where I had to guess".
62
+
63
+ ## Checking answers
64
+
65
+ - Read [references/success.md](references/success.md) when you decide how an exercise checks an answer and what each
66
+ wrong answer is told.
67
+
68
+ ## Every pattern
69
+
70
+ - Works without seeing the figure: the figure explains, the check checks.
71
+ - The figure shows what is given, never the answer.
72
+ - Numbers fit the story; units are named; rounding is said.
73
+ - Wrong options and mistakes are real ones, each with a reason.
74
+ - Every figure works at 360 px and has a text alternative (`usable-at-360px`, `accessible`).
@@ -0,0 +1,13 @@
1
+ # Patterns: Biology and geography
2
+
3
+ - A start, not a rule. Columns: idea; what learners see and do; how it is expressed.
4
+ - Means: explainer blocks (`figure` `hundred-grid`/`bar`/`image`, `labelled-figure`, `table`, `timeline`, `formula`
5
+ with `\ce{…}`/`\pu{…}`, `definition`, `quote`, `code`); question types (`single-choice`, `multiple-choice`,
6
+ `true-false`, `number`, `ordering`, `matching`); `generated` (task per seed, `given` or data-file records,
7
+ `mistakes`, optional drawn figure); component (`vue-component` + `nojs`) last, each with a static form first.
8
+ - New pattern in an app → its content guide, with example and data file.
9
+
10
+ | Idea | Learners see and do | Expressed with |
11
+ |---|---|---|
12
+ | Parts and functions | an organ, a cell or a landscape with numbered parts | `labelled-figure`; `table` of parts and functions from a data file; `matching` part ↔ function |
13
+ | Classification | living things or places by a feature | `multiple-choice` "which of these are …" |
@@ -0,0 +1,16 @@
1
+ # Patterns: Chemistry
2
+
3
+ - A start, not a rule. Columns: idea; what learners see and do; how it is expressed.
4
+ - Means: explainer blocks (`figure` `hundred-grid`/`bar`/`image`, `labelled-figure`, `table`, `timeline`, `formula`
5
+ with `\ce{…}`/`\pu{…}`, `definition`, `quote`, `code`); question types (`single-choice`, `multiple-choice`,
6
+ `true-false`, `number`, `ordering`, `matching`); `generated` (task per seed, `given` or data-file records,
7
+ `mistakes`, optional drawn figure); component (`vue-component` + `nojs`) last, each with a static form first.
8
+ - New pattern in an app → its content guide, with example and data file.
9
+
10
+ | Idea | Learners see and do | Expressed with |
11
+ |---|---|---|
12
+ | Particle model | the states of matter as dots with their spacing | three `image`s with captions; `matching` state ↔ description; a component with a temperature slider |
13
+ | Atom model | shells with electrons for the elements 1 to 20, valence electrons marked | a data file of elements (protons, shells, valence electrons); `generated` `pick: 1` with a number answer |
14
+ | Reaction equations | atom counts left and right; balance by coefficients | `formula` with `\ce{…}`; `number` or `generated` asking one coefficient from a data file of reactions; a component that shows the counts |
15
+ | Stoichiometry | mol, g and particles as three boxes with the molar mass between them | `formula` with `\pu{…}`; `generated` from a data file of substances, the mistake "multiplied instead of divided by M" |
16
+ | pH scale | a coloured scale; where substances lie | `image` of the scale; `ordering` of substances by pH from a data file |
@@ -0,0 +1,13 @@
1
+ # Patterns: Computer science
2
+
3
+ - A start, not a rule. Columns: idea; what learners see and do; how it is expressed.
4
+ - Means: explainer blocks (`figure` `hundred-grid`/`bar`/`image`, `labelled-figure`, `table`, `timeline`, `formula`
5
+ with `\ce{…}`/`\pu{…}`, `definition`, `quote`, `code`); question types (`single-choice`, `multiple-choice`,
6
+ `true-false`, `number`, `ordering`, `matching`); `generated` (task per seed, `given` or data-file records,
7
+ `mistakes`, optional drawn figure); component (`vue-component` + `nojs`) last, each with a static form first.
8
+ - New pattern in an app → its content guide, with example and data file.
9
+
10
+ | Idea | Learners see and do | Expressed with |
11
+ |---|---|---|
12
+ | Reading code | a short program; what it prints | `code`; `single-choice` or `number` on its output |
13
+ | Number systems | a number in binary; convert it | `generated` with `int` drawn and the answer computed; the mistake "read from the wrong end" |
@@ -0,0 +1,10 @@
1
+ # Figures
2
+
3
+ - Shows what the text next to it says; caption: what to look at; `alt`: what it shows (`explainer-figure-explains`).
4
+ - Drawn from the given, never the answer (`explainer-figure-hides-answer`).
5
+ - Bundled; nothing from other servers before a click (`no-request-before-click`); others' images with source and
6
+ licence (`third-party-licence`).
7
+ - Works at 360 px: trees top to bottom; too wide → table, or split by stage.
8
+ - Same conventions (colours, labels, units, orientation) across the app; write them into the guide, "Figures".
9
+ - The same figures work in a quiz question (`material`, skill `lernapps-content-questions`): an image of `src/images/` with
10
+ `alt`, `caption`, `source` and `licence`.
@@ -0,0 +1,13 @@
1
+ # Patterns: History
2
+
3
+ - A start, not a rule. Columns: idea; what learners see and do; how it is expressed.
4
+ - Means: explainer blocks (`figure` `hundred-grid`/`bar`/`image`, `labelled-figure`, `table`, `timeline`, `formula`
5
+ with `\ce{…}`/`\pu{…}`, `definition`, `quote`, `code`); question types (`single-choice`, `multiple-choice`,
6
+ `true-false`, `number`, `ordering`, `matching`); `generated` (task per seed, `given` or data-file records,
7
+ `mistakes`, optional drawn figure); component (`vue-component` + `nojs`) last, each with a static form first.
8
+ - New pattern in an app → its content guide, with example and data file.
9
+
10
+ | Idea | Learners see and do | Expressed with |
11
+ |---|---|---|
12
+ | Source and context | a quotation with its origin; what it says about its time | `quote` with `origin`, `source` and `licence`; `single-choice` on its meaning |
13
+ | Chronology | events on a timeline; put them in order | `timeline` from a data file of events; `generated` with `pick: 3, distinct: true` and `compare: order` |
@@ -0,0 +1,19 @@
1
+ # Patterns: Mathematics
2
+
3
+ - A start, not a rule. Columns: idea; what learners see and do; how it is expressed.
4
+ - Means: explainer blocks (`figure` `hundred-grid`/`bar`/`image`, `labelled-figure`, `table`, `timeline`, `formula`
5
+ with `\ce{…}`/`\pu{…}`, `definition`, `quote`, `code`); question types (`single-choice`, `multiple-choice`,
6
+ `true-false`, `number`, `ordering`, `matching`); `generated` (task per seed, `given` or data-file records,
7
+ `mistakes`, optional drawn figure); component (`vue-component` + `nojs`) last, each with a static form first.
8
+ - New pattern in an app → its content guide, with example and data file.
9
+
10
+ | Idea | Learners see and do | Expressed with |
11
+ |---|---|---|
12
+ | Part of a whole (percent, fractions) | a 10×10 grid with the part filled; compute the part, the whole or the rate | `figure` `hundred-grid` on the page; `generated` with `compare: { number: { format: percent } }`; a figure that changes with the task: an exercise component |
13
+ | Before and after a change | two bars, old and new value; compute the change or the new value | `figure` `bar` (`part`, `whole`) on the page; `generated` with the typical mistake "added the rate instead of the amount" |
14
+ | Product of brackets (binomial formulas) | a rectangle split into a², ab, ab, b², lengths from the task | `image` (SVG) for the rule; `generated` for the task; a component only for lengths that follow the task |
15
+ | Difference of squares | a² − b² as an L-shape, rearranged into (a + b)(a − b) | two `image`s side by side with captions; `ordering` of the steps |
16
+ | Outcome set (Laplace) | die faces, wheel sectors or balls, the favourable ones marked | `table` or `image`; `generated` drawing from a data file of experiments, answer as a fraction |
17
+ | Multi-stage experiment | a tree from top to bottom with branch probabilities; multiply along a path | `image` (SVG) of the tree; `generated` with the path rule; a clickable tree as a component |
18
+ | Drawing without replacement | an urn before and after one ball is taken | two `image`s; `generated` with `pick: 2, distinct: true` from a data file of balls |
19
+ | Unit conversion | a value with one unit; give it in another | `generated` with `compare: { number: { unit } }` and the mistake "factor in the wrong direction" |
@@ -0,0 +1,8 @@
1
+ # Page structures (explainer)
2
+
3
+ - Recommended; keep alike across the app's pages.
4
+ - Maths, sciences: Warum, Regel (formula, figure), Beispiel (`example` box), Übung.
5
+ - History: Quelle (`quote`), Einordnung, Zeitleiste (`timeline` from data), Übung (ordering or `generated`).
6
+ - Biology, geography: Überblick, Aufbau (`labelled-figure`), Funktion (`table`), Übung (matching).
7
+ - Computer science: Idee, Beispiel, Code (`code`), Übung (output of the code).
8
+ - Quiz: one round per chapter, questions in the patterns above a question type can express.
@@ -0,0 +1,18 @@
1
+ # Patterns: Physics
2
+
3
+ - A start, not a rule. Columns: idea; what learners see and do; how it is expressed.
4
+ - Means: explainer blocks (`figure` `hundred-grid`/`bar`/`image`, `labelled-figure`, `table`, `timeline`, `formula`
5
+ with `\ce{…}`/`\pu{…}`, `definition`, `quote`, `code`); question types (`single-choice`, `multiple-choice`,
6
+ `true-false`, `number`, `ordering`, `matching`); `generated` (task per seed, `given` or data-file records,
7
+ `mistakes`, optional drawn figure); component (`vue-component` + `nojs`) last, each with a static form first.
8
+ - New pattern in an app → its content guide, with example and data file.
9
+
10
+ | Idea | Learners see and do | Expressed with |
11
+ |---|---|---|
12
+ | Circuit symbols | the symbol of a part and its name and function | `table` from a data file of parts; `matching` symbol ↔ part; `generated` `pick` from the data file |
13
+ | Series and parallel circuit | two circuits with the same parts; where is the current larger | `labelled-figure` of both schematics; `single-choice` with the reason in each option's `info`; `ordering` of currents |
14
+ | Ohm's law and quantities | U, R and I of a circuit; compute the missing one with its unit | `formula` `U = R \cdot I`; `generated` with `\pu{…}` units, `where` for realistic values, mistakes "U · I instead of U / I", "mA not converted" |
15
+ | Linear motion | s-t and v-t graphs side by side; read off or compute speed | `image` of the graphs with a `table` of values; `generated` for s = v · t; a component with a slider for v |
16
+ | Lever and moment | a beam with weights at distances; does it balance | `image` of the beam; `generated` for F₁ · a₁ = F₂ · a₂; a component with draggable weights |
17
+ | Optics | a ray diagram of a convex lens; where the image forms | `labelled-figure` of the rays; `true-false` on image properties; a component with a draggable object |
18
+ | Density | blocks of equal mass and different volumes; float or sink | `table` from a data file of materials; `generated` with `compare: { choice: [schwimmt, sinkt] }` |
@@ -0,0 +1,28 @@
1
+ # How an exercise checks success
2
+
3
+ ## Property, not model solution
4
+
5
+ - Check what the text asks: "a fraction equal to 1/2" accepts 2/4 and 3/6; "a conductor" accepts every conductor.
6
+ - "Order the steps" only where the order is fixed.
7
+ - A type that cannot accept every correct answer (ordering with a free order, single choice with two defensible
8
+ options) → another type or another text.
9
+
10
+ ## Write down first, in the content method
11
+
12
+ 1. The answers that fulfil the text, including correct ones other than yours.
13
+ 2. The typical wrong answers.
14
+ 3. The feedback for each.
15
+
16
+ ## Feedback on a wrong answer
17
+
18
+ - Every wrong option says why it does not fit.
19
+ - Computed tasks: 2–3 common mistakes, each with its message.
20
+ - Optionally a hint: where to look, not the answer.
21
+ - A component of your own: right or wrong, plus a short reason.
22
+
23
+ ## Examples as tests
24
+
25
+ - Each exercise lists other correct answers the text allows as accepted, and typical wrong ones as rejected. The
26
+ build runs them through the real check; learners never see them.
27
+ - An accepted example fails → the exercise checks the wrong thing: change the type or the check, not the example.
28
+ - The archetype's skill says the notation (`examples`, `mistakes`, component tests).
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: lernapps-explainer
3
+ description: Use in Code of a lernapps.net explainer whenever you write or change its content in src/ - a chapter, page, block, figure, formula, exercise, data file, language or component - or a build or runtime test of the explainer fails. What you write, the notation of structure, blocks and exercises, components, the runtime, and the explainer's technical rules.
4
+ license: MIT
5
+ ---
6
+
7
+ # Explainer
8
+
9
+ - You write YAML in `src/`; a Vue component only where the plan names one. Rendering, navigation, formulas, figures,
10
+ exercises, accessibility, languages and the no-JS page come from the runtime `@lernapps/app-templates`.
11
+ - `create` writes the example chapter "Prozent": replace it with the planned content.
12
+ - Schema: `node_modules/@lernapps/app-templates/runtime/explainer/explainer.v1.schema.json`. Start every YAML file with
13
+ `# yaml-language-server: $schema=../../node_modules/@lernapps/app-templates/runtime/explainer/explainer.v1.schema.json`
14
+ (one `../` less in `src/app.yaml`).
15
+ - Questions of the quiz's types: also skill `lernapps-content-questions`.
16
+
17
+ ## Read when
18
+
19
+ - [references/structure.md](references/structure.md): before you add or move a chapter or page.
20
+ - [references/blocks.md](references/blocks.md): before you write a page.
21
+ - [references/exercises.md](references/exercises.md): before you write an exercise, above all a `generated` one.
22
+ - [references/components.md](references/components.md): only when the plan names a component.
23
+ - [references/runtime.md](references/runtime.md): when the build or a runtime test fails, and before you set up the
24
+ tutor.
25
+ - [references/rules.md](references/rules.md): when a check names an `explainer-*` or `vue-component-*` rule.
26
+
27
+ ## Gotchas
28
+
29
+ - A build problem is one line `file:line: place (language): what to do`. Fix where it points.
30
+ - Headings are `section` blocks, never Markdown headings.
31
+ - A new chapter: a folder with `chapter.yaml`, listed in `src/app.yaml`, each page listed in `chapter.yaml`.
32
+ - `selfAssessment` in a `chapter.yaml`: written in Commit, skill
33
+ `lernapps-explainer-self-assessment`. An exercise it names renamed or moved → change the reference too.
@@ -0,0 +1,83 @@
1
+ # Blocks
2
+
3
+ - A page = list of blocks from a closed set. Every text field: text or language map.
4
+ - Prose: restricted Markdown: paragraphs, `**bold**`, `*italics*`, lists, links, line breaks, `$…$`.
5
+ - No headings (use `section`), HTML, images, code, quotes, tables in Markdown: each has its block.
6
+ - App-internal links start with `/` (`/prozent/grundwert/#regel`); the build checks them.
7
+
8
+ | `type` | Fields | Shows |
9
+ |---|---|---|
10
+ | `section` | `id`, `title`, `blocks` | heading and blocks |
11
+ | `text` | `text` | prose |
12
+ | `formula` | `formula` (LaTeX subset, no `$`) | formula on its own line, MathML |
13
+ | `figure` | `draw` (`hundred-grid` with `filled`, `bar` with `part`, `whole`) or `image` (`images/<name>.svg`, `source`, `licence`); `alt`, `caption` | inline SVG or bundled image |
14
+ | `labelled-figure` | `image`, `alt`, `caption`, `labels` (`x`, `y` in %, `text`, optional `marker` of 1 to 3 characters, e.g. the material's `A` to `E`, else the number), `legend` (default `true`; `false` shows only the markers, then `alt` names every marker), `source`, `licence` | image with markers (letters or numbers) and a legend of the texts |
15
+ | `table` | `caption`, `header`, `rowHeaders`, `rows` | table with caption |
16
+ | `timeline` | `events` (`date`, `title`, `label`, `text`) or `data` | dated events, earliest first |
17
+ | `definition` | `term`, `explanation` | term in place, in the glossary |
18
+ | `quote` | `text`, `origin` (`author`, `work`, `year`), `source`, `licence` | quotation with origin |
19
+ | `code` | `language` (bash, c, css, html, java, javascript, json, plaintext, python, sql, typescript), `code`, `caption` | highlighted code |
20
+ | `example`, `note` | `title`, `blocks` | box: worked example, hint |
21
+ | `video` | `youtube` (the 11-character id, not the address), `title`, `channel` (both as on YouTube, plain strings) | YouTube video behind two clicks: link, channel, privacy note; player only after a click |
22
+ | exercises | quiz's six types, `generated` | `exercises.md` |
23
+ | `vue-component` | `component`, `props`, `nojs` | `components.md` |
24
+
25
+ ```yaml
26
+ - type: section
27
+ id: regel
28
+ title: Regel
29
+ blocks:
30
+ - type: formula
31
+ formula: 'W = \frac{G \cdot p}{100}'
32
+ - type: definition
33
+ term: Prozentwert
34
+ explanation: Der Prozentwert $W$ ist der Anteil am Ganzen, in der Einheit des Grundwerts.
35
+ - type: figure
36
+ draw: { kind: hundred-grid, filled: 12 }
37
+ alt: Ein Hunderterfeld mit 100 Kästchen, 12 davon sind gefärbt.
38
+ caption: Die 12 gefärbten Kästchen sind 12 % des Ganzen.
39
+ ```
40
+
41
+ - Images in `src/images/`: found under a free licence (e.g. Wikimedia Commons) or your own, generated or drawn as
42
+ SVG. Always `source` (URL or citation, e.g. `eigene Zeichnung`, `KI-generiert`) and `licence` (SPDX id, e.g.
43
+ `CC-BY-SA-4.0`, or `gemeinfrei`). Several languages: a citation is a language map; a URL one string.
44
+
45
+ ## Videos
46
+
47
+ - YouTube only, explainer only (not in a quiz question's `material`). No thumbnail, no video files in the bundle.
48
+ - `title`, `channel`: as YouTube names them, in the video's language; the page's language does not change them.
49
+ - What the learner should notice in the video: a `text` block before it; the block has no note field.
50
+ - An app with a video loads from another server after a click: its catalog entry says `fitness.thirdParty: on-click`,
51
+ and with the choice "Videos immer direkt laden" also `fitness.storage: device`.
52
+
53
+ ```yaml
54
+ - type: video
55
+ youtube: rkLmLaFHodo
56
+ title: einstufiger Zufallsversuch | Wahrscheinlichkeitsrechnung - einfach erklärt
57
+ channel: Lehrerschmidt
58
+ ```
59
+
60
+ ## Formulas
61
+
62
+ - LaTeX subset → MathML; `formula` block or inline `$…$`.
63
+ - Commands: `\frac`, `\cdot`, `\times`, `\div`, `\%`, `\text`, `^`, `_`, `\sqrt`, `\approx`, `\pm`, `\le`, `\ge`,
64
+ `\neq`, `\,`, parentheses, braces (`\{`, `\}`).
65
+ - Chemistry (mhchem): `\ce{2H2 + O2 -> 2H2O}`, `\ce{CO2 + H2O <=> H2CO3}`, units `\pu{123 kJ/mol}`.
66
+ - Other command or parse error → build fails with the place.
67
+ - YAML formulas in single quotes. Same in every language unless `\text{…}` differs (then a map).
68
+
69
+ ## Languages
70
+
71
+ - `languages` in `src/app.yaml`, German first: `[de]` or `[de, en]` (runtime texts: de, en).
72
+ - A string = German, enough only while German is the only language. Else every text a map:
73
+ `title: { de: Die drei Stände, en: The three estates }`.
74
+ - Build fails on a missing translation (`the translation is missing; write the text as a map: { de: …, en: … }`)
75
+ and an undeclared language.
76
+ - Same in every language: ids, addresses, numbers, formulas, drawn figures.
77
+ - Trees: German at root, others under `/<language>/`; `lang`, `hreflang`, plain-link switch.
78
+
79
+ ## Data files
80
+
81
+ - `src/data/<name>.yaml`: list of records, same lowercase fields; values number, boolean, text (map if several
82
+ languages).
83
+ - Used by `timeline` (`data: ereignisse`) and `generated` (`from: { data: elemente }`). Each fact once, there.