@nakafa/aksara-contracts 1.0.0 → 2.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/README.md +15 -32
- package/dist/{question → assessment}/answer.d.ts +14 -58
- package/dist/{question → assessment}/answer.js +13 -60
- package/dist/assessment/catalog.d.ts +235 -0
- package/dist/assessment/catalog.js +115 -0
- package/dist/assessment/chart.d.ts +62 -0
- package/dist/assessment/chart.js +64 -0
- package/dist/assessment/closure.d.ts +28 -0
- package/dist/assessment/closure.js +164 -0
- package/dist/assessment/explanation.d.ts +13 -8
- package/dist/assessment/explanation.js +14 -8
- package/dist/assessment/figure.d.ts +140 -1
- package/dist/assessment/figure.js +9 -2
- package/dist/assessment/hash.d.ts +348 -208
- package/dist/assessment/hash.js +14 -0
- package/dist/assessment/inline.d.ts +3 -1
- package/dist/assessment/inline.js +20 -5
- package/dist/assessment/item.d.ts +8 -4
- package/dist/assessment/item.js +6 -2
- package/dist/assessment/key.js +6 -6
- package/dist/assessment/paper.d.ts +74 -74
- package/dist/assessment/snapshot.d.ts +3778 -0
- package/dist/assessment/snapshot.js +192 -0
- package/dist/cache/content.d.ts +4 -4
- package/dist/canonical.d.ts +6 -0
- package/dist/canonical.js +8 -1
- package/dist/content.d.ts +1 -1
- package/dist/content.js +0 -1
- package/dist/delivery.d.ts +0 -3
- package/dist/delivery.js +0 -5
- package/dist/preview/artifact.d.ts +1 -120
- package/dist/preview/document.d.ts +0 -586
- package/dist/preview/document.js +1 -47
- package/dist/preview/spec.d.ts +6 -1984
- package/dist/preview/spec.js +7 -47
- package/dist/preview/target.d.ts +0 -173
- package/dist/preview/target.js +1 -70
- package/dist/projection/digest.d.ts +0 -127
- package/dist/projection/hash.d.ts +0 -127
- package/dist/projection/spec.d.ts +6 -211
- package/dist/projection/spec.js +4 -18
- package/dist/projection/verify.d.ts +0 -127
- package/dist/projection/verify.js +0 -3
- package/dist/release/canonical.d.ts +2 -2
- package/dist/release/current/evidence.d.ts +24 -24
- package/dist/release/current/state.d.ts +28 -56
- package/dist/release/current/state.js +1 -6
- package/dist/release/digest.d.ts +2 -2
- package/dist/release/hash.d.ts +5 -5
- package/dist/release/head.d.ts +10 -57
- package/dist/release/head.js +3 -14
- package/dist/release/identity.d.ts +3 -3
- package/dist/release/items.d.ts +2 -2
- package/dist/release/lifecycle.d.ts +18 -18
- package/dist/release/policy.d.ts +3 -4
- package/dist/release/policy.js +2 -11
- package/dist/release/result/digest.d.ts +6 -18
- package/dist/release/result/digest.js +1 -2
- package/dist/release/rollback/digest.d.ts +4 -19
- package/dist/release/rollback/spec.d.ts +30 -792
- package/dist/release/rollback/spec.js +1 -4
- package/dist/release/snapshot/data.d.ts +599 -249
- package/dist/release/snapshot/data.js +11 -28
- package/dist/release/snapshot/evidence/assessment.d.ts +26 -0
- package/dist/release/snapshot/evidence/assessment.js +44 -0
- package/dist/release/snapshot/evidence/requirement.d.ts +1 -1
- package/dist/release/snapshot/evidence.d.ts +19 -19
- package/dist/release/snapshot/evidence.js +2 -2
- package/dist/release/snapshot/scope.d.ts +5 -5
- package/dist/release/snapshot/scope.js +1 -1
- package/dist/release/snapshot/spec.d.ts +15 -15
- package/dist/release/snapshot/spec.js +8 -8
- package/dist/release/snapshot/verify.d.ts +1278 -268
- package/dist/release/snapshot/verify.js +8 -5
- package/dist/release/spec.d.ts +33 -33
- package/dist/release/verify.d.ts +5 -5
- package/dist/runtime/spec.d.ts +38 -38
- package/dist/runtime/spec.js +4 -5
- package/dist/runtime/verify.d.ts +40 -40
- package/dist/signature/spec.d.ts +5 -5
- package/dist/signature/spec.js +0 -1
- package/dist/signature/trusted.d.ts +4 -1
- package/dist/signature/trusted.js +4 -1
- package/dist/transport/batch.d.ts +6 -244
- package/dist/transport/failure.d.ts +6 -20
- package/dist/transport/failure.js +0 -10
- package/dist/transport/group.d.ts +1969 -1369
- package/dist/transport/group.js +0 -2
- package/dist/transport/request.d.ts +10691 -5086
- package/dist/transport/request.js +0 -3
- package/dist/transport/response.d.ts +219 -1442
- package/dist/transport/response.js +0 -4
- package/dist/transport/snapshot.d.ts +1187 -487
- package/package.json +187 -295
- package/dist/projection/question.d.ts +0 -1067
- package/dist/projection/question.js +0 -121
- package/dist/question/identity.d.ts +0 -175
- package/dist/question/identity.js +0 -207
- package/dist/question/item.d.ts +0 -450
- package/dist/question/item.js +0 -174
- package/dist/question/label.d.ts +0 -3
- package/dist/question/label.js +0 -3
- package/dist/question/points.d.ts +0 -18
- package/dist/question/points.js +0 -22
- package/dist/question/response.d.ts +0 -289
- package/dist/question/response.js +0 -167
- package/dist/question/rubric.d.ts +0 -234
- package/dist/question/rubric.js +0 -186
- package/dist/release/current/runtime.d.ts +0 -4
- package/dist/release/current/runtime.js +0 -15
- package/dist/release/snapshot/evidence/tryout.d.ts +0 -22
- package/dist/release/snapshot/evidence/tryout.js +0 -91
- package/dist/runtime/protected/limits.d.ts +0 -10
- package/dist/runtime/protected/limits.js +0 -16
- package/dist/runtime/protected/spec.d.ts +0 -310
- package/dist/runtime/protected/spec.js +0 -80
- package/dist/runtime/protected/verify.d.ts +0 -83
- package/dist/runtime/protected/verify.js +0 -70
- package/dist/transport/runtime.d.ts +0 -77
- package/dist/transport/runtime.js +0 -33
- package/dist/tryout/canonical.d.ts +0 -12
- package/dist/tryout/canonical.js +0 -7
- package/dist/tryout/catalog.d.ts +0 -396
- package/dist/tryout/catalog.js +0 -155
- package/dist/tryout/closure/accounting.d.ts +0 -20
- package/dist/tryout/closure/accounting.js +0 -70
- package/dist/tryout/closure/locale.d.ts +0 -14
- package/dist/tryout/closure/locale.js +0 -113
- package/dist/tryout/closure/placement.d.ts +0 -5
- package/dist/tryout/closure/placement.js +0 -32
- package/dist/tryout/digest.d.ts +0 -34
- package/dist/tryout/digest.js +0 -57
- package/dist/tryout/hash/catalog.d.ts +0 -364
- package/dist/tryout/hash/catalog.js +0 -209
- package/dist/tryout/hash/content.d.ts +0 -215
- package/dist/tryout/hash/content.js +0 -75
- package/dist/tryout/hash/placement.d.ts +0 -242
- package/dist/tryout/hash/placement.js +0 -56
- package/dist/tryout/identity.d.ts +0 -12
- package/dist/tryout/identity.js +0 -47
- package/dist/tryout/key.d.ts +0 -4
- package/dist/tryout/key.js +0 -8
- package/dist/tryout/language.d.ts +0 -24
- package/dist/tryout/language.js +0 -30
- package/dist/tryout/placement.d.ts +0 -331
- package/dist/tryout/placement.js +0 -96
- package/dist/tryout/runtime/canonical.d.ts +0 -8
- package/dist/tryout/runtime/canonical.js +0 -34
- package/dist/tryout/runtime/hash.d.ts +0 -34
- package/dist/tryout/runtime/hash.js +0 -13
- package/dist/tryout/runtime/source.d.ts +0 -44
- package/dist/tryout/runtime/source.js +0 -47
- package/dist/tryout/runtime/spec.d.ts +0 -58
- package/dist/tryout/runtime/spec.js +0 -21
- package/dist/tryout/runtime/verify.d.ts +0 -69
- package/dist/tryout/runtime/verify.js +0 -67
- package/dist/tryout/scoring.d.ts +0 -148
- package/dist/tryout/scoring.js +0 -98
- package/dist/tryout/snapshot/canonical.d.ts +0 -7
- package/dist/tryout/snapshot/canonical.js +0 -18
- package/dist/tryout/snapshot/hash.d.ts +0 -49
- package/dist/tryout/snapshot/hash.js +0 -22
- package/dist/tryout/snapshot/spec.d.ts +0 -46
- package/dist/tryout/snapshot/spec.js +0 -30
- package/dist/tryout/spec.d.ts +0 -41
- package/dist/tryout/spec.js +0 -46
|
@@ -164,6 +164,58 @@ export declare const hashItemVersion: (body: Omit<{
|
|
|
164
164
|
})[]];
|
|
165
165
|
}[];
|
|
166
166
|
readonly shuffle: boolean;
|
|
167
|
+
} | {
|
|
168
|
+
readonly id: string;
|
|
169
|
+
readonly label: string;
|
|
170
|
+
readonly expectedLength?: number;
|
|
171
|
+
readonly kind: "textEntry";
|
|
172
|
+
} | {
|
|
173
|
+
readonly id: string;
|
|
174
|
+
readonly label: string;
|
|
175
|
+
readonly acceptsFractions: boolean;
|
|
176
|
+
readonly kind: "numericEntry";
|
|
177
|
+
readonly unit?: string;
|
|
178
|
+
} | {
|
|
179
|
+
readonly id: string;
|
|
180
|
+
readonly label: string;
|
|
181
|
+
readonly kind: "mathEntry";
|
|
182
|
+
} | {
|
|
183
|
+
readonly id: string;
|
|
184
|
+
readonly label: string;
|
|
185
|
+
readonly areas: readonly ({
|
|
186
|
+
readonly id: string;
|
|
187
|
+
readonly label: string;
|
|
188
|
+
readonly coords: readonly [number, number, number, number];
|
|
189
|
+
readonly shape: "rect";
|
|
190
|
+
} | {
|
|
191
|
+
readonly id: string;
|
|
192
|
+
readonly label: string;
|
|
193
|
+
readonly coords: readonly [number, number, number];
|
|
194
|
+
readonly shape: "circle";
|
|
195
|
+
} | {
|
|
196
|
+
readonly id: string;
|
|
197
|
+
readonly label: string;
|
|
198
|
+
readonly coords: readonly [number, number, number, number];
|
|
199
|
+
readonly shape: "ellipse";
|
|
200
|
+
} | {
|
|
201
|
+
readonly id: string;
|
|
202
|
+
readonly label: string;
|
|
203
|
+
readonly coords: readonly [number, number, number, number, number, number, ...number[]];
|
|
204
|
+
readonly shape: "poly";
|
|
205
|
+
} | {
|
|
206
|
+
readonly id: string;
|
|
207
|
+
readonly label: string;
|
|
208
|
+
readonly shape: "default";
|
|
209
|
+
})[];
|
|
210
|
+
readonly image: {
|
|
211
|
+
readonly alt: string;
|
|
212
|
+
readonly asset: string;
|
|
213
|
+
readonly height: number;
|
|
214
|
+
readonly width: number;
|
|
215
|
+
};
|
|
216
|
+
readonly kind: "hotspot";
|
|
217
|
+
readonly maxChoices: number;
|
|
218
|
+
readonly minChoices: number;
|
|
167
219
|
} | {
|
|
168
220
|
readonly id: string;
|
|
169
221
|
readonly label: string;
|
|
@@ -275,58 +327,6 @@ export declare const hashItemVersion: (body: Omit<{
|
|
|
275
327
|
}[]];
|
|
276
328
|
readonly kind: "gapMatch";
|
|
277
329
|
readonly shuffle: boolean;
|
|
278
|
-
} | {
|
|
279
|
-
readonly id: string;
|
|
280
|
-
readonly label: string;
|
|
281
|
-
readonly areas: readonly ({
|
|
282
|
-
readonly id: string;
|
|
283
|
-
readonly label: string;
|
|
284
|
-
readonly coords: readonly [number, number, number, number];
|
|
285
|
-
readonly shape: "rect";
|
|
286
|
-
} | {
|
|
287
|
-
readonly id: string;
|
|
288
|
-
readonly label: string;
|
|
289
|
-
readonly coords: readonly [number, number, number];
|
|
290
|
-
readonly shape: "circle";
|
|
291
|
-
} | {
|
|
292
|
-
readonly id: string;
|
|
293
|
-
readonly label: string;
|
|
294
|
-
readonly coords: readonly [number, number, number, number];
|
|
295
|
-
readonly shape: "ellipse";
|
|
296
|
-
} | {
|
|
297
|
-
readonly id: string;
|
|
298
|
-
readonly label: string;
|
|
299
|
-
readonly coords: readonly [number, number, number, number, number, number, ...number[]];
|
|
300
|
-
readonly shape: "poly";
|
|
301
|
-
} | {
|
|
302
|
-
readonly id: string;
|
|
303
|
-
readonly label: string;
|
|
304
|
-
readonly shape: "default";
|
|
305
|
-
})[];
|
|
306
|
-
readonly image: {
|
|
307
|
-
readonly alt: string;
|
|
308
|
-
readonly asset: string;
|
|
309
|
-
readonly height: number;
|
|
310
|
-
readonly width: number;
|
|
311
|
-
};
|
|
312
|
-
readonly kind: "hotspot";
|
|
313
|
-
readonly maxChoices: number;
|
|
314
|
-
readonly minChoices: number;
|
|
315
|
-
} | {
|
|
316
|
-
readonly id: string;
|
|
317
|
-
readonly label: string;
|
|
318
|
-
readonly expectedLength?: number;
|
|
319
|
-
readonly kind: "textEntry";
|
|
320
|
-
} | {
|
|
321
|
-
readonly id: string;
|
|
322
|
-
readonly label: string;
|
|
323
|
-
readonly acceptsFractions: boolean;
|
|
324
|
-
readonly kind: "numericEntry";
|
|
325
|
-
readonly unit?: string;
|
|
326
|
-
} | {
|
|
327
|
-
readonly id: string;
|
|
328
|
-
readonly label: string;
|
|
329
|
-
readonly kind: "mathEntry";
|
|
330
330
|
} | {
|
|
331
331
|
readonly id: string;
|
|
332
332
|
readonly label: string;
|
|
@@ -493,6 +493,58 @@ export declare const hashItemVersion: (body: Omit<{
|
|
|
493
493
|
})[]];
|
|
494
494
|
}[];
|
|
495
495
|
readonly shuffle: boolean;
|
|
496
|
+
} | {
|
|
497
|
+
readonly id: string;
|
|
498
|
+
readonly label: string;
|
|
499
|
+
readonly expectedLength?: number;
|
|
500
|
+
readonly kind: "textEntry";
|
|
501
|
+
} | {
|
|
502
|
+
readonly id: string;
|
|
503
|
+
readonly label: string;
|
|
504
|
+
readonly acceptsFractions: boolean;
|
|
505
|
+
readonly kind: "numericEntry";
|
|
506
|
+
readonly unit?: string;
|
|
507
|
+
} | {
|
|
508
|
+
readonly id: string;
|
|
509
|
+
readonly label: string;
|
|
510
|
+
readonly kind: "mathEntry";
|
|
511
|
+
} | {
|
|
512
|
+
readonly id: string;
|
|
513
|
+
readonly label: string;
|
|
514
|
+
readonly areas: readonly ({
|
|
515
|
+
readonly id: string;
|
|
516
|
+
readonly label: string;
|
|
517
|
+
readonly coords: readonly [number, number, number, number];
|
|
518
|
+
readonly shape: "rect";
|
|
519
|
+
} | {
|
|
520
|
+
readonly id: string;
|
|
521
|
+
readonly label: string;
|
|
522
|
+
readonly coords: readonly [number, number, number];
|
|
523
|
+
readonly shape: "circle";
|
|
524
|
+
} | {
|
|
525
|
+
readonly id: string;
|
|
526
|
+
readonly label: string;
|
|
527
|
+
readonly coords: readonly [number, number, number, number];
|
|
528
|
+
readonly shape: "ellipse";
|
|
529
|
+
} | {
|
|
530
|
+
readonly id: string;
|
|
531
|
+
readonly label: string;
|
|
532
|
+
readonly coords: readonly [number, number, number, number, number, number, ...number[]];
|
|
533
|
+
readonly shape: "poly";
|
|
534
|
+
} | {
|
|
535
|
+
readonly id: string;
|
|
536
|
+
readonly label: string;
|
|
537
|
+
readonly shape: "default";
|
|
538
|
+
})[];
|
|
539
|
+
readonly image: {
|
|
540
|
+
readonly alt: string;
|
|
541
|
+
readonly asset: string;
|
|
542
|
+
readonly height: number;
|
|
543
|
+
readonly width: number;
|
|
544
|
+
};
|
|
545
|
+
readonly kind: "hotspot";
|
|
546
|
+
readonly maxChoices: number;
|
|
547
|
+
readonly minChoices: number;
|
|
496
548
|
} | {
|
|
497
549
|
readonly id: string;
|
|
498
550
|
readonly label: string;
|
|
@@ -604,58 +656,6 @@ export declare const hashItemVersion: (body: Omit<{
|
|
|
604
656
|
}[]];
|
|
605
657
|
readonly kind: "gapMatch";
|
|
606
658
|
readonly shuffle: boolean;
|
|
607
|
-
} | {
|
|
608
|
-
readonly id: string;
|
|
609
|
-
readonly label: string;
|
|
610
|
-
readonly areas: readonly ({
|
|
611
|
-
readonly id: string;
|
|
612
|
-
readonly label: string;
|
|
613
|
-
readonly coords: readonly [number, number, number, number];
|
|
614
|
-
readonly shape: "rect";
|
|
615
|
-
} | {
|
|
616
|
-
readonly id: string;
|
|
617
|
-
readonly label: string;
|
|
618
|
-
readonly coords: readonly [number, number, number];
|
|
619
|
-
readonly shape: "circle";
|
|
620
|
-
} | {
|
|
621
|
-
readonly id: string;
|
|
622
|
-
readonly label: string;
|
|
623
|
-
readonly coords: readonly [number, number, number, number];
|
|
624
|
-
readonly shape: "ellipse";
|
|
625
|
-
} | {
|
|
626
|
-
readonly id: string;
|
|
627
|
-
readonly label: string;
|
|
628
|
-
readonly coords: readonly [number, number, number, number, number, number, ...number[]];
|
|
629
|
-
readonly shape: "poly";
|
|
630
|
-
} | {
|
|
631
|
-
readonly id: string;
|
|
632
|
-
readonly label: string;
|
|
633
|
-
readonly shape: "default";
|
|
634
|
-
})[];
|
|
635
|
-
readonly image: {
|
|
636
|
-
readonly alt: string;
|
|
637
|
-
readonly asset: string;
|
|
638
|
-
readonly height: number;
|
|
639
|
-
readonly width: number;
|
|
640
|
-
};
|
|
641
|
-
readonly kind: "hotspot";
|
|
642
|
-
readonly maxChoices: number;
|
|
643
|
-
readonly minChoices: number;
|
|
644
|
-
} | {
|
|
645
|
-
readonly id: string;
|
|
646
|
-
readonly label: string;
|
|
647
|
-
readonly expectedLength?: number;
|
|
648
|
-
readonly kind: "textEntry";
|
|
649
|
-
} | {
|
|
650
|
-
readonly id: string;
|
|
651
|
-
readonly label: string;
|
|
652
|
-
readonly acceptsFractions: boolean;
|
|
653
|
-
readonly kind: "numericEntry";
|
|
654
|
-
readonly unit?: string;
|
|
655
|
-
} | {
|
|
656
|
-
readonly id: string;
|
|
657
|
-
readonly label: string;
|
|
658
|
-
readonly kind: "mathEntry";
|
|
659
659
|
} | {
|
|
660
660
|
readonly id: string;
|
|
661
661
|
readonly label: string;
|
|
@@ -748,6 +748,146 @@ export declare const hashStimulusVersion: (body: Omit<{
|
|
|
748
748
|
readonly id: string & import("effect/Brand").Brand<"@NakafaAI/AksaraStimulusId">;
|
|
749
749
|
readonly hash: string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">;
|
|
750
750
|
}, "hash">) => Effect.Effect<string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">, Schema.SchemaError | import("#contracts/hash/text").TextHashError, never>;
|
|
751
|
+
/**
|
|
752
|
+
* Computes the hash of an exam profile, which a paper names beside its
|
|
753
|
+
* identifier, so a paper follows one exact profile.
|
|
754
|
+
*/
|
|
755
|
+
export declare const hashExamProfile: (profile: {
|
|
756
|
+
readonly accommodations: {
|
|
757
|
+
readonly assigned: readonly ("high-contrast" | "separate-room" | "text-to-speech")[];
|
|
758
|
+
readonly recorded: readonly ({
|
|
759
|
+
readonly kind: "extraTime";
|
|
760
|
+
readonly maxPercent: number;
|
|
761
|
+
} | {
|
|
762
|
+
readonly kind: "extraBreak";
|
|
763
|
+
readonly maxSeconds: number;
|
|
764
|
+
} | {
|
|
765
|
+
readonly kind: "alternateFormat" | "reader" | "scribe";
|
|
766
|
+
})[];
|
|
767
|
+
readonly universal: readonly ("calculator-basic" | "calculator-graphing" | "calculator-scientific" | "formula-sheet" | "hide-timer" | "highlighter" | "line-reader" | "mark-for-review" | "notes" | "option-eliminator" | "text-to-speech" | "zoom")[];
|
|
768
|
+
};
|
|
769
|
+
readonly breaks: readonly {
|
|
770
|
+
readonly after: string;
|
|
771
|
+
readonly seconds: number;
|
|
772
|
+
}[];
|
|
773
|
+
readonly defaults: readonly {
|
|
774
|
+
readonly interaction: "choice" | "extendedText" | "gapMatch" | "graphPoint" | "hotspot" | "inlineChoice" | "match" | "mathEntry" | "matrix" | "numericEntry" | "order" | "textEntry";
|
|
775
|
+
readonly rule: {
|
|
776
|
+
readonly kind: "allOrNothing";
|
|
777
|
+
} | {
|
|
778
|
+
readonly floor: number;
|
|
779
|
+
readonly kind: "perPart";
|
|
780
|
+
readonly penaltyPerWrongPart?: number;
|
|
781
|
+
readonly pointsPerPart: number;
|
|
782
|
+
} | {
|
|
783
|
+
readonly bands: readonly [{
|
|
784
|
+
readonly points: number;
|
|
785
|
+
readonly wrong: number;
|
|
786
|
+
}, ...{
|
|
787
|
+
readonly points: number;
|
|
788
|
+
readonly wrong: number;
|
|
789
|
+
}[]];
|
|
790
|
+
readonly kind: "wrongParts";
|
|
791
|
+
};
|
|
792
|
+
}[];
|
|
793
|
+
readonly graceSeconds: number;
|
|
794
|
+
readonly id: string & import("effect/Brand").Brand<"@NakafaAI/AksaraExamProfileId">;
|
|
795
|
+
readonly names: {
|
|
796
|
+
readonly de: string;
|
|
797
|
+
readonly en: string;
|
|
798
|
+
readonly id: string;
|
|
799
|
+
};
|
|
800
|
+
readonly report: {
|
|
801
|
+
readonly sections: boolean;
|
|
802
|
+
readonly standardError: boolean;
|
|
803
|
+
readonly total: boolean;
|
|
804
|
+
};
|
|
805
|
+
readonly sampledMath: "review" | "score";
|
|
806
|
+
readonly scale?: {
|
|
807
|
+
readonly maximum: number;
|
|
808
|
+
readonly minimum: number;
|
|
809
|
+
};
|
|
810
|
+
readonly scoring: {
|
|
811
|
+
readonly kind: "irt";
|
|
812
|
+
} | {
|
|
813
|
+
readonly kind: "raw";
|
|
814
|
+
} | {
|
|
815
|
+
readonly kind: "penalized";
|
|
816
|
+
readonly marks: {
|
|
817
|
+
readonly blank: number;
|
|
818
|
+
readonly correct: number;
|
|
819
|
+
readonly wrong: number;
|
|
820
|
+
};
|
|
821
|
+
} | {
|
|
822
|
+
readonly formula: {
|
|
823
|
+
readonly de: string;
|
|
824
|
+
readonly en: string;
|
|
825
|
+
readonly id: string;
|
|
826
|
+
};
|
|
827
|
+
readonly kind: "composite";
|
|
828
|
+
};
|
|
829
|
+
readonly sections: readonly [{
|
|
830
|
+
readonly id: string;
|
|
831
|
+
readonly interactions: readonly ["choice" | "extendedText" | "gapMatch" | "graphPoint" | "hotspot" | "inlineChoice" | "match" | "mathEntry" | "matrix" | "numericEntry" | "order" | "textEntry", ...("choice" | "extendedText" | "gapMatch" | "graphPoint" | "hotspot" | "inlineChoice" | "match" | "mathEntry" | "matrix" | "numericEntry" | "order" | "textEntry")[]];
|
|
832
|
+
readonly items: number;
|
|
833
|
+
readonly names: {
|
|
834
|
+
readonly de: string;
|
|
835
|
+
readonly en: string;
|
|
836
|
+
readonly id: string;
|
|
837
|
+
};
|
|
838
|
+
readonly navigation: "free" | "linear";
|
|
839
|
+
readonly seconds: number;
|
|
840
|
+
readonly tools: readonly ("calculator-basic" | "calculator-graphing" | "calculator-scientific" | "formula-sheet" | "hide-timer" | "highlighter" | "line-reader" | "mark-for-review" | "notes" | "option-eliminator" | "text-to-speech" | "zoom")[];
|
|
841
|
+
}, ...{
|
|
842
|
+
readonly id: string;
|
|
843
|
+
readonly interactions: readonly ["choice" | "extendedText" | "gapMatch" | "graphPoint" | "hotspot" | "inlineChoice" | "match" | "mathEntry" | "matrix" | "numericEntry" | "order" | "textEntry", ...("choice" | "extendedText" | "gapMatch" | "graphPoint" | "hotspot" | "inlineChoice" | "match" | "mathEntry" | "matrix" | "numericEntry" | "order" | "textEntry")[]];
|
|
844
|
+
readonly items: number;
|
|
845
|
+
readonly names: {
|
|
846
|
+
readonly de: string;
|
|
847
|
+
readonly en: string;
|
|
848
|
+
readonly id: string;
|
|
849
|
+
};
|
|
850
|
+
readonly navigation: "free" | "linear";
|
|
851
|
+
readonly seconds: number;
|
|
852
|
+
readonly tools: readonly ("calculator-basic" | "calculator-graphing" | "calculator-scientific" | "formula-sheet" | "hide-timer" | "highlighter" | "line-reader" | "mark-for-review" | "notes" | "option-eliminator" | "text-to-speech" | "zoom")[];
|
|
853
|
+
}[]];
|
|
854
|
+
readonly totalSeconds: number;
|
|
855
|
+
readonly writeAllowanceSeconds: number;
|
|
856
|
+
}) => Effect.Effect<string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">, Schema.SchemaError | import("#contracts/hash/text").TextHashError, never>;
|
|
857
|
+
/**
|
|
858
|
+
* Computes the hash of a paper, the name a frozen paper is known by: equal
|
|
859
|
+
* places, profile, and readings have one hash.
|
|
860
|
+
*/
|
|
861
|
+
export declare const hashPaper: (paper: {
|
|
862
|
+
readonly id: string & import("effect/Brand").Brand<"@NakafaAI/AksaraPaperId">;
|
|
863
|
+
readonly profile: {
|
|
864
|
+
readonly hash: string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">;
|
|
865
|
+
readonly id: string & import("effect/Brand").Brand<"@NakafaAI/AksaraExamProfileId">;
|
|
866
|
+
};
|
|
867
|
+
readonly sections: readonly [{
|
|
868
|
+
readonly placements: readonly [{
|
|
869
|
+
readonly family: string & import("effect/Brand").Brand<"@NakafaAI/AksaraItemFamilyId">;
|
|
870
|
+
readonly hash: string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">;
|
|
871
|
+
}, ...{
|
|
872
|
+
readonly family: string & import("effect/Brand").Brand<"@NakafaAI/AksaraItemFamilyId">;
|
|
873
|
+
readonly hash: string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">;
|
|
874
|
+
}[]];
|
|
875
|
+
readonly section: string;
|
|
876
|
+
}, ...{
|
|
877
|
+
readonly placements: readonly [{
|
|
878
|
+
readonly family: string & import("effect/Brand").Brand<"@NakafaAI/AksaraItemFamilyId">;
|
|
879
|
+
readonly hash: string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">;
|
|
880
|
+
}, ...{
|
|
881
|
+
readonly family: string & import("effect/Brand").Brand<"@NakafaAI/AksaraItemFamilyId">;
|
|
882
|
+
readonly hash: string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">;
|
|
883
|
+
}[]];
|
|
884
|
+
readonly section: string;
|
|
885
|
+
}[]];
|
|
886
|
+
readonly stimuli: readonly {
|
|
887
|
+
readonly hash: string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">;
|
|
888
|
+
readonly id: string & import("effect/Brand").Brand<"@NakafaAI/AksaraStimulusId">;
|
|
889
|
+
}[];
|
|
890
|
+
}) => Effect.Effect<string & import("effect/Brand").Brand<"@NakafaAI/AksaraSha256Hash">, Schema.SchemaError | import("#contracts/hash/text").TextHashError, never>;
|
|
751
891
|
/** Requires an item version to carry the hash of its own content. */
|
|
752
892
|
export declare const verifyItemVersion: (version: {
|
|
753
893
|
readonly deliveryLanguage: string & import("effect/Brand").Brand<"@NakafaAI/AksaraContentLanguage">;
|
|
@@ -895,6 +1035,58 @@ export declare const verifyItemVersion: (version: {
|
|
|
895
1035
|
})[]];
|
|
896
1036
|
}[];
|
|
897
1037
|
readonly shuffle: boolean;
|
|
1038
|
+
} | {
|
|
1039
|
+
readonly id: string;
|
|
1040
|
+
readonly label: string;
|
|
1041
|
+
readonly expectedLength?: number;
|
|
1042
|
+
readonly kind: "textEntry";
|
|
1043
|
+
} | {
|
|
1044
|
+
readonly id: string;
|
|
1045
|
+
readonly label: string;
|
|
1046
|
+
readonly acceptsFractions: boolean;
|
|
1047
|
+
readonly kind: "numericEntry";
|
|
1048
|
+
readonly unit?: string;
|
|
1049
|
+
} | {
|
|
1050
|
+
readonly id: string;
|
|
1051
|
+
readonly label: string;
|
|
1052
|
+
readonly kind: "mathEntry";
|
|
1053
|
+
} | {
|
|
1054
|
+
readonly id: string;
|
|
1055
|
+
readonly label: string;
|
|
1056
|
+
readonly areas: readonly ({
|
|
1057
|
+
readonly id: string;
|
|
1058
|
+
readonly label: string;
|
|
1059
|
+
readonly coords: readonly [number, number, number, number];
|
|
1060
|
+
readonly shape: "rect";
|
|
1061
|
+
} | {
|
|
1062
|
+
readonly id: string;
|
|
1063
|
+
readonly label: string;
|
|
1064
|
+
readonly coords: readonly [number, number, number];
|
|
1065
|
+
readonly shape: "circle";
|
|
1066
|
+
} | {
|
|
1067
|
+
readonly id: string;
|
|
1068
|
+
readonly label: string;
|
|
1069
|
+
readonly coords: readonly [number, number, number, number];
|
|
1070
|
+
readonly shape: "ellipse";
|
|
1071
|
+
} | {
|
|
1072
|
+
readonly id: string;
|
|
1073
|
+
readonly label: string;
|
|
1074
|
+
readonly coords: readonly [number, number, number, number, number, number, ...number[]];
|
|
1075
|
+
readonly shape: "poly";
|
|
1076
|
+
} | {
|
|
1077
|
+
readonly id: string;
|
|
1078
|
+
readonly label: string;
|
|
1079
|
+
readonly shape: "default";
|
|
1080
|
+
})[];
|
|
1081
|
+
readonly image: {
|
|
1082
|
+
readonly alt: string;
|
|
1083
|
+
readonly asset: string;
|
|
1084
|
+
readonly height: number;
|
|
1085
|
+
readonly width: number;
|
|
1086
|
+
};
|
|
1087
|
+
readonly kind: "hotspot";
|
|
1088
|
+
readonly maxChoices: number;
|
|
1089
|
+
readonly minChoices: number;
|
|
898
1090
|
} | {
|
|
899
1091
|
readonly id: string;
|
|
900
1092
|
readonly label: string;
|
|
@@ -1006,58 +1198,6 @@ export declare const verifyItemVersion: (version: {
|
|
|
1006
1198
|
}[]];
|
|
1007
1199
|
readonly kind: "gapMatch";
|
|
1008
1200
|
readonly shuffle: boolean;
|
|
1009
|
-
} | {
|
|
1010
|
-
readonly id: string;
|
|
1011
|
-
readonly label: string;
|
|
1012
|
-
readonly areas: readonly ({
|
|
1013
|
-
readonly id: string;
|
|
1014
|
-
readonly label: string;
|
|
1015
|
-
readonly coords: readonly [number, number, number, number];
|
|
1016
|
-
readonly shape: "rect";
|
|
1017
|
-
} | {
|
|
1018
|
-
readonly id: string;
|
|
1019
|
-
readonly label: string;
|
|
1020
|
-
readonly coords: readonly [number, number, number];
|
|
1021
|
-
readonly shape: "circle";
|
|
1022
|
-
} | {
|
|
1023
|
-
readonly id: string;
|
|
1024
|
-
readonly label: string;
|
|
1025
|
-
readonly coords: readonly [number, number, number, number];
|
|
1026
|
-
readonly shape: "ellipse";
|
|
1027
|
-
} | {
|
|
1028
|
-
readonly id: string;
|
|
1029
|
-
readonly label: string;
|
|
1030
|
-
readonly coords: readonly [number, number, number, number, number, number, ...number[]];
|
|
1031
|
-
readonly shape: "poly";
|
|
1032
|
-
} | {
|
|
1033
|
-
readonly id: string;
|
|
1034
|
-
readonly label: string;
|
|
1035
|
-
readonly shape: "default";
|
|
1036
|
-
})[];
|
|
1037
|
-
readonly image: {
|
|
1038
|
-
readonly alt: string;
|
|
1039
|
-
readonly asset: string;
|
|
1040
|
-
readonly height: number;
|
|
1041
|
-
readonly width: number;
|
|
1042
|
-
};
|
|
1043
|
-
readonly kind: "hotspot";
|
|
1044
|
-
readonly maxChoices: number;
|
|
1045
|
-
readonly minChoices: number;
|
|
1046
|
-
} | {
|
|
1047
|
-
readonly id: string;
|
|
1048
|
-
readonly label: string;
|
|
1049
|
-
readonly expectedLength?: number;
|
|
1050
|
-
readonly kind: "textEntry";
|
|
1051
|
-
} | {
|
|
1052
|
-
readonly id: string;
|
|
1053
|
-
readonly label: string;
|
|
1054
|
-
readonly acceptsFractions: boolean;
|
|
1055
|
-
readonly kind: "numericEntry";
|
|
1056
|
-
readonly unit?: string;
|
|
1057
|
-
} | {
|
|
1058
|
-
readonly id: string;
|
|
1059
|
-
readonly label: string;
|
|
1060
|
-
readonly kind: "mathEntry";
|
|
1061
1201
|
} | {
|
|
1062
1202
|
readonly id: string;
|
|
1063
1203
|
readonly label: string;
|
|
@@ -1224,6 +1364,58 @@ export declare const verifyItemVersion: (version: {
|
|
|
1224
1364
|
})[]];
|
|
1225
1365
|
}[];
|
|
1226
1366
|
readonly shuffle: boolean;
|
|
1367
|
+
} | {
|
|
1368
|
+
readonly id: string;
|
|
1369
|
+
readonly label: string;
|
|
1370
|
+
readonly expectedLength?: number;
|
|
1371
|
+
readonly kind: "textEntry";
|
|
1372
|
+
} | {
|
|
1373
|
+
readonly id: string;
|
|
1374
|
+
readonly label: string;
|
|
1375
|
+
readonly acceptsFractions: boolean;
|
|
1376
|
+
readonly kind: "numericEntry";
|
|
1377
|
+
readonly unit?: string;
|
|
1378
|
+
} | {
|
|
1379
|
+
readonly id: string;
|
|
1380
|
+
readonly label: string;
|
|
1381
|
+
readonly kind: "mathEntry";
|
|
1382
|
+
} | {
|
|
1383
|
+
readonly id: string;
|
|
1384
|
+
readonly label: string;
|
|
1385
|
+
readonly areas: readonly ({
|
|
1386
|
+
readonly id: string;
|
|
1387
|
+
readonly label: string;
|
|
1388
|
+
readonly coords: readonly [number, number, number, number];
|
|
1389
|
+
readonly shape: "rect";
|
|
1390
|
+
} | {
|
|
1391
|
+
readonly id: string;
|
|
1392
|
+
readonly label: string;
|
|
1393
|
+
readonly coords: readonly [number, number, number];
|
|
1394
|
+
readonly shape: "circle";
|
|
1395
|
+
} | {
|
|
1396
|
+
readonly id: string;
|
|
1397
|
+
readonly label: string;
|
|
1398
|
+
readonly coords: readonly [number, number, number, number];
|
|
1399
|
+
readonly shape: "ellipse";
|
|
1400
|
+
} | {
|
|
1401
|
+
readonly id: string;
|
|
1402
|
+
readonly label: string;
|
|
1403
|
+
readonly coords: readonly [number, number, number, number, number, number, ...number[]];
|
|
1404
|
+
readonly shape: "poly";
|
|
1405
|
+
} | {
|
|
1406
|
+
readonly id: string;
|
|
1407
|
+
readonly label: string;
|
|
1408
|
+
readonly shape: "default";
|
|
1409
|
+
})[];
|
|
1410
|
+
readonly image: {
|
|
1411
|
+
readonly alt: string;
|
|
1412
|
+
readonly asset: string;
|
|
1413
|
+
readonly height: number;
|
|
1414
|
+
readonly width: number;
|
|
1415
|
+
};
|
|
1416
|
+
readonly kind: "hotspot";
|
|
1417
|
+
readonly maxChoices: number;
|
|
1418
|
+
readonly minChoices: number;
|
|
1227
1419
|
} | {
|
|
1228
1420
|
readonly id: string;
|
|
1229
1421
|
readonly label: string;
|
|
@@ -1335,58 +1527,6 @@ export declare const verifyItemVersion: (version: {
|
|
|
1335
1527
|
}[]];
|
|
1336
1528
|
readonly kind: "gapMatch";
|
|
1337
1529
|
readonly shuffle: boolean;
|
|
1338
|
-
} | {
|
|
1339
|
-
readonly id: string;
|
|
1340
|
-
readonly label: string;
|
|
1341
|
-
readonly areas: readonly ({
|
|
1342
|
-
readonly id: string;
|
|
1343
|
-
readonly label: string;
|
|
1344
|
-
readonly coords: readonly [number, number, number, number];
|
|
1345
|
-
readonly shape: "rect";
|
|
1346
|
-
} | {
|
|
1347
|
-
readonly id: string;
|
|
1348
|
-
readonly label: string;
|
|
1349
|
-
readonly coords: readonly [number, number, number];
|
|
1350
|
-
readonly shape: "circle";
|
|
1351
|
-
} | {
|
|
1352
|
-
readonly id: string;
|
|
1353
|
-
readonly label: string;
|
|
1354
|
-
readonly coords: readonly [number, number, number, number];
|
|
1355
|
-
readonly shape: "ellipse";
|
|
1356
|
-
} | {
|
|
1357
|
-
readonly id: string;
|
|
1358
|
-
readonly label: string;
|
|
1359
|
-
readonly coords: readonly [number, number, number, number, number, number, ...number[]];
|
|
1360
|
-
readonly shape: "poly";
|
|
1361
|
-
} | {
|
|
1362
|
-
readonly id: string;
|
|
1363
|
-
readonly label: string;
|
|
1364
|
-
readonly shape: "default";
|
|
1365
|
-
})[];
|
|
1366
|
-
readonly image: {
|
|
1367
|
-
readonly alt: string;
|
|
1368
|
-
readonly asset: string;
|
|
1369
|
-
readonly height: number;
|
|
1370
|
-
readonly width: number;
|
|
1371
|
-
};
|
|
1372
|
-
readonly kind: "hotspot";
|
|
1373
|
-
readonly maxChoices: number;
|
|
1374
|
-
readonly minChoices: number;
|
|
1375
|
-
} | {
|
|
1376
|
-
readonly id: string;
|
|
1377
|
-
readonly label: string;
|
|
1378
|
-
readonly expectedLength?: number;
|
|
1379
|
-
readonly kind: "textEntry";
|
|
1380
|
-
} | {
|
|
1381
|
-
readonly id: string;
|
|
1382
|
-
readonly label: string;
|
|
1383
|
-
readonly acceptsFractions: boolean;
|
|
1384
|
-
readonly kind: "numericEntry";
|
|
1385
|
-
readonly unit?: string;
|
|
1386
|
-
} | {
|
|
1387
|
-
readonly id: string;
|
|
1388
|
-
readonly label: string;
|
|
1389
|
-
readonly kind: "mathEntry";
|
|
1390
1530
|
} | {
|
|
1391
1531
|
readonly id: string;
|
|
1392
1532
|
readonly label: string;
|
package/dist/assessment/hash.js
CHANGED
|
@@ -6,6 +6,10 @@ import { encodeJsonText } from "#contracts/text/json";
|
|
|
6
6
|
const ITEM_DOMAIN = "nakafa.aksara.assessment-item";
|
|
7
7
|
/** Separates the hash of a stimulus version from the hash of any other record. */
|
|
8
8
|
const STIMULUS_DOMAIN = "nakafa.aksara.assessment-stimulus";
|
|
9
|
+
/** Separates the hash of an exam profile from the hash of any other record. */
|
|
10
|
+
const PROFILE_DOMAIN = "nakafa.aksara.assessment-profile";
|
|
11
|
+
/** Separates the hash of a paper from the hash of any other record. */
|
|
12
|
+
const PAPER_DOMAIN = "nakafa.aksara.assessment-paper";
|
|
9
13
|
/**
|
|
10
14
|
* Writes a value that is already known to be JSON as text, with the keys of
|
|
11
15
|
* every object in code-unit order. Every leaf is a string, a finite number, a
|
|
@@ -42,6 +46,16 @@ const hashRecord = (domain, record) => canonicalJson(record).pipe(Effect.flatMap
|
|
|
42
46
|
export const hashItemVersion = Effect.fn("AksaraContracts.hashItemVersion")((body) => hashRecord(ITEM_DOMAIN, body));
|
|
43
47
|
/** Computes the hash that a stimulus version carries, from all of its other fields. */
|
|
44
48
|
export const hashStimulusVersion = Effect.fn("AksaraContracts.hashStimulusVersion")((body) => hashRecord(STIMULUS_DOMAIN, body));
|
|
49
|
+
/**
|
|
50
|
+
* Computes the hash of an exam profile, which a paper names beside its
|
|
51
|
+
* identifier, so a paper follows one exact profile.
|
|
52
|
+
*/
|
|
53
|
+
export const hashExamProfile = Effect.fn("AksaraContracts.hashExamProfile")((profile) => hashRecord(PROFILE_DOMAIN, profile));
|
|
54
|
+
/**
|
|
55
|
+
* Computes the hash of a paper, the name a frozen paper is known by: equal
|
|
56
|
+
* places, profile, and readings have one hash.
|
|
57
|
+
*/
|
|
58
|
+
export const hashPaper = Effect.fn("AksaraContracts.hashPaper")((paper) => hashRecord(PAPER_DOMAIN, paper));
|
|
45
59
|
/** Requires an item version to carry the hash of its own content. */
|
|
46
60
|
export const verifyItemVersion = Effect.fn("AksaraContracts.verifyItemVersion")(function* (version) {
|
|
47
61
|
const { hash, ...body } = version;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Schema } from "effect";
|
|
1
|
+
import { Order, Schema } from "effect";
|
|
2
2
|
/** One text mark, as ProseMirror writes it: `{ type }` plus `attrs` when it has any. */
|
|
3
3
|
export declare const MarkSchema: Schema.Union<readonly [Schema.Struct<{
|
|
4
4
|
readonly type: Schema.Literals<readonly ["bold", "italic", "underline", "code", "subscript", "superscript"]>;
|
|
@@ -9,6 +9,8 @@ export declare const MarkSchema: Schema.Union<readonly [Schema.Struct<{
|
|
|
9
9
|
readonly type: Schema.Literal<"link">;
|
|
10
10
|
}>]>;
|
|
11
11
|
export type Mark = typeof MarkSchema.Type;
|
|
12
|
+
/** Orders marks as a text node keeps them. */
|
|
13
|
+
export declare const MarkOrder: Order.Order<Mark>;
|
|
12
14
|
/** A run of text with the same marks. Text is never empty, as in ProseMirror. */
|
|
13
15
|
export declare const TextNodeSchema: Schema.Struct<{
|
|
14
16
|
readonly marks: Schema.optionalKey<Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|