@nakafa/aksara-contracts 8.10.0 → 8.13.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/visual/biology/binomial.d.ts +139 -0
- package/dist/visual/biology/binomial.js +46 -0
- package/dist/visual/biology/bone.d.ts +141 -0
- package/dist/visual/biology/bone.js +46 -0
- package/dist/visual/biology/chromosome.d.ts +139 -0
- package/dist/visual/biology/chromosome.js +42 -0
- 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/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/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/leaf.d.ts +436 -0
- package/dist/visual/biology/leaf.js +151 -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/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/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/taxon.d.ts +138 -0
- package/dist/visual/biology/taxon.js +50 -0
- package/dist/visual/biology/tissue.d.ts +424 -0
- package/dist/visual/biology/tissue.js +140 -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/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/card.d.ts +11 -0
- package/dist/visual/card.js +17 -1
- package/dist/visual/catalog.d.ts +6886 -754
- package/dist/visual/catalog.js +72 -0
- package/dist/visual/chemistry/equilibrium.d.ts +449 -0
- package/dist/visual/chemistry/equilibrium.js +135 -0
- package/dist/visual/mathematics/argument.d.ts +226 -0
- package/dist/visual/mathematics/argument.js +150 -0
- package/dist/visual/mathematics/counterexample.d.ts +340 -0
- package/dist/visual/mathematics/counterexample.js +157 -0
- package/package.json +1 -1
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import type { RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/** The visuals of this lab. Every prop names or picks equipment; none is answer state. */
|
|
4
|
+
export declare function equipmentVisuals<E>(rich: RichSlot<E>): {
|
|
5
|
+
LabEquipmentLab: 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 items: Schema.NonEmptyArray<Schema.Literals<readonly ["beaker", "conicalFlask", "measuringCylinder", "testTube", "boilingTube", "dropper", "petriDish", "inoculatingLoop", "bunsenBurner", "tripod", "forceps", "scalpel", "mountedNeedle", "microscope", "slide", "labCoat", "goggles", "gloves", "mask", "extinguisher", "fireBlanket", "eyewash", "firstAid", "fumeChamber"]>>;
|
|
126
|
+
readonly labels: Schema.Struct<{
|
|
127
|
+
readonly care: Schema.Trimmed;
|
|
128
|
+
readonly categories: Schema.$Record<Schema.Literals<readonly ["apparatus", "protective", "safety"]>, Schema.Trimmed>;
|
|
129
|
+
readonly category: Schema.Trimmed;
|
|
130
|
+
readonly item: Schema.Trimmed;
|
|
131
|
+
readonly items: Schema.$Record<Schema.Literals<readonly ["beaker", "conicalFlask", "measuringCylinder", "testTube", "boilingTube", "dropper", "petriDish", "inoculatingLoop", "bunsenBurner", "tripod", "forceps", "scalpel", "mountedNeedle", "microscope", "slide", "labCoat", "goggles", "gloves", "mask", "extinguisher", "fireBlanket", "eyewash", "firstAid", "fumeChamber"]>, Schema.optionalKey<Schema.Struct<{
|
|
132
|
+
readonly care: RichSlot<E>;
|
|
133
|
+
readonly name: Schema.Trimmed;
|
|
134
|
+
readonly use: RichSlot<E>;
|
|
135
|
+
}>>>;
|
|
136
|
+
readonly use: Schema.Trimmed;
|
|
137
|
+
readonly view: Schema.Trimmed;
|
|
138
|
+
}>;
|
|
139
|
+
}>, "figure">;
|
|
140
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
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
|
+
* Everything the school laboratory holds, in three groups the renderer knows:
|
|
6
|
+
* apparatus on the bench, personal protective equipment on its hook, and
|
|
7
|
+
* safety equipment on the wall.
|
|
8
|
+
*/
|
|
9
|
+
const EQUIPMENT = [
|
|
10
|
+
"beaker",
|
|
11
|
+
"conicalFlask",
|
|
12
|
+
"measuringCylinder",
|
|
13
|
+
"testTube",
|
|
14
|
+
"boilingTube",
|
|
15
|
+
"dropper",
|
|
16
|
+
"petriDish",
|
|
17
|
+
"inoculatingLoop",
|
|
18
|
+
"bunsenBurner",
|
|
19
|
+
"tripod",
|
|
20
|
+
"forceps",
|
|
21
|
+
"scalpel",
|
|
22
|
+
"mountedNeedle",
|
|
23
|
+
"microscope",
|
|
24
|
+
"slide",
|
|
25
|
+
"labCoat",
|
|
26
|
+
"goggles",
|
|
27
|
+
"gloves",
|
|
28
|
+
"mask",
|
|
29
|
+
"extinguisher",
|
|
30
|
+
"fireBlanket",
|
|
31
|
+
"eyewash",
|
|
32
|
+
"firstAid",
|
|
33
|
+
"fumeChamber",
|
|
34
|
+
];
|
|
35
|
+
const EquipmentSchema = Schema.Literals(EQUIPMENT);
|
|
36
|
+
/**
|
|
37
|
+
* Props of `LabEquipmentLab`: one corner of a school biology laboratory, with
|
|
38
|
+
* apparatus on the bench, protective equipment on a hook and safety equipment
|
|
39
|
+
* on the wall. `items` are the ones a learner can pick, each once, in the
|
|
40
|
+
* order the item toggle lists them. Picking one turns the camera to it and the
|
|
41
|
+
* readouts give its name, what it is for and how to handle it safely, words
|
|
42
|
+
* from `labels.items`, one entry for each item and no other.
|
|
43
|
+
*/
|
|
44
|
+
function labEquipmentLab(rich) {
|
|
45
|
+
return figure(Schema.Struct({
|
|
46
|
+
...cardFields(rich),
|
|
47
|
+
items: Schema.NonEmptyArray(EquipmentSchema).check(Schema.isUnique()),
|
|
48
|
+
labels: Schema.Struct({
|
|
49
|
+
care: TextSchema,
|
|
50
|
+
categories: byIds(["apparatus", "protective", "safety"], TextSchema),
|
|
51
|
+
category: TextSchema,
|
|
52
|
+
item: TextSchema,
|
|
53
|
+
items: byPickedIds(EQUIPMENT, Schema.Struct({ care: rich, name: TextSchema, use: rich })),
|
|
54
|
+
use: TextSchema,
|
|
55
|
+
view: TextSchema,
|
|
56
|
+
}),
|
|
57
|
+
}).check(Schema.makeFilter(({ items, labels }) => namesEach(items, labels.items), {
|
|
58
|
+
message: "Expected words for every item the lab shows, and no other.",
|
|
59
|
+
})));
|
|
60
|
+
}
|
|
61
|
+
/** The visuals of this lab. Every prop names or picks equipment; none is answer state. */
|
|
62
|
+
export function equipmentVisuals(rich) {
|
|
63
|
+
return { LabEquipmentLab: labEquipmentLab(rich) };
|
|
64
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import type { RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/**
|
|
4
|
+
* The gametogenesis lab. A gamete's chromosome count and how many gametes one
|
|
5
|
+
* cell makes are what a question asks for, so those readouts are answer state.
|
|
6
|
+
*/
|
|
7
|
+
export declare function gametogenesisVisuals<E>(rich: RichSlot<E>): {
|
|
8
|
+
GametogenesisLab: 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 chromosomes: Schema.Int;
|
|
129
|
+
readonly labels: Schema.Struct<{
|
|
130
|
+
readonly cell: RichSlot<E>;
|
|
131
|
+
readonly cells: Schema.$Record<Schema.Literals<readonly ["spermatogonium", "primarySpermatocyte", "secondarySpermatocyte", "spermatid", "sperm", "oogonium", "primaryOocyte", "secondaryOocyte", "polarBody", "ovum"]>, Schema.Trimmed>;
|
|
132
|
+
readonly chromosomes: Schema.optionalKey<RichSlot<E>>;
|
|
133
|
+
readonly level: Schema.Trimmed;
|
|
134
|
+
readonly levels: Schema.$Record<Schema.Literals<readonly ["system", "gonad", "meiosis", "gamete"]>, Schema.optionalKey<Schema.Trimmed>>;
|
|
135
|
+
readonly made: Schema.optionalKey<RichSlot<E>>;
|
|
136
|
+
readonly parts: Schema.$Record<Schema.Literals<readonly ["testis", "scrotum", "epididymis", "spermDuct", "seminalVesicle", "prostate", "cowper", "urethra", "penis", "ovary", "oviduct", "uterus", "cervix", "vagina", "tubule", "interstitial", "follicle", "corpusLuteum", "head", "acrosome", "middle", "tail", "follicular", "antrum"]>, Schema.Trimmed>;
|
|
137
|
+
readonly polar: RichSlot<E>;
|
|
138
|
+
readonly sex: Schema.Trimmed;
|
|
139
|
+
readonly sexes: Schema.$Record<Schema.Literals<readonly ["male", "female"]>, Schema.optionalKey<Schema.Trimmed>>;
|
|
140
|
+
readonly view: Schema.Trimmed;
|
|
141
|
+
}>;
|
|
142
|
+
readonly levels: Schema.NonEmptyArray<Schema.Literals<readonly ["system", "gonad", "meiosis", "gamete"]>>;
|
|
143
|
+
readonly sexes: Schema.NonEmptyArray<Schema.Literals<readonly ["male", "female"]>>;
|
|
144
|
+
}>, "figure">;
|
|
145
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
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 SEXES = ["male", "female"];
|
|
5
|
+
const LEVELS = ["system", "gonad", "meiosis", "gamete"];
|
|
6
|
+
/**
|
|
7
|
+
* Props of `GametogenesisLab`: how sperm form in a testis and eggs in an
|
|
8
|
+
* ovary, from the whole reproductive system down to one gamete. The learner
|
|
9
|
+
* picks one of `sexes` and steps through `levels` (each once, in the order
|
|
10
|
+
* the toggles list them); a body cell holds `chromosomes` chromosomes, an
|
|
11
|
+
* even number, and every gamete half of them. The readouts name the cell, its
|
|
12
|
+
* chromosome count and how many gametes one starting cell makes, and the
|
|
13
|
+
* latter two show only when `labels.chromosomes` and `labels.made` name them,
|
|
14
|
+
* so a question can ask for them.
|
|
15
|
+
*/
|
|
16
|
+
function gametogenesisLab(rich) {
|
|
17
|
+
return figure(Schema.Struct({
|
|
18
|
+
...cardFields(rich),
|
|
19
|
+
chromosomes: Schema.Int.check(Schema.isGreaterThan(0), Schema.makeFilter((count) => count % 2 === 0, {
|
|
20
|
+
message: "Expected an even chromosome count, so a gamete holds half of it.",
|
|
21
|
+
})),
|
|
22
|
+
labels: Schema.Struct({
|
|
23
|
+
cell: rich,
|
|
24
|
+
cells: byIds([
|
|
25
|
+
"spermatogonium",
|
|
26
|
+
"primarySpermatocyte",
|
|
27
|
+
"secondarySpermatocyte",
|
|
28
|
+
"spermatid",
|
|
29
|
+
"sperm",
|
|
30
|
+
"oogonium",
|
|
31
|
+
"primaryOocyte",
|
|
32
|
+
"secondaryOocyte",
|
|
33
|
+
"polarBody",
|
|
34
|
+
"ovum",
|
|
35
|
+
], TextSchema),
|
|
36
|
+
chromosomes: Schema.optionalKey(rich),
|
|
37
|
+
level: TextSchema,
|
|
38
|
+
levels: byPickedIds(LEVELS, TextSchema),
|
|
39
|
+
made: Schema.optionalKey(rich),
|
|
40
|
+
parts: byIds([
|
|
41
|
+
"testis",
|
|
42
|
+
"scrotum",
|
|
43
|
+
"epididymis",
|
|
44
|
+
"spermDuct",
|
|
45
|
+
"seminalVesicle",
|
|
46
|
+
"prostate",
|
|
47
|
+
"cowper",
|
|
48
|
+
"urethra",
|
|
49
|
+
"penis",
|
|
50
|
+
"ovary",
|
|
51
|
+
"oviduct",
|
|
52
|
+
"uterus",
|
|
53
|
+
"cervix",
|
|
54
|
+
"vagina",
|
|
55
|
+
"tubule",
|
|
56
|
+
"interstitial",
|
|
57
|
+
"follicle",
|
|
58
|
+
"corpusLuteum",
|
|
59
|
+
"head",
|
|
60
|
+
"acrosome",
|
|
61
|
+
"middle",
|
|
62
|
+
"tail",
|
|
63
|
+
"follicular",
|
|
64
|
+
"antrum",
|
|
65
|
+
], TextSchema),
|
|
66
|
+
polar: rich,
|
|
67
|
+
sex: TextSchema,
|
|
68
|
+
sexes: byPickedIds(SEXES, TextSchema),
|
|
69
|
+
view: TextSchema,
|
|
70
|
+
}),
|
|
71
|
+
levels: Schema.NonEmptyArray(Schema.Literals(LEVELS)).check(Schema.isUnique()),
|
|
72
|
+
sexes: Schema.NonEmptyArray(Schema.Literals(SEXES)).check(Schema.isUnique()),
|
|
73
|
+
}).check(Schema.makeFilter(({ labels, levels, sexes }) => namesEach(sexes, labels.sexes) && namesEach(levels, labels.levels), {
|
|
74
|
+
message: "Expected a name for every sex and level the lab shows, and no other.",
|
|
75
|
+
})), answerAt(["labels", "chromosomes"], ["labels", "made"]));
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The gametogenesis lab. A gamete's chromosome count and how many gametes one
|
|
79
|
+
* cell makes are what a question asks for, so those readouts are answer state.
|
|
80
|
+
*/
|
|
81
|
+
export function gametogenesisVisuals(rich) {
|
|
82
|
+
return { GametogenesisLab: gametogenesisLab(rich) };
|
|
83
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import type { RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/**
|
|
4
|
+
* The implantation lab. How many cells the embryo has and how much of the
|
|
5
|
+
* zygote each holds are what a question asks for, so they are answer state.
|
|
6
|
+
*/
|
|
7
|
+
export declare function implantationVisuals<E>(rich: RichSlot<E>): {
|
|
8
|
+
ImplantationLab: 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 cells: Schema.optionalKey<RichSlot<E>>;
|
|
130
|
+
readonly day: RichSlot<E>;
|
|
131
|
+
readonly parts: Schema.$Record<Schema.Literals<readonly ["ovary", "ampulla", "tube", "uterus", "endometrium", "sperm", "zona", "innerCellMass", "trophoblast", "cavity", "hcg"]>, Schema.Trimmed>;
|
|
132
|
+
readonly share: Schema.optionalKey<RichSlot<E>>;
|
|
133
|
+
readonly stage: RichSlot<E>;
|
|
134
|
+
readonly stages: Schema.$Record<Schema.Literals<readonly ["zygote", "twoCell", "morula", "blastocyst", "implanting"]>, Schema.Trimmed>;
|
|
135
|
+
readonly view: Schema.Trimmed;
|
|
136
|
+
}>;
|
|
137
|
+
}>, "figure">;
|
|
138
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { byIds, cardFields, TextSchema } from "#contracts/visual/card";
|
|
3
|
+
import { answerAt, figure } from "#contracts/visual/entry";
|
|
4
|
+
/**
|
|
5
|
+
* Props of `ImplantationLab`: the first week after fertilisation, from the
|
|
6
|
+
* zygote in the ampulla of the oviduct to the blastocyst sinking into the
|
|
7
|
+
* uterus lining. The learner moves through the days; the readouts name the
|
|
8
|
+
* stage and, when `labels.cells` and `labels.share` name them, the number of
|
|
9
|
+
* cells and the share of the zygote each cell holds, so a question can ask for
|
|
10
|
+
* them.
|
|
11
|
+
*/
|
|
12
|
+
function implantationLab(rich) {
|
|
13
|
+
return figure(Schema.Struct({
|
|
14
|
+
...cardFields(rich),
|
|
15
|
+
labels: Schema.Struct({
|
|
16
|
+
cells: Schema.optionalKey(rich),
|
|
17
|
+
day: rich,
|
|
18
|
+
parts: byIds([
|
|
19
|
+
"ovary",
|
|
20
|
+
"ampulla",
|
|
21
|
+
"tube",
|
|
22
|
+
"uterus",
|
|
23
|
+
"endometrium",
|
|
24
|
+
"sperm",
|
|
25
|
+
"zona",
|
|
26
|
+
"innerCellMass",
|
|
27
|
+
"trophoblast",
|
|
28
|
+
"cavity",
|
|
29
|
+
"hcg",
|
|
30
|
+
], TextSchema),
|
|
31
|
+
share: Schema.optionalKey(rich),
|
|
32
|
+
stage: rich,
|
|
33
|
+
stages: byIds(["zygote", "twoCell", "morula", "blastocyst", "implanting"], TextSchema),
|
|
34
|
+
view: TextSchema,
|
|
35
|
+
}),
|
|
36
|
+
}), answerAt(["labels", "cells"], ["labels", "share"]));
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The implantation lab. How many cells the embryo has and how much of the
|
|
40
|
+
* zygote each holds are what a question asks for, so they are answer state.
|
|
41
|
+
*/
|
|
42
|
+
export function implantationVisuals(rich) {
|
|
43
|
+
return { ImplantationLab: implantationLab(rich) };
|
|
44
|
+
}
|