@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,142 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import type { RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/**
|
|
4
|
+
* The kingdom lab. The feedback after a placement tells the learner the
|
|
5
|
+
* answer, so it is answer state.
|
|
6
|
+
*/
|
|
7
|
+
export declare function kingdomVisuals<E>(rich: RichSlot<E>): {
|
|
8
|
+
KingdomSortLab: 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 labels: Schema.Struct<{
|
|
129
|
+
readonly checks: Schema.$Record<Schema.Literals<readonly ["nucleus", "cells", "wall", "food"]>, Schema.Trimmed>;
|
|
130
|
+
readonly kingdom: Schema.optionalKey<RichSlot<E>>;
|
|
131
|
+
readonly kingdoms: Schema.$Record<Schema.Literals<readonly ["archaebacteria", "eubacteria", "protista", "fungi", "plantae", "animalia"]>, Schema.Trimmed>;
|
|
132
|
+
readonly place: Schema.Trimmed;
|
|
133
|
+
readonly right: Schema.optionalKey<RichSlot<E>>;
|
|
134
|
+
readonly specimen: Schema.Trimmed;
|
|
135
|
+
readonly specimens: Schema.$Record<Schema.Literals<readonly ["sulfolobus", "thermus", "paramecium", "spirogyra", "slimeMould", "yeast", "mushroom", "fern", "padi", "hydra"]>, Schema.optionalKey<RichSlot<E>>>;
|
|
136
|
+
readonly values: Schema.$Record<Schema.Literals<readonly ["yes", "no", "one", "many", "tissue", "none", "peptidoglycan", "noPeptidoglycan", "chitin", "cellulose", "photosynthesis", "absorbs", "ingests", "either"]>, Schema.Trimmed>;
|
|
137
|
+
readonly view: Schema.Trimmed;
|
|
138
|
+
readonly wrong: Schema.optionalKey<RichSlot<E>>;
|
|
139
|
+
}>;
|
|
140
|
+
readonly specimens: Schema.NonEmptyArray<Schema.Literals<readonly ["sulfolobus", "thermus", "paramecium", "spirogyra", "slimeMould", "yeast", "mushroom", "fern", "padi", "hydra"]>>;
|
|
141
|
+
}>, "figure">;
|
|
142
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Array as Arr, Schema } from "effect";
|
|
2
|
+
import { byIds, byPickedIds, cardFields, namesEach, TextSchema, } from "#contracts/visual/card";
|
|
3
|
+
import { answerAt, figure } from "#contracts/visual/entry";
|
|
4
|
+
/**
|
|
5
|
+
* Specimens that each match exactly one of the six kingdoms on four features
|
|
6
|
+
* (nucleus, number of cells, cell wall, how it gets food); which one is a fact
|
|
7
|
+
* the renderer's model holds.
|
|
8
|
+
*/
|
|
9
|
+
const SPECIMENS = [
|
|
10
|
+
"sulfolobus",
|
|
11
|
+
"thermus",
|
|
12
|
+
"paramecium",
|
|
13
|
+
"spirogyra",
|
|
14
|
+
"slimeMould",
|
|
15
|
+
"yeast",
|
|
16
|
+
"mushroom",
|
|
17
|
+
"fern",
|
|
18
|
+
"padi",
|
|
19
|
+
"hydra",
|
|
20
|
+
];
|
|
21
|
+
/**
|
|
22
|
+
* Props of `KingdomSortLab`: a lab bench with a microscope, `specimens`
|
|
23
|
+
* (each once) and six kingdom trays. The learner looks at a specimen's four
|
|
24
|
+
* features, words from `labels.checks` and `labels.values`, and places it in
|
|
25
|
+
* a tray. Whether the placement is right, and the correct kingdom, show only
|
|
26
|
+
* when `labels.right`, `labels.wrong` and `labels.kingdom` are all given, so a
|
|
27
|
+
* question can leave all three out.
|
|
28
|
+
*/
|
|
29
|
+
function kingdomSortLab(rich) {
|
|
30
|
+
return figure(Schema.Struct({
|
|
31
|
+
...cardFields(rich),
|
|
32
|
+
labels: Schema.Struct({
|
|
33
|
+
checks: byIds(["nucleus", "cells", "wall", "food"], TextSchema),
|
|
34
|
+
kingdom: Schema.optionalKey(rich),
|
|
35
|
+
kingdoms: byIds([
|
|
36
|
+
"archaebacteria",
|
|
37
|
+
"eubacteria",
|
|
38
|
+
"protista",
|
|
39
|
+
"fungi",
|
|
40
|
+
"plantae",
|
|
41
|
+
"animalia",
|
|
42
|
+
], TextSchema),
|
|
43
|
+
place: TextSchema,
|
|
44
|
+
right: Schema.optionalKey(rich),
|
|
45
|
+
specimen: TextSchema,
|
|
46
|
+
specimens: byPickedIds(SPECIMENS, rich),
|
|
47
|
+
values: byIds([
|
|
48
|
+
"yes",
|
|
49
|
+
"no",
|
|
50
|
+
"one",
|
|
51
|
+
"many",
|
|
52
|
+
"tissue",
|
|
53
|
+
"none",
|
|
54
|
+
"peptidoglycan",
|
|
55
|
+
"noPeptidoglycan",
|
|
56
|
+
"chitin",
|
|
57
|
+
"cellulose",
|
|
58
|
+
"photosynthesis",
|
|
59
|
+
"absorbs",
|
|
60
|
+
"ingests",
|
|
61
|
+
"either",
|
|
62
|
+
], TextSchema),
|
|
63
|
+
view: TextSchema,
|
|
64
|
+
wrong: Schema.optionalKey(rich),
|
|
65
|
+
}),
|
|
66
|
+
specimens: Schema.NonEmptyArray(Schema.Literals(SPECIMENS)).check(Schema.isUnique()),
|
|
67
|
+
}).check(Schema.makeFilter(({ labels, specimens }) => {
|
|
68
|
+
const feedback = [labels.kingdom, labels.right, labels.wrong];
|
|
69
|
+
return (namesEach(specimens, labels.specimens) &&
|
|
70
|
+
(Arr.every(feedback, (word) => word === undefined) ||
|
|
71
|
+
Arr.every(feedback, (word) => word !== undefined)));
|
|
72
|
+
}, {
|
|
73
|
+
message: "Expected a name for every specimen shown, and the right, wrong and kingdom feedback all given or all left out.",
|
|
74
|
+
})), answerAt(["labels", "right"], ["labels", "wrong"], ["labels", "kingdom"]));
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The kingdom lab. The feedback after a placement tells the learner the
|
|
78
|
+
* answer, so it is answer state.
|
|
79
|
+
*/
|
|
80
|
+
export function kingdomVisuals(rich) {
|
|
81
|
+
return { KingdomSortLab: kingdomSortLab(rich) };
|
|
82
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import type { RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/** The immobilised lactase lab. The learner compares the methods by trying, so none is answer state. */
|
|
4
|
+
export declare function lactaseVisuals<E>(rich: RichSlot<E>): {
|
|
5
|
+
LactaseColumnLab: 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 flow: Schema.Struct<{
|
|
126
|
+
readonly max: Schema.Codec<number, number, never, never>;
|
|
127
|
+
readonly min: Schema.Codec<number, number, never, never>;
|
|
128
|
+
readonly value: Schema.Codec<number, number, never, never>;
|
|
129
|
+
}>;
|
|
130
|
+
readonly labels: Schema.Struct<{
|
|
131
|
+
readonly batches: RichSlot<E>;
|
|
132
|
+
readonly enzyme: RichSlot<E>;
|
|
133
|
+
readonly flow: Schema.Trimmed;
|
|
134
|
+
readonly glucose: RichSlot<E>;
|
|
135
|
+
readonly lactose: RichSlot<E>;
|
|
136
|
+
readonly method: Schema.Trimmed;
|
|
137
|
+
readonly methods: Schema.$Record<Schema.Literals<readonly ["immobilised", "free"]>, Schema.optionalKey<Schema.Trimmed>>;
|
|
138
|
+
readonly negative: RichSlot<E>;
|
|
139
|
+
readonly none: RichSlot<E>;
|
|
140
|
+
readonly parts: Schema.$Record<Schema.Literals<readonly ["column", "beads", "milk", "strip"]>, Schema.Trimmed>;
|
|
141
|
+
readonly positive: RichSlot<E>;
|
|
142
|
+
readonly present: RichSlot<E>;
|
|
143
|
+
readonly view: Schema.Trimmed;
|
|
144
|
+
}>;
|
|
145
|
+
readonly methods: Schema.NonEmptyArray<Schema.Literals<readonly ["immobilised", "free"]>>;
|
|
146
|
+
}>, "figure">;
|
|
147
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { pickedFrom, sliderOf } from "#contracts/visual/biology/control";
|
|
3
|
+
import { byIds, byPickedIds, cardFields, namesEach, TextSchema, } from "#contracts/visual/card";
|
|
4
|
+
import { figure } from "#contracts/visual/entry";
|
|
5
|
+
/**
|
|
6
|
+
* The two ways to make lactose-reduced milk: lactase held in alginate beads
|
|
7
|
+
* in a column the milk flows through, or lactase stirred straight into the
|
|
8
|
+
* milk, which then leaves with it.
|
|
9
|
+
*/
|
|
10
|
+
const METHODS = ["immobilised", "free"];
|
|
11
|
+
/** A milk flow rate through the column in millilitres per minute, up to twenty. */
|
|
12
|
+
const FlowSchema = Schema.Finite.check(Schema.isGreaterThan(0), Schema.isLessThanOrEqualTo(20));
|
|
13
|
+
/**
|
|
14
|
+
* Props of `LactaseColumnLab`: a glass column of alginate beads with milk
|
|
15
|
+
* flowing through it, or a beaker of milk with lactase stirred in, picked
|
|
16
|
+
* from `methods` (each once, in toggle order). The learner sets the milk
|
|
17
|
+
* `flow`; the readouts give the lactose left, the glucose test strip result,
|
|
18
|
+
* whether lactase leaves in the milk, and how many batches the same lactase
|
|
19
|
+
* treats.
|
|
20
|
+
*/
|
|
21
|
+
function lactaseColumnLab(rich) {
|
|
22
|
+
return figure(Schema.Struct({
|
|
23
|
+
...cardFields(rich),
|
|
24
|
+
flow: sliderOf(FlowSchema),
|
|
25
|
+
labels: Schema.Struct({
|
|
26
|
+
batches: rich,
|
|
27
|
+
enzyme: rich,
|
|
28
|
+
flow: TextSchema,
|
|
29
|
+
glucose: rich,
|
|
30
|
+
lactose: rich,
|
|
31
|
+
method: TextSchema,
|
|
32
|
+
methods: byPickedIds(METHODS, TextSchema),
|
|
33
|
+
negative: rich,
|
|
34
|
+
none: rich,
|
|
35
|
+
parts: byIds(["column", "beads", "milk", "strip"], TextSchema),
|
|
36
|
+
positive: rich,
|
|
37
|
+
present: rich,
|
|
38
|
+
view: TextSchema,
|
|
39
|
+
}),
|
|
40
|
+
methods: pickedFrom(METHODS),
|
|
41
|
+
}).check(Schema.makeFilter(({ labels, methods }) => namesEach(methods, labels.methods), {
|
|
42
|
+
message: "Expected a name for every method the lab shows, and no other.",
|
|
43
|
+
})));
|
|
44
|
+
}
|
|
45
|
+
/** The immobilised lactase lab. The learner compares the methods by trying, so none is answer state. */
|
|
46
|
+
export function lactaseVisuals(rich) {
|
|
47
|
+
return { LactaseColumnLab: lactaseColumnLab(rich) };
|
|
48
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import type { RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/** The muscle pair lab. Which muscle contracts is shown as the learner moves; no prop is answer state. */
|
|
4
|
+
export declare function limbVisuals<E>(rich: RichSlot<E>): {
|
|
5
|
+
MusclePairLab: 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 angle: Schema.Trimmed;
|
|
127
|
+
readonly contracting: RichSlot<E>;
|
|
128
|
+
readonly limb: Schema.Trimmed;
|
|
129
|
+
readonly limbs: Schema.$Record<Schema.Literals<readonly ["arm", "leg"]>, Schema.optionalKey<Schema.Trimmed>>;
|
|
130
|
+
readonly movement: Schema.Trimmed;
|
|
131
|
+
readonly movements: Schema.$Record<Schema.Literals<readonly ["heel", "toes", "bend", "straighten"]>, Schema.Trimmed>;
|
|
132
|
+
readonly muscles: Schema.$Record<Schema.Literals<readonly ["biceps", "triceps", "quadriceps", "hamstrings", "gastrocnemius", "tibialis"]>, Schema.Trimmed>;
|
|
133
|
+
readonly parts: Schema.$Record<Schema.Literals<readonly ["humerus", "radius", "ulna", "femur", "tibia", "tendon"]>, Schema.Trimmed>;
|
|
134
|
+
readonly relaxing: RichSlot<E>;
|
|
135
|
+
readonly view: Schema.Trimmed;
|
|
136
|
+
}>;
|
|
137
|
+
readonly limbs: Schema.NonEmptyArray<Schema.Literals<readonly ["arm", "leg"]>>;
|
|
138
|
+
}>, "figure">;
|
|
139
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
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 LIMBS = ["arm", "leg"];
|
|
5
|
+
/**
|
|
6
|
+
* Props of `MusclePairLab`: antagonistic muscles in a human arm, a human leg,
|
|
7
|
+
* or both (`limbs`, each once, in the order the toggle lists them). In the arm
|
|
8
|
+
* the learner sets the elbow angle (`labels.angle`) and the biceps and triceps
|
|
9
|
+
* take turns; in the leg the learner picks a movement of the knee or ankle
|
|
10
|
+
* (`labels.movements`) and the quadriceps, hamstrings, gastrocnemius and
|
|
11
|
+
* tibialis anterior take turns. The readouts name the muscle that contracts and
|
|
12
|
+
* the one that relaxes; the scene labels the bones and a tendon.
|
|
13
|
+
*/
|
|
14
|
+
function musclePairLab(rich) {
|
|
15
|
+
return figure(Schema.Struct({
|
|
16
|
+
...cardFields(rich),
|
|
17
|
+
labels: Schema.Struct({
|
|
18
|
+
angle: TextSchema,
|
|
19
|
+
contracting: rich,
|
|
20
|
+
limb: TextSchema,
|
|
21
|
+
limbs: byPickedIds(LIMBS, TextSchema),
|
|
22
|
+
movement: TextSchema,
|
|
23
|
+
movements: byIds(["heel", "toes", "bend", "straighten"], TextSchema),
|
|
24
|
+
muscles: byIds([
|
|
25
|
+
"biceps",
|
|
26
|
+
"triceps",
|
|
27
|
+
"quadriceps",
|
|
28
|
+
"hamstrings",
|
|
29
|
+
"gastrocnemius",
|
|
30
|
+
"tibialis",
|
|
31
|
+
], TextSchema),
|
|
32
|
+
parts: byIds(["humerus", "radius", "ulna", "femur", "tibia", "tendon"], TextSchema),
|
|
33
|
+
relaxing: rich,
|
|
34
|
+
view: TextSchema,
|
|
35
|
+
}),
|
|
36
|
+
limbs: Schema.NonEmptyArray(Schema.Literals(LIMBS)).check(Schema.isUnique()),
|
|
37
|
+
}).check(Schema.makeFilter(({ labels, limbs }) => namesEach(limbs, labels.limbs), {
|
|
38
|
+
message: "Expected a name for every limb the lab shows, and no other.",
|
|
39
|
+
})));
|
|
40
|
+
}
|
|
41
|
+
/** The muscle pair lab. Which muscle contracts is shown as the learner moves; no prop is answer state. */
|
|
42
|
+
export function limbVisuals(rich) {
|
|
43
|
+
return { MusclePairLab: musclePairLab(rich) };
|
|
44
|
+
}
|