@nakafa/aksara-contracts 0.27.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/LICENSE +185 -0
- package/README.md +73 -0
- package/dist/artifact/integrity.d.ts +29 -0
- package/dist/artifact/integrity.js +54 -0
- package/dist/artifact/limits.d.ts +26 -0
- package/dist/artifact/limits.js +46 -0
- package/dist/artifact/source.d.ts +21 -0
- package/dist/artifact/source.js +24 -0
- package/dist/artifact/spec.d.ts +148 -0
- package/dist/artifact/spec.js +92 -0
- package/dist/artifact/verify.d.ts +26 -0
- package/dist/artifact/verify.js +18 -0
- package/dist/cache/content.d.ts +52 -0
- package/dist/cache/content.js +80 -0
- package/dist/content.d.ts +168 -0
- package/dist/content.js +107 -0
- package/dist/country.d.ts +4 -0
- package/dist/country.js +8 -0
- package/dist/date.d.ts +24 -0
- package/dist/date.js +44 -0
- package/dist/decode.d.ts +4 -0
- package/dist/decode.js +8 -0
- package/dist/delivery.d.ts +4 -0
- package/dist/delivery.js +7 -0
- package/dist/errors.d.ts +10 -0
- package/dist/errors.js +8 -0
- package/dist/graph/family.d.ts +45 -0
- package/dist/graph/family.js +85 -0
- package/dist/graph/identity.d.ts +19 -0
- package/dist/graph/identity.js +39 -0
- package/dist/graph/spec.d.ts +20 -0
- package/dist/graph/spec.js +26 -0
- package/dist/hash/text.d.ts +10 -0
- package/dist/hash/text.js +20 -0
- package/dist/ids.d.ts +27 -0
- package/dist/ids.js +63 -0
- package/dist/limits.d.ts +10 -0
- package/dist/limits.js +10 -0
- package/dist/locale.d.ts +37 -0
- package/dist/locale.js +53 -0
- package/dist/material/domain.d.ts +4 -0
- package/dist/material/domain.js +8 -0
- package/dist/preview/artifact.d.ts +198 -0
- package/dist/preview/artifact.js +20 -0
- package/dist/preview/auth.d.ts +71 -0
- package/dist/preview/auth.js +49 -0
- package/dist/preview/document.d.ts +692 -0
- package/dist/preview/document.js +90 -0
- package/dist/preview/spec.d.ts +2517 -0
- package/dist/preview/spec.js +142 -0
- package/dist/preview/target.d.ts +172 -0
- package/dist/preview/target.js +70 -0
- package/dist/program/curriculum.d.ts +69 -0
- package/dist/program/curriculum.js +181 -0
- package/dist/program/snapshot/digest.d.ts +26 -0
- package/dist/program/snapshot/digest.js +220 -0
- package/dist/program/snapshot/hash.d.ts +31 -0
- package/dist/program/snapshot/hash.js +40 -0
- package/dist/program/snapshot/row-hash.d.ts +155 -0
- package/dist/program/snapshot/row-hash.js +34 -0
- package/dist/program/snapshot/row.d.ts +139 -0
- package/dist/program/snapshot/row.js +28 -0
- package/dist/program/snapshot/spec.d.ts +36 -0
- package/dist/program/snapshot/spec.js +39 -0
- package/dist/program/spec.d.ts +85 -0
- package/dist/program/spec.js +197 -0
- package/dist/projection/article.d.ts +145 -0
- package/dist/projection/article.js +150 -0
- package/dist/projection/digest.d.ts +261 -0
- package/dist/projection/digest.js +59 -0
- package/dist/projection/hash.d.ts +3 -0
- package/dist/projection/hash.js +10 -0
- package/dist/projection/material.d.ts +109 -0
- package/dist/projection/material.js +160 -0
- package/dist/projection/page.d.ts +112 -0
- package/dist/projection/page.js +106 -0
- package/dist/projection/question.d.ts +520 -0
- package/dist/projection/question.js +109 -0
- package/dist/projection/spec.d.ts +503 -0
- package/dist/projection/spec.js +56 -0
- package/dist/projection/verify.d.ts +281 -0
- package/dist/projection/verify.js +86 -0
- package/dist/question/identity.d.ts +175 -0
- package/dist/question/identity.js +205 -0
- package/dist/question/item.d.ts +453 -0
- package/dist/question/item.js +146 -0
- package/dist/question/response.d.ts +175 -0
- package/dist/question/response.js +150 -0
- package/dist/quran/attribution.d.ts +48 -0
- package/dist/quran/attribution.js +44 -0
- package/dist/quran/identity.d.ts +105 -0
- package/dist/quran/identity.js +100 -0
- package/dist/quran/notes.d.ts +56 -0
- package/dist/quran/notes.js +142 -0
- package/dist/quran/provenance.d.ts +257 -0
- package/dist/quran/provenance.js +144 -0
- package/dist/quran/snapshot/digest.d.ts +33 -0
- package/dist/quran/snapshot/digest.js +232 -0
- package/dist/quran/snapshot/hash.d.ts +51 -0
- package/dist/quran/snapshot/hash.js +50 -0
- package/dist/quran/snapshot/row/hash.d.ts +748 -0
- package/dist/quran/snapshot/row/hash.js +115 -0
- package/dist/quran/snapshot/row.d.ts +354 -0
- package/dist/quran/snapshot/row.js +91 -0
- package/dist/quran/snapshot/spec.d.ts +50 -0
- package/dist/quran/snapshot/spec.js +66 -0
- package/dist/quran/source.d.ts +206 -0
- package/dist/quran/source.js +153 -0
- package/dist/quran/spec.d.ts +47 -0
- package/dist/quran/spec.js +41 -0
- package/dist/quran/text.d.ts +7 -0
- package/dist/quran/text.js +11 -0
- package/dist/release/canonical.d.ts +23 -0
- package/dist/release/canonical.js +29 -0
- package/dist/release/current/evidence.d.ts +424 -0
- package/dist/release/current/evidence.js +41 -0
- package/dist/release/current/runtime.d.ts +4 -0
- package/dist/release/current/runtime.js +15 -0
- package/dist/release/current/state.d.ts +567 -0
- package/dist/release/current/state.js +91 -0
- package/dist/release/digest.d.ts +54 -0
- package/dist/release/digest.js +71 -0
- package/dist/release/hash.d.ts +72 -0
- package/dist/release/hash.js +14 -0
- package/dist/release/head.d.ts +206 -0
- package/dist/release/head.js +131 -0
- package/dist/release/items.d.ts +98 -0
- package/dist/release/items.js +114 -0
- package/dist/release/lifecycle.d.ts +297 -0
- package/dist/release/lifecycle.js +97 -0
- package/dist/release/origin.d.ts +30 -0
- package/dist/release/origin.js +24 -0
- package/dist/release/policy.d.ts +45 -0
- package/dist/release/policy.js +124 -0
- package/dist/release/result/digest.d.ts +127 -0
- package/dist/release/result/digest.js +140 -0
- package/dist/release/result/spec.d.ts +4 -0
- package/dist/release/result/spec.js +5 -0
- package/dist/release/rollback/digest.d.ts +126 -0
- package/dist/release/rollback/digest.js +92 -0
- package/dist/release/rollback/spec.d.ts +1729 -0
- package/dist/release/rollback/spec.js +156 -0
- package/dist/release/route/digest.d.ts +45 -0
- package/dist/release/route/digest.js +59 -0
- package/dist/release/route/page.d.ts +56 -0
- package/dist/release/route/page.js +46 -0
- package/dist/release/route/spec.d.ts +49 -0
- package/dist/release/route/spec.js +40 -0
- package/dist/release/route/verify.d.ts +66 -0
- package/dist/release/route/verify.js +67 -0
- package/dist/release/signing.d.ts +6 -0
- package/dist/release/signing.js +38 -0
- package/dist/release/snapshot/data.d.ts +475 -0
- package/dist/release/snapshot/data.js +74 -0
- package/dist/release/snapshot/evidence-requirement.d.ts +22 -0
- package/dist/release/snapshot/evidence-requirement.js +21 -0
- package/dist/release/snapshot/evidence.d.ts +58 -0
- package/dist/release/snapshot/evidence.js +14 -0
- package/dist/release/snapshot/program-evidence.d.ts +17 -0
- package/dist/release/snapshot/program-evidence.js +39 -0
- package/dist/release/snapshot/quran-evidence.d.ts +27 -0
- package/dist/release/snapshot/quran-evidence.js +43 -0
- package/dist/release/snapshot/scope.d.ts +60 -0
- package/dist/release/snapshot/scope.js +102 -0
- package/dist/release/snapshot/spec.d.ts +193 -0
- package/dist/release/snapshot/spec.js +139 -0
- package/dist/release/snapshot/tryout-evidence.d.ts +22 -0
- package/dist/release/snapshot/tryout-evidence.js +86 -0
- package/dist/release/snapshot/verify.d.ts +710 -0
- package/dist/release/snapshot/verify.js +147 -0
- package/dist/release/spec.d.ts +491 -0
- package/dist/release/spec.js +200 -0
- package/dist/release/verify.d.ts +98 -0
- package/dist/release/verify.js +70 -0
- package/dist/renderer/compatibility.d.ts +35 -0
- package/dist/renderer/compatibility.js +48 -0
- package/dist/renderer/component.d.ts +99 -0
- package/dist/renderer/component.js +102 -0
- package/dist/renderer/contract.d.ts +144 -0
- package/dist/renderer/contract.js +122 -0
- package/dist/renderer/domain.d.ts +6 -0
- package/dist/renderer/domain.js +18 -0
- package/dist/renderer/manifest.d.ts +86 -0
- package/dist/renderer/manifest.js +49 -0
- package/dist/renderer/selection.d.ts +39 -0
- package/dist/renderer/selection.js +87 -0
- package/dist/runtime/error.d.ts +8 -0
- package/dist/runtime/error.js +20 -0
- package/dist/runtime/protected/limits.d.ts +10 -0
- package/dist/runtime/protected/limits.js +15 -0
- package/dist/runtime/protected/spec.d.ts +328 -0
- package/dist/runtime/protected/spec.js +79 -0
- package/dist/runtime/protected/verify.d.ts +97 -0
- package/dist/runtime/protected/verify.js +72 -0
- package/dist/runtime/result.d.ts +12 -0
- package/dist/runtime/result.js +17 -0
- package/dist/runtime/spec.d.ts +705 -0
- package/dist/runtime/spec.js +61 -0
- package/dist/runtime/verify.d.ts +479 -0
- package/dist/runtime/verify.js +123 -0
- package/dist/signature/spec.d.ts +53 -0
- package/dist/signature/spec.js +29 -0
- package/dist/signature/trusted.d.ts +19 -0
- package/dist/signature/trusted.js +32 -0
- package/dist/signature/verify.d.ts +10 -0
- package/dist/signature/verify.js +82 -0
- package/dist/text/order.d.ts +2 -0
- package/dist/text/order.js +10 -0
- package/dist/text/syntax.d.ts +6 -0
- package/dist/text/syntax.js +15 -0
- package/dist/transport/batch.d.ts +971 -0
- package/dist/transport/batch.js +101 -0
- package/dist/transport/failure.d.ts +168 -0
- package/dist/transport/failure.js +194 -0
- package/dist/transport/group.d.ts +2946 -0
- package/dist/transport/group.js +47 -0
- package/dist/transport/limits.d.ts +30 -0
- package/dist/transport/limits.js +30 -0
- package/dist/transport/request.d.ts +9333 -0
- package/dist/transport/request.js +121 -0
- package/dist/transport/response.d.ts +6247 -0
- package/dist/transport/response.js +181 -0
- package/dist/transport/runtime.d.ts +77 -0
- package/dist/transport/runtime.js +33 -0
- package/dist/transport/snapshot.d.ts +978 -0
- package/dist/transport/snapshot.js +70 -0
- package/dist/tryout/canonical.d.ts +2 -0
- package/dist/tryout/canonical.js +11 -0
- package/dist/tryout/catalog-hash.d.ts +134 -0
- package/dist/tryout/catalog-hash.js +203 -0
- package/dist/tryout/catalog.d.ts +376 -0
- package/dist/tryout/catalog.js +147 -0
- package/dist/tryout/content-hash.d.ts +89 -0
- package/dist/tryout/content-hash.js +72 -0
- package/dist/tryout/identity.d.ts +12 -0
- package/dist/tryout/identity.js +46 -0
- package/dist/tryout/key.d.ts +4 -0
- package/dist/tryout/key.js +8 -0
- package/dist/tryout/language.d.ts +24 -0
- package/dist/tryout/language.js +32 -0
- package/dist/tryout/locale-closure.d.ts +20 -0
- package/dist/tryout/locale-closure.js +164 -0
- package/dist/tryout/placement-closure.d.ts +5 -0
- package/dist/tryout/placement-closure.js +30 -0
- package/dist/tryout/placement-hash.d.ts +11 -0
- package/dist/tryout/placement-hash.js +55 -0
- package/dist/tryout/placement.d.ts +280 -0
- package/dist/tryout/placement.js +82 -0
- package/dist/tryout/row-hash.d.ts +28 -0
- package/dist/tryout/row-hash.js +50 -0
- package/dist/tryout/runtime/canonical.d.ts +8 -0
- package/dist/tryout/runtime/canonical.js +33 -0
- package/dist/tryout/runtime/hash.d.ts +32 -0
- package/dist/tryout/runtime/hash.js +11 -0
- package/dist/tryout/runtime/source.d.ts +42 -0
- package/dist/tryout/runtime/source.js +47 -0
- package/dist/tryout/runtime/spec.d.ts +58 -0
- package/dist/tryout/runtime/spec.js +21 -0
- package/dist/tryout/runtime/verify.d.ts +61 -0
- package/dist/tryout/runtime/verify.js +69 -0
- package/dist/tryout/snapshot/canonical.d.ts +7 -0
- package/dist/tryout/snapshot/canonical.js +17 -0
- package/dist/tryout/snapshot/hash.d.ts +8 -0
- package/dist/tryout/snapshot/hash.js +19 -0
- package/dist/tryout/snapshot/spec.d.ts +46 -0
- package/dist/tryout/snapshot/spec.js +30 -0
- package/dist/tryout/spec.d.ts +13 -0
- package/dist/tryout/spec.js +15 -0
- package/package.json +506 -0
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { CONTENT_KEY_MAX_LENGTH, ContentKeySchema, CorpusSourcePathSchema, } from "#contracts/ids";
|
|
3
|
+
import { ArtifactLocaleSchema } from "#contracts/locale";
|
|
4
|
+
import { TryoutKeySchema } from "#contracts/tryout/key";
|
|
5
|
+
/** Stable namespace shared by every try-out question-bank identity. */
|
|
6
|
+
export const QUESTION_BANK_KEY_ROOT = "question-bank/tryout";
|
|
7
|
+
const QUESTION_NUMBER_PATTERN = /^question-[1-9]\d*$/u;
|
|
8
|
+
const QUESTION_SEGMENT_PREFIX = "question-";
|
|
9
|
+
const MAX_QUESTION_KEY_LENGTH = CONTENT_KEY_MAX_LENGTH - "/question".length;
|
|
10
|
+
const MAX_QUESTION_SET_KEY_LENGTH = MAX_QUESTION_KEY_LENGTH - "/question-1".length;
|
|
11
|
+
const isTryoutKey = Schema.is(TryoutKeySchema);
|
|
12
|
+
/** Checks that one canonical question number stays a safe integer. */
|
|
13
|
+
function hasSafeQuestionNumber(segment) {
|
|
14
|
+
return Number.isSafeInteger(Number(segment.slice(QUESTION_SEGMENT_PREFIX.length)));
|
|
15
|
+
}
|
|
16
|
+
/** Canonical terminal directory identity for one numbered question. */
|
|
17
|
+
export const QuestionSegmentSchema = Schema.String.pipe(Schema.check(Schema.isPattern(QUESTION_NUMBER_PATTERN)), Schema.check(Schema.makeFilter(hasSafeQuestionNumber)));
|
|
18
|
+
const isQuestionSegment = Schema.is(QuestionSegmentSchema);
|
|
19
|
+
/** Authored MDX body roles carried by each localized question. */
|
|
20
|
+
export const QuestionBodyKindSchema = Schema.Literals(["question", "answer"]);
|
|
21
|
+
/** Generic hierarchy derived from one canonical try-out question set. */
|
|
22
|
+
export const QuestionSetPartsSchema = Schema.Struct({
|
|
23
|
+
countryKey: TryoutKeySchema,
|
|
24
|
+
examKey: TryoutKeySchema,
|
|
25
|
+
intermediateBankKeys: Schema.Array(TryoutKeySchema),
|
|
26
|
+
sectionKey: TryoutKeySchema,
|
|
27
|
+
setKey: TryoutKeySchema,
|
|
28
|
+
});
|
|
29
|
+
/** Generic hierarchy and authored order derived from one question key. */
|
|
30
|
+
export const QuestionKeyPartsSchema = Schema.Struct({
|
|
31
|
+
...QuestionSetPartsSchema.fields,
|
|
32
|
+
questionNumber: Schema.Finite.pipe(Schema.check(Schema.isInt()), Schema.check(Schema.isGreaterThan(0))),
|
|
33
|
+
});
|
|
34
|
+
/** Parses the protocol root plus generic country, exam, and set hierarchy. */
|
|
35
|
+
function parseQuestionSetParts(input) {
|
|
36
|
+
const prefix = `${QUESTION_BANK_KEY_ROOT}/`;
|
|
37
|
+
if (!input.startsWith(prefix)) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const keys = input.slice(prefix.length).split("/");
|
|
41
|
+
if (keys.length < 4 ||
|
|
42
|
+
keys.some((key) => !isTryoutKey(key) || isQuestionSegment(key))) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
return Schema.decodeUnknownSync(QuestionSetPartsSchema)({
|
|
46
|
+
countryKey: keys.at(0),
|
|
47
|
+
examKey: keys.at(1),
|
|
48
|
+
intermediateBankKeys: keys.slice(2, -2),
|
|
49
|
+
sectionKey: keys.at(-2),
|
|
50
|
+
setKey: keys.at(-1),
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/** Parses one numbered question beneath a structurally valid set identity. */
|
|
54
|
+
function parseQuestionKeyParts(input) {
|
|
55
|
+
const separator = input.lastIndexOf("/");
|
|
56
|
+
if (separator === -1) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const question = input.slice(separator + 1);
|
|
60
|
+
const setParts = parseQuestionSetParts(input.slice(0, separator));
|
|
61
|
+
if (!isQuestionSegment(question) || setParts === undefined) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
...setParts,
|
|
66
|
+
questionNumber: Number(question.slice(QUESTION_SEGMENT_PREFIX.length)),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/** Stable logical identity shared by every locale and body of one question. */
|
|
70
|
+
export const QuestionKeySchema = Schema.String.pipe(Schema.check(Schema.isMaxLength(MAX_QUESTION_KEY_LENGTH)), Schema.check(Schema.makeFilter((input) => parseQuestionKeyParts(input) !== undefined, {
|
|
71
|
+
identifier: "QuestionKey",
|
|
72
|
+
message: "Invalid try-out question key.",
|
|
73
|
+
})), Schema.brand("@NakafaAI/AksaraQuestionKey"));
|
|
74
|
+
/** Stable logical identity shared by every question within one authored set. */
|
|
75
|
+
export const QuestionSetKeySchema = Schema.String.pipe(Schema.check(Schema.isMaxLength(MAX_QUESTION_SET_KEY_LENGTH)), Schema.check(Schema.makeFilter((input) => parseQuestionSetParts(input) !== undefined, {
|
|
76
|
+
identifier: "QuestionSetKey",
|
|
77
|
+
message: "Invalid try-out question-set key.",
|
|
78
|
+
})), Schema.brand("@NakafaAI/AksaraQuestionSetKey"));
|
|
79
|
+
/** Derives the renderer-owned bank identity above one authored set. */
|
|
80
|
+
export function questionBankKey(questionSetKey) {
|
|
81
|
+
return questionSetKey.slice(0, questionSetKey.lastIndexOf("/"));
|
|
82
|
+
}
|
|
83
|
+
/** Derives generic country, exam, bank, section, and set identities. */
|
|
84
|
+
export function questionSetKeyParts(questionSetKey) {
|
|
85
|
+
return Schema.decodeUnknownSync(QuestionSetPartsSchema)(parseQuestionSetParts(questionSetKey));
|
|
86
|
+
}
|
|
87
|
+
/** Derives the parent hierarchy and safe authored order from one question. */
|
|
88
|
+
export function questionKeyParts(questionKey) {
|
|
89
|
+
const parts = Schema.decodeUnknownSync(QuestionKeyPartsSchema)(parseQuestionKeyParts(questionKey));
|
|
90
|
+
const separator = questionKey.lastIndexOf("/");
|
|
91
|
+
return {
|
|
92
|
+
...parts,
|
|
93
|
+
questionSetKey: QuestionSetKeySchema.make(questionKey.slice(0, separator)),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
const QuestionSourceFields = {
|
|
97
|
+
...QuestionKeyPartsSchema.fields,
|
|
98
|
+
questionKey: QuestionKeySchema,
|
|
99
|
+
sourcePath: CorpusSourcePathSchema,
|
|
100
|
+
};
|
|
101
|
+
/** Complete physical MDX source identity derived from one question body. */
|
|
102
|
+
export const QuestionBodySourcePartsSchema = Schema.Struct({
|
|
103
|
+
...QuestionSourceFields,
|
|
104
|
+
artifactLocale: ArtifactLocaleSchema,
|
|
105
|
+
bodyKind: QuestionBodyKindSchema,
|
|
106
|
+
contentKey: ContentKeySchema,
|
|
107
|
+
kind: Schema.Literal("body"),
|
|
108
|
+
});
|
|
109
|
+
/** Complete physical TypeScript source identity for one assessment item. */
|
|
110
|
+
export const QuestionItemSourcePartsSchema = Schema.Struct({
|
|
111
|
+
...QuestionSourceFields,
|
|
112
|
+
kind: Schema.Literal("item"),
|
|
113
|
+
});
|
|
114
|
+
/** Every direct authored source accepted inside one question directory. */
|
|
115
|
+
export const QuestionSourcePartsSchema = Schema.Union([
|
|
116
|
+
QuestionBodySourcePartsSchema,
|
|
117
|
+
QuestionItemSourcePartsSchema,
|
|
118
|
+
]);
|
|
119
|
+
/** Parses one exact body or item source below the question corpus. */
|
|
120
|
+
function parseQuestionSourceParts(input) {
|
|
121
|
+
const corpusPrefix = "packages/corpus/";
|
|
122
|
+
const fileSeparator = input.lastIndexOf("/");
|
|
123
|
+
const questionKey = input.slice(corpusPrefix.length, fileSeparator);
|
|
124
|
+
const questionParts = parseQuestionKeyParts(questionKey);
|
|
125
|
+
if (questionParts === undefined ||
|
|
126
|
+
!Schema.is(QuestionKeySchema)(questionKey)) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
const sourceFile = input.slice(fileSeparator + 1);
|
|
130
|
+
if (sourceFile === "item.ts") {
|
|
131
|
+
return Schema.decodeSync(QuestionItemSourcePartsSchema)({
|
|
132
|
+
...questionParts,
|
|
133
|
+
kind: "item",
|
|
134
|
+
questionKey,
|
|
135
|
+
sourcePath: input,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
const extension = ".mdx";
|
|
139
|
+
if (!sourceFile.endsWith(extension)) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
const fileStem = sourceFile.slice(0, -extension.length);
|
|
143
|
+
const localeSeparator = fileStem.lastIndexOf(".");
|
|
144
|
+
if (localeSeparator === -1) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
const bodyKind = fileStem.slice(0, localeSeparator);
|
|
148
|
+
const artifactLocale = fileStem.slice(localeSeparator + 1);
|
|
149
|
+
if (!(Schema.is(QuestionBodyKindSchema)(bodyKind) &&
|
|
150
|
+
Schema.is(ArtifactLocaleSchema)(artifactLocale))) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
return Schema.decodeSync(QuestionBodySourcePartsSchema)({
|
|
154
|
+
...questionParts,
|
|
155
|
+
artifactLocale,
|
|
156
|
+
bodyKind,
|
|
157
|
+
contentKey: `${questionKey}/${bodyKind}`,
|
|
158
|
+
kind: "body",
|
|
159
|
+
questionKey,
|
|
160
|
+
sourcePath: input,
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
/** Exact direct authored source path below one Aksara question directory. */
|
|
164
|
+
export const QuestionSourcePathSchema = CorpusSourcePathSchema.pipe(Schema.check(Schema.makeFilter((input) => parseQuestionSourceParts(input) !== undefined, {
|
|
165
|
+
message: "Invalid try-out question source path.",
|
|
166
|
+
})), Schema.brand("@NakafaAI/AksaraQuestionSourcePath"));
|
|
167
|
+
/** Derives every logical identity from one validated physical source path. */
|
|
168
|
+
export function questionSourcePathParts(sourcePath) {
|
|
169
|
+
return Schema.decodeUnknownSync(QuestionSourcePartsSchema)(parseQuestionSourceParts(sourcePath));
|
|
170
|
+
}
|
|
171
|
+
const QuestionIdentityFields = {
|
|
172
|
+
artifactLocale: ArtifactLocaleSchema,
|
|
173
|
+
contentKey: ContentKeySchema,
|
|
174
|
+
peerContentKey: ContentKeySchema,
|
|
175
|
+
questionKey: QuestionKeySchema,
|
|
176
|
+
questionNumber: Schema.Finite.pipe(Schema.check(Schema.isInt()), Schema.check(Schema.isGreaterThan(0))),
|
|
177
|
+
setKey: QuestionSetKeySchema,
|
|
178
|
+
};
|
|
179
|
+
/** Checks logical question, body, peer, set, and numeric identities together. */
|
|
180
|
+
function hasCoherentQuestionIdentity(input) {
|
|
181
|
+
const expectedQuestionKey = `${input.setKey}/question-${input.questionNumber}`;
|
|
182
|
+
const peerKind = input.bodyKind === "question" ? "answer" : "question";
|
|
183
|
+
return (input.questionKey === expectedQuestionKey &&
|
|
184
|
+
input.contentKey === `${input.questionKey}/${input.bodyKind}` &&
|
|
185
|
+
input.peerContentKey === `${input.questionKey}/${peerKind}`);
|
|
186
|
+
}
|
|
187
|
+
/** Exact stable identity carried by one localized question prompt. */
|
|
188
|
+
export const QuestionPromptIdentitySchema = Schema.Struct({
|
|
189
|
+
...QuestionIdentityFields,
|
|
190
|
+
bodyKind: Schema.Literal("question"),
|
|
191
|
+
}).pipe(Schema.check(Schema.makeFilter(hasCoherentQuestionIdentity, {
|
|
192
|
+
message: "Expected question body, peer, set, and number identities to agree.",
|
|
193
|
+
})));
|
|
194
|
+
/** Exact stable identity carried by one localized entitled answer. */
|
|
195
|
+
export const QuestionAnswerIdentitySchema = Schema.Struct({
|
|
196
|
+
...QuestionIdentityFields,
|
|
197
|
+
bodyKind: Schema.Literal("answer"),
|
|
198
|
+
}).pipe(Schema.check(Schema.makeFilter(hasCoherentQuestionIdentity, {
|
|
199
|
+
message: "Expected answer body, peer, set, and number identities to agree.",
|
|
200
|
+
})));
|
|
201
|
+
/** Complete prompt and answer identity vocabulary for question bodies. */
|
|
202
|
+
export const QuestionBodyIdentitySchema = Schema.Union([
|
|
203
|
+
QuestionPromptIdentitySchema,
|
|
204
|
+
QuestionAnswerIdentitySchema,
|
|
205
|
+
]);
|
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
import { Effect, Schema } from "effect";
|
|
2
|
+
/** One locale-specific response authored without duplicated runtime keys. */
|
|
3
|
+
export declare const QuestionResponseSourceSchema: Schema.Union<readonly [Schema.Struct<{
|
|
4
|
+
readonly categories: Schema.mutableKey<Schema.mutable<Schema.$Array<Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
5
|
+
readonly display: Schema.Literals<readonly ["block", "inline"]>;
|
|
6
|
+
readonly kind: Schema.Literal<"math">;
|
|
7
|
+
readonly math: Schema.String;
|
|
8
|
+
}>, Schema.Struct<{
|
|
9
|
+
readonly kind: Schema.Literal<"text">;
|
|
10
|
+
readonly text: Schema.String;
|
|
11
|
+
}>]>>>>>;
|
|
12
|
+
readonly kind: Schema.mutableKey<Schema.Literal<"category">>;
|
|
13
|
+
readonly statements: Schema.mutableKey<Schema.mutable<Schema.$Array<Schema.Struct<{
|
|
14
|
+
readonly correctCategoryOrder: Schema.mutableKey<Schema.Int>;
|
|
15
|
+
readonly label: Schema.mutableKey<Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
16
|
+
readonly display: Schema.Literals<readonly ["block", "inline"]>;
|
|
17
|
+
readonly kind: Schema.Literal<"math">;
|
|
18
|
+
readonly math: Schema.String;
|
|
19
|
+
}>, Schema.Struct<{
|
|
20
|
+
readonly kind: Schema.Literal<"text">;
|
|
21
|
+
readonly text: Schema.String;
|
|
22
|
+
}>]>>>;
|
|
23
|
+
}>>>>;
|
|
24
|
+
}>, Schema.Struct<{
|
|
25
|
+
readonly kind: Schema.mutableKey<Schema.Literal<"multiple-choice">>;
|
|
26
|
+
readonly options: Schema.mutableKey<Schema.mutable<Schema.$Array<Schema.Struct<{
|
|
27
|
+
readonly isCorrect: Schema.mutableKey<Schema.Boolean>;
|
|
28
|
+
readonly label: Schema.mutableKey<Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
29
|
+
readonly display: Schema.Literals<readonly ["block", "inline"]>;
|
|
30
|
+
readonly kind: Schema.Literal<"math">;
|
|
31
|
+
readonly math: Schema.String;
|
|
32
|
+
}>, Schema.Struct<{
|
|
33
|
+
readonly kind: Schema.Literal<"text">;
|
|
34
|
+
readonly text: Schema.String;
|
|
35
|
+
}>]>>>;
|
|
36
|
+
}>>>>;
|
|
37
|
+
}>, Schema.Struct<{
|
|
38
|
+
readonly kind: Schema.mutableKey<Schema.Literal<"single-choice">>;
|
|
39
|
+
readonly options: Schema.mutableKey<Schema.mutable<Schema.$Array<Schema.Struct<{
|
|
40
|
+
readonly isCorrect: Schema.mutableKey<Schema.Boolean>;
|
|
41
|
+
readonly label: Schema.mutableKey<Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
42
|
+
readonly display: Schema.Literals<readonly ["block", "inline"]>;
|
|
43
|
+
readonly kind: Schema.Literal<"math">;
|
|
44
|
+
readonly math: Schema.String;
|
|
45
|
+
}>, Schema.Struct<{
|
|
46
|
+
readonly kind: Schema.Literal<"text">;
|
|
47
|
+
readonly text: Schema.String;
|
|
48
|
+
}>]>>>;
|
|
49
|
+
}>>>>;
|
|
50
|
+
}>]>;
|
|
51
|
+
export type QuestionResponseSource = typeof QuestionResponseSourceSchema.Type;
|
|
52
|
+
/** Editorial blueprint coordinates used to prove assessment coverage. */
|
|
53
|
+
export declare const QuestionBlueprintSchema: Schema.Struct<{
|
|
54
|
+
readonly cognitiveLevel: Schema.String;
|
|
55
|
+
readonly contentDomain: Schema.String;
|
|
56
|
+
readonly topic: Schema.String;
|
|
57
|
+
}>;
|
|
58
|
+
export type QuestionBlueprint = typeof QuestionBlueprintSchema.Type;
|
|
59
|
+
/** Complete source-owned item, including optional shared-stimulus identity. */
|
|
60
|
+
export declare const QuestionItemSchema: Schema.Struct<{
|
|
61
|
+
readonly blueprint: Schema.optionalKey<Schema.Struct<{
|
|
62
|
+
readonly cognitiveLevel: Schema.String;
|
|
63
|
+
readonly contentDomain: Schema.String;
|
|
64
|
+
readonly topic: Schema.String;
|
|
65
|
+
}>>;
|
|
66
|
+
readonly responses: Schema.$Record<Schema.Literals<readonly ["en", "id", "de"]>, Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
67
|
+
readonly categories: Schema.mutableKey<Schema.mutable<Schema.$Array<Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
68
|
+
readonly display: Schema.Literals<readonly ["block", "inline"]>;
|
|
69
|
+
readonly kind: Schema.Literal<"math">;
|
|
70
|
+
readonly math: Schema.String;
|
|
71
|
+
}>, Schema.Struct<{
|
|
72
|
+
readonly kind: Schema.Literal<"text">;
|
|
73
|
+
readonly text: Schema.String;
|
|
74
|
+
}>]>>>>>;
|
|
75
|
+
readonly kind: Schema.mutableKey<Schema.Literal<"category">>;
|
|
76
|
+
readonly statements: Schema.mutableKey<Schema.mutable<Schema.$Array<Schema.Struct<{
|
|
77
|
+
readonly correctCategoryOrder: Schema.mutableKey<Schema.Int>;
|
|
78
|
+
readonly label: Schema.mutableKey<Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
79
|
+
readonly display: Schema.Literals<readonly ["block", "inline"]>;
|
|
80
|
+
readonly kind: Schema.Literal<"math">;
|
|
81
|
+
readonly math: Schema.String;
|
|
82
|
+
}>, Schema.Struct<{
|
|
83
|
+
readonly kind: Schema.Literal<"text">;
|
|
84
|
+
readonly text: Schema.String;
|
|
85
|
+
}>]>>>;
|
|
86
|
+
}>>>>;
|
|
87
|
+
}>, Schema.Struct<{
|
|
88
|
+
readonly kind: Schema.mutableKey<Schema.Literal<"multiple-choice">>;
|
|
89
|
+
readonly options: Schema.mutableKey<Schema.mutable<Schema.$Array<Schema.Struct<{
|
|
90
|
+
readonly isCorrect: Schema.mutableKey<Schema.Boolean>;
|
|
91
|
+
readonly label: Schema.mutableKey<Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
92
|
+
readonly display: Schema.Literals<readonly ["block", "inline"]>;
|
|
93
|
+
readonly kind: Schema.Literal<"math">;
|
|
94
|
+
readonly math: Schema.String;
|
|
95
|
+
}>, Schema.Struct<{
|
|
96
|
+
readonly kind: Schema.Literal<"text">;
|
|
97
|
+
readonly text: Schema.String;
|
|
98
|
+
}>]>>>;
|
|
99
|
+
}>>>>;
|
|
100
|
+
}>, Schema.Struct<{
|
|
101
|
+
readonly kind: Schema.mutableKey<Schema.Literal<"single-choice">>;
|
|
102
|
+
readonly options: Schema.mutableKey<Schema.mutable<Schema.$Array<Schema.Struct<{
|
|
103
|
+
readonly isCorrect: Schema.mutableKey<Schema.Boolean>;
|
|
104
|
+
readonly label: Schema.mutableKey<Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
105
|
+
readonly display: Schema.Literals<readonly ["block", "inline"]>;
|
|
106
|
+
readonly kind: Schema.Literal<"math">;
|
|
107
|
+
readonly math: Schema.String;
|
|
108
|
+
}>, Schema.Struct<{
|
|
109
|
+
readonly kind: Schema.Literal<"text">;
|
|
110
|
+
readonly text: Schema.String;
|
|
111
|
+
}>]>>>;
|
|
112
|
+
}>>>>;
|
|
113
|
+
}>]>>>;
|
|
114
|
+
readonly stimulusKey: Schema.optionalKey<Schema.String>;
|
|
115
|
+
}>;
|
|
116
|
+
export type QuestionItem = typeof QuestionItemSchema.Type;
|
|
117
|
+
/** Returns blueprint facts in stable field order for signed canonicalizers. */
|
|
118
|
+
export declare function canonicalQuestionBlueprint(blueprint: QuestionBlueprint): {
|
|
119
|
+
cognitiveLevel: string;
|
|
120
|
+
contentDomain: string;
|
|
121
|
+
topic: string;
|
|
122
|
+
};
|
|
123
|
+
declare const QuestionResponseLocaleMissingError_base: Schema.Class<QuestionResponseLocaleMissingError, Schema.TaggedStruct<"QuestionResponseLocaleMissingError", {
|
|
124
|
+
readonly artifactLocale: Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraArtifactLocale">;
|
|
125
|
+
}>, import("effect/Cause").YieldableError>;
|
|
126
|
+
/** One item does not contain the exact artifact locale it must assess. */
|
|
127
|
+
export declare class QuestionResponseLocaleMissingError extends QuestionResponseLocaleMissingError_base {
|
|
128
|
+
}
|
|
129
|
+
/** Resolves and freezes one exact-locale response from an authored item. */
|
|
130
|
+
export declare const questionResponseFor: (item: {
|
|
131
|
+
readonly blueprint?: {
|
|
132
|
+
readonly cognitiveLevel: string;
|
|
133
|
+
readonly contentDomain: string;
|
|
134
|
+
readonly topic: string;
|
|
135
|
+
};
|
|
136
|
+
readonly responses: {
|
|
137
|
+
readonly de?: {
|
|
138
|
+
categories: (readonly [{
|
|
139
|
+
readonly display: "block" | "inline";
|
|
140
|
+
readonly kind: "math";
|
|
141
|
+
readonly math: string;
|
|
142
|
+
} | {
|
|
143
|
+
readonly kind: "text";
|
|
144
|
+
readonly text: string;
|
|
145
|
+
}, ...({
|
|
146
|
+
readonly display: "block" | "inline";
|
|
147
|
+
readonly kind: "math";
|
|
148
|
+
readonly math: string;
|
|
149
|
+
} | {
|
|
150
|
+
readonly kind: "text";
|
|
151
|
+
readonly text: string;
|
|
152
|
+
})[]])[];
|
|
153
|
+
kind: "category";
|
|
154
|
+
statements: {
|
|
155
|
+
correctCategoryOrder: number;
|
|
156
|
+
label: readonly [{
|
|
157
|
+
readonly display: "block" | "inline";
|
|
158
|
+
readonly kind: "math";
|
|
159
|
+
readonly math: string;
|
|
160
|
+
} | {
|
|
161
|
+
readonly kind: "text";
|
|
162
|
+
readonly text: string;
|
|
163
|
+
}, ...({
|
|
164
|
+
readonly display: "block" | "inline";
|
|
165
|
+
readonly kind: "math";
|
|
166
|
+
readonly math: string;
|
|
167
|
+
} | {
|
|
168
|
+
readonly kind: "text";
|
|
169
|
+
readonly text: string;
|
|
170
|
+
})[]];
|
|
171
|
+
}[];
|
|
172
|
+
} | {
|
|
173
|
+
kind: "multiple-choice";
|
|
174
|
+
options: {
|
|
175
|
+
isCorrect: boolean;
|
|
176
|
+
label: readonly [{
|
|
177
|
+
readonly display: "block" | "inline";
|
|
178
|
+
readonly kind: "math";
|
|
179
|
+
readonly math: string;
|
|
180
|
+
} | {
|
|
181
|
+
readonly kind: "text";
|
|
182
|
+
readonly text: string;
|
|
183
|
+
}, ...({
|
|
184
|
+
readonly display: "block" | "inline";
|
|
185
|
+
readonly kind: "math";
|
|
186
|
+
readonly math: string;
|
|
187
|
+
} | {
|
|
188
|
+
readonly kind: "text";
|
|
189
|
+
readonly text: string;
|
|
190
|
+
})[]];
|
|
191
|
+
}[];
|
|
192
|
+
} | {
|
|
193
|
+
kind: "single-choice";
|
|
194
|
+
options: {
|
|
195
|
+
isCorrect: boolean;
|
|
196
|
+
label: readonly [{
|
|
197
|
+
readonly display: "block" | "inline";
|
|
198
|
+
readonly kind: "math";
|
|
199
|
+
readonly math: string;
|
|
200
|
+
} | {
|
|
201
|
+
readonly kind: "text";
|
|
202
|
+
readonly text: string;
|
|
203
|
+
}, ...({
|
|
204
|
+
readonly display: "block" | "inline";
|
|
205
|
+
readonly kind: "math";
|
|
206
|
+
readonly math: string;
|
|
207
|
+
} | {
|
|
208
|
+
readonly kind: "text";
|
|
209
|
+
readonly text: string;
|
|
210
|
+
})[]];
|
|
211
|
+
}[];
|
|
212
|
+
} | undefined;
|
|
213
|
+
readonly en?: {
|
|
214
|
+
categories: (readonly [{
|
|
215
|
+
readonly display: "block" | "inline";
|
|
216
|
+
readonly kind: "math";
|
|
217
|
+
readonly math: string;
|
|
218
|
+
} | {
|
|
219
|
+
readonly kind: "text";
|
|
220
|
+
readonly text: string;
|
|
221
|
+
}, ...({
|
|
222
|
+
readonly display: "block" | "inline";
|
|
223
|
+
readonly kind: "math";
|
|
224
|
+
readonly math: string;
|
|
225
|
+
} | {
|
|
226
|
+
readonly kind: "text";
|
|
227
|
+
readonly text: string;
|
|
228
|
+
})[]])[];
|
|
229
|
+
kind: "category";
|
|
230
|
+
statements: {
|
|
231
|
+
correctCategoryOrder: number;
|
|
232
|
+
label: readonly [{
|
|
233
|
+
readonly display: "block" | "inline";
|
|
234
|
+
readonly kind: "math";
|
|
235
|
+
readonly math: string;
|
|
236
|
+
} | {
|
|
237
|
+
readonly kind: "text";
|
|
238
|
+
readonly text: string;
|
|
239
|
+
}, ...({
|
|
240
|
+
readonly display: "block" | "inline";
|
|
241
|
+
readonly kind: "math";
|
|
242
|
+
readonly math: string;
|
|
243
|
+
} | {
|
|
244
|
+
readonly kind: "text";
|
|
245
|
+
readonly text: string;
|
|
246
|
+
})[]];
|
|
247
|
+
}[];
|
|
248
|
+
} | {
|
|
249
|
+
kind: "multiple-choice";
|
|
250
|
+
options: {
|
|
251
|
+
isCorrect: boolean;
|
|
252
|
+
label: readonly [{
|
|
253
|
+
readonly display: "block" | "inline";
|
|
254
|
+
readonly kind: "math";
|
|
255
|
+
readonly math: string;
|
|
256
|
+
} | {
|
|
257
|
+
readonly kind: "text";
|
|
258
|
+
readonly text: string;
|
|
259
|
+
}, ...({
|
|
260
|
+
readonly display: "block" | "inline";
|
|
261
|
+
readonly kind: "math";
|
|
262
|
+
readonly math: string;
|
|
263
|
+
} | {
|
|
264
|
+
readonly kind: "text";
|
|
265
|
+
readonly text: string;
|
|
266
|
+
})[]];
|
|
267
|
+
}[];
|
|
268
|
+
} | {
|
|
269
|
+
kind: "single-choice";
|
|
270
|
+
options: {
|
|
271
|
+
isCorrect: boolean;
|
|
272
|
+
label: readonly [{
|
|
273
|
+
readonly display: "block" | "inline";
|
|
274
|
+
readonly kind: "math";
|
|
275
|
+
readonly math: string;
|
|
276
|
+
} | {
|
|
277
|
+
readonly kind: "text";
|
|
278
|
+
readonly text: string;
|
|
279
|
+
}, ...({
|
|
280
|
+
readonly display: "block" | "inline";
|
|
281
|
+
readonly kind: "math";
|
|
282
|
+
readonly math: string;
|
|
283
|
+
} | {
|
|
284
|
+
readonly kind: "text";
|
|
285
|
+
readonly text: string;
|
|
286
|
+
})[]];
|
|
287
|
+
}[];
|
|
288
|
+
} | undefined;
|
|
289
|
+
readonly id?: {
|
|
290
|
+
categories: (readonly [{
|
|
291
|
+
readonly display: "block" | "inline";
|
|
292
|
+
readonly kind: "math";
|
|
293
|
+
readonly math: string;
|
|
294
|
+
} | {
|
|
295
|
+
readonly kind: "text";
|
|
296
|
+
readonly text: string;
|
|
297
|
+
}, ...({
|
|
298
|
+
readonly display: "block" | "inline";
|
|
299
|
+
readonly kind: "math";
|
|
300
|
+
readonly math: string;
|
|
301
|
+
} | {
|
|
302
|
+
readonly kind: "text";
|
|
303
|
+
readonly text: string;
|
|
304
|
+
})[]])[];
|
|
305
|
+
kind: "category";
|
|
306
|
+
statements: {
|
|
307
|
+
correctCategoryOrder: number;
|
|
308
|
+
label: readonly [{
|
|
309
|
+
readonly display: "block" | "inline";
|
|
310
|
+
readonly kind: "math";
|
|
311
|
+
readonly math: string;
|
|
312
|
+
} | {
|
|
313
|
+
readonly kind: "text";
|
|
314
|
+
readonly text: string;
|
|
315
|
+
}, ...({
|
|
316
|
+
readonly display: "block" | "inline";
|
|
317
|
+
readonly kind: "math";
|
|
318
|
+
readonly math: string;
|
|
319
|
+
} | {
|
|
320
|
+
readonly kind: "text";
|
|
321
|
+
readonly text: string;
|
|
322
|
+
})[]];
|
|
323
|
+
}[];
|
|
324
|
+
} | {
|
|
325
|
+
kind: "multiple-choice";
|
|
326
|
+
options: {
|
|
327
|
+
isCorrect: boolean;
|
|
328
|
+
label: readonly [{
|
|
329
|
+
readonly display: "block" | "inline";
|
|
330
|
+
readonly kind: "math";
|
|
331
|
+
readonly math: string;
|
|
332
|
+
} | {
|
|
333
|
+
readonly kind: "text";
|
|
334
|
+
readonly text: string;
|
|
335
|
+
}, ...({
|
|
336
|
+
readonly display: "block" | "inline";
|
|
337
|
+
readonly kind: "math";
|
|
338
|
+
readonly math: string;
|
|
339
|
+
} | {
|
|
340
|
+
readonly kind: "text";
|
|
341
|
+
readonly text: string;
|
|
342
|
+
})[]];
|
|
343
|
+
}[];
|
|
344
|
+
} | {
|
|
345
|
+
kind: "single-choice";
|
|
346
|
+
options: {
|
|
347
|
+
isCorrect: boolean;
|
|
348
|
+
label: readonly [{
|
|
349
|
+
readonly display: "block" | "inline";
|
|
350
|
+
readonly kind: "math";
|
|
351
|
+
readonly math: string;
|
|
352
|
+
} | {
|
|
353
|
+
readonly kind: "text";
|
|
354
|
+
readonly text: string;
|
|
355
|
+
}, ...({
|
|
356
|
+
readonly display: "block" | "inline";
|
|
357
|
+
readonly kind: "math";
|
|
358
|
+
readonly math: string;
|
|
359
|
+
} | {
|
|
360
|
+
readonly kind: "text";
|
|
361
|
+
readonly text: string;
|
|
362
|
+
})[]];
|
|
363
|
+
}[];
|
|
364
|
+
} | undefined;
|
|
365
|
+
};
|
|
366
|
+
readonly stimulusKey?: string;
|
|
367
|
+
}, artifactLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraArtifactLocale">) => Effect.Effect<{
|
|
368
|
+
readonly categories: readonly {
|
|
369
|
+
readonly categoryKey: string;
|
|
370
|
+
readonly label: readonly [{
|
|
371
|
+
readonly display: "block" | "inline";
|
|
372
|
+
readonly kind: "math";
|
|
373
|
+
readonly math: string;
|
|
374
|
+
} | {
|
|
375
|
+
readonly kind: "text";
|
|
376
|
+
readonly text: string;
|
|
377
|
+
}, ...({
|
|
378
|
+
readonly display: "block" | "inline";
|
|
379
|
+
readonly kind: "math";
|
|
380
|
+
readonly math: string;
|
|
381
|
+
} | {
|
|
382
|
+
readonly kind: "text";
|
|
383
|
+
readonly text: string;
|
|
384
|
+
})[]];
|
|
385
|
+
readonly order: number;
|
|
386
|
+
}[];
|
|
387
|
+
readonly kind: "category";
|
|
388
|
+
readonly statements: readonly {
|
|
389
|
+
readonly correctCategoryKey: string;
|
|
390
|
+
readonly label: readonly [{
|
|
391
|
+
readonly display: "block" | "inline";
|
|
392
|
+
readonly kind: "math";
|
|
393
|
+
readonly math: string;
|
|
394
|
+
} | {
|
|
395
|
+
readonly kind: "text";
|
|
396
|
+
readonly text: string;
|
|
397
|
+
}, ...({
|
|
398
|
+
readonly display: "block" | "inline";
|
|
399
|
+
readonly kind: "math";
|
|
400
|
+
readonly math: string;
|
|
401
|
+
} | {
|
|
402
|
+
readonly kind: "text";
|
|
403
|
+
readonly text: string;
|
|
404
|
+
})[]];
|
|
405
|
+
readonly order: number;
|
|
406
|
+
readonly statementKey: string;
|
|
407
|
+
}[];
|
|
408
|
+
} | {
|
|
409
|
+
readonly kind: "multiple-choice";
|
|
410
|
+
readonly options: readonly {
|
|
411
|
+
readonly isCorrect: boolean;
|
|
412
|
+
readonly label: readonly [{
|
|
413
|
+
readonly display: "block" | "inline";
|
|
414
|
+
readonly kind: "math";
|
|
415
|
+
readonly math: string;
|
|
416
|
+
} | {
|
|
417
|
+
readonly kind: "text";
|
|
418
|
+
readonly text: string;
|
|
419
|
+
}, ...({
|
|
420
|
+
readonly display: "block" | "inline";
|
|
421
|
+
readonly kind: "math";
|
|
422
|
+
readonly math: string;
|
|
423
|
+
} | {
|
|
424
|
+
readonly kind: "text";
|
|
425
|
+
readonly text: string;
|
|
426
|
+
})[]];
|
|
427
|
+
readonly optionKey: string;
|
|
428
|
+
readonly order: number;
|
|
429
|
+
}[];
|
|
430
|
+
} | {
|
|
431
|
+
readonly kind: "single-choice";
|
|
432
|
+
readonly options: readonly {
|
|
433
|
+
readonly isCorrect: boolean;
|
|
434
|
+
readonly label: readonly [{
|
|
435
|
+
readonly display: "block" | "inline";
|
|
436
|
+
readonly kind: "math";
|
|
437
|
+
readonly math: string;
|
|
438
|
+
} | {
|
|
439
|
+
readonly kind: "text";
|
|
440
|
+
readonly text: string;
|
|
441
|
+
}, ...({
|
|
442
|
+
readonly display: "block" | "inline";
|
|
443
|
+
readonly kind: "math";
|
|
444
|
+
readonly math: string;
|
|
445
|
+
} | {
|
|
446
|
+
readonly kind: "text";
|
|
447
|
+
readonly text: string;
|
|
448
|
+
})[]];
|
|
449
|
+
readonly optionKey: string;
|
|
450
|
+
readonly order: number;
|
|
451
|
+
}[];
|
|
452
|
+
}, QuestionResponseLocaleMissingError, never>;
|
|
453
|
+
export {};
|