@nakafa/aksara-contracts 8.8.0 → 8.10.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/answer.d.ts +2 -0
- package/dist/assessment/answer.js +5 -3
- package/dist/assessment/choice.d.ts +26 -0
- package/dist/assessment/closure.js +2 -1
- package/dist/assessment/document.d.ts +39 -0
- package/dist/assessment/figure.d.ts +13 -0
- package/dist/assessment/fit.d.ts +16 -2
- package/dist/assessment/fit.js +23 -5
- package/dist/assessment/graphic.d.ts +27 -0
- package/dist/assessment/graphic.js +17 -1
- package/dist/assessment/hash.d.ts +777 -109
- package/dist/assessment/inline.d.ts +53 -0
- package/dist/assessment/inline.js +1 -0
- package/dist/assessment/interaction.d.ts +44 -1
- package/dist/assessment/interaction.js +2 -1
- package/dist/assessment/item.d.ts +500 -37
- package/dist/assessment/item.js +1 -1
- package/dist/assessment/joint.d.ts +4 -3
- package/dist/assessment/joint.js +4 -3
- package/dist/assessment/key.d.ts +138 -0
- package/dist/assessment/key.js +6 -0
- package/dist/assessment/paper.d.ts +1006 -90
- package/dist/assessment/part.d.ts +13 -0
- package/dist/assessment/profile.d.ts +3 -3
- package/dist/assessment/profile.js +4 -4
- package/dist/assessment/rows.d.ts +621 -39
- package/dist/assessment/scoring.d.ts +12 -6
- package/dist/assessment/scoring.js +25 -8
- package/dist/assessment/sketch.d.ts +125 -0
- package/dist/assessment/sketch.js +175 -0
- package/dist/assessment/snapshot.d.ts +1479 -91
- package/dist/assessment/structure.js +4 -4
- package/dist/release/snapshot/data.d.ts +114 -2
- package/dist/release/snapshot/verify.d.ts +621 -39
- package/dist/transport/group.d.ts +342 -6
- package/dist/transport/request.d.ts +4032 -316
- package/dist/transport/snapshot.d.ts +228 -4
- 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/blood.d.ts +56 -6
- package/dist/visual/biology/cell.d.ts +168 -18
- package/dist/visual/biology/climate.d.ts +168 -18
- package/dist/visual/biology/ecology.d.ts +224 -24
- package/dist/visual/biology/heart.d.ts +56 -6
- 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/plant.d.ts +280 -30
- package/dist/visual/biology/synapse.d.ts +56 -6
- package/dist/visual/biology/vessel.d.ts +56 -6
- package/dist/visual/biology/yeast.d.ts +56 -6
- package/dist/visual/card.d.ts +56 -6
- package/dist/visual/catalog.d.ts +16734 -5484
- 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/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/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 +2 -2
package/dist/assessment/item.js
CHANGED
|
@@ -57,7 +57,7 @@ const VersionFields = {
|
|
|
57
57
|
export const ItemVersionBodySchema = Schema.Struct(VersionFields).check(Schema.makeFilter(hasPlacedInteractions, {
|
|
58
58
|
message: "Expected the prompt to place each interaction once, as its kind allows, and no other.",
|
|
59
59
|
}), Schema.makeFilter(hasFittingRules, {
|
|
60
|
-
message: "Expected each scoring rule to fit its interaction, and each extended text to carry a rubric.",
|
|
60
|
+
message: "Expected each scoring rule to fit its interaction, and each extended text and sketch to carry a rubric.",
|
|
61
61
|
}), Schema.makeFilter(hasJointParts, {
|
|
62
62
|
message: "Expected a joint rule to name at least two interactions of the version, each level naming only those.",
|
|
63
63
|
}), Schema.makeFilter(hasOneItemRule, {
|
|
@@ -52,9 +52,10 @@ export declare function hasJointParts(version: {
|
|
|
52
52
|
}): boolean;
|
|
53
53
|
/**
|
|
54
54
|
* Checks that a version with a joint rule sets no scoring override: one rule
|
|
55
|
-
* scores the item. This also refuses an extended text in a joint
|
|
56
|
-
*
|
|
57
|
-
*
|
|
55
|
+
* scores the item. This also refuses an extended text or a sketch in a joint
|
|
56
|
+
* item, because each needs a rubric override (`fit`), and a joint item has
|
|
57
|
+
* none. No key can say that either is correct as a whole: each earns its
|
|
58
|
+
* criteria one by one.
|
|
58
59
|
*/
|
|
59
60
|
export declare function hasOneItemRule(version: {
|
|
60
61
|
readonly joint?: JointRule;
|
package/dist/assessment/joint.js
CHANGED
|
@@ -76,9 +76,10 @@ export function hasJointParts(version) {
|
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
78
78
|
* Checks that a version with a joint rule sets no scoring override: one rule
|
|
79
|
-
* scores the item. This also refuses an extended text in a joint
|
|
80
|
-
*
|
|
81
|
-
*
|
|
79
|
+
* scores the item. This also refuses an extended text or a sketch in a joint
|
|
80
|
+
* item, because each needs a rubric override (`fit`), and a joint item has
|
|
81
|
+
* none. No key can say that either is correct as a whole: each earns its
|
|
82
|
+
* criteria one by one.
|
|
82
83
|
*/
|
|
83
84
|
export function hasOneItemRule(version) {
|
|
84
85
|
return version.joint === undefined || version.scoring.length === 0;
|
package/dist/assessment/key.d.ts
CHANGED
|
@@ -84,12 +84,81 @@ export declare const InteractionKeySchema: Schema.Union<readonly [Schema.Struct<
|
|
|
84
84
|
readonly interaction: Schema.String;
|
|
85
85
|
readonly criteria: Schema.NonEmptyArray<Schema.Struct<{
|
|
86
86
|
readonly criterion: Schema.String;
|
|
87
|
+
readonly feedback: Schema.optionalKey<Schema.Struct<{
|
|
88
|
+
readonly earned: Schema.Trimmed;
|
|
89
|
+
readonly missed: Schema.Trimmed;
|
|
90
|
+
}>>;
|
|
87
91
|
readonly levels: Schema.NonEmptyArray<Schema.Struct<{
|
|
88
92
|
readonly descriptor: Schema.Trimmed;
|
|
89
93
|
readonly level: Schema.String;
|
|
90
94
|
}>>;
|
|
91
95
|
}>>;
|
|
92
96
|
readonly kind: Schema.Literal<"extendedText">;
|
|
97
|
+
}>, Schema.Struct<{
|
|
98
|
+
readonly criteria: Schema.NonEmptyArray<Schema.Struct<{
|
|
99
|
+
readonly check: Schema.Struct<{
|
|
100
|
+
readonly feature: Schema.Union<readonly [Schema.Struct<{
|
|
101
|
+
readonly contact: Schema.Literals<readonly ["cross", "touch"]>;
|
|
102
|
+
readonly kind: Schema.Literal<"zero">;
|
|
103
|
+
readonly x: Schema.String;
|
|
104
|
+
}>, Schema.Struct<{
|
|
105
|
+
readonly kind: Schema.Literal<"yIntercept">;
|
|
106
|
+
readonly y: Schema.String;
|
|
107
|
+
}>, Schema.Struct<{
|
|
108
|
+
readonly kind: Schema.Literal<"extremum">;
|
|
109
|
+
readonly turn: Schema.Literals<readonly ["maximum", "minimum"]>;
|
|
110
|
+
readonly x: Schema.String;
|
|
111
|
+
readonly y: Schema.String;
|
|
112
|
+
}>, Schema.Struct<{
|
|
113
|
+
readonly kind: Schema.Literal<"asymptote">;
|
|
114
|
+
readonly line: Schema.Union<readonly [Schema.Struct<{
|
|
115
|
+
readonly kind: Schema.Literal<"vertical">;
|
|
116
|
+
readonly x: Schema.String;
|
|
117
|
+
}>, Schema.Struct<{
|
|
118
|
+
readonly intercept: Schema.String;
|
|
119
|
+
readonly kind: Schema.Literal<"sloped">;
|
|
120
|
+
readonly slope: Schema.String;
|
|
121
|
+
}>]>;
|
|
122
|
+
}>, Schema.Struct<{
|
|
123
|
+
readonly direction: Schema.Literals<readonly ["falling", "rising"]>;
|
|
124
|
+
readonly from: Schema.NullOr<Schema.String>;
|
|
125
|
+
readonly kind: Schema.Literal<"interval">;
|
|
126
|
+
readonly to: Schema.NullOr<Schema.String>;
|
|
127
|
+
}>, Schema.Struct<{
|
|
128
|
+
readonly kind: Schema.Literal<"end">;
|
|
129
|
+
readonly limit: Schema.Union<readonly [Schema.Literals<readonly ["negativeInfinity", "positiveInfinity"]>, Schema.String]>;
|
|
130
|
+
readonly side: Schema.Literals<readonly ["left", "right"]>;
|
|
131
|
+
}>, Schema.Struct<{
|
|
132
|
+
readonly kind: Schema.Literal<"inflection">;
|
|
133
|
+
readonly x: Schema.String;
|
|
134
|
+
readonly y: Schema.String;
|
|
135
|
+
}>, Schema.Struct<{
|
|
136
|
+
readonly end: Schema.optionalKey<Schema.Literals<readonly ["closed", "open"]>>;
|
|
137
|
+
readonly kind: Schema.Literal<"point">;
|
|
138
|
+
readonly x: Schema.String;
|
|
139
|
+
readonly y: Schema.String;
|
|
140
|
+
}>]>;
|
|
141
|
+
readonly kind: Schema.Literal<"feature">;
|
|
142
|
+
}>;
|
|
143
|
+
readonly criterion: Schema.String;
|
|
144
|
+
readonly feedback: Schema.Struct<{
|
|
145
|
+
readonly earned: Schema.Trimmed;
|
|
146
|
+
readonly missed: Schema.Trimmed;
|
|
147
|
+
}>;
|
|
148
|
+
readonly requires: Schema.optionalKey<Schema.NonEmptyArray<Schema.String>>;
|
|
149
|
+
}>>;
|
|
150
|
+
readonly interaction: Schema.String;
|
|
151
|
+
readonly kind: Schema.Literal<"sketch">;
|
|
152
|
+
readonly tolerances: Schema.Struct<{
|
|
153
|
+
readonly asymptote: Schema.optionalKey<Schema.String>;
|
|
154
|
+
readonly end: Schema.optionalKey<Schema.String>;
|
|
155
|
+
readonly extremum: Schema.optionalKey<Schema.String>;
|
|
156
|
+
readonly inflection: Schema.optionalKey<Schema.String>;
|
|
157
|
+
readonly interval: Schema.optionalKey<Schema.String>;
|
|
158
|
+
readonly point: Schema.optionalKey<Schema.String>;
|
|
159
|
+
readonly yIntercept: Schema.optionalKey<Schema.String>;
|
|
160
|
+
readonly zero: Schema.optionalKey<Schema.String>;
|
|
161
|
+
}>;
|
|
93
162
|
}>]>;
|
|
94
163
|
export type InteractionKey = typeof InteractionKeySchema.Type;
|
|
95
164
|
/**
|
|
@@ -183,12 +252,81 @@ export declare const ItemKeySchema: Schema.Struct<{
|
|
|
183
252
|
readonly interaction: Schema.String;
|
|
184
253
|
readonly criteria: Schema.NonEmptyArray<Schema.Struct<{
|
|
185
254
|
readonly criterion: Schema.String;
|
|
255
|
+
readonly feedback: Schema.optionalKey<Schema.Struct<{
|
|
256
|
+
readonly earned: Schema.Trimmed;
|
|
257
|
+
readonly missed: Schema.Trimmed;
|
|
258
|
+
}>>;
|
|
186
259
|
readonly levels: Schema.NonEmptyArray<Schema.Struct<{
|
|
187
260
|
readonly descriptor: Schema.Trimmed;
|
|
188
261
|
readonly level: Schema.String;
|
|
189
262
|
}>>;
|
|
190
263
|
}>>;
|
|
191
264
|
readonly kind: Schema.Literal<"extendedText">;
|
|
265
|
+
}>, Schema.Struct<{
|
|
266
|
+
readonly criteria: Schema.NonEmptyArray<Schema.Struct<{
|
|
267
|
+
readonly check: Schema.Struct<{
|
|
268
|
+
readonly feature: Schema.Union<readonly [Schema.Struct<{
|
|
269
|
+
readonly contact: Schema.Literals<readonly ["cross", "touch"]>;
|
|
270
|
+
readonly kind: Schema.Literal<"zero">;
|
|
271
|
+
readonly x: Schema.String;
|
|
272
|
+
}>, Schema.Struct<{
|
|
273
|
+
readonly kind: Schema.Literal<"yIntercept">;
|
|
274
|
+
readonly y: Schema.String;
|
|
275
|
+
}>, Schema.Struct<{
|
|
276
|
+
readonly kind: Schema.Literal<"extremum">;
|
|
277
|
+
readonly turn: Schema.Literals<readonly ["maximum", "minimum"]>;
|
|
278
|
+
readonly x: Schema.String;
|
|
279
|
+
readonly y: Schema.String;
|
|
280
|
+
}>, Schema.Struct<{
|
|
281
|
+
readonly kind: Schema.Literal<"asymptote">;
|
|
282
|
+
readonly line: Schema.Union<readonly [Schema.Struct<{
|
|
283
|
+
readonly kind: Schema.Literal<"vertical">;
|
|
284
|
+
readonly x: Schema.String;
|
|
285
|
+
}>, Schema.Struct<{
|
|
286
|
+
readonly intercept: Schema.String;
|
|
287
|
+
readonly kind: Schema.Literal<"sloped">;
|
|
288
|
+
readonly slope: Schema.String;
|
|
289
|
+
}>]>;
|
|
290
|
+
}>, Schema.Struct<{
|
|
291
|
+
readonly direction: Schema.Literals<readonly ["falling", "rising"]>;
|
|
292
|
+
readonly from: Schema.NullOr<Schema.String>;
|
|
293
|
+
readonly kind: Schema.Literal<"interval">;
|
|
294
|
+
readonly to: Schema.NullOr<Schema.String>;
|
|
295
|
+
}>, Schema.Struct<{
|
|
296
|
+
readonly kind: Schema.Literal<"end">;
|
|
297
|
+
readonly limit: Schema.Union<readonly [Schema.Literals<readonly ["negativeInfinity", "positiveInfinity"]>, Schema.String]>;
|
|
298
|
+
readonly side: Schema.Literals<readonly ["left", "right"]>;
|
|
299
|
+
}>, Schema.Struct<{
|
|
300
|
+
readonly kind: Schema.Literal<"inflection">;
|
|
301
|
+
readonly x: Schema.String;
|
|
302
|
+
readonly y: Schema.String;
|
|
303
|
+
}>, Schema.Struct<{
|
|
304
|
+
readonly end: Schema.optionalKey<Schema.Literals<readonly ["closed", "open"]>>;
|
|
305
|
+
readonly kind: Schema.Literal<"point">;
|
|
306
|
+
readonly x: Schema.String;
|
|
307
|
+
readonly y: Schema.String;
|
|
308
|
+
}>]>;
|
|
309
|
+
readonly kind: Schema.Literal<"feature">;
|
|
310
|
+
}>;
|
|
311
|
+
readonly criterion: Schema.String;
|
|
312
|
+
readonly feedback: Schema.Struct<{
|
|
313
|
+
readonly earned: Schema.Trimmed;
|
|
314
|
+
readonly missed: Schema.Trimmed;
|
|
315
|
+
}>;
|
|
316
|
+
readonly requires: Schema.optionalKey<Schema.NonEmptyArray<Schema.String>>;
|
|
317
|
+
}>>;
|
|
318
|
+
readonly interaction: Schema.String;
|
|
319
|
+
readonly kind: Schema.Literal<"sketch">;
|
|
320
|
+
readonly tolerances: Schema.Struct<{
|
|
321
|
+
readonly asymptote: Schema.optionalKey<Schema.String>;
|
|
322
|
+
readonly end: Schema.optionalKey<Schema.String>;
|
|
323
|
+
readonly extremum: Schema.optionalKey<Schema.String>;
|
|
324
|
+
readonly inflection: Schema.optionalKey<Schema.String>;
|
|
325
|
+
readonly interval: Schema.optionalKey<Schema.String>;
|
|
326
|
+
readonly point: Schema.optionalKey<Schema.String>;
|
|
327
|
+
readonly yIntercept: Schema.optionalKey<Schema.String>;
|
|
328
|
+
readonly zero: Schema.optionalKey<Schema.String>;
|
|
329
|
+
}>;
|
|
192
330
|
}>]>>;
|
|
193
331
|
readonly version: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
194
332
|
}>;
|
package/dist/assessment/key.js
CHANGED
|
@@ -3,6 +3,7 @@ import { DecimalSchema, TextKeySchema, ToleranceSchema, } from "#contracts/asses
|
|
|
3
3
|
import { hasDistinctIds, LocalIdSchema } from "#contracts/assessment/identity";
|
|
4
4
|
import { isWithinRecordLimit } from "#contracts/assessment/record";
|
|
5
5
|
import { LatexSchema, PlainTextSchema } from "#contracts/assessment/scalar";
|
|
6
|
+
import { CriterionFeedbackSchema, SketchKeySchema, } from "#contracts/assessment/sketch";
|
|
6
7
|
import { Sha256HashSchema } from "#contracts/ids";
|
|
7
8
|
import { PlanePointSchema, PositiveMeasureSchema, samePlanePoint, } from "#contracts/math/base";
|
|
8
9
|
const DISTINCT_MESSAGE = "Expected no part to be named twice.";
|
|
@@ -100,11 +101,15 @@ const GraphPointKeySchema = Schema.Struct({
|
|
|
100
101
|
/**
|
|
101
102
|
* The rubric descriptors: for each criterion, what earns each level. They are
|
|
102
103
|
* for a grader and are never shown to a learner before the key is released.
|
|
104
|
+
* `feedback`, when present, is what the learner reads about the criterion once
|
|
105
|
+
* it is scored: `earned` at its highest level and `missed` below it, the same
|
|
106
|
+
* shape a sketch's criteria carry, so one results view serves both.
|
|
103
107
|
*/
|
|
104
108
|
const ExtendedTextKeySchema = Schema.Struct({
|
|
105
109
|
...KeyFields,
|
|
106
110
|
criteria: Schema.NonEmptyArray(Schema.Struct({
|
|
107
111
|
criterion: LocalIdSchema,
|
|
112
|
+
feedback: Schema.optionalKey(CriterionFeedbackSchema),
|
|
108
113
|
levels: Schema.NonEmptyArray(Schema.Struct({ descriptor: PlainTextSchema, level: LocalIdSchema })).check(Schema.makeFilter((levels) => hasDistinctIds(Arr.map(levels, ({ level }) => level)), { message: DISTINCT_MESSAGE })),
|
|
109
114
|
})).check(Schema.makeFilter((criteria) => hasDistinctIds(Arr.map(criteria, ({ criterion }) => criterion)), { message: DISTINCT_MESSAGE })),
|
|
110
115
|
kind: Schema.Literal("extendedText"),
|
|
@@ -123,6 +128,7 @@ export const InteractionKeySchema = Schema.Union([
|
|
|
123
128
|
GapMatchKeySchema,
|
|
124
129
|
GraphPointKeySchema,
|
|
125
130
|
ExtendedTextKeySchema,
|
|
131
|
+
SketchKeySchema,
|
|
126
132
|
]);
|
|
127
133
|
/**
|
|
128
134
|
* The answer key of one item version: its own schema and its own artifact,
|