@nakafa/aksara-contracts 6.5.0 → 7.0.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/catalog.d.ts +18 -5
- package/dist/assessment/catalog.js +18 -8
- package/dist/assessment/choice.d.ts +10 -0
- package/dist/assessment/closure.d.ts +2 -1
- package/dist/assessment/closure.js +43 -62
- package/dist/assessment/document.d.ts +18 -0
- package/dist/assessment/document.js +10 -0
- package/dist/assessment/figure.d.ts +47605 -1555
- package/dist/assessment/figure.js +14 -217
- package/dist/assessment/hash.d.ts +274 -4
- package/dist/assessment/inline.d.ts +25 -0
- package/dist/assessment/inline.js +22 -3
- package/dist/assessment/interaction.d.ts +10 -0
- package/dist/assessment/item.d.ts +864 -0
- package/dist/assessment/item.js +10 -2
- package/dist/assessment/locales.d.ts +10 -0
- package/dist/assessment/locales.js +58 -0
- package/dist/assessment/paper.d.ts +1349 -12
- package/dist/assessment/paper.js +93 -9
- package/dist/assessment/part.d.ts +5 -0
- package/dist/assessment/profile.d.ts +4 -4
- package/dist/assessment/rows.d.ts +1409 -0
- package/dist/assessment/rows.js +44 -0
- package/dist/assessment/scalar.d.ts +1 -1
- package/dist/assessment/scoring.d.ts +1 -1
- package/dist/assessment/snapshot.d.ts +372 -20
- package/dist/assessment/structure.d.ts +6 -0
- package/dist/assessment/structure.js +22 -2
- package/dist/locale.d.ts +9 -9
- package/dist/locale.js +4 -3
- package/dist/program/snapshot/hash.d.ts +2 -2
- package/dist/program/snapshot/spec.d.ts +2 -2
- package/dist/projection/material.d.ts +10 -0
- package/dist/projection/material.js +1 -1
- package/dist/quran/attribution.d.ts +2 -2
- package/dist/quran/identity.d.ts +31 -10
- package/dist/quran/identity.js +15 -3
- package/dist/quran/provenance.d.ts +16 -16
- package/dist/quran/provenance.js +4 -1
- package/dist/quran/snapshot/hash.d.ts +2 -2
- package/dist/quran/snapshot/row/hash.d.ts +48 -15
- package/dist/quran/snapshot/row.d.ts +18 -8
- package/dist/quran/snapshot/spec.d.ts +2 -2
- package/dist/quran/source.d.ts +17 -7
- package/dist/quran/source.js +13 -1
- package/dist/quran/spec.d.ts +4 -4
- package/dist/quran/spec.js +2 -1
- package/dist/release/current/evidence.d.ts +9 -9
- package/dist/release/current/state.d.ts +11 -11
- package/dist/release/hash.d.ts +2 -2
- package/dist/release/identity.d.ts +1 -1
- package/dist/release/lifecycle.d.ts +7 -7
- package/dist/release/policy.d.ts +1 -1
- package/dist/release/snapshot/data.d.ts +36 -11
- package/dist/release/snapshot/evidence/assessment.d.ts +1 -1
- package/dist/release/snapshot/evidence/program.d.ts +1 -1
- package/dist/release/snapshot/evidence/quran.d.ts +1 -1
- package/dist/release/snapshot/evidence.d.ts +3 -3
- package/dist/release/snapshot/verify.d.ts +179 -12
- package/dist/release/spec.d.ts +13 -13
- package/dist/release/verify.d.ts +2 -2
- package/dist/runtime/spec.d.ts +6 -6
- package/dist/runtime/verify.d.ts +4 -4
- package/dist/transport/group.d.ts +108 -33
- package/dist/transport/request.d.ts +1166 -114
- package/dist/transport/response.d.ts +64 -64
- package/dist/transport/snapshot.d.ts +72 -22
- package/dist/visual/base/layout.d.ts +27 -0
- package/dist/visual/base/layout.js +35 -0
- package/dist/visual/base/math.d.ts +523 -0
- package/dist/visual/base/math.js +72 -0
- package/dist/visual/base/media.d.ts +13 -0
- package/dist/visual/base/media.js +25 -0
- package/dist/visual/biology.d.ts +203 -0
- package/dist/visual/biology.js +108 -0
- package/dist/visual/card.d.ts +32 -0
- package/dist/visual/card.js +30 -0
- package/dist/visual/catalog.d.ts +28633 -0
- package/dist/visual/catalog.js +73 -0
- package/dist/visual/chemistry/atom.d.ts +79 -0
- package/dist/visual/chemistry/atom.js +109 -0
- package/dist/visual/chemistry/electron.d.ts +41 -0
- package/dist/visual/chemistry/electron.js +69 -0
- package/dist/visual/chemistry/laws.d.ts +86 -0
- package/dist/visual/chemistry/laws.js +117 -0
- package/dist/visual/chemistry/particles.d.ts +114 -0
- package/dist/visual/chemistry/particles.js +149 -0
- package/dist/visual/chemistry/periodic.d.ts +52 -0
- package/dist/visual/chemistry/periodic.js +85 -0
- package/dist/visual/chemistry/reaction.d.ts +60 -0
- package/dist/visual/chemistry/reaction.js +76 -0
- package/dist/visual/entry.d.ts +42 -0
- package/dist/visual/entry.js +48 -0
- package/dist/visual/mathematics/chart.d.ts +30 -0
- package/dist/{assessment → visual/mathematics}/chart.js +26 -18
- package/dist/visual/mathematics/charts.d.ts +118 -0
- package/dist/visual/mathematics/charts.js +100 -0
- package/dist/visual/mathematics/function.d.ts +82 -0
- package/dist/visual/mathematics/function.js +102 -0
- package/dist/visual/mathematics/geometry.d.ts +222 -0
- package/dist/visual/mathematics/geometry.js +81 -0
- package/dist/visual/mathematics/line.d.ts +179 -0
- package/dist/visual/mathematics/line.js +156 -0
- package/dist/visual/mathematics/number.d.ts +21 -0
- package/dist/visual/mathematics/number.js +53 -0
- package/dist/visual/physics/measurement.d.ts +66 -0
- package/dist/visual/physics/measurement.js +85 -0
- package/dist/visual/physics/motion.d.ts +85 -0
- package/dist/visual/physics/motion.js +110 -0
- package/dist/visual/physics/parabolic.d.ts +42 -0
- package/dist/visual/physics/parabolic.js +56 -0
- package/dist/visual/physics/velocity.d.ts +112 -0
- package/dist/visual/physics/velocity.js +144 -0
- package/dist/visual/politics.d.ts +92 -0
- package/dist/visual/politics.js +76 -0
- package/package.json +13 -5
- package/dist/assessment/chart.d.ts +0 -62
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { type RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/** Props of `NumberLine`: segments on a line, with an optional visible range. */
|
|
4
|
+
export declare function numberLine<E>(rich: RichSlot<E>): import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
5
|
+
readonly description: RichSlot<E>;
|
|
6
|
+
readonly title: RichSlot<E>;
|
|
7
|
+
readonly max: Schema.optionalKey<Schema.Finite>;
|
|
8
|
+
readonly min: Schema.optionalKey<Schema.Finite>;
|
|
9
|
+
readonly segments: Schema.NonEmptyArray<Schema.Struct<{
|
|
10
|
+
readonly backgroundColor: Schema.optionalKey<Schema.Literal<"transparent">>;
|
|
11
|
+
readonly end: Schema.optionalKey<Schema.Finite>;
|
|
12
|
+
readonly endInclusive: Schema.optionalKey<Schema.Boolean>;
|
|
13
|
+
readonly endLabel: Schema.optionalKey<RichSlot<E>>;
|
|
14
|
+
readonly label: Schema.optionalKey<RichSlot<E>>;
|
|
15
|
+
readonly shaded: Schema.optionalKey<Schema.Boolean>;
|
|
16
|
+
readonly showPoints: Schema.optionalKey<Schema.Boolean>;
|
|
17
|
+
readonly start: Schema.optionalKey<Schema.Finite>;
|
|
18
|
+
readonly startInclusive: Schema.optionalKey<Schema.Boolean>;
|
|
19
|
+
readonly startLabel: Schema.optionalKey<RichSlot<E>>;
|
|
20
|
+
}>>;
|
|
21
|
+
}>>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { cardFields } from "#contracts/visual/card";
|
|
3
|
+
import { figure } from "#contracts/visual/entry";
|
|
4
|
+
/** The two ends of one segment; a missing end is a ray to the edge of the axis. */
|
|
5
|
+
const SegmentEndsSchema = Schema.Struct({
|
|
6
|
+
end: Schema.optionalKey(Schema.Finite),
|
|
7
|
+
start: Schema.optionalKey(Schema.Finite),
|
|
8
|
+
});
|
|
9
|
+
/** Checks that a segment that has two ends does not end before it starts. */
|
|
10
|
+
function isOrderedSegment({ end, start }) {
|
|
11
|
+
return start === undefined || end === undefined || start <= end;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* One segment of a number line. A segment without a start or an end is a ray
|
|
15
|
+
* to the edge of the axis, as the renderer draws it. The corpus sets a
|
|
16
|
+
* background only to transparent, and an arbitrary color is not part of this
|
|
17
|
+
* contract, because no meaning may ride on color.
|
|
18
|
+
*/
|
|
19
|
+
function segment(rich) {
|
|
20
|
+
return Schema.Struct({
|
|
21
|
+
backgroundColor: Schema.optionalKey(Schema.Literal("transparent")),
|
|
22
|
+
end: Schema.optionalKey(Schema.Finite),
|
|
23
|
+
endInclusive: Schema.optionalKey(Schema.Boolean),
|
|
24
|
+
endLabel: Schema.optionalKey(rich),
|
|
25
|
+
label: Schema.optionalKey(rich),
|
|
26
|
+
shaded: Schema.optionalKey(Schema.Boolean),
|
|
27
|
+
showPoints: Schema.optionalKey(Schema.Boolean),
|
|
28
|
+
start: Schema.optionalKey(Schema.Finite),
|
|
29
|
+
startInclusive: Schema.optionalKey(Schema.Boolean),
|
|
30
|
+
startLabel: Schema.optionalKey(rich),
|
|
31
|
+
}).check(Schema.makeFilter(isOrderedSegment, {
|
|
32
|
+
message: "Expected a segment that does not end before it starts.",
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
/** The visible range of a number line, each end optional. */
|
|
36
|
+
const VisibleRangeSchema = Schema.Struct({
|
|
37
|
+
max: Schema.optionalKey(Schema.Finite),
|
|
38
|
+
min: Schema.optionalKey(Schema.Finite),
|
|
39
|
+
});
|
|
40
|
+
/** Checks that the visible range of a number line runs upward. */
|
|
41
|
+
function isOrderedRange({ max, min }) {
|
|
42
|
+
return min === undefined || max === undefined || min < max;
|
|
43
|
+
}
|
|
44
|
+
/** Props of `NumberLine`: segments on a line, with an optional visible range. */
|
|
45
|
+
export function numberLine(rich) {
|
|
46
|
+
return figure(Schema.Struct({
|
|
47
|
+
...cardFields(rich),
|
|
48
|
+
...VisibleRangeSchema.fields,
|
|
49
|
+
segments: Schema.NonEmptyArray(segment(rich)),
|
|
50
|
+
}).check(Schema.makeFilter(isOrderedRange, {
|
|
51
|
+
message: "Expected a visible range whose minimum is below its maximum.",
|
|
52
|
+
})));
|
|
53
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { type RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/**
|
|
4
|
+
* The measurement, vector, and energy labs. The net idea of the cable lab and
|
|
5
|
+
* the meaning of the wind lab state the conclusion each lab leads to, so they
|
|
6
|
+
* are answer state.
|
|
7
|
+
*/
|
|
8
|
+
export declare function measurementVisuals<E>(rich: RichSlot<E>): {
|
|
9
|
+
DimensionLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
10
|
+
readonly description: RichSlot<E>;
|
|
11
|
+
readonly title: RichSlot<E>;
|
|
12
|
+
readonly labels: Schema.Struct<{
|
|
13
|
+
readonly chooseMode: Schema.Trimmed;
|
|
14
|
+
readonly dimension: Schema.Trimmed;
|
|
15
|
+
readonly formula: Schema.Trimmed;
|
|
16
|
+
readonly modes: Schema.$Record<Schema.Literals<readonly ["length", "area", "volume"]>, Schema.Trimmed>;
|
|
17
|
+
readonly unit: Schema.Trimmed;
|
|
18
|
+
}>;
|
|
19
|
+
}>>;
|
|
20
|
+
MeasurementToolsLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
21
|
+
readonly description: RichSlot<E>;
|
|
22
|
+
readonly title: RichSlot<E>;
|
|
23
|
+
readonly labels: Schema.Struct<{
|
|
24
|
+
readonly chooseTool: Schema.Trimmed;
|
|
25
|
+
readonly decimalSeparator: Schema.Literals<readonly [".", ","]>;
|
|
26
|
+
readonly instrument: Schema.Trimmed;
|
|
27
|
+
readonly measuredObject: Schema.Trimmed;
|
|
28
|
+
readonly reading: Schema.Trimmed;
|
|
29
|
+
readonly tools: Schema.$Record<Schema.Literals<readonly ["length", "mass", "time"]>, Schema.Struct<{
|
|
30
|
+
readonly control: Schema.Trimmed;
|
|
31
|
+
readonly instrument: Schema.Trimmed;
|
|
32
|
+
readonly object: Schema.Trimmed;
|
|
33
|
+
readonly tab: Schema.Trimmed;
|
|
34
|
+
}>>;
|
|
35
|
+
}>;
|
|
36
|
+
}>>;
|
|
37
|
+
VectorConceptLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
38
|
+
readonly description: RichSlot<E>;
|
|
39
|
+
readonly title: RichSlot<E>;
|
|
40
|
+
readonly labels: Schema.Struct<{
|
|
41
|
+
readonly bridgeView: Schema.Trimmed;
|
|
42
|
+
readonly chooseLoadPosition: Schema.Trimmed;
|
|
43
|
+
readonly direction: Schema.Trimmed;
|
|
44
|
+
readonly directionValue: Schema.Trimmed;
|
|
45
|
+
readonly leftCable: RichSlot<E>;
|
|
46
|
+
readonly magnitude: Schema.Trimmed;
|
|
47
|
+
readonly magnitudeValue: Schema.Trimmed;
|
|
48
|
+
readonly netIdea: Schema.Trimmed;
|
|
49
|
+
readonly netIdeaValue: Schema.Trimmed;
|
|
50
|
+
readonly rightCable: RichSlot<E>;
|
|
51
|
+
}>;
|
|
52
|
+
}>>;
|
|
53
|
+
WindEnergyConversionLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
54
|
+
readonly description: RichSlot<E>;
|
|
55
|
+
readonly title: RichSlot<E>;
|
|
56
|
+
readonly labels: Schema.Struct<{
|
|
57
|
+
readonly flow: RichSlot<E>;
|
|
58
|
+
readonly flowLabel: Schema.Trimmed;
|
|
59
|
+
readonly meaning: RichSlot<E>;
|
|
60
|
+
readonly meaningLabel: Schema.Trimmed;
|
|
61
|
+
readonly speedControl: Schema.Trimmed;
|
|
62
|
+
readonly speedUnit: Schema.Trimmed;
|
|
63
|
+
readonly viewLabel: Schema.Trimmed;
|
|
64
|
+
}>;
|
|
65
|
+
}>>;
|
|
66
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { byIds, cardFields, TextSchema, } from "#contracts/visual/card";
|
|
3
|
+
import { answerAt, figure } from "#contracts/visual/entry";
|
|
4
|
+
/** The quantities the dimension lab builds from length. */
|
|
5
|
+
const DIMENSION_MODES = ["length", "area", "volume"];
|
|
6
|
+
/** The instruments the measurement lab reads. */
|
|
7
|
+
const MEASUREMENT_TOOLS = ["length", "mass", "time"];
|
|
8
|
+
/** Props of `DimensionLab`: length, area, and volume and their dimensions. */
|
|
9
|
+
function dimensionLab(rich) {
|
|
10
|
+
return figure(Schema.Struct({
|
|
11
|
+
...cardFields(rich),
|
|
12
|
+
labels: Schema.Struct({
|
|
13
|
+
chooseMode: TextSchema,
|
|
14
|
+
dimension: TextSchema,
|
|
15
|
+
formula: TextSchema,
|
|
16
|
+
modes: byIds(DIMENSION_MODES, TextSchema),
|
|
17
|
+
unit: TextSchema,
|
|
18
|
+
}),
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
/** Props of `MeasurementToolsLab`: reading a ruler, a balance, and a stopwatch. */
|
|
22
|
+
function measurementToolsLab(rich) {
|
|
23
|
+
return figure(Schema.Struct({
|
|
24
|
+
...cardFields(rich),
|
|
25
|
+
labels: Schema.Struct({
|
|
26
|
+
chooseTool: TextSchema,
|
|
27
|
+
decimalSeparator: Schema.Literals([".", ","]),
|
|
28
|
+
instrument: TextSchema,
|
|
29
|
+
measuredObject: TextSchema,
|
|
30
|
+
reading: TextSchema,
|
|
31
|
+
tools: byIds(MEASUREMENT_TOOLS, Schema.Struct({
|
|
32
|
+
control: TextSchema,
|
|
33
|
+
instrument: TextSchema,
|
|
34
|
+
object: TextSchema,
|
|
35
|
+
tab: TextSchema,
|
|
36
|
+
})),
|
|
37
|
+
}),
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
/** Props of `VectorConceptLab`: the tension of two cables as vectors. */
|
|
41
|
+
function vectorConceptLab(rich) {
|
|
42
|
+
return figure(Schema.Struct({
|
|
43
|
+
...cardFields(rich),
|
|
44
|
+
labels: Schema.Struct({
|
|
45
|
+
bridgeView: TextSchema,
|
|
46
|
+
chooseLoadPosition: TextSchema,
|
|
47
|
+
direction: TextSchema,
|
|
48
|
+
directionValue: TextSchema,
|
|
49
|
+
leftCable: rich,
|
|
50
|
+
magnitude: TextSchema,
|
|
51
|
+
magnitudeValue: TextSchema,
|
|
52
|
+
netIdea: TextSchema,
|
|
53
|
+
netIdeaValue: TextSchema,
|
|
54
|
+
rightCable: rich,
|
|
55
|
+
}),
|
|
56
|
+
}), answerAt(["labels", "netIdeaValue"]));
|
|
57
|
+
}
|
|
58
|
+
/** Props of `WindEnergyConversionLab`: wind turned into electric energy. */
|
|
59
|
+
function windEnergyLab(rich) {
|
|
60
|
+
return figure(Schema.Struct({
|
|
61
|
+
...cardFields(rich),
|
|
62
|
+
labels: Schema.Struct({
|
|
63
|
+
flow: rich,
|
|
64
|
+
flowLabel: TextSchema,
|
|
65
|
+
meaning: rich,
|
|
66
|
+
meaningLabel: TextSchema,
|
|
67
|
+
speedControl: TextSchema,
|
|
68
|
+
speedUnit: TextSchema,
|
|
69
|
+
viewLabel: TextSchema,
|
|
70
|
+
}),
|
|
71
|
+
}), answerAt(["labels", "meaning"]));
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The measurement, vector, and energy labs. The net idea of the cable lab and
|
|
75
|
+
* the meaning of the wind lab state the conclusion each lab leads to, so they
|
|
76
|
+
* are answer state.
|
|
77
|
+
*/
|
|
78
|
+
export function measurementVisuals(rich) {
|
|
79
|
+
return {
|
|
80
|
+
DimensionLab: dimensionLab(rich),
|
|
81
|
+
MeasurementToolsLab: measurementToolsLab(rich),
|
|
82
|
+
VectorConceptLab: vectorConceptLab(rich),
|
|
83
|
+
WindEnergyConversionLab: windEnergyLab(rich),
|
|
84
|
+
};
|
|
85
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { type RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/**
|
|
4
|
+
* The labs and graphs of linear and circular motion. Their labels name the
|
|
5
|
+
* quantities a reader measures; the values come from the motion the reader
|
|
6
|
+
* picks, so no prop holds answer state.
|
|
7
|
+
*/
|
|
8
|
+
export declare function motionVisuals<E>(rich: RichSlot<E>): {
|
|
9
|
+
AccelerationGraphCard: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
10
|
+
readonly description: RichSlot<E>;
|
|
11
|
+
readonly title: RichSlot<E>;
|
|
12
|
+
readonly labels: Schema.Struct<{
|
|
13
|
+
readonly chooseCase: Schema.Trimmed;
|
|
14
|
+
readonly contextLine: Schema.Trimmed;
|
|
15
|
+
readonly scenarioNames: Schema.$Record<Schema.Literals<readonly ["speed-up", "steady", "slow-down"]>, Schema.Trimmed>;
|
|
16
|
+
readonly timeAxis: Schema.Trimmed;
|
|
17
|
+
readonly velocityAxis: Schema.Trimmed;
|
|
18
|
+
}>;
|
|
19
|
+
}>>;
|
|
20
|
+
AccelerationLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
21
|
+
readonly description: RichSlot<E>;
|
|
22
|
+
readonly title: RichSlot<E>;
|
|
23
|
+
readonly labels: Schema.Struct<{
|
|
24
|
+
readonly chooseCase: Schema.Trimmed;
|
|
25
|
+
readonly factLabels: Schema.Struct<{
|
|
26
|
+
readonly acceleration: RichSlot<E>;
|
|
27
|
+
readonly finalVelocity: RichSlot<E>;
|
|
28
|
+
readonly initialVelocity: RichSlot<E>;
|
|
29
|
+
readonly timeStep: RichSlot<E>;
|
|
30
|
+
}>;
|
|
31
|
+
readonly scenarioNames: Schema.$Record<Schema.Literals<readonly ["speed-up", "steady", "slow-down"]>, RichSlot<E>>;
|
|
32
|
+
readonly viewLabel: Schema.Trimmed;
|
|
33
|
+
}>;
|
|
34
|
+
}>>;
|
|
35
|
+
NonUniformLinearMotionGraphCard: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
36
|
+
readonly description: RichSlot<E>;
|
|
37
|
+
readonly title: RichSlot<E>;
|
|
38
|
+
readonly labels: Schema.Struct<{
|
|
39
|
+
readonly chooseScenario: Schema.Trimmed;
|
|
40
|
+
readonly scenarioNames: Schema.$Record<Schema.Literals<readonly ["from-rest", "speed-up", "brake"]>, Schema.Trimmed>;
|
|
41
|
+
readonly timeAxis: Schema.Trimmed;
|
|
42
|
+
readonly velocityAxis: Schema.Trimmed;
|
|
43
|
+
}>;
|
|
44
|
+
}>>;
|
|
45
|
+
NonUniformLinearMotionLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
46
|
+
readonly description: RichSlot<E>;
|
|
47
|
+
readonly title: RichSlot<E>;
|
|
48
|
+
readonly labels: Schema.Struct<{
|
|
49
|
+
readonly chooseScenario: Schema.Trimmed;
|
|
50
|
+
readonly factLabels: Schema.Struct<{
|
|
51
|
+
readonly acceleration: RichSlot<E>;
|
|
52
|
+
readonly displacement: RichSlot<E>;
|
|
53
|
+
readonly finalVelocity: RichSlot<E>;
|
|
54
|
+
readonly initialVelocity: RichSlot<E>;
|
|
55
|
+
}>;
|
|
56
|
+
readonly scenarioNames: Schema.$Record<Schema.Literals<readonly ["from-rest", "speed-up", "brake"]>, RichSlot<E>>;
|
|
57
|
+
readonly viewLabel: Schema.Trimmed;
|
|
58
|
+
}>;
|
|
59
|
+
}>>;
|
|
60
|
+
UniformCircularMotionLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
61
|
+
readonly description: RichSlot<E>;
|
|
62
|
+
readonly title: RichSlot<E>;
|
|
63
|
+
readonly decimalSeparator: Schema.optionalKey<Schema.Literals<readonly ["comma", "dot"]>>;
|
|
64
|
+
readonly labels: Schema.Struct<{
|
|
65
|
+
readonly acceleration: RichSlot<E>;
|
|
66
|
+
readonly choosePeriod: Schema.Trimmed;
|
|
67
|
+
readonly period: RichSlot<E>;
|
|
68
|
+
readonly radius: RichSlot<E>;
|
|
69
|
+
readonly speed: RichSlot<E>;
|
|
70
|
+
readonly viewLabel: Schema.Trimmed;
|
|
71
|
+
}>;
|
|
72
|
+
}>>;
|
|
73
|
+
UniformLinearMotionLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
74
|
+
readonly description: RichSlot<E>;
|
|
75
|
+
readonly title: RichSlot<E>;
|
|
76
|
+
readonly labels: Schema.Struct<{
|
|
77
|
+
readonly chooseSpeed: Schema.Trimmed;
|
|
78
|
+
readonly duration: RichSlot<E>;
|
|
79
|
+
readonly positionStep: RichSlot<E>;
|
|
80
|
+
readonly speed: RichSlot<E>;
|
|
81
|
+
readonly stepDistance: RichSlot<E>;
|
|
82
|
+
readonly viewLabel: Schema.Trimmed;
|
|
83
|
+
}>;
|
|
84
|
+
}>>;
|
|
85
|
+
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { byIds, cardFields, DecimalSeparatorSchema, TextSchema, } from "#contracts/visual/card";
|
|
3
|
+
import { figure } from "#contracts/visual/entry";
|
|
4
|
+
/** The rocket motions the acceleration visuals compare. */
|
|
5
|
+
const ACCELERATION_CASES = ["speed-up", "steady", "slow-down"];
|
|
6
|
+
/** The train motions of uniformly accelerated motion. */
|
|
7
|
+
const ACCELERATED_SCENARIOS = ["from-rest", "speed-up", "brake"];
|
|
8
|
+
/** Props of `AccelerationGraphCard`: the velocity-time graph of three rocket motions. */
|
|
9
|
+
function accelerationGraphCard(rich) {
|
|
10
|
+
return figure(Schema.Struct({
|
|
11
|
+
...cardFields(rich),
|
|
12
|
+
labels: Schema.Struct({
|
|
13
|
+
chooseCase: TextSchema,
|
|
14
|
+
contextLine: TextSchema,
|
|
15
|
+
scenarioNames: byIds(ACCELERATION_CASES, TextSchema),
|
|
16
|
+
timeAxis: TextSchema,
|
|
17
|
+
velocityAxis: TextSchema,
|
|
18
|
+
}),
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
/** Props of `AccelerationLab`: a rocket passing gates once every second. */
|
|
22
|
+
function accelerationLab(rich) {
|
|
23
|
+
return figure(Schema.Struct({
|
|
24
|
+
...cardFields(rich),
|
|
25
|
+
labels: Schema.Struct({
|
|
26
|
+
chooseCase: TextSchema,
|
|
27
|
+
factLabels: Schema.Struct({
|
|
28
|
+
acceleration: rich,
|
|
29
|
+
finalVelocity: rich,
|
|
30
|
+
initialVelocity: rich,
|
|
31
|
+
timeStep: rich,
|
|
32
|
+
}),
|
|
33
|
+
scenarioNames: byIds(ACCELERATION_CASES, rich),
|
|
34
|
+
viewLabel: TextSchema,
|
|
35
|
+
}),
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
/** Props of `NonUniformLinearMotionGraphCard`: the velocity-time graph of a train. */
|
|
39
|
+
function acceleratedGraphCard(rich) {
|
|
40
|
+
return figure(Schema.Struct({
|
|
41
|
+
...cardFields(rich),
|
|
42
|
+
labels: Schema.Struct({
|
|
43
|
+
chooseScenario: TextSchema,
|
|
44
|
+
scenarioNames: byIds(ACCELERATED_SCENARIOS, TextSchema),
|
|
45
|
+
timeAxis: TextSchema,
|
|
46
|
+
velocityAxis: TextSchema,
|
|
47
|
+
}),
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
/** Props of `NonUniformLinearMotionLab`: a train that speeds up or brakes evenly. */
|
|
51
|
+
function acceleratedLab(rich) {
|
|
52
|
+
return figure(Schema.Struct({
|
|
53
|
+
...cardFields(rich),
|
|
54
|
+
labels: Schema.Struct({
|
|
55
|
+
chooseScenario: TextSchema,
|
|
56
|
+
factLabels: Schema.Struct({
|
|
57
|
+
acceleration: rich,
|
|
58
|
+
displacement: rich,
|
|
59
|
+
finalVelocity: rich,
|
|
60
|
+
initialVelocity: rich,
|
|
61
|
+
}),
|
|
62
|
+
scenarioNames: byIds(ACCELERATED_SCENARIOS, rich),
|
|
63
|
+
viewLabel: TextSchema,
|
|
64
|
+
}),
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
/** Props of `UniformLinearMotionLab`: equal steps in equal times. */
|
|
68
|
+
function uniformLinearLab(rich) {
|
|
69
|
+
return figure(Schema.Struct({
|
|
70
|
+
...cardFields(rich),
|
|
71
|
+
labels: Schema.Struct({
|
|
72
|
+
chooseSpeed: TextSchema,
|
|
73
|
+
duration: rich,
|
|
74
|
+
positionStep: rich,
|
|
75
|
+
speed: rich,
|
|
76
|
+
stepDistance: rich,
|
|
77
|
+
viewLabel: TextSchema,
|
|
78
|
+
}),
|
|
79
|
+
}));
|
|
80
|
+
}
|
|
81
|
+
/** Props of `UniformCircularMotionLab`: a body on a circle at a steady period. */
|
|
82
|
+
function uniformCircularLab(rich) {
|
|
83
|
+
return figure(Schema.Struct({
|
|
84
|
+
...cardFields(rich),
|
|
85
|
+
decimalSeparator: Schema.optionalKey(DecimalSeparatorSchema),
|
|
86
|
+
labels: Schema.Struct({
|
|
87
|
+
acceleration: rich,
|
|
88
|
+
choosePeriod: TextSchema,
|
|
89
|
+
period: rich,
|
|
90
|
+
radius: rich,
|
|
91
|
+
speed: rich,
|
|
92
|
+
viewLabel: TextSchema,
|
|
93
|
+
}),
|
|
94
|
+
}));
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* The labs and graphs of linear and circular motion. Their labels name the
|
|
98
|
+
* quantities a reader measures; the values come from the motion the reader
|
|
99
|
+
* picks, so no prop holds answer state.
|
|
100
|
+
*/
|
|
101
|
+
export function motionVisuals(rich) {
|
|
102
|
+
return {
|
|
103
|
+
AccelerationGraphCard: accelerationGraphCard(rich),
|
|
104
|
+
AccelerationLab: accelerationLab(rich),
|
|
105
|
+
NonUniformLinearMotionGraphCard: acceleratedGraphCard(rich),
|
|
106
|
+
NonUniformLinearMotionLab: acceleratedLab(rich),
|
|
107
|
+
UniformCircularMotionLab: uniformCircularLab(rich),
|
|
108
|
+
UniformLinearMotionLab: uniformLinearLab(rich),
|
|
109
|
+
};
|
|
110
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { type RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/**
|
|
4
|
+
* The projectile labs. Their labels name the quantities the lab computes for
|
|
5
|
+
* the launch the reader picks, so no prop holds answer state.
|
|
6
|
+
*/
|
|
7
|
+
export declare function parabolicVisuals<E>(rich: RichSlot<E>): {
|
|
8
|
+
ParabolicMovementAnalysisLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
9
|
+
readonly description: RichSlot<E>;
|
|
10
|
+
readonly title: RichSlot<E>;
|
|
11
|
+
readonly decimalSeparator: Schema.optionalKey<Schema.Literals<readonly ["comma", "dot"]>>;
|
|
12
|
+
readonly labels: Schema.Struct<{
|
|
13
|
+
readonly chooseScenario: Schema.Trimmed;
|
|
14
|
+
readonly factLabels: Schema.Struct<{
|
|
15
|
+
readonly flightTime: RichSlot<E>;
|
|
16
|
+
readonly horizontalComponent: RichSlot<E>;
|
|
17
|
+
readonly instantaneousVelocity: RichSlot<E>;
|
|
18
|
+
readonly peakTime: RichSlot<E>;
|
|
19
|
+
readonly range: RichSlot<E>;
|
|
20
|
+
readonly verticalComponent: RichSlot<E>;
|
|
21
|
+
}>;
|
|
22
|
+
readonly scenarioNames: Schema.$Record<Schema.Literals<readonly ["sixty-degree", "long-drive", "high-arc"]>, RichSlot<E>>;
|
|
23
|
+
readonly viewLabel: Schema.Trimmed;
|
|
24
|
+
}>;
|
|
25
|
+
}>>;
|
|
26
|
+
ParabolicMovementLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
27
|
+
readonly decimalSeparator: Schema.optionalKey<Schema.Literals<readonly ["comma", "dot"]>>;
|
|
28
|
+
readonly defaultLaunchId: Schema.optionalKey<Schema.Literals<readonly ["low-angle", "balanced-angle", "high-angle"]>>;
|
|
29
|
+
readonly description: Schema.optionalKey<RichSlot<E>>;
|
|
30
|
+
readonly labels: Schema.Struct<{
|
|
31
|
+
readonly chooseLaunch: Schema.Trimmed;
|
|
32
|
+
readonly factLabels: Schema.Struct<{
|
|
33
|
+
readonly flightTime: RichSlot<E>;
|
|
34
|
+
readonly initialSpeed: RichSlot<E>;
|
|
35
|
+
readonly peakHeight: RichSlot<E>;
|
|
36
|
+
readonly range: RichSlot<E>;
|
|
37
|
+
}>;
|
|
38
|
+
readonly viewLabel: Schema.Trimmed;
|
|
39
|
+
}>;
|
|
40
|
+
readonly title: Schema.optionalKey<RichSlot<E>>;
|
|
41
|
+
}>>;
|
|
42
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { byIds, cardFields, DecimalSeparatorSchema, TextSchema, } from "#contracts/visual/card";
|
|
3
|
+
import { figure } from "#contracts/visual/entry";
|
|
4
|
+
/** The launches the parabolic movement lab compares. */
|
|
5
|
+
const LAUNCHES = ["low-angle", "balanced-angle", "high-angle"];
|
|
6
|
+
/** The projectiles the analysis lab follows. */
|
|
7
|
+
const PROJECTILES = ["sixty-degree", "long-drive", "high-arc"];
|
|
8
|
+
/** Props of `ParabolicMovementLab`: one launch speed at three angles. */
|
|
9
|
+
function parabolicLab(rich) {
|
|
10
|
+
return figure(Schema.Struct({
|
|
11
|
+
decimalSeparator: Schema.optionalKey(DecimalSeparatorSchema),
|
|
12
|
+
defaultLaunchId: Schema.optionalKey(Schema.Literals(LAUNCHES)),
|
|
13
|
+
description: Schema.optionalKey(rich),
|
|
14
|
+
labels: Schema.Struct({
|
|
15
|
+
chooseLaunch: TextSchema,
|
|
16
|
+
factLabels: Schema.Struct({
|
|
17
|
+
flightTime: rich,
|
|
18
|
+
initialSpeed: rich,
|
|
19
|
+
peakHeight: rich,
|
|
20
|
+
range: rich,
|
|
21
|
+
}),
|
|
22
|
+
viewLabel: TextSchema,
|
|
23
|
+
}),
|
|
24
|
+
title: Schema.optionalKey(rich),
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
/** Props of `ParabolicMovementAnalysisLab`: the components of a projectile's velocity. */
|
|
28
|
+
function analysisLab(rich) {
|
|
29
|
+
return figure(Schema.Struct({
|
|
30
|
+
...cardFields(rich),
|
|
31
|
+
decimalSeparator: Schema.optionalKey(DecimalSeparatorSchema),
|
|
32
|
+
labels: Schema.Struct({
|
|
33
|
+
chooseScenario: TextSchema,
|
|
34
|
+
factLabels: Schema.Struct({
|
|
35
|
+
flightTime: rich,
|
|
36
|
+
horizontalComponent: rich,
|
|
37
|
+
instantaneousVelocity: rich,
|
|
38
|
+
peakTime: rich,
|
|
39
|
+
range: rich,
|
|
40
|
+
verticalComponent: rich,
|
|
41
|
+
}),
|
|
42
|
+
scenarioNames: byIds(PROJECTILES, rich),
|
|
43
|
+
viewLabel: TextSchema,
|
|
44
|
+
}),
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The projectile labs. Their labels name the quantities the lab computes for
|
|
49
|
+
* the launch the reader picks, so no prop holds answer state.
|
|
50
|
+
*/
|
|
51
|
+
export function parabolicVisuals(rich) {
|
|
52
|
+
return {
|
|
53
|
+
ParabolicMovementAnalysisLab: analysisLab(rich),
|
|
54
|
+
ParabolicMovementLab: parabolicLab(rich),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { type RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/**
|
|
4
|
+
* The labs of velocity, distance, and relative motion. The meaning of each
|
|
5
|
+
* route says what its displacement shows, so it is answer state; every other
|
|
6
|
+
* label names a quantity the reader measures.
|
|
7
|
+
*/
|
|
8
|
+
export declare function velocityVisuals<E>(rich: RichSlot<E>): {
|
|
9
|
+
AverageVelocitySpeedLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
10
|
+
readonly description: RichSlot<E>;
|
|
11
|
+
readonly title: RichSlot<E>;
|
|
12
|
+
readonly decimalSeparator: Schema.optionalKey<Schema.Literals<readonly ["comma", "dot"]>>;
|
|
13
|
+
readonly labels: Schema.Struct<{
|
|
14
|
+
readonly chooseCase: Schema.Trimmed;
|
|
15
|
+
readonly factLabels: Schema.Struct<{
|
|
16
|
+
readonly displacement: RichSlot<E>;
|
|
17
|
+
readonly distance: RichSlot<E>;
|
|
18
|
+
readonly speed: RichSlot<E>;
|
|
19
|
+
readonly time: RichSlot<E>;
|
|
20
|
+
readonly velocity: RichSlot<E>;
|
|
21
|
+
}>;
|
|
22
|
+
readonly modeLabels: Schema.$Record<Schema.Literals<readonly ["straight", "bank", "loop"]>, RichSlot<E>>;
|
|
23
|
+
readonly viewLabel: Schema.Trimmed;
|
|
24
|
+
}>;
|
|
25
|
+
}>>;
|
|
26
|
+
DisplacementDistanceLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
27
|
+
readonly description: RichSlot<E>;
|
|
28
|
+
readonly title: RichSlot<E>;
|
|
29
|
+
readonly labels: Schema.Struct<{
|
|
30
|
+
readonly chooseCase: Schema.Trimmed;
|
|
31
|
+
readonly factLabels: Schema.Struct<{
|
|
32
|
+
readonly displacement: RichSlot<E>;
|
|
33
|
+
readonly distance: RichSlot<E>;
|
|
34
|
+
readonly meaning: RichSlot<E>;
|
|
35
|
+
readonly vector: RichSlot<E>;
|
|
36
|
+
}>;
|
|
37
|
+
readonly meanings: Schema.$Record<Schema.Literals<readonly ["straight", "turn", "return"]>, RichSlot<E>>;
|
|
38
|
+
readonly modeLabels: Schema.$Record<Schema.Literals<readonly ["straight", "turn", "return"]>, RichSlot<E>>;
|
|
39
|
+
readonly viewLabel: Schema.Trimmed;
|
|
40
|
+
}>;
|
|
41
|
+
}>>;
|
|
42
|
+
InstantaneousVelocitySpeedLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
43
|
+
readonly description: RichSlot<E>;
|
|
44
|
+
readonly title: RichSlot<E>;
|
|
45
|
+
readonly labels: Schema.Struct<{
|
|
46
|
+
readonly chooseMoment: Schema.Trimmed;
|
|
47
|
+
readonly factLabels: Schema.Struct<{
|
|
48
|
+
readonly speed: RichSlot<E>;
|
|
49
|
+
readonly time: RichSlot<E>;
|
|
50
|
+
readonly velocity: RichSlot<E>;
|
|
51
|
+
}>;
|
|
52
|
+
readonly viewLabel: Schema.Trimmed;
|
|
53
|
+
}>;
|
|
54
|
+
}>>;
|
|
55
|
+
RelativeMovementLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
56
|
+
readonly description: RichSlot<E>;
|
|
57
|
+
readonly title: RichSlot<E>;
|
|
58
|
+
readonly labels: Schema.Struct<{
|
|
59
|
+
readonly chooseCase: Schema.Trimmed;
|
|
60
|
+
readonly directionLabels: Schema.$Record<Schema.Literals<readonly ["left", "right"]>, RichSlot<E>>;
|
|
61
|
+
readonly factLabels: Schema.Struct<{
|
|
62
|
+
readonly observer: RichSlot<E>;
|
|
63
|
+
readonly relativeVelocity: RichSlot<E>;
|
|
64
|
+
readonly target: RichSlot<E>;
|
|
65
|
+
readonly visibleDirection: RichSlot<E>;
|
|
66
|
+
}>;
|
|
67
|
+
readonly modeLabels: Schema.$Record<Schema.Literals<readonly ["same-direction", "opposite-direction"]>, RichSlot<E>>;
|
|
68
|
+
readonly viewLabel: Schema.Trimmed;
|
|
69
|
+
}>;
|
|
70
|
+
}>>;
|
|
71
|
+
StoppingDistanceLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
72
|
+
readonly description: RichSlot<E>;
|
|
73
|
+
readonly title: RichSlot<E>;
|
|
74
|
+
readonly labels: Schema.Struct<{
|
|
75
|
+
readonly brakingDistance: RichSlot<E>;
|
|
76
|
+
readonly chooseSpeed: Schema.Trimmed;
|
|
77
|
+
readonly reactionDistance: RichSlot<E>;
|
|
78
|
+
readonly speed: RichSlot<E>;
|
|
79
|
+
readonly stoppingDistance: RichSlot<E>;
|
|
80
|
+
readonly viewLabel: Schema.Trimmed;
|
|
81
|
+
}>;
|
|
82
|
+
}>>;
|
|
83
|
+
VelocitySpeedLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
84
|
+
readonly description: RichSlot<E>;
|
|
85
|
+
readonly title: RichSlot<E>;
|
|
86
|
+
readonly labels: Schema.Struct<{
|
|
87
|
+
readonly chooseCase: Schema.Trimmed;
|
|
88
|
+
readonly factLabels: Schema.Struct<{
|
|
89
|
+
readonly displacement: RichSlot<E>;
|
|
90
|
+
readonly distance: RichSlot<E>;
|
|
91
|
+
readonly speed: RichSlot<E>;
|
|
92
|
+
readonly velocity: RichSlot<E>;
|
|
93
|
+
}>;
|
|
94
|
+
readonly modeLabels: Schema.$Record<Schema.Literals<readonly ["forward", "partialReturn", "backToStart"]>, RichSlot<E>>;
|
|
95
|
+
readonly viewLabel: Schema.Trimmed;
|
|
96
|
+
}>;
|
|
97
|
+
}>>;
|
|
98
|
+
VerticalMovementLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
99
|
+
readonly description: RichSlot<E>;
|
|
100
|
+
readonly title: RichSlot<E>;
|
|
101
|
+
readonly decimalSeparator: Schema.optionalKey<Schema.Literals<readonly ["comma", "dot"]>>;
|
|
102
|
+
readonly labels: Schema.Struct<{
|
|
103
|
+
readonly condition: Schema.Trimmed;
|
|
104
|
+
readonly finalVelocity: RichSlot<E>;
|
|
105
|
+
readonly initialCondition: RichSlot<E>;
|
|
106
|
+
readonly maxHeight: RichSlot<E>;
|
|
107
|
+
readonly modeLabels: Schema.$Record<Schema.Literals<readonly ["throw", "drop"]>, RichSlot<E>>;
|
|
108
|
+
readonly time: RichSlot<E>;
|
|
109
|
+
readonly viewLabel: Schema.Trimmed;
|
|
110
|
+
}>;
|
|
111
|
+
}>>;
|
|
112
|
+
};
|