@nakafa/aksara-contracts 8.9.1 → 8.12.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.
- package/dist/assessment/choice.d.ts +26 -0
- package/dist/assessment/document.d.ts +39 -0
- package/dist/assessment/figure.d.ts +13 -0
- package/dist/assessment/hash.d.ts +711 -111
- package/dist/assessment/inline.d.ts +53 -0
- package/dist/assessment/inline.js +1 -0
- package/dist/assessment/interaction.d.ts +26 -0
- package/dist/assessment/item.d.ts +414 -36
- package/dist/assessment/paper.d.ts +731 -131
- package/dist/assessment/part.d.ts +13 -0
- package/dist/assessment/rows.d.ts +336 -36
- package/dist/assessment/snapshot.d.ts +773 -121
- package/dist/release/snapshot/data.d.ts +26 -0
- package/dist/release/snapshot/verify.d.ts +336 -36
- package/dist/transport/group.d.ts +78 -0
- package/dist/transport/request.d.ts +2195 -343
- package/dist/transport/snapshot.d.ts +52 -0
- package/dist/visual/base/math.d.ts +56 -6
- package/dist/visual/base/media.d.ts +56 -6
- package/dist/visual/biology/bacteria.d.ts +224 -24
- package/dist/visual/biology/binomial.d.ts +139 -0
- package/dist/visual/biology/binomial.js +46 -0
- package/dist/visual/biology/blood.d.ts +56 -6
- package/dist/visual/biology/bone.d.ts +141 -0
- package/dist/visual/biology/bone.js +46 -0
- package/dist/visual/biology/cell.d.ts +168 -18
- package/dist/visual/biology/chromosome.d.ts +139 -0
- package/dist/visual/biology/chromosome.js +42 -0
- package/dist/visual/biology/climate.d.ts +168 -18
- package/dist/visual/biology/control.d.ts +17 -0
- package/dist/visual/biology/control.js +21 -0
- package/dist/visual/biology/denature.d.ts +159 -0
- package/dist/visual/biology/denature.js +74 -0
- package/dist/visual/biology/drawing.d.ts +151 -0
- package/dist/visual/biology/drawing.js +69 -0
- package/dist/visual/biology/ecology.d.ts +224 -24
- package/dist/visual/biology/enzyme.d.ts +145 -0
- package/dist/visual/biology/enzyme.js +54 -0
- package/dist/visual/biology/equipment.d.ts +140 -0
- package/dist/visual/biology/equipment.js +64 -0
- package/dist/visual/biology/gametogenesis.d.ts +145 -0
- package/dist/visual/biology/gametogenesis.js +83 -0
- package/dist/visual/biology/heart.d.ts +56 -6
- package/dist/visual/biology/implantation.d.ts +138 -0
- package/dist/visual/biology/implantation.js +44 -0
- package/dist/visual/biology/joint.d.ts +140 -0
- package/dist/visual/biology/joint.js +47 -0
- package/dist/visual/biology/key.d.ts +141 -0
- package/dist/visual/biology/key.js +58 -0
- package/dist/visual/biology/kingdom.d.ts +142 -0
- package/dist/visual/biology/kingdom.js +82 -0
- package/dist/visual/biology/lactase.d.ts +147 -0
- package/dist/visual/biology/lactase.js +48 -0
- package/dist/visual/biology/limb.d.ts +139 -0
- package/dist/visual/biology/limb.js +44 -0
- package/dist/visual/biology/lipid.d.ts +144 -0
- package/dist/visual/biology/lipid.js +43 -0
- package/dist/visual/biology/locomotion.d.ts +141 -0
- package/dist/visual/biology/locomotion.js +48 -0
- package/dist/visual/biology/menstrual.d.ts +148 -0
- package/dist/visual/biology/menstrual.js +65 -0
- package/dist/visual/biology/metamorphosis.d.ts +140 -0
- package/dist/visual/biology/metamorphosis.js +34 -0
- package/dist/visual/biology/mitochondrion.d.ts +56 -6
- package/dist/visual/biology/muscle.d.ts +56 -6
- package/dist/visual/biology/neuron.d.ts +56 -6
- package/dist/visual/biology/paddy.d.ts +56 -6
- package/dist/visual/biology/physiology.d.ts +168 -18
- package/dist/visual/biology/placenta.d.ts +139 -0
- package/dist/visual/biology/placenta.js +52 -0
- package/dist/visual/biology/planes.d.ts +145 -0
- package/dist/visual/biology/planes.js +62 -0
- package/dist/visual/biology/plant.d.ts +280 -30
- package/dist/visual/biology/protein.d.ts +142 -0
- package/dist/visual/biology/protein.js +41 -0
- package/dist/visual/biology/saturation.d.ts +149 -0
- package/dist/visual/biology/saturation.js +40 -0
- package/dist/visual/biology/secretion.d.ts +149 -0
- package/dist/visual/biology/secretion.js +79 -0
- package/dist/visual/biology/spill.d.ts +165 -0
- package/dist/visual/biology/spill.js +58 -0
- package/dist/visual/biology/sugar.d.ts +152 -0
- package/dist/visual/biology/sugar.js +59 -0
- package/dist/visual/biology/synapse.d.ts +56 -6
- package/dist/visual/biology/taxon.d.ts +138 -0
- package/dist/visual/biology/taxon.js +50 -0
- package/dist/visual/biology/twins.d.ts +144 -0
- package/dist/visual/biology/twins.js +60 -0
- package/dist/visual/biology/vernacular.d.ts +141 -0
- package/dist/visual/biology/vernacular.js +57 -0
- package/dist/visual/biology/vertebra.d.ts +141 -0
- package/dist/visual/biology/vertebra.js +59 -0
- package/dist/visual/biology/vessel.d.ts +56 -6
- package/dist/visual/biology/waste.d.ts +140 -0
- package/dist/visual/biology/waste.js +57 -0
- package/dist/visual/biology/water.d.ts +152 -0
- package/dist/visual/biology/water.js +54 -0
- package/dist/visual/biology/yeast.d.ts +56 -6
- package/dist/visual/card.d.ts +67 -6
- package/dist/visual/card.js +17 -1
- package/dist/visual/catalog.d.ts +21584 -5487
- package/dist/visual/catalog.js +66 -0
- package/dist/visual/chemistry/atom.d.ts +168 -18
- package/dist/visual/chemistry/balance.d.ts +280 -30
- package/dist/visual/chemistry/bonding.d.ts +280 -30
- package/dist/visual/chemistry/discovery.d.ts +392 -42
- package/dist/visual/chemistry/electrochemistry.d.ts +112 -12
- package/dist/visual/chemistry/electron.d.ts +112 -12
- package/dist/visual/chemistry/laws.d.ts +224 -24
- package/dist/visual/chemistry/particles.d.ts +280 -30
- package/dist/visual/chemistry/periodic.d.ts +112 -12
- package/dist/visual/chemistry/rate.d.ts +56 -6
- package/dist/visual/chemistry/reaction.d.ts +168 -18
- package/dist/visual/chemistry/titration.d.ts +56 -6
- package/dist/visual/length.d.ts +56 -6
- package/dist/visual/mathematics/argument.d.ts +226 -0
- package/dist/visual/mathematics/argument.js +150 -0
- package/dist/visual/mathematics/chance.d.ts +168 -18
- package/dist/visual/mathematics/chart.d.ts +56 -6
- package/dist/visual/mathematics/charts.d.ts +280 -30
- package/dist/visual/mathematics/counterexample.d.ts +340 -0
- package/dist/visual/mathematics/counterexample.js +157 -0
- package/dist/visual/mathematics/function.d.ts +168 -18
- package/dist/visual/mathematics/journey.d.ts +56 -6
- package/dist/visual/mathematics/logic.d.ts +56 -6
- package/dist/visual/mathematics/network.d.ts +56 -6
- package/dist/visual/mathematics/numeral.d.ts +168 -18
- package/dist/visual/mathematics/sets.d.ts +56 -6
- package/dist/visual/physics/braking.d.ts +224 -24
- package/dist/visual/physics/circuit.d.ts +224 -24
- package/dist/visual/physics/circular.d.ts +112 -12
- package/dist/visual/physics/dynamics.d.ts +392 -42
- package/dist/visual/physics/efficiency.d.ts +336 -36
- package/dist/visual/physics/electronics.d.ts +168 -18
- package/dist/visual/physics/falling.d.ts +224 -24
- package/dist/visual/physics/field.d.ts +168 -18
- package/dist/visual/physics/fluid.d.ts +224 -24
- package/dist/visual/physics/force.d.ts +280 -30
- package/dist/visual/physics/gravity.d.ts +112 -12
- package/dist/visual/physics/heat.d.ts +168 -18
- package/dist/visual/physics/instrument.d.ts +392 -42
- package/dist/visual/physics/light.d.ts +224 -24
- package/dist/visual/physics/measurement.d.ts +224 -24
- package/dist/visual/physics/motion.d.ts +336 -36
- package/dist/visual/physics/nuclear.d.ts +168 -18
- package/dist/visual/physics/parabolic.d.ts +56 -6
- package/dist/visual/physics/position.d.ts +336 -36
- package/dist/visual/physics/power.d.ts +448 -48
- package/dist/visual/physics/precision.d.ts +392 -42
- package/dist/visual/physics/product.d.ts +224 -24
- package/dist/visual/physics/reading.d.ts +168 -18
- package/dist/visual/physics/record.d.ts +112 -12
- package/dist/visual/physics/relative.d.ts +168 -18
- package/dist/visual/physics/solar.d.ts +336 -36
- package/dist/visual/physics/thermodynamics.d.ts +56 -6
- package/dist/visual/physics/vector.d.ts +280 -30
- package/dist/visual/physics/velocity.d.ts +392 -42
- package/dist/visual/physics/wave.d.ts +224 -24
- package/dist/visual/politics.d.ts +336 -36
- package/package.json +1 -1
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { byIds, byPickedIds, cardFields, namesEach, TextSchema, } from "#contracts/visual/card";
|
|
3
|
+
import { figure } from "#contracts/visual/entry";
|
|
4
|
+
const KINDS = ["identical", "fraternal"];
|
|
5
|
+
/** A whole number of days, zero or more. */
|
|
6
|
+
const DaySchema = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));
|
|
7
|
+
/**
|
|
8
|
+
* The day after fertilisation an identical twin embryo splits: a slider over
|
|
9
|
+
* whole days, its range and its starting day.
|
|
10
|
+
*/
|
|
11
|
+
const SplitSchema = Schema.Struct({
|
|
12
|
+
max: DaySchema,
|
|
13
|
+
min: DaySchema,
|
|
14
|
+
value: DaySchema,
|
|
15
|
+
}).check(Schema.makeFilter(({ max, min, value }) => min < max && min <= value && value <= max, {
|
|
16
|
+
message: "Expected a split day range whose minimum is below its maximum, with the starting day between them.",
|
|
17
|
+
}));
|
|
18
|
+
/**
|
|
19
|
+
* Props of `TwinsLab`: how twins form, picked from `kinds` (each once).
|
|
20
|
+
* Fraternal twins come from two eggs and two sperm; identical twins from one
|
|
21
|
+
* embryo that splits on the day the learner sets with `split`, and that day
|
|
22
|
+
* decides whether they share a placenta and an amniotic sac. The readouts
|
|
23
|
+
* give the placentas, the sacs, whether the genes and the sex match.
|
|
24
|
+
*/
|
|
25
|
+
function twinsLab(rich) {
|
|
26
|
+
return figure(Schema.Struct({
|
|
27
|
+
...cardFields(rich),
|
|
28
|
+
kinds: Schema.NonEmptyArray(Schema.Literals(KINDS)).check(Schema.isUnique()),
|
|
29
|
+
labels: Schema.Struct({
|
|
30
|
+
genes: rich,
|
|
31
|
+
kind: TextSchema,
|
|
32
|
+
kinds: byPickedIds(KINDS, TextSchema),
|
|
33
|
+
parts: byIds([
|
|
34
|
+
"ovary",
|
|
35
|
+
"oocyte",
|
|
36
|
+
"sperm",
|
|
37
|
+
"blastocyst",
|
|
38
|
+
"innerCellMass",
|
|
39
|
+
"disc",
|
|
40
|
+
"placenta",
|
|
41
|
+
"amnion",
|
|
42
|
+
"chorion",
|
|
43
|
+
"foetus",
|
|
44
|
+
], TextSchema),
|
|
45
|
+
placentas: rich,
|
|
46
|
+
results: byIds(["same", "different", "either", "joined"], TextSchema),
|
|
47
|
+
sacs: rich,
|
|
48
|
+
sex: rich,
|
|
49
|
+
split: TextSchema,
|
|
50
|
+
view: TextSchema,
|
|
51
|
+
}),
|
|
52
|
+
split: SplitSchema,
|
|
53
|
+
}).check(Schema.makeFilter(({ kinds, labels }) => namesEach(kinds, labels.kinds), {
|
|
54
|
+
message: "Expected a name for every kind of twin shown, and no other.",
|
|
55
|
+
})));
|
|
56
|
+
}
|
|
57
|
+
/** The twins lab. Every prop names what the learner explores; none is answer state. */
|
|
58
|
+
export function twinsVisuals(rich) {
|
|
59
|
+
return { TwinsLab: twinsLab(rich) };
|
|
60
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import type { RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/**
|
|
4
|
+
* The sea name lab. What each animal really is answers the question the lab
|
|
5
|
+
* raises, so the groups are answer state.
|
|
6
|
+
*/
|
|
7
|
+
export declare function vernacularVisuals<E>(rich: RichSlot<E>): {
|
|
8
|
+
SeaNameLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
9
|
+
readonly description: RichSlot<E>;
|
|
10
|
+
readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
|
|
11
|
+
readonly marks?: readonly [{
|
|
12
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
13
|
+
} | {
|
|
14
|
+
readonly attrs: {
|
|
15
|
+
readonly href: string;
|
|
16
|
+
};
|
|
17
|
+
readonly type: "link";
|
|
18
|
+
} | {
|
|
19
|
+
readonly attrs: {
|
|
20
|
+
readonly variant: "success" | "warning" | null;
|
|
21
|
+
};
|
|
22
|
+
readonly type: "highlight";
|
|
23
|
+
}, ...({
|
|
24
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
25
|
+
} | {
|
|
26
|
+
readonly attrs: {
|
|
27
|
+
readonly href: string;
|
|
28
|
+
};
|
|
29
|
+
readonly type: "link";
|
|
30
|
+
} | {
|
|
31
|
+
readonly attrs: {
|
|
32
|
+
readonly variant: "success" | "warning" | null;
|
|
33
|
+
};
|
|
34
|
+
readonly type: "highlight";
|
|
35
|
+
})[]];
|
|
36
|
+
readonly text: string;
|
|
37
|
+
readonly type: "text";
|
|
38
|
+
} | {
|
|
39
|
+
readonly attrs: {
|
|
40
|
+
readonly latex: string;
|
|
41
|
+
};
|
|
42
|
+
readonly marks?: readonly [{
|
|
43
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
44
|
+
} | {
|
|
45
|
+
readonly attrs: {
|
|
46
|
+
readonly href: string;
|
|
47
|
+
};
|
|
48
|
+
readonly type: "link";
|
|
49
|
+
} | {
|
|
50
|
+
readonly attrs: {
|
|
51
|
+
readonly variant: "success" | "warning" | null;
|
|
52
|
+
};
|
|
53
|
+
readonly type: "highlight";
|
|
54
|
+
}, ...({
|
|
55
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
56
|
+
} | {
|
|
57
|
+
readonly attrs: {
|
|
58
|
+
readonly href: string;
|
|
59
|
+
};
|
|
60
|
+
readonly type: "link";
|
|
61
|
+
} | {
|
|
62
|
+
readonly attrs: {
|
|
63
|
+
readonly variant: "success" | "warning" | null;
|
|
64
|
+
};
|
|
65
|
+
readonly type: "highlight";
|
|
66
|
+
})[]];
|
|
67
|
+
readonly type: "mathInline";
|
|
68
|
+
}, ...({
|
|
69
|
+
readonly marks?: readonly [{
|
|
70
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
71
|
+
} | {
|
|
72
|
+
readonly attrs: {
|
|
73
|
+
readonly href: string;
|
|
74
|
+
};
|
|
75
|
+
readonly type: "link";
|
|
76
|
+
} | {
|
|
77
|
+
readonly attrs: {
|
|
78
|
+
readonly variant: "success" | "warning" | null;
|
|
79
|
+
};
|
|
80
|
+
readonly type: "highlight";
|
|
81
|
+
}, ...({
|
|
82
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
83
|
+
} | {
|
|
84
|
+
readonly attrs: {
|
|
85
|
+
readonly href: string;
|
|
86
|
+
};
|
|
87
|
+
readonly type: "link";
|
|
88
|
+
} | {
|
|
89
|
+
readonly attrs: {
|
|
90
|
+
readonly variant: "success" | "warning" | null;
|
|
91
|
+
};
|
|
92
|
+
readonly type: "highlight";
|
|
93
|
+
})[]];
|
|
94
|
+
readonly text: string;
|
|
95
|
+
readonly type: "text";
|
|
96
|
+
} | {
|
|
97
|
+
readonly attrs: {
|
|
98
|
+
readonly latex: string;
|
|
99
|
+
};
|
|
100
|
+
readonly marks?: readonly [{
|
|
101
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
102
|
+
} | {
|
|
103
|
+
readonly attrs: {
|
|
104
|
+
readonly href: string;
|
|
105
|
+
};
|
|
106
|
+
readonly type: "link";
|
|
107
|
+
} | {
|
|
108
|
+
readonly attrs: {
|
|
109
|
+
readonly variant: "success" | "warning" | null;
|
|
110
|
+
};
|
|
111
|
+
readonly type: "highlight";
|
|
112
|
+
}, ...({
|
|
113
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
114
|
+
} | {
|
|
115
|
+
readonly attrs: {
|
|
116
|
+
readonly href: string;
|
|
117
|
+
};
|
|
118
|
+
readonly type: "link";
|
|
119
|
+
} | {
|
|
120
|
+
readonly attrs: {
|
|
121
|
+
readonly variant: "success" | "warning" | null;
|
|
122
|
+
};
|
|
123
|
+
readonly type: "highlight";
|
|
124
|
+
})[]];
|
|
125
|
+
readonly type: "mathInline";
|
|
126
|
+
})[]], E, never, never>>;
|
|
127
|
+
readonly title: RichSlot<E>;
|
|
128
|
+
readonly animals: Schema.NonEmptyArray<Schema.Literals<readonly ["dugong", "whale", "jellyfish", "seaStar", "mackerel"]>>;
|
|
129
|
+
readonly labels: Schema.Struct<{
|
|
130
|
+
readonly animal: Schema.Trimmed;
|
|
131
|
+
readonly group: RichSlot<E>;
|
|
132
|
+
readonly groups: Schema.optionalKey<Schema.$Record<Schema.Literals<readonly ["dugong", "whale", "jellyfish", "seaStar", "mackerel"]>, Schema.optionalKey<RichSlot<E>>>>;
|
|
133
|
+
readonly language: Schema.Trimmed;
|
|
134
|
+
readonly languages: Schema.$Record<Schema.Literals<readonly ["malay", "english", "indonesian", "german"]>, Schema.optionalKey<Schema.Trimmed>>;
|
|
135
|
+
readonly names: Schema.$Record<Schema.Literals<readonly ["dugong", "whale", "jellyfish", "seaStar", "mackerel"]>, Schema.optionalKey<Schema.$Record<Schema.Literals<readonly ["malay", "english", "indonesian", "german"]>, Schema.optionalKey<Schema.Trimmed>>>>;
|
|
136
|
+
readonly scientific: Schema.Trimmed;
|
|
137
|
+
readonly view: Schema.Trimmed;
|
|
138
|
+
}>;
|
|
139
|
+
readonly languages: Schema.NonEmptyArray<Schema.Literals<readonly ["malay", "english", "indonesian", "german"]>>;
|
|
140
|
+
}>, "figure">;
|
|
141
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Array as Arr, Schema } from "effect";
|
|
2
|
+
import { byPickedIds, cardFields, namesEach, TextSchema, } from "#contracts/visual/card";
|
|
3
|
+
import { answerAt, figure } from "#contracts/visual/entry";
|
|
4
|
+
/**
|
|
5
|
+
* Sea animals of Malaysian waters whose everyday names mislead: the dugong and
|
|
6
|
+
* the whale are mammals, the jellyfish and the sea star are not fish, and the
|
|
7
|
+
* mackerel is. Each one's scientific name and real group are cited data in the
|
|
8
|
+
* renderer's model.
|
|
9
|
+
*/
|
|
10
|
+
const ANIMALS = [
|
|
11
|
+
"dugong",
|
|
12
|
+
"whale",
|
|
13
|
+
"jellyfish",
|
|
14
|
+
"seaStar",
|
|
15
|
+
"mackerel",
|
|
16
|
+
];
|
|
17
|
+
const LANGUAGES = ["malay", "english", "indonesian", "german"];
|
|
18
|
+
/**
|
|
19
|
+
* Props of `SeaNameLab`: a shallow Malaysian sea with `animals` (each once)
|
|
20
|
+
* wearing name tags in one of `languages` (each once) at a time. The
|
|
21
|
+
* learner switches the language and the everyday names change while the
|
|
22
|
+
* scientific name stays the same. `labels.names` gives each animal's name in
|
|
23
|
+
* every language shown, and nothing else; the "what it really is" readout
|
|
24
|
+
* shows only when `labels.groups` gives it, so a question can ask first.
|
|
25
|
+
*/
|
|
26
|
+
function seaNameLab(rich) {
|
|
27
|
+
return figure(Schema.Struct({
|
|
28
|
+
...cardFields(rich),
|
|
29
|
+
animals: Schema.NonEmptyArray(Schema.Literals(ANIMALS)).check(Schema.isUnique()),
|
|
30
|
+
labels: Schema.Struct({
|
|
31
|
+
animal: TextSchema,
|
|
32
|
+
group: rich,
|
|
33
|
+
groups: Schema.optionalKey(byPickedIds(ANIMALS, rich)),
|
|
34
|
+
language: TextSchema,
|
|
35
|
+
languages: byPickedIds(LANGUAGES, TextSchema),
|
|
36
|
+
names: byPickedIds(ANIMALS, byPickedIds(LANGUAGES, TextSchema)),
|
|
37
|
+
scientific: TextSchema,
|
|
38
|
+
view: TextSchema,
|
|
39
|
+
}),
|
|
40
|
+
languages: Schema.NonEmptyArray(Schema.Literals(LANGUAGES)).check(Schema.isUnique()),
|
|
41
|
+
}).check(Schema.makeFilter(({ animals, labels, languages }) => namesEach(languages, labels.languages) &&
|
|
42
|
+
namesEach(animals, labels.names) &&
|
|
43
|
+
Arr.every(animals, (animal) => {
|
|
44
|
+
const names = labels.names[animal];
|
|
45
|
+
return names !== undefined && namesEach(languages, names);
|
|
46
|
+
}) &&
|
|
47
|
+
(labels.groups === undefined || namesEach(animals, labels.groups)), {
|
|
48
|
+
message: "Expected a name for every animal in every language the lab shows, and no other.",
|
|
49
|
+
})), answerAt(["labels", "groups"]));
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The sea name lab. What each animal really is answers the question the lab
|
|
53
|
+
* raises, so the groups are answer state.
|
|
54
|
+
*/
|
|
55
|
+
export function vernacularVisuals(rich) {
|
|
56
|
+
return { SeaNameLab: seaNameLab(rich) };
|
|
57
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import type { RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/** The vertebra lab. Every prop names what the learner explores; none is answer state. */
|
|
4
|
+
export declare function vertebraVisuals<E>(rich: RichSlot<E>): {
|
|
5
|
+
VertebraLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
6
|
+
readonly description: RichSlot<E>;
|
|
7
|
+
readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
|
|
8
|
+
readonly marks?: readonly [{
|
|
9
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
10
|
+
} | {
|
|
11
|
+
readonly attrs: {
|
|
12
|
+
readonly href: string;
|
|
13
|
+
};
|
|
14
|
+
readonly type: "link";
|
|
15
|
+
} | {
|
|
16
|
+
readonly attrs: {
|
|
17
|
+
readonly variant: "success" | "warning" | null;
|
|
18
|
+
};
|
|
19
|
+
readonly type: "highlight";
|
|
20
|
+
}, ...({
|
|
21
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
22
|
+
} | {
|
|
23
|
+
readonly attrs: {
|
|
24
|
+
readonly href: string;
|
|
25
|
+
};
|
|
26
|
+
readonly type: "link";
|
|
27
|
+
} | {
|
|
28
|
+
readonly attrs: {
|
|
29
|
+
readonly variant: "success" | "warning" | null;
|
|
30
|
+
};
|
|
31
|
+
readonly type: "highlight";
|
|
32
|
+
})[]];
|
|
33
|
+
readonly text: string;
|
|
34
|
+
readonly type: "text";
|
|
35
|
+
} | {
|
|
36
|
+
readonly attrs: {
|
|
37
|
+
readonly latex: string;
|
|
38
|
+
};
|
|
39
|
+
readonly marks?: readonly [{
|
|
40
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
41
|
+
} | {
|
|
42
|
+
readonly attrs: {
|
|
43
|
+
readonly href: string;
|
|
44
|
+
};
|
|
45
|
+
readonly type: "link";
|
|
46
|
+
} | {
|
|
47
|
+
readonly attrs: {
|
|
48
|
+
readonly variant: "success" | "warning" | null;
|
|
49
|
+
};
|
|
50
|
+
readonly type: "highlight";
|
|
51
|
+
}, ...({
|
|
52
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
53
|
+
} | {
|
|
54
|
+
readonly attrs: {
|
|
55
|
+
readonly href: string;
|
|
56
|
+
};
|
|
57
|
+
readonly type: "link";
|
|
58
|
+
} | {
|
|
59
|
+
readonly attrs: {
|
|
60
|
+
readonly variant: "success" | "warning" | null;
|
|
61
|
+
};
|
|
62
|
+
readonly type: "highlight";
|
|
63
|
+
})[]];
|
|
64
|
+
readonly type: "mathInline";
|
|
65
|
+
}, ...({
|
|
66
|
+
readonly marks?: readonly [{
|
|
67
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
68
|
+
} | {
|
|
69
|
+
readonly attrs: {
|
|
70
|
+
readonly href: string;
|
|
71
|
+
};
|
|
72
|
+
readonly type: "link";
|
|
73
|
+
} | {
|
|
74
|
+
readonly attrs: {
|
|
75
|
+
readonly variant: "success" | "warning" | null;
|
|
76
|
+
};
|
|
77
|
+
readonly type: "highlight";
|
|
78
|
+
}, ...({
|
|
79
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
80
|
+
} | {
|
|
81
|
+
readonly attrs: {
|
|
82
|
+
readonly href: string;
|
|
83
|
+
};
|
|
84
|
+
readonly type: "link";
|
|
85
|
+
} | {
|
|
86
|
+
readonly attrs: {
|
|
87
|
+
readonly variant: "success" | "warning" | null;
|
|
88
|
+
};
|
|
89
|
+
readonly type: "highlight";
|
|
90
|
+
})[]];
|
|
91
|
+
readonly text: string;
|
|
92
|
+
readonly type: "text";
|
|
93
|
+
} | {
|
|
94
|
+
readonly attrs: {
|
|
95
|
+
readonly latex: string;
|
|
96
|
+
};
|
|
97
|
+
readonly marks?: readonly [{
|
|
98
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
99
|
+
} | {
|
|
100
|
+
readonly attrs: {
|
|
101
|
+
readonly href: string;
|
|
102
|
+
};
|
|
103
|
+
readonly type: "link";
|
|
104
|
+
} | {
|
|
105
|
+
readonly attrs: {
|
|
106
|
+
readonly variant: "success" | "warning" | null;
|
|
107
|
+
};
|
|
108
|
+
readonly type: "highlight";
|
|
109
|
+
}, ...({
|
|
110
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
111
|
+
} | {
|
|
112
|
+
readonly attrs: {
|
|
113
|
+
readonly href: string;
|
|
114
|
+
};
|
|
115
|
+
readonly type: "link";
|
|
116
|
+
} | {
|
|
117
|
+
readonly attrs: {
|
|
118
|
+
readonly variant: "success" | "warning" | null;
|
|
119
|
+
};
|
|
120
|
+
readonly type: "highlight";
|
|
121
|
+
})[]];
|
|
122
|
+
readonly type: "mathInline";
|
|
123
|
+
})[]], E, never, never>>;
|
|
124
|
+
readonly title: RichSlot<E>;
|
|
125
|
+
readonly labels: Schema.Struct<{
|
|
126
|
+
readonly count: RichSlot<E>;
|
|
127
|
+
readonly fused: RichSlot<E>;
|
|
128
|
+
readonly job: RichSlot<E>;
|
|
129
|
+
readonly no: RichSlot<E>;
|
|
130
|
+
readonly parts: Schema.$Record<Schema.Literals<readonly ["body", "canal", "spinous", "transverse", "foramen", "facet", "dens", "disc"]>, Schema.Trimmed>;
|
|
131
|
+
readonly region: Schema.Trimmed;
|
|
132
|
+
readonly regions: Schema.$Record<Schema.Literals<readonly ["cervical", "atlas", "axis", "thoracic", "lumbar", "sacral", "caudal"]>, Schema.optionalKey<Schema.Struct<{
|
|
133
|
+
readonly job: RichSlot<E>;
|
|
134
|
+
readonly name: Schema.Trimmed;
|
|
135
|
+
}>>>;
|
|
136
|
+
readonly view: Schema.Trimmed;
|
|
137
|
+
readonly yes: RichSlot<E>;
|
|
138
|
+
}>;
|
|
139
|
+
readonly regions: Schema.NonEmptyArray<Schema.Literals<readonly ["cervical", "atlas", "axis", "thoracic", "lumbar", "sacral", "caudal"]>>;
|
|
140
|
+
}>, "figure">;
|
|
141
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { byIds, byPickedIds, cardFields, namesEach, TextSchema, } from "#contracts/visual/card";
|
|
3
|
+
import { figure } from "#contracts/visual/entry";
|
|
4
|
+
/**
|
|
5
|
+
* The kinds of vertebra the column holds, from the neck down: cervical, the
|
|
6
|
+
* first two cervical vertebrae (atlas and axis) on their own, thoracic,
|
|
7
|
+
* lumbar, then the sacral and caudal vertebrae that fuse into the sacrum and
|
|
8
|
+
* the coccyx. How many each region has and whether it fuses are facts the
|
|
9
|
+
* renderer knows.
|
|
10
|
+
*/
|
|
11
|
+
const REGIONS = [
|
|
12
|
+
"cervical",
|
|
13
|
+
"atlas",
|
|
14
|
+
"axis",
|
|
15
|
+
"thoracic",
|
|
16
|
+
"lumbar",
|
|
17
|
+
"sacral",
|
|
18
|
+
"caudal",
|
|
19
|
+
];
|
|
20
|
+
/**
|
|
21
|
+
* Props of `VertebraLab`: a human vertebral column with its curves. The
|
|
22
|
+
* learner picks one of `regions` (each once, in the order the toggle lists
|
|
23
|
+
* them) and turns the vertebra that lifts out of the column; the readouts give
|
|
24
|
+
* how many the region has, whether they fuse into one bone and the region's
|
|
25
|
+
* job, words from `labels.regions`, one entry for each region shown and no
|
|
26
|
+
* other. The parts of a vertebra are labelled in the scene.
|
|
27
|
+
*/
|
|
28
|
+
function vertebraLab(rich) {
|
|
29
|
+
return figure(Schema.Struct({
|
|
30
|
+
...cardFields(rich),
|
|
31
|
+
labels: Schema.Struct({
|
|
32
|
+
count: rich,
|
|
33
|
+
fused: rich,
|
|
34
|
+
job: rich,
|
|
35
|
+
no: rich,
|
|
36
|
+
parts: byIds([
|
|
37
|
+
"body",
|
|
38
|
+
"canal",
|
|
39
|
+
"spinous",
|
|
40
|
+
"transverse",
|
|
41
|
+
"foramen",
|
|
42
|
+
"facet",
|
|
43
|
+
"dens",
|
|
44
|
+
"disc",
|
|
45
|
+
], TextSchema),
|
|
46
|
+
region: TextSchema,
|
|
47
|
+
regions: byPickedIds(REGIONS, Schema.Struct({ job: rich, name: TextSchema })),
|
|
48
|
+
view: TextSchema,
|
|
49
|
+
yes: rich,
|
|
50
|
+
}),
|
|
51
|
+
regions: Schema.NonEmptyArray(Schema.Literals(REGIONS)).check(Schema.isUnique()),
|
|
52
|
+
}).check(Schema.makeFilter(({ labels, regions }) => namesEach(regions, labels.regions), {
|
|
53
|
+
message: "Expected words for every region the lab shows, and no other.",
|
|
54
|
+
})));
|
|
55
|
+
}
|
|
56
|
+
/** The vertebra lab. Every prop names what the learner explores; none is answer state. */
|
|
57
|
+
export function vertebraVisuals(rich) {
|
|
58
|
+
return { VertebraLab: vertebraLab(rich) };
|
|
59
|
+
}
|
|
@@ -8,11 +8,64 @@ export declare function vesselVisuals<E>(rich: RichSlot<E>): {
|
|
|
8
8
|
CapillaryBedLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
9
9
|
readonly description: RichSlot<E>;
|
|
10
10
|
readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
|
|
11
|
+
readonly marks?: readonly [{
|
|
12
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
13
|
+
} | {
|
|
14
|
+
readonly attrs: {
|
|
15
|
+
readonly href: string;
|
|
16
|
+
};
|
|
17
|
+
readonly type: "link";
|
|
18
|
+
} | {
|
|
19
|
+
readonly attrs: {
|
|
20
|
+
readonly variant: "success" | "warning" | null;
|
|
21
|
+
};
|
|
22
|
+
readonly type: "highlight";
|
|
23
|
+
}, ...({
|
|
24
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
25
|
+
} | {
|
|
26
|
+
readonly attrs: {
|
|
27
|
+
readonly href: string;
|
|
28
|
+
};
|
|
29
|
+
readonly type: "link";
|
|
30
|
+
} | {
|
|
31
|
+
readonly attrs: {
|
|
32
|
+
readonly variant: "success" | "warning" | null;
|
|
33
|
+
};
|
|
34
|
+
readonly type: "highlight";
|
|
35
|
+
})[]];
|
|
36
|
+
readonly text: string;
|
|
37
|
+
readonly type: "text";
|
|
38
|
+
} | {
|
|
11
39
|
readonly attrs: {
|
|
12
40
|
readonly latex: string;
|
|
13
41
|
};
|
|
42
|
+
readonly marks?: readonly [{
|
|
43
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
44
|
+
} | {
|
|
45
|
+
readonly attrs: {
|
|
46
|
+
readonly href: string;
|
|
47
|
+
};
|
|
48
|
+
readonly type: "link";
|
|
49
|
+
} | {
|
|
50
|
+
readonly attrs: {
|
|
51
|
+
readonly variant: "success" | "warning" | null;
|
|
52
|
+
};
|
|
53
|
+
readonly type: "highlight";
|
|
54
|
+
}, ...({
|
|
55
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
56
|
+
} | {
|
|
57
|
+
readonly attrs: {
|
|
58
|
+
readonly href: string;
|
|
59
|
+
};
|
|
60
|
+
readonly type: "link";
|
|
61
|
+
} | {
|
|
62
|
+
readonly attrs: {
|
|
63
|
+
readonly variant: "success" | "warning" | null;
|
|
64
|
+
};
|
|
65
|
+
readonly type: "highlight";
|
|
66
|
+
})[]];
|
|
14
67
|
readonly type: "mathInline";
|
|
15
|
-
}
|
|
68
|
+
}, ...({
|
|
16
69
|
readonly marks?: readonly [{
|
|
17
70
|
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
18
71
|
} | {
|
|
@@ -40,12 +93,10 @@ export declare function vesselVisuals<E>(rich: RichSlot<E>): {
|
|
|
40
93
|
})[]];
|
|
41
94
|
readonly text: string;
|
|
42
95
|
readonly type: "text";
|
|
43
|
-
}
|
|
96
|
+
} | {
|
|
44
97
|
readonly attrs: {
|
|
45
98
|
readonly latex: string;
|
|
46
99
|
};
|
|
47
|
-
readonly type: "mathInline";
|
|
48
|
-
} | {
|
|
49
100
|
readonly marks?: readonly [{
|
|
50
101
|
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
51
102
|
} | {
|
|
@@ -71,8 +122,7 @@ export declare function vesselVisuals<E>(rich: RichSlot<E>): {
|
|
|
71
122
|
};
|
|
72
123
|
readonly type: "highlight";
|
|
73
124
|
})[]];
|
|
74
|
-
readonly
|
|
75
|
-
readonly type: "text";
|
|
125
|
+
readonly type: "mathInline";
|
|
76
126
|
})[]], E, never, never>>;
|
|
77
127
|
readonly title: RichSlot<E>;
|
|
78
128
|
readonly labels: Schema.Struct<{
|