@lernapps/app-templates 0.2.1 → 0.3.1
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.
- package/README.md +5 -11
- package/dist/{assessment-Dy359O1O.mjs → assessment-DaKsXUdj.mjs} +204 -16
- package/dist/{blocks-CxtCPAa5.mjs → blocks-D4SSGKuL.mjs} +2 -2
- package/dist/blocks.mjs +2 -2
- package/dist/{check-CteIFN96.mjs → check-BxZOZPic.mjs} +58 -4
- package/dist/{content-DO6oEJxj.mjs → content-CAL0Nz1a.mjs} +1 -1
- package/dist/explainer-e2e.mjs +36 -5
- package/dist/explainer-plugin.mjs +57 -13
- package/dist/explainer.mjs +2 -2
- package/dist/interactive-e2e.mjs +1 -1
- package/dist/interactive-plugin.mjs +2 -2
- package/dist/{load-RosvaPZf.mjs → load--ovXqbNE.mjs} +286 -33
- package/dist/questions.mjs +1 -1
- package/dist/quiz-e2e.mjs +1 -1
- package/dist/quiz-plugin.mjs +3 -3
- package/dist/{render-D5kwkNt1.mjs → render-D3LsJY04.mjs} +2 -2
- package/dist/{render-DqHOJyHK.mjs → render-mYtzN1DV.mjs} +1 -1
- package/dist/{result-D_mmCVwN.mjs → result-DphIWHDF.mjs} +1 -1
- package/dist/{validate-Bxy9NfB8.mjs → validate-CfFykN0M.mjs} +1 -1
- package/dist/{validate-BDwL7Su3.mjs → validate-j3GjVhNF.mjs} +2 -2
- package/explainer/README.md +7 -3
- package/explainer/docs/arc42/05-explainer-building-blocks.arc42.md +26 -8
- package/explainer/docs/arc42/09-explainer-decisions.arc42.md +42 -0
- package/explainer/package.json +1 -1
- package/explainer/src/app.yaml +3 -1
- package/explainer/src/prozent/chapter.yaml +1 -1
- package/explainer/src/prozent/grundwert.yaml +2 -1
- package/explainer/src/prozent/prozentsatz.yaml +2 -1
- package/explainer/src/prozent/prozentwert.yaml +2 -1
- package/interactive/package.json +1 -1
- package/package.json +3 -4
- package/quiz/package.json +1 -1
- package/runtime/explainer/assessment.ts +4 -2
- package/runtime/explainer/check-page.ts +6 -2
- package/runtime/explainer/content.ts +20 -1
- package/runtime/explainer/e2e.ts +40 -0
- package/runtime/explainer/exercises.ts +71 -6
- package/runtime/explainer/explainer.css +21 -16
- package/runtime/explainer/explainer.v1.schema.json +2 -2
- package/runtime/explainer/explainer.v2.schema.json +152 -0
- package/runtime/explainer/expression.ts +127 -1
- package/runtime/explainer/generated/texts.ts +98 -9
- package/runtime/explainer/generated/types.ts +8 -0
- package/runtime/explainer/load.ts +70 -16
- package/runtime/explainer/messages/de.json +5 -1
- package/runtime/explainer/messages/en.json +5 -1
- package/runtime/explainer/outline.ts +1 -1
- package/runtime/explainer/page-list.ts +38 -0
- package/runtime/explainer/plugin.ts +13 -4
- package/runtime/explainer/render.ts +26 -2
- package/runtime/explainer/schema.ts +92 -9
- package/runtime/explainer/tutorpage.ts +9 -1
- package/runtime/shared/blocks/blocks.css +18 -0
- package/runtime/shared/blocks/blocks.v1.schema.json +1 -1
- package/runtime/shared/text/formula.ts +61 -1
- package/scaffold/explainer/src/app.yaml +5 -1
- package/scaffold/explainer/src/thema/chapter.yaml +1 -1
- package/scaffold/explainer/src/thema/einstieg.yaml +1 -1
|
@@ -7,6 +7,46 @@ import temml from "temml";
|
|
|
7
7
|
const mhchem: string = "temml/contrib/mhchem/mhchem.js";
|
|
8
8
|
await import(mhchem);
|
|
9
9
|
|
|
10
|
+
/** The Greek letters a formula may use, as \\alpha: the small ones, and the capitals that differ from Latin ones. */
|
|
11
|
+
const GREEK = [
|
|
12
|
+
"alpha",
|
|
13
|
+
"beta",
|
|
14
|
+
"gamma",
|
|
15
|
+
"delta",
|
|
16
|
+
"varepsilon",
|
|
17
|
+
"epsilon",
|
|
18
|
+
"zeta",
|
|
19
|
+
"eta",
|
|
20
|
+
"theta",
|
|
21
|
+
"vartheta",
|
|
22
|
+
"iota",
|
|
23
|
+
"kappa",
|
|
24
|
+
"lambda",
|
|
25
|
+
"mu",
|
|
26
|
+
"nu",
|
|
27
|
+
"xi",
|
|
28
|
+
"pi",
|
|
29
|
+
"rho",
|
|
30
|
+
"sigma",
|
|
31
|
+
"tau",
|
|
32
|
+
"upsilon",
|
|
33
|
+
"varphi",
|
|
34
|
+
"phi",
|
|
35
|
+
"chi",
|
|
36
|
+
"psi",
|
|
37
|
+
"omega",
|
|
38
|
+
"Gamma",
|
|
39
|
+
"Delta",
|
|
40
|
+
"Theta",
|
|
41
|
+
"Lambda",
|
|
42
|
+
"Xi",
|
|
43
|
+
"Pi",
|
|
44
|
+
"Sigma",
|
|
45
|
+
"Phi",
|
|
46
|
+
"Psi",
|
|
47
|
+
"Omega",
|
|
48
|
+
];
|
|
49
|
+
|
|
10
50
|
/** The commands a formula may use (explainer.v1.schema.json, $defs/latex), besides ^, _, braces and parentheses. */
|
|
11
51
|
export const COMMANDS: readonly string[] = [
|
|
12
52
|
"\\frac",
|
|
@@ -26,6 +66,25 @@ export const COMMANDS: readonly string[] = [
|
|
|
26
66
|
"\\}",
|
|
27
67
|
"\\ce",
|
|
28
68
|
"\\pu",
|
|
69
|
+
// spaces and arrows between the steps of a calculation
|
|
70
|
+
"\\ ",
|
|
71
|
+
"\\quad",
|
|
72
|
+
"\\qquad",
|
|
73
|
+
"\\Rightarrow",
|
|
74
|
+
"\\Leftrightarrow",
|
|
75
|
+
// parentheses that grow with their content
|
|
76
|
+
"\\left",
|
|
77
|
+
"\\right",
|
|
78
|
+
// trigonometry: the functions, their inverses (or \sin^{-1}) and the degree sign (^\circ)
|
|
79
|
+
"\\sin",
|
|
80
|
+
"\\cos",
|
|
81
|
+
"\\tan",
|
|
82
|
+
"\\arcsin",
|
|
83
|
+
"\\arccos",
|
|
84
|
+
"\\arctan",
|
|
85
|
+
"\\circ",
|
|
86
|
+
// Greek letters
|
|
87
|
+
...GREEK.map((letter) => `\\${letter}`),
|
|
29
88
|
];
|
|
30
89
|
const allowed = new Set(COMMANDS);
|
|
31
90
|
|
|
@@ -52,7 +111,8 @@ function commands(tex: string): string[] {
|
|
|
52
111
|
export function formulaProblem(tex: string): string | undefined {
|
|
53
112
|
const unknown = commands(tex).find((command) => !allowed.has(command));
|
|
54
113
|
if (unknown !== undefined) {
|
|
55
|
-
|
|
114
|
+
const list = COMMANDS.map((command) => (command === "\\ " ? "\\ (a space)" : command)).join(", ");
|
|
115
|
+
return `${unknown} is not in the formula command list; use only these commands, besides ^, _, braces and parentheses: ${list}`;
|
|
56
116
|
}
|
|
57
117
|
try {
|
|
58
118
|
temml.renderToString(tex, { throwOnError: true });
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
# yaml-language-server: $schema=../node_modules/@lernapps/app-templates/runtime/explainer/explainer.
|
|
1
|
+
# yaml-language-server: $schema=../node_modules/@lernapps/app-templates/runtime/explainer/explainer.v2.schema.json
|
|
2
|
+
format: 2
|
|
3
|
+
# The strand of the learning map the app stays in, <subject>/<strand> (e.g. mathematik/stochastik); then each page
|
|
4
|
+
# names its competencies. none: the app is on no strand, and no page names competencies.
|
|
5
|
+
strand: none
|
|
2
6
|
title: Platzhalter
|
|
3
7
|
intro: Dieses Kapitel hält den Platz frei, bis der geplante Inhalt da ist.
|
|
4
8
|
languages: [de]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# yaml-language-server: $schema=../../node_modules/@lernapps/app-templates/runtime/explainer/explainer.
|
|
1
|
+
# yaml-language-server: $schema=../../node_modules/@lernapps/app-templates/runtime/explainer/explainer.v2.schema.json
|
|
2
2
|
title: Thema
|
|
3
3
|
summary: Ersetze dieses Kapitel durch das erste geplante.
|
|
4
4
|
pages: [einstieg]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# yaml-language-server: $schema=../../node_modules/@lernapps/app-templates/runtime/explainer/explainer.
|
|
1
|
+
# yaml-language-server: $schema=../../node_modules/@lernapps/app-templates/runtime/explainer/explainer.v2.schema.json
|
|
2
2
|
title: Einstieg
|
|
3
3
|
description: Eine Seite, die den Platz frei hält.
|
|
4
4
|
blocks:
|