@nakafa/aksara-contracts 0.27.0 → 0.31.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 +18 -10
- package/dist/math/base.d.ts +49 -0
- package/dist/math/base.js +103 -0
- package/dist/math/plane.d.ts +317 -0
- package/dist/math/plane.js +151 -0
- package/dist/math/space.d.ts +397 -0
- package/dist/math/space.js +129 -0
- package/dist/math/vector.d.ts +3 -0
- package/dist/math/vector.js +74 -0
- package/dist/math/visual.d.ts +984 -0
- package/dist/math/visual.js +15 -0
- package/dist/preview/artifact.d.ts +4 -32
- package/dist/preview/artifact.js +2 -2
- package/dist/preview/spec.d.ts +8 -64
- package/dist/projection/digest.d.ts +4 -74
- package/dist/projection/page.d.ts +1 -50
- package/dist/projection/page.js +9 -38
- package/dist/projection/question.d.ts +16 -184
- package/dist/projection/spec.d.ts +7 -253
- package/dist/projection/spec.js +2 -9
- package/dist/projection/verify.d.ts +4 -74
- package/dist/question/item.d.ts +24 -304
- package/dist/question/item.js +4 -4
- package/dist/question/response.d.ts +9 -97
- package/dist/question/response.js +8 -31
- package/dist/release/policy.d.ts +3 -0
- package/dist/release/policy.js +2 -0
- package/dist/release/rollback/spec.d.ts +36 -288
- package/dist/release/snapshot/data.d.ts +4 -32
- package/dist/release/snapshot/verify.d.ts +4 -60
- package/dist/renderer/compatibility.d.ts +49 -2
- package/dist/renderer/compatibility.js +49 -1
- package/dist/runtime/spec.d.ts +4 -46
- package/dist/runtime/verify.d.ts +0 -28
- package/dist/transport/batch.d.ts +8 -481
- package/dist/transport/batch.js +2 -14
- package/dist/transport/group.d.ts +50 -836
- package/dist/transport/group.js +1 -2
- package/dist/transport/request.d.ts +440 -2356
- package/dist/transport/response.d.ts +44 -436
- package/dist/transport/snapshot.d.ts +8 -64
- package/dist/tryout/content-hash.d.ts +4 -32
- package/dist/tryout/placement.d.ts +12 -96
- package/package.json +9 -1
|
@@ -124,20 +124,6 @@ export declare function decodeContentProjections<E, R>(projections: Stream.Strea
|
|
|
124
124
|
};
|
|
125
125
|
readonly sitemap: true;
|
|
126
126
|
readonly sourcePath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraCorpusSourcePath">;
|
|
127
|
-
} | {
|
|
128
|
-
readonly appLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraAppLocale">;
|
|
129
|
-
readonly artifactLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraArtifactLocale">;
|
|
130
|
-
readonly contentKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraContentKey">;
|
|
131
|
-
readonly pageKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraPageKey">;
|
|
132
|
-
readonly publicPath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraPublicPath">;
|
|
133
|
-
readonly kind: "public-page";
|
|
134
|
-
readonly metadata: {
|
|
135
|
-
readonly description: string;
|
|
136
|
-
readonly lastModified: string;
|
|
137
|
-
readonly title: string;
|
|
138
|
-
};
|
|
139
|
-
readonly sitemap: true;
|
|
140
|
-
readonly sourcePath: string & import("effect/Brand").Brand<"@NakafaAI/AksaraCorpusSourcePath">;
|
|
141
127
|
} | {
|
|
142
128
|
readonly artifactLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraArtifactLocale">;
|
|
143
129
|
readonly contentKey: string & import("effect/Brand").Brand<"@NakafaAI/AksaraContentKey">;
|
|
@@ -164,41 +150,13 @@ export declare function decodeContentProjections<E, R>(projections: Stream.Strea
|
|
|
164
150
|
readonly response: {
|
|
165
151
|
readonly categories: readonly {
|
|
166
152
|
readonly categoryKey: string;
|
|
167
|
-
readonly label:
|
|
168
|
-
readonly display: "block" | "inline";
|
|
169
|
-
readonly kind: "math";
|
|
170
|
-
readonly math: string;
|
|
171
|
-
} | {
|
|
172
|
-
readonly kind: "text";
|
|
173
|
-
readonly text: string;
|
|
174
|
-
}, ...({
|
|
175
|
-
readonly display: "block" | "inline";
|
|
176
|
-
readonly kind: "math";
|
|
177
|
-
readonly math: string;
|
|
178
|
-
} | {
|
|
179
|
-
readonly kind: "text";
|
|
180
|
-
readonly text: string;
|
|
181
|
-
})[]];
|
|
153
|
+
readonly label: string;
|
|
182
154
|
readonly order: number;
|
|
183
155
|
}[];
|
|
184
156
|
readonly kind: "category";
|
|
185
157
|
readonly statements: readonly {
|
|
186
158
|
readonly correctCategoryKey: string;
|
|
187
|
-
readonly label:
|
|
188
|
-
readonly display: "block" | "inline";
|
|
189
|
-
readonly kind: "math";
|
|
190
|
-
readonly math: string;
|
|
191
|
-
} | {
|
|
192
|
-
readonly kind: "text";
|
|
193
|
-
readonly text: string;
|
|
194
|
-
}, ...({
|
|
195
|
-
readonly display: "block" | "inline";
|
|
196
|
-
readonly kind: "math";
|
|
197
|
-
readonly math: string;
|
|
198
|
-
} | {
|
|
199
|
-
readonly kind: "text";
|
|
200
|
-
readonly text: string;
|
|
201
|
-
})[]];
|
|
159
|
+
readonly label: string;
|
|
202
160
|
readonly order: number;
|
|
203
161
|
readonly statementKey: string;
|
|
204
162
|
}[];
|
|
@@ -206,21 +164,7 @@ export declare function decodeContentProjections<E, R>(projections: Stream.Strea
|
|
|
206
164
|
readonly kind: "multiple-choice";
|
|
207
165
|
readonly options: readonly {
|
|
208
166
|
readonly isCorrect: boolean;
|
|
209
|
-
readonly label:
|
|
210
|
-
readonly display: "block" | "inline";
|
|
211
|
-
readonly kind: "math";
|
|
212
|
-
readonly math: string;
|
|
213
|
-
} | {
|
|
214
|
-
readonly kind: "text";
|
|
215
|
-
readonly text: string;
|
|
216
|
-
}, ...({
|
|
217
|
-
readonly display: "block" | "inline";
|
|
218
|
-
readonly kind: "math";
|
|
219
|
-
readonly math: string;
|
|
220
|
-
} | {
|
|
221
|
-
readonly kind: "text";
|
|
222
|
-
readonly text: string;
|
|
223
|
-
})[]];
|
|
167
|
+
readonly label: string;
|
|
224
168
|
readonly optionKey: string;
|
|
225
169
|
readonly order: number;
|
|
226
170
|
}[];
|
|
@@ -228,21 +172,7 @@ export declare function decodeContentProjections<E, R>(projections: Stream.Strea
|
|
|
228
172
|
readonly kind: "single-choice";
|
|
229
173
|
readonly options: readonly {
|
|
230
174
|
readonly isCorrect: boolean;
|
|
231
|
-
readonly label:
|
|
232
|
-
readonly display: "block" | "inline";
|
|
233
|
-
readonly kind: "math";
|
|
234
|
-
readonly math: string;
|
|
235
|
-
} | {
|
|
236
|
-
readonly kind: "text";
|
|
237
|
-
readonly text: string;
|
|
238
|
-
}, ...({
|
|
239
|
-
readonly display: "block" | "inline";
|
|
240
|
-
readonly kind: "math";
|
|
241
|
-
readonly math: string;
|
|
242
|
-
} | {
|
|
243
|
-
readonly kind: "text";
|
|
244
|
-
readonly text: string;
|
|
245
|
-
})[]];
|
|
175
|
+
readonly label: string;
|
|
246
176
|
readonly optionKey: string;
|
|
247
177
|
readonly order: number;
|
|
248
178
|
}[];
|
package/dist/question/item.d.ts
CHANGED
|
@@ -1,51 +1,23 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
2
|
/** One locale-specific response authored without duplicated runtime keys. */
|
|
3
3
|
export declare const QuestionResponseSourceSchema: Schema.Union<readonly [Schema.Struct<{
|
|
4
|
-
readonly categories: Schema.mutableKey<Schema.mutable<Schema.$Array<Schema.
|
|
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
|
-
}>]>>>>>;
|
|
4
|
+
readonly categories: Schema.mutableKey<Schema.mutable<Schema.$Array<Schema.String>>>;
|
|
12
5
|
readonly kind: Schema.mutableKey<Schema.Literal<"category">>;
|
|
13
6
|
readonly statements: Schema.mutableKey<Schema.mutable<Schema.$Array<Schema.Struct<{
|
|
14
7
|
readonly correctCategoryOrder: Schema.mutableKey<Schema.Int>;
|
|
15
|
-
readonly label: Schema.mutableKey<Schema.
|
|
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
|
-
}>]>>>;
|
|
8
|
+
readonly label: Schema.mutableKey<Schema.String>;
|
|
23
9
|
}>>>>;
|
|
24
10
|
}>, Schema.Struct<{
|
|
25
11
|
readonly kind: Schema.mutableKey<Schema.Literal<"multiple-choice">>;
|
|
26
12
|
readonly options: Schema.mutableKey<Schema.mutable<Schema.$Array<Schema.Struct<{
|
|
27
13
|
readonly isCorrect: Schema.mutableKey<Schema.Boolean>;
|
|
28
|
-
readonly label: Schema.mutableKey<Schema.
|
|
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
|
-
}>]>>>;
|
|
14
|
+
readonly label: Schema.mutableKey<Schema.String>;
|
|
36
15
|
}>>>>;
|
|
37
16
|
}>, Schema.Struct<{
|
|
38
17
|
readonly kind: Schema.mutableKey<Schema.Literal<"single-choice">>;
|
|
39
18
|
readonly options: Schema.mutableKey<Schema.mutable<Schema.$Array<Schema.Struct<{
|
|
40
19
|
readonly isCorrect: Schema.mutableKey<Schema.Boolean>;
|
|
41
|
-
readonly label: Schema.mutableKey<Schema.
|
|
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
|
-
}>]>>>;
|
|
20
|
+
readonly label: Schema.mutableKey<Schema.String>;
|
|
49
21
|
}>>>>;
|
|
50
22
|
}>]>;
|
|
51
23
|
export type QuestionResponseSource = typeof QuestionResponseSourceSchema.Type;
|
|
@@ -64,51 +36,23 @@ export declare const QuestionItemSchema: Schema.Struct<{
|
|
|
64
36
|
readonly topic: Schema.String;
|
|
65
37
|
}>>;
|
|
66
38
|
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.
|
|
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
|
-
}>]>>>>>;
|
|
39
|
+
readonly categories: Schema.mutableKey<Schema.mutable<Schema.$Array<Schema.String>>>;
|
|
75
40
|
readonly kind: Schema.mutableKey<Schema.Literal<"category">>;
|
|
76
41
|
readonly statements: Schema.mutableKey<Schema.mutable<Schema.$Array<Schema.Struct<{
|
|
77
42
|
readonly correctCategoryOrder: Schema.mutableKey<Schema.Int>;
|
|
78
|
-
readonly label: Schema.mutableKey<Schema.
|
|
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
|
-
}>]>>>;
|
|
43
|
+
readonly label: Schema.mutableKey<Schema.String>;
|
|
86
44
|
}>>>>;
|
|
87
45
|
}>, Schema.Struct<{
|
|
88
46
|
readonly kind: Schema.mutableKey<Schema.Literal<"multiple-choice">>;
|
|
89
47
|
readonly options: Schema.mutableKey<Schema.mutable<Schema.$Array<Schema.Struct<{
|
|
90
48
|
readonly isCorrect: Schema.mutableKey<Schema.Boolean>;
|
|
91
|
-
readonly label: Schema.mutableKey<Schema.
|
|
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
|
-
}>]>>>;
|
|
49
|
+
readonly label: Schema.mutableKey<Schema.String>;
|
|
99
50
|
}>>>>;
|
|
100
51
|
}>, Schema.Struct<{
|
|
101
52
|
readonly kind: Schema.mutableKey<Schema.Literal<"single-choice">>;
|
|
102
53
|
readonly options: Schema.mutableKey<Schema.mutable<Schema.$Array<Schema.Struct<{
|
|
103
54
|
readonly isCorrect: Schema.mutableKey<Schema.Boolean>;
|
|
104
|
-
readonly label: Schema.mutableKey<Schema.
|
|
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
|
-
}>]>>>;
|
|
55
|
+
readonly label: Schema.mutableKey<Schema.String>;
|
|
112
56
|
}>>>>;
|
|
113
57
|
}>]>>>;
|
|
114
58
|
readonly stimulusKey: Schema.optionalKey<Schema.String>;
|
|
@@ -135,231 +79,63 @@ export declare const questionResponseFor: (item: {
|
|
|
135
79
|
};
|
|
136
80
|
readonly responses: {
|
|
137
81
|
readonly de?: {
|
|
138
|
-
categories:
|
|
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
|
-
})[]])[];
|
|
82
|
+
categories: string[];
|
|
153
83
|
kind: "category";
|
|
154
84
|
statements: {
|
|
155
85
|
correctCategoryOrder: number;
|
|
156
|
-
label:
|
|
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
|
-
})[]];
|
|
86
|
+
label: string;
|
|
171
87
|
}[];
|
|
172
88
|
} | {
|
|
173
89
|
kind: "multiple-choice";
|
|
174
90
|
options: {
|
|
175
91
|
isCorrect: boolean;
|
|
176
|
-
label:
|
|
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
|
-
})[]];
|
|
92
|
+
label: string;
|
|
191
93
|
}[];
|
|
192
94
|
} | {
|
|
193
95
|
kind: "single-choice";
|
|
194
96
|
options: {
|
|
195
97
|
isCorrect: boolean;
|
|
196
|
-
label:
|
|
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
|
-
})[]];
|
|
98
|
+
label: string;
|
|
211
99
|
}[];
|
|
212
100
|
} | undefined;
|
|
213
101
|
readonly en?: {
|
|
214
|
-
categories:
|
|
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
|
-
})[]])[];
|
|
102
|
+
categories: string[];
|
|
229
103
|
kind: "category";
|
|
230
104
|
statements: {
|
|
231
105
|
correctCategoryOrder: number;
|
|
232
|
-
label:
|
|
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
|
-
})[]];
|
|
106
|
+
label: string;
|
|
247
107
|
}[];
|
|
248
108
|
} | {
|
|
249
109
|
kind: "multiple-choice";
|
|
250
110
|
options: {
|
|
251
111
|
isCorrect: boolean;
|
|
252
|
-
label:
|
|
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
|
-
})[]];
|
|
112
|
+
label: string;
|
|
267
113
|
}[];
|
|
268
114
|
} | {
|
|
269
115
|
kind: "single-choice";
|
|
270
116
|
options: {
|
|
271
117
|
isCorrect: boolean;
|
|
272
|
-
label:
|
|
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
|
-
})[]];
|
|
118
|
+
label: string;
|
|
287
119
|
}[];
|
|
288
120
|
} | undefined;
|
|
289
121
|
readonly id?: {
|
|
290
|
-
categories:
|
|
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
|
-
})[]])[];
|
|
122
|
+
categories: string[];
|
|
305
123
|
kind: "category";
|
|
306
124
|
statements: {
|
|
307
125
|
correctCategoryOrder: number;
|
|
308
|
-
label:
|
|
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
|
-
})[]];
|
|
126
|
+
label: string;
|
|
323
127
|
}[];
|
|
324
128
|
} | {
|
|
325
129
|
kind: "multiple-choice";
|
|
326
130
|
options: {
|
|
327
131
|
isCorrect: boolean;
|
|
328
|
-
label:
|
|
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
|
-
})[]];
|
|
132
|
+
label: string;
|
|
343
133
|
}[];
|
|
344
134
|
} | {
|
|
345
135
|
kind: "single-choice";
|
|
346
136
|
options: {
|
|
347
137
|
isCorrect: boolean;
|
|
348
|
-
label:
|
|
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
|
-
})[]];
|
|
138
|
+
label: string;
|
|
363
139
|
}[];
|
|
364
140
|
} | undefined;
|
|
365
141
|
};
|
|
@@ -367,41 +143,13 @@ export declare const questionResponseFor: (item: {
|
|
|
367
143
|
}, artifactLocale: ("de" | "en" | "id") & import("effect/Brand").Brand<"@NakafaAI/AksaraArtifactLocale">) => Effect.Effect<{
|
|
368
144
|
readonly categories: readonly {
|
|
369
145
|
readonly categoryKey: string;
|
|
370
|
-
readonly label:
|
|
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
|
-
})[]];
|
|
146
|
+
readonly label: string;
|
|
385
147
|
readonly order: number;
|
|
386
148
|
}[];
|
|
387
149
|
readonly kind: "category";
|
|
388
150
|
readonly statements: readonly {
|
|
389
151
|
readonly correctCategoryKey: string;
|
|
390
|
-
readonly label:
|
|
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
|
-
})[]];
|
|
152
|
+
readonly label: string;
|
|
405
153
|
readonly order: number;
|
|
406
154
|
readonly statementKey: string;
|
|
407
155
|
}[];
|
|
@@ -409,21 +157,7 @@ export declare const questionResponseFor: (item: {
|
|
|
409
157
|
readonly kind: "multiple-choice";
|
|
410
158
|
readonly options: readonly {
|
|
411
159
|
readonly isCorrect: boolean;
|
|
412
|
-
readonly label:
|
|
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
|
-
})[]];
|
|
160
|
+
readonly label: string;
|
|
427
161
|
readonly optionKey: string;
|
|
428
162
|
readonly order: number;
|
|
429
163
|
}[];
|
|
@@ -431,21 +165,7 @@ export declare const questionResponseFor: (item: {
|
|
|
431
165
|
readonly kind: "single-choice";
|
|
432
166
|
readonly options: readonly {
|
|
433
167
|
readonly isCorrect: boolean;
|
|
434
|
-
readonly label:
|
|
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
|
-
})[]];
|
|
168
|
+
readonly label: string;
|
|
449
169
|
readonly optionKey: string;
|
|
450
170
|
readonly order: number;
|
|
451
171
|
}[];
|
package/dist/question/item.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Effect, Schema, Struct } from "effect";
|
|
2
2
|
import { AppLocaleCodeSchema, ArtifactLocaleSchema, artifactLocaleCode, } from "#contracts/locale";
|
|
3
|
-
import {
|
|
3
|
+
import { QuestionResponseLabelSchema, QuestionResponseSchema, } from "#contracts/question/response";
|
|
4
4
|
import { TryoutKeySchema } from "#contracts/tryout/key";
|
|
5
5
|
const PositiveOrderSchema = Schema.Int.pipe(Schema.check(Schema.isGreaterThan(0)));
|
|
6
6
|
/** One source-authored option before stable runtime identities are derived. */
|
|
7
7
|
const QuestionOptionSourceSchema = Schema.Struct({
|
|
8
8
|
isCorrect: Schema.Boolean,
|
|
9
|
-
label:
|
|
9
|
+
label: QuestionResponseLabelSchema,
|
|
10
10
|
}).mapFields(Struct.map(Schema.mutableKey));
|
|
11
11
|
/** Requires enough options to present one meaningful choice interaction. */
|
|
12
12
|
function hasAtLeastTwoOptions(options) {
|
|
@@ -38,7 +38,7 @@ const MultipleChoiceResponseSourceSchema = Schema.Struct({
|
|
|
38
38
|
}).mapFields(Struct.map(Schema.mutableKey));
|
|
39
39
|
const CategoryStatementSourceSchema = Schema.Struct({
|
|
40
40
|
correctCategoryOrder: PositiveOrderSchema,
|
|
41
|
-
label:
|
|
41
|
+
label: QuestionResponseLabelSchema,
|
|
42
42
|
}).mapFields(Struct.map(Schema.mutableKey));
|
|
43
43
|
/** Checks category cardinality and every statement's category reference. */
|
|
44
44
|
function hasCoherentCategoryResponse(input) {
|
|
@@ -47,7 +47,7 @@ function hasCoherentCategoryResponse(input) {
|
|
|
47
47
|
input.statements.every(({ correctCategoryOrder }) => correctCategoryOrder <= input.categories.length));
|
|
48
48
|
}
|
|
49
49
|
const CategoryResponseSourceSchema = Schema.Struct({
|
|
50
|
-
categories: Schema.Array(
|
|
50
|
+
categories: Schema.Array(QuestionResponseLabelSchema).pipe(Schema.mutable),
|
|
51
51
|
kind: Schema.Literal("category"),
|
|
52
52
|
statements: Schema.Array(CategoryStatementSourceSchema).pipe(Schema.mutable),
|
|
53
53
|
})
|