@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,144 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import type { RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/** The lipid lab. Every prop names what the learner explores; none is answer state. */
|
|
4
|
+
export declare function lipidVisuals<E>(rich: RichSlot<E>): {
|
|
5
|
+
LipidLab: 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 chains: Schema.NonEmptyArray<Schema.Literals<readonly ["saturated", "unsaturated"]>>;
|
|
126
|
+
readonly labels: Schema.Struct<{
|
|
127
|
+
readonly bilayer: RichSlot<E>;
|
|
128
|
+
readonly chain: Schema.Trimmed;
|
|
129
|
+
readonly chains: Schema.$Record<Schema.Literals<readonly ["saturated", "unsaturated"]>, Schema.optionalKey<Schema.Trimmed>>;
|
|
130
|
+
readonly droplet: RichSlot<E>;
|
|
131
|
+
readonly form: RichSlot<E>;
|
|
132
|
+
readonly liquid: RichSlot<E>;
|
|
133
|
+
readonly molecule: Schema.Trimmed;
|
|
134
|
+
readonly molecules: Schema.$Record<Schema.Literals<readonly ["triglyceride", "phospholipid"]>, Schema.optionalKey<Schema.Trimmed>>;
|
|
135
|
+
readonly parts: Schema.$Record<Schema.Literals<readonly ["glycerol", "fatty", "ester", "phosphate", "head", "tail", "kink"]>, Schema.Trimmed>;
|
|
136
|
+
readonly scale: Schema.Trimmed;
|
|
137
|
+
readonly scales: Schema.$Record<Schema.Literals<readonly ["molecule", "water"]>, Schema.Trimmed>;
|
|
138
|
+
readonly solid: RichSlot<E>;
|
|
139
|
+
readonly state: RichSlot<E>;
|
|
140
|
+
readonly view: Schema.Trimmed;
|
|
141
|
+
}>;
|
|
142
|
+
readonly molecules: Schema.NonEmptyArray<Schema.Literals<readonly ["triglyceride", "phospholipid"]>>;
|
|
143
|
+
}>, "figure">;
|
|
144
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
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 MOLECULES = ["triglyceride", "phospholipid"];
|
|
5
|
+
const CHAINS = ["saturated", "unsaturated"];
|
|
6
|
+
/**
|
|
7
|
+
* Props of `LipidLab`: a triglyceride and a phospholipid, at the scale of one
|
|
8
|
+
* molecule or of many molecules in water. The learner picks one of
|
|
9
|
+
* `molecules` and one of `chains` (each once, in the order the toggles list
|
|
10
|
+
* them); a kinked unsaturated chain packs loosely and stays liquid, a straight
|
|
11
|
+
* saturated chain packs tightly and turns solid, and in water triglycerides
|
|
12
|
+
* gather into a droplet while phospholipids form a bilayer.
|
|
13
|
+
*/
|
|
14
|
+
function lipidLab(rich) {
|
|
15
|
+
return figure(Schema.Struct({
|
|
16
|
+
...cardFields(rich),
|
|
17
|
+
chains: Schema.NonEmptyArray(Schema.Literals(CHAINS)).check(Schema.isUnique()),
|
|
18
|
+
labels: Schema.Struct({
|
|
19
|
+
bilayer: rich,
|
|
20
|
+
chain: TextSchema,
|
|
21
|
+
chains: byPickedIds(CHAINS, TextSchema),
|
|
22
|
+
droplet: rich,
|
|
23
|
+
form: rich,
|
|
24
|
+
liquid: rich,
|
|
25
|
+
molecule: TextSchema,
|
|
26
|
+
molecules: byPickedIds(MOLECULES, TextSchema),
|
|
27
|
+
parts: byIds(["glycerol", "fatty", "ester", "phosphate", "head", "tail", "kink"], TextSchema),
|
|
28
|
+
scale: TextSchema,
|
|
29
|
+
scales: byIds(["molecule", "water"], TextSchema),
|
|
30
|
+
solid: rich,
|
|
31
|
+
state: rich,
|
|
32
|
+
view: TextSchema,
|
|
33
|
+
}),
|
|
34
|
+
molecules: Schema.NonEmptyArray(Schema.Literals(MOLECULES)).check(Schema.isUnique()),
|
|
35
|
+
}).check(Schema.makeFilter(({ chains, labels, molecules }) => namesEach(molecules, labels.molecules) &&
|
|
36
|
+
namesEach(chains, labels.chains), {
|
|
37
|
+
message: "Expected a name for every molecule and chain the lab shows, and no other.",
|
|
38
|
+
})));
|
|
39
|
+
}
|
|
40
|
+
/** The lipid lab. Every prop names what the learner explores; none is answer state. */
|
|
41
|
+
export function lipidVisuals(rich) {
|
|
42
|
+
return { LipidLab: lipidLab(rich) };
|
|
43
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import type { RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/** The locomotion lab. Every prop names what the learner explores; none is answer state. */
|
|
4
|
+
export declare function locomotionVisuals<E>(rich: RichSlot<E>): {
|
|
5
|
+
AnimalLocomotionLab: 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 animals: Schema.NonEmptyArray<Schema.Literals<readonly ["earthworm", "fish", "grasshopper", "bird"]>>;
|
|
126
|
+
readonly labels: Schema.Struct<{
|
|
127
|
+
readonly against: RichSlot<E>;
|
|
128
|
+
readonly animal: Schema.Trimmed;
|
|
129
|
+
readonly animals: Schema.$Record<Schema.Literals<readonly ["earthworm", "fish", "grasshopper", "bird"]>, Schema.optionalKey<Schema.Struct<{
|
|
130
|
+
readonly against: RichSlot<E>;
|
|
131
|
+
readonly name: Schema.Trimmed;
|
|
132
|
+
readonly skeleton: RichSlot<E>;
|
|
133
|
+
}>>>;
|
|
134
|
+
readonly contracting: RichSlot<E>;
|
|
135
|
+
readonly muscles: Schema.$Record<Schema.Literals<readonly ["circular", "longitudinal", "left", "right", "extensor", "flexor", "pectoralis", "supracoracoideus"]>, Schema.Trimmed>;
|
|
136
|
+
readonly parts: Schema.$Record<Schema.Literals<readonly ["chaetae", "fluid", "myotome", "fin", "femur", "tibia", "keel"]>, Schema.Trimmed>;
|
|
137
|
+
readonly skeleton: RichSlot<E>;
|
|
138
|
+
readonly view: Schema.Trimmed;
|
|
139
|
+
}>;
|
|
140
|
+
}>, "figure">;
|
|
141
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
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 animals the lab can show, one per way of moving: an earthworm with a
|
|
6
|
+
* hydrostatic skeleton crawling through soil, a fish swimming with its
|
|
7
|
+
* myotomes, a grasshopper jumping with an exoskeleton, and a bird flying.
|
|
8
|
+
*/
|
|
9
|
+
const ANIMALS = ["earthworm", "fish", "grasshopper", "bird"];
|
|
10
|
+
/**
|
|
11
|
+
* Props of `AnimalLocomotionLab`: one of `animals` at a time (each once, in
|
|
12
|
+
* the order the toggle lists them) moving through its medium. The learner
|
|
13
|
+
* plays the movement; the readouts give the kind of skeleton, what the body
|
|
14
|
+
* pushes against and the muscle contracting at that moment, words from
|
|
15
|
+
* `labels.animals` (one entry for each animal shown and no other) and
|
|
16
|
+
* `labels.muscles`. The scene labels the parts that matter for each animal.
|
|
17
|
+
*/
|
|
18
|
+
function animalLocomotionLab(rich) {
|
|
19
|
+
return figure(Schema.Struct({
|
|
20
|
+
...cardFields(rich),
|
|
21
|
+
animals: Schema.NonEmptyArray(Schema.Literals(ANIMALS)).check(Schema.isUnique()),
|
|
22
|
+
labels: Schema.Struct({
|
|
23
|
+
against: rich,
|
|
24
|
+
animal: TextSchema,
|
|
25
|
+
animals: byPickedIds(ANIMALS, Schema.Struct({ against: rich, name: TextSchema, skeleton: rich })),
|
|
26
|
+
contracting: rich,
|
|
27
|
+
muscles: byIds([
|
|
28
|
+
"circular",
|
|
29
|
+
"longitudinal",
|
|
30
|
+
"left",
|
|
31
|
+
"right",
|
|
32
|
+
"extensor",
|
|
33
|
+
"flexor",
|
|
34
|
+
"pectoralis",
|
|
35
|
+
"supracoracoideus",
|
|
36
|
+
], TextSchema),
|
|
37
|
+
parts: byIds(["chaetae", "fluid", "myotome", "fin", "femur", "tibia", "keel"], TextSchema),
|
|
38
|
+
skeleton: rich,
|
|
39
|
+
view: TextSchema,
|
|
40
|
+
}),
|
|
41
|
+
}).check(Schema.makeFilter(({ animals, labels }) => namesEach(animals, labels.animals), {
|
|
42
|
+
message: "Expected words for every animal the lab shows, and no other.",
|
|
43
|
+
})));
|
|
44
|
+
}
|
|
45
|
+
/** The locomotion lab. Every prop names what the learner explores; none is answer state. */
|
|
46
|
+
export function locomotionVisuals(rich) {
|
|
47
|
+
return { AnimalLocomotionLab: animalLocomotionLab(rich) };
|
|
48
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import type { RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/**
|
|
4
|
+
* The menstrual cycle lab. The ovulation day is what a question asks a
|
|
5
|
+
* learner to work out, so that readout is answer state.
|
|
6
|
+
*/
|
|
7
|
+
export declare function menstrualVisuals<E>(rich: RichSlot<E>): {
|
|
8
|
+
MenstrualCycleLab: 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 day: RichSlot<E>;
|
|
130
|
+
readonly hormones: Schema.$Record<Schema.Literals<readonly ["fsh", "lh", "oestrogen", "progesterone", "hcg"]>, Schema.Trimmed>;
|
|
131
|
+
readonly length: Schema.Trimmed;
|
|
132
|
+
readonly outcome: Schema.Trimmed;
|
|
133
|
+
readonly outcomes: Schema.$Record<Schema.Literals<readonly ["cycle", "pregnancy", "miscarriage"]>, Schema.optionalKey<Schema.Trimmed>>;
|
|
134
|
+
readonly ovulation: Schema.optionalKey<RichSlot<E>>;
|
|
135
|
+
readonly parts: Schema.$Record<Schema.Literals<readonly ["ovary", "follicle", "oocyte", "corpusLuteum", "endometrium", "artery"]>, Schema.Trimmed>;
|
|
136
|
+
readonly phase: RichSlot<E>;
|
|
137
|
+
readonly phases: Schema.$Record<Schema.Literals<readonly ["menstruation", "follicle", "ovulation", "luteal", "pregnancy", "miscarriage"]>, Schema.Trimmed>;
|
|
138
|
+
readonly view: Schema.Trimmed;
|
|
139
|
+
}>;
|
|
140
|
+
readonly length: Schema.Struct<{
|
|
141
|
+
readonly max: Schema.Int;
|
|
142
|
+
readonly min: Schema.Int;
|
|
143
|
+
readonly value: Schema.Int;
|
|
144
|
+
}>;
|
|
145
|
+
readonly luteal: Schema.Int;
|
|
146
|
+
readonly outcomes: Schema.NonEmptyArray<Schema.Literals<readonly ["cycle", "pregnancy", "miscarriage"]>>;
|
|
147
|
+
}>, "figure">;
|
|
148
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { byIds, byPickedIds, cardFields, namesEach, TextSchema, } from "#contracts/visual/card";
|
|
3
|
+
import { answerAt, figure } from "#contracts/visual/entry";
|
|
4
|
+
const OUTCOMES = ["cycle", "pregnancy", "miscarriage"];
|
|
5
|
+
/** A whole number of days above zero. */
|
|
6
|
+
const DaysSchema = Schema.Int.check(Schema.isGreaterThan(0));
|
|
7
|
+
/** The cycle length slider, in days: its range and its starting value. */
|
|
8
|
+
const LengthSchema = Schema.Struct({
|
|
9
|
+
max: DaysSchema,
|
|
10
|
+
min: DaysSchema,
|
|
11
|
+
value: DaysSchema,
|
|
12
|
+
}).check(Schema.makeFilter(({ max, min, value }) => min < max && min <= value && value <= max, {
|
|
13
|
+
message: "Expected a cycle length range whose minimum is below its maximum, with the starting length between them.",
|
|
14
|
+
}));
|
|
15
|
+
/**
|
|
16
|
+
* Props of `MenstrualCycleLab`: one menstrual cycle drawn as an ovary, the
|
|
17
|
+
* uterus lining and the four hormone curves (plus HCG in pregnancy) over the
|
|
18
|
+
* days. The learner sets the cycle length (`length`, days) and picks one of
|
|
19
|
+
* `outcomes` (each once); ovulation falls `luteal` days before the next
|
|
20
|
+
* period, so `luteal` is below the shortest length. The ovulation day shows
|
|
21
|
+
* only when `labels.ovulation` names it, so a question can ask for it.
|
|
22
|
+
*/
|
|
23
|
+
function menstrualCycleLab(rich) {
|
|
24
|
+
return figure(Schema.Struct({
|
|
25
|
+
...cardFields(rich),
|
|
26
|
+
labels: Schema.Struct({
|
|
27
|
+
day: rich,
|
|
28
|
+
hormones: byIds(["fsh", "lh", "oestrogen", "progesterone", "hcg"], TextSchema),
|
|
29
|
+
length: TextSchema,
|
|
30
|
+
outcome: TextSchema,
|
|
31
|
+
outcomes: byPickedIds(OUTCOMES, TextSchema),
|
|
32
|
+
ovulation: Schema.optionalKey(rich),
|
|
33
|
+
parts: byIds([
|
|
34
|
+
"ovary",
|
|
35
|
+
"follicle",
|
|
36
|
+
"oocyte",
|
|
37
|
+
"corpusLuteum",
|
|
38
|
+
"endometrium",
|
|
39
|
+
"artery",
|
|
40
|
+
], TextSchema),
|
|
41
|
+
phase: rich,
|
|
42
|
+
phases: byIds([
|
|
43
|
+
"menstruation",
|
|
44
|
+
"follicle",
|
|
45
|
+
"ovulation",
|
|
46
|
+
"luteal",
|
|
47
|
+
"pregnancy",
|
|
48
|
+
"miscarriage",
|
|
49
|
+
], TextSchema),
|
|
50
|
+
view: TextSchema,
|
|
51
|
+
}),
|
|
52
|
+
length: LengthSchema,
|
|
53
|
+
luteal: DaysSchema,
|
|
54
|
+
outcomes: Schema.NonEmptyArray(Schema.Literals(OUTCOMES)).check(Schema.isUnique()),
|
|
55
|
+
}).check(Schema.makeFilter(({ labels, length, luteal, outcomes }) => luteal < length.min && namesEach(outcomes, labels.outcomes), {
|
|
56
|
+
message: "Expected a luteal phase shorter than the shortest cycle, and a name for every outcome shown and no other.",
|
|
57
|
+
})), answerAt(["labels", "ovulation"]));
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The menstrual cycle lab. The ovulation day is what a question asks a
|
|
61
|
+
* learner to work out, so that readout is answer state.
|
|
62
|
+
*/
|
|
63
|
+
export function menstrualVisuals(rich) {
|
|
64
|
+
return { MenstrualCycleLab: menstrualCycleLab(rich) };
|
|
65
|
+
}
|