@nakafa/aksara-contracts 0.42.0 → 0.44.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.
Files changed (77) hide show
  1. package/README.md +20 -1
  2. package/dist/math/resolution.js +1 -1
  3. package/dist/math/scene.js +1 -1
  4. package/dist/preview/artifact.d.ts +44 -0
  5. package/dist/preview/document.d.ts +36 -12
  6. package/dist/preview/spec.d.ts +196 -36
  7. package/dist/preview/target.d.ts +10 -3
  8. package/dist/program/snapshot/digest.d.ts +1 -1
  9. package/dist/program/snapshot/digest.js +1 -1
  10. package/dist/program/snapshot/hash.d.ts +153 -0
  11. package/dist/program/snapshot/hash.js +31 -0
  12. package/dist/projection/digest.d.ts +74 -22
  13. package/dist/projection/material.d.ts +10 -0
  14. package/dist/projection/material.js +15 -0
  15. package/dist/projection/question.d.ts +188 -0
  16. package/dist/projection/spec.d.ts +45 -0
  17. package/dist/projection/verify.d.ts +127 -75
  18. package/dist/question/answer.d.ts +141 -0
  19. package/dist/question/answer.js +238 -0
  20. package/dist/question/item.d.ts +276 -1
  21. package/dist/question/item.js +63 -38
  22. package/dist/question/label.d.ts +3 -0
  23. package/dist/question/label.js +3 -0
  24. package/dist/question/points.d.ts +18 -0
  25. package/dist/question/points.js +22 -0
  26. package/dist/question/response.d.ts +187 -5
  27. package/dist/question/response.js +41 -4
  28. package/dist/question/rubric.d.ts +234 -0
  29. package/dist/question/rubric.js +182 -0
  30. package/dist/release/rollback/spec.d.ts +264 -0
  31. package/dist/release/snapshot/data.d.ts +52 -3
  32. package/dist/release/snapshot/{program-evidence.d.ts → evidence/program.d.ts} +2 -2
  33. package/dist/release/snapshot/{program-evidence.js → evidence/program.js} +1 -1
  34. package/dist/release/snapshot/{quran-evidence.d.ts → evidence/quran.d.ts} +2 -2
  35. package/dist/release/snapshot/{quran-evidence.js → evidence/quran.js} +1 -1
  36. package/dist/release/snapshot/{tryout-evidence.d.ts → evidence/tryout.d.ts} +2 -2
  37. package/dist/release/snapshot/{tryout-evidence.js → evidence/tryout.js} +4 -4
  38. package/dist/release/snapshot/evidence.d.ts +2 -2
  39. package/dist/release/snapshot/evidence.js +3 -3
  40. package/dist/release/snapshot/verify.d.ts +88 -31
  41. package/dist/runtime/spec.d.ts +25 -22
  42. package/dist/runtime/verify.d.ts +46 -44
  43. package/dist/transport/batch.d.ts +88 -0
  44. package/dist/transport/group.d.ts +288 -9
  45. package/dist/transport/request.d.ts +1858 -1018
  46. package/dist/transport/response.d.ts +499 -131
  47. package/dist/transport/snapshot.d.ts +104 -6
  48. package/dist/tryout/catalog.d.ts +28 -10
  49. package/dist/tryout/catalog.js +6 -2
  50. package/dist/tryout/closure/accounting.d.ts +16 -0
  51. package/dist/tryout/closure/accounting.js +68 -0
  52. package/dist/tryout/closure/locale.d.ts +14 -0
  53. package/dist/tryout/{locale-closure.js → closure/locale.js} +13 -72
  54. package/dist/tryout/{placement-closure.js → closure/placement.js} +1 -0
  55. package/dist/tryout/{catalog-hash.d.ts → hash/catalog.d.ts} +25 -20
  56. package/dist/tryout/{catalog-hash.js → hash/catalog.js} +8 -1
  57. package/dist/tryout/{content-hash.d.ts → hash/content.d.ts} +43 -0
  58. package/dist/tryout/{placement-hash.d.ts → hash/placement.d.ts} +1 -1
  59. package/dist/tryout/{placement-hash.js → hash/placement.js} +2 -1
  60. package/dist/tryout/placement.d.ts +136 -1
  61. package/dist/tryout/placement.js +16 -2
  62. package/dist/tryout/scoring.d.ts +37 -0
  63. package/dist/tryout/scoring.js +89 -0
  64. package/dist/tryout/spec.d.ts +32 -4
  65. package/dist/tryout/spec.js +35 -4
  66. package/package.json +29 -21
  67. package/dist/program/snapshot/row-hash.d.ts +0 -155
  68. package/dist/program/snapshot/row-hash.js +0 -34
  69. package/dist/tryout/locale-closure.d.ts +0 -20
  70. /package/dist/math/{arc-precision.d.ts → arc.d.ts} +0 -0
  71. /package/dist/math/{arc-precision.js → arc.js} +0 -0
  72. /package/dist/release/snapshot/{evidence-requirement.d.ts → evidence/requirement.d.ts} +0 -0
  73. /package/dist/release/snapshot/{evidence-requirement.js → evidence/requirement.js} +0 -0
  74. /package/dist/tryout/{placement-closure.d.ts → closure/placement.d.ts} +0 -0
  75. /package/dist/tryout/{row-hash.d.ts → digest.d.ts} +0 -0
  76. /package/dist/tryout/{row-hash.js → digest.js} +0 -0
  77. /package/dist/tryout/{content-hash.js → hash/content.js} +0 -0
@@ -0,0 +1,238 @@
1
+ import { BigDecimal, Option, Schema } from "effect";
2
+ const DECIMAL_PATTERN = /^(?:0|-?[1-9]\d*|-?(?:0|[1-9]\d*)\.\d*[1-9])$/u;
3
+ const UNTYPABLE_CHARACTER_PATTERN = /[\p{Cc}\p{Cf}]|[^\S ]/u;
4
+ const FORMAT_CHARACTER_PATTERN = /\p{Cf}/gu;
5
+ const WHITESPACE_PATTERN = /\s/gu;
6
+ const SPACE_RUN_PATTERN = / {2,}/gu;
7
+ const COMMA_NUMBER_PATTERN = /^[+\u2212-]?(?:\d+(?:,\d*)?|,\d+)$/u;
8
+ const DOT_NUMBER_PATTERN = /^[+\u2212-]?(?:\d+(?:\.\d*)?|\.\d+)$/u;
9
+ const FRACTION_PATTERN = /^[+\u2212-]?\d+ *\/ *\d+$/u;
10
+ const ONE = BigDecimal.fromBigInt(1n);
11
+ /** Typed decimal notation of each delivery language. */
12
+ const NUMBER_PATTERNS = {
13
+ de: COMMA_NUMBER_PATTERN,
14
+ en: DOT_NUMBER_PATTERN,
15
+ id: COMMA_NUMBER_PATTERN,
16
+ };
17
+ /**
18
+ * One exact decimal in its only canonical spelling: an optional minus sign, an
19
+ * integer part without leading zeros, and a dot-separated fraction without
20
+ * trailing zeros. Zero is always `0`, so equal values share one encoding.
21
+ * Graders compare it exactly through `matchesAnswerKey`, never through binary
22
+ * floating point.
23
+ */
24
+ export const QuestionDecimalSchema = Schema.String.check(Schema.isPattern(DECIMAL_PATTERN, {
25
+ description: "Exact decimal written in its canonical dot-separated form.",
26
+ identifier: "QuestionDecimal",
27
+ message: "Invalid canonical decimal.",
28
+ }));
29
+ /** Checks that one canonical decimal is strictly greater than zero. */
30
+ function isPositiveDecimal(value) {
31
+ return value !== "0" && !value.startsWith("-");
32
+ }
33
+ /**
34
+ * Largest accepted distance from the exact value, inclusive. An absolute
35
+ * tolerance `t` accepts `|answer - value| <= t`. A relative tolerance `r`
36
+ * accepts `|answer - value| <= r * |value|`, is below one, and needs a nonzero
37
+ * value.
38
+ */
39
+ export const QuestionToleranceSchema = Schema.Struct({
40
+ kind: Schema.Literals(["absolute", "relative"]),
41
+ value: QuestionDecimalSchema.check(Schema.makeFilter(isPositiveDecimal, {
42
+ message: "Expected a positive tolerance.",
43
+ })),
44
+ }).check(Schema.makeFilter(({ kind, value }) => kind === "absolute" || value.startsWith("0."), { message: "Expected a relative tolerance below one." }));
45
+ /**
46
+ * Deterministic numeric answer key. A learner number, read by
47
+ * `readNumberAnswer` in the delivery language, matches when its exact value
48
+ * equals `value`, or lies within `tolerance` when present. A fraction such as
49
+ * `6/8` matches only when `acceptsFractions` is true.
50
+ */
51
+ export const QuestionNumberKeySchema = Schema.Struct({
52
+ acceptsFractions: Schema.Boolean,
53
+ kind: Schema.Literal("number"),
54
+ tolerance: Schema.optionalKey(QuestionToleranceSchema),
55
+ value: QuestionDecimalSchema,
56
+ }).check(Schema.makeFilter(({ tolerance, value }) => tolerance?.kind !== "relative" || value !== "0", { message: "A relative tolerance cannot measure distance from zero." }));
57
+ /**
58
+ * One accepted answer as a learner types it on one line: trimmed, non-empty,
59
+ * in Unicode NFC, with the ordinary space as its only whitespace and no
60
+ * control or invisible format character. Each key therefore has one signed
61
+ * spelling and can be typed into a single-line answer field.
62
+ */
63
+ const QuestionAcceptedTextSchema = Schema.Trimmed.check(Schema.isNonEmpty(), Schema.makeFilter((text) => !UNTYPABLE_CHARACTER_PATTERN.test(text), {
64
+ message: "Expected one typed line whose only whitespace is the ordinary space.",
65
+ }), Schema.makeFilter((text) => text === text.normalize("NFC"), {
66
+ message: "Expected NFC text.",
67
+ }));
68
+ /**
69
+ * Returns one typed answer as a learner sees it: Unicode NFC, without
70
+ * invisible format characters, trimmed, and with every whitespace character
71
+ * written as the ordinary space.
72
+ */
73
+ function visibleText(text) {
74
+ return text
75
+ .normalize("NFC")
76
+ .replace(FORMAT_CHARACTER_PATTERN, "")
77
+ .trim()
78
+ .replace(WHITESPACE_PATTERN, " ");
79
+ }
80
+ /**
81
+ * Normalizes one learner or accepted text answer exactly as graders compare
82
+ * it. `ignoreCase` first applies the locale-independent Unicode lowercase
83
+ * mapping. The answer is then read as visible text, because canonically
84
+ * equivalent spellings, invisible characters, surrounding whitespace, and the
85
+ * kind of space never change a short answer. Finally `collapseWhitespace`
86
+ * merges each run of spaces into one.
87
+ */
88
+ function normalizeTextAnswer(text, rules) {
89
+ const visible = visibleText(rules.ignoreCase ? text.toLowerCase() : text);
90
+ return rules.collapseWhitespace
91
+ ? visible.replace(SPACE_RUN_PATTERN, " ")
92
+ : visible;
93
+ }
94
+ /** Checks that no two accepted answers grade as the same normalized text. */
95
+ function hasDistinctAcceptedAnswers(key) {
96
+ const normalized = key.acceptedAnswers.map((text) => normalizeTextAnswer(text, key));
97
+ return new Set(normalized).size === normalized.length;
98
+ }
99
+ /**
100
+ * Deterministic text answer key written in the delivery language. A learner
101
+ * answer matches when it normalizes, under `ignoreCase` and
102
+ * `collapseWhitespace`, to the same text as one accepted answer. Accepted
103
+ * answers are plain text, never Markdown, so show them without rich rendering.
104
+ */
105
+ export const QuestionTextKeySchema = Schema.Struct({
106
+ acceptedAnswers: Schema.NonEmptyArray(QuestionAcceptedTextSchema),
107
+ collapseWhitespace: Schema.Boolean,
108
+ ignoreCase: Schema.Boolean,
109
+ kind: Schema.Literal("text"),
110
+ }).check(Schema.makeFilter(hasDistinctAcceptedAnswers, {
111
+ message: "Accepted answers must stay distinct after normalization.",
112
+ }));
113
+ /** Deterministic key shared by short answers and rubric final results. */
114
+ export const QuestionAnswerKeySchema = Schema.Union([
115
+ QuestionNumberKeySchema,
116
+ QuestionTextKeySchema,
117
+ ]);
118
+ /** Reads one signed ASCII number, where U+2212 is a minus sign. */
119
+ function readSigned(text) {
120
+ return BigDecimal.fromString(text.trim().replace("\u2212", "-"));
121
+ }
122
+ /** Reads one typed decimal in the notation of its delivery language. */
123
+ function readDecimal(typed, language) {
124
+ if (!NUMBER_PATTERNS[language].test(typed)) {
125
+ return Option.none();
126
+ }
127
+ return Option.map(readSigned(typed.replace(",", ".")), (numerator) => ({
128
+ denominator: ONE,
129
+ fraction: false,
130
+ numerator,
131
+ }));
132
+ }
133
+ /** Reads one typed integer fraction whose denominator is not zero. */
134
+ function readFraction(typed) {
135
+ if (!FRACTION_PATTERN.test(typed)) {
136
+ return Option.none();
137
+ }
138
+ const slash = typed.indexOf("/");
139
+ const parts = Option.all({
140
+ denominator: readSigned(typed.slice(slash + 1)),
141
+ numerator: readSigned(typed.slice(0, slash)),
142
+ });
143
+ return Option.flatMap(parts, ({ denominator, numerator }) => BigDecimal.isZero(denominator)
144
+ ? Option.none()
145
+ : Option.some({ denominator, fraction: true, numerator }));
146
+ }
147
+ /**
148
+ * Reads one typed learner number exactly, under the single grammar every
149
+ * runtime grades with. The input is first read as visible text, as for text
150
+ * answers. A decimal is an optional sign (`+`, `-`, or the minus sign U+2212)
151
+ * and ASCII digits with at most one decimal separator, a comma for `id` and
152
+ * `de` and a dot for `en`, and at least one digit, so `.5` and `5.` read in
153
+ * English. A fraction is an optionally signed integer numerator, a slash with
154
+ * optional spaces on each side, and a nonzero integer denominator. Grouping
155
+ * separators, exponents, mixed numbers such as `1 1/2`, and empty input are
156
+ * not numbers.
157
+ */
158
+ export function readNumberAnswer(input, language) {
159
+ const typed = visibleText(input);
160
+ return Option.orElse(readDecimal(typed, language), () => readFraction(typed));
161
+ }
162
+ /**
163
+ * Compares one exact learner number with a numeric key. For an answer
164
+ * `n / d`, the distance `|n - value * d|` is compared with the tolerance
165
+ * scaled by `d`, so fractions are graded exactly without division.
166
+ */
167
+ function matchesNumberKey(key, answer) {
168
+ if (answer.fraction && !key.acceptsFractions) {
169
+ return false;
170
+ }
171
+ const value = BigDecimal.fromStringUnsafe(key.value);
172
+ const distance = BigDecimal.abs(BigDecimal.subtract(answer.numerator, BigDecimal.multiply(value, answer.denominator)));
173
+ if (key.tolerance === undefined) {
174
+ return BigDecimal.isZero(distance);
175
+ }
176
+ const reach = key.tolerance.kind === "absolute"
177
+ ? answer.denominator
178
+ : BigDecimal.multiply(BigDecimal.abs(value), answer.denominator);
179
+ return BigDecimal.isLessThanOrEqualTo(distance, BigDecimal.multiply(BigDecimal.fromStringUnsafe(key.tolerance.value), reach));
180
+ }
181
+ /**
182
+ * Grades one typed learner answer against its key, as every runtime must. A
183
+ * text key matches when the answer normalizes to one accepted answer. A
184
+ * numeric key reads the answer with `readNumberAnswer` in the delivery
185
+ * language and compares its exact value, so an unreadable or empty answer
186
+ * never matches.
187
+ */
188
+ export function matchesAnswerKey(key, answer, language) {
189
+ if (key.kind === "text") {
190
+ const typed = normalizeTextAnswer(answer, key);
191
+ return key.acceptedAnswers.some((accepted) => normalizeTextAnswer(accepted, key) === typed);
192
+ }
193
+ return Option.exists(readNumberAnswer(answer, language), (number) => matchesNumberKey(key, number));
194
+ }
195
+ /** Copies accepted answers while keeping their non-empty tuple type. */
196
+ function canonicalAcceptedAnswers(answers) {
197
+ const [first, ...rest] = answers;
198
+ return [first, ...rest];
199
+ }
200
+ /** Returns one answer key in stable field order for signed canonicalizers. */
201
+ export function canonicalQuestionAnswerKey(key) {
202
+ if (key.kind === "text") {
203
+ return {
204
+ acceptedAnswers: canonicalAcceptedAnswers(key.acceptedAnswers),
205
+ collapseWhitespace: key.collapseWhitespace,
206
+ ignoreCase: key.ignoreCase,
207
+ kind: key.kind,
208
+ };
209
+ }
210
+ return {
211
+ acceptsFractions: key.acceptsFractions,
212
+ kind: key.kind,
213
+ ...(key.tolerance === undefined
214
+ ? {}
215
+ : {
216
+ tolerance: {
217
+ kind: key.tolerance.kind,
218
+ value: key.tolerance.value,
219
+ },
220
+ }),
221
+ value: key.value,
222
+ };
223
+ }
224
+ /**
225
+ * Returns the grading rules shared by every delivery language. A numeric key is
226
+ * language-neutral and stays whole; text keeps its rules but drops accepted
227
+ * answers, which each delivery language writes in its own words.
228
+ */
229
+ export function canonicalQuestionAnswerKeyStructure(key) {
230
+ if (key.kind === "text") {
231
+ return {
232
+ collapseWhitespace: key.collapseWhitespace,
233
+ ignoreCase: key.ignoreCase,
234
+ kind: key.kind,
235
+ };
236
+ }
237
+ return canonicalQuestionAnswerKey(key);
238
+ }
@@ -13,6 +13,45 @@ export declare const QuestionResponseSourceSchema: Schema.Union<readonly [Schema
13
13
  readonly isCorrect: Schema.mutableKey<Schema.Boolean>;
14
14
  readonly label: Schema.mutableKey<Schema.String>;
15
15
  }>>>>;
16
+ }>, Schema.Struct<{
17
+ readonly criteria: Schema.mutableKey<Schema.mutable<Schema.$Array<Schema.Struct<{
18
+ readonly finalAnswer: Schema.mutableKey<Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
19
+ readonly acceptsFractions: Schema.Boolean;
20
+ readonly kind: Schema.Literal<"number">;
21
+ readonly tolerance: Schema.optionalKey<Schema.Struct<{
22
+ readonly kind: Schema.Literals<readonly ["absolute", "relative"]>;
23
+ readonly value: Schema.String;
24
+ }>>;
25
+ readonly value: Schema.String;
26
+ }>, Schema.Struct<{
27
+ readonly acceptedAnswers: Schema.NonEmptyArray<Schema.Trimmed>;
28
+ readonly collapseWhitespace: Schema.Boolean;
29
+ readonly ignoreCase: Schema.Boolean;
30
+ readonly kind: Schema.Literal<"text">;
31
+ }>]>>>;
32
+ readonly label: Schema.mutableKey<Schema.$Record<Schema.Literals<readonly ["en", "id", "de"]>, Schema.String>>;
33
+ readonly levels: Schema.mutableKey<Schema.mutable<Schema.$Array<Schema.Struct<{
34
+ readonly label: Schema.mutableKey<Schema.$Record<Schema.Literals<readonly ["en", "id", "de"]>, Schema.String>>;
35
+ readonly points: Schema.mutableKey<Schema.Int>;
36
+ }>>>>;
37
+ }>>>>;
38
+ readonly kind: Schema.mutableKey<Schema.Literal<"rubric">>;
39
+ }>, Schema.Struct<{
40
+ readonly key: Schema.mutableKey<Schema.Union<readonly [Schema.Struct<{
41
+ readonly acceptsFractions: Schema.Boolean;
42
+ readonly kind: Schema.Literal<"number">;
43
+ readonly tolerance: Schema.optionalKey<Schema.Struct<{
44
+ readonly kind: Schema.Literals<readonly ["absolute", "relative"]>;
45
+ readonly value: Schema.String;
46
+ }>>;
47
+ readonly value: Schema.String;
48
+ }>, Schema.Struct<{
49
+ readonly acceptedAnswers: Schema.NonEmptyArray<Schema.Trimmed>;
50
+ readonly collapseWhitespace: Schema.Boolean;
51
+ readonly ignoreCase: Schema.Boolean;
52
+ readonly kind: Schema.Literal<"text">;
53
+ }>]>>;
54
+ readonly kind: Schema.mutableKey<Schema.Literal<"short-answer">>;
16
55
  }>, Schema.Struct<{
17
56
  readonly kind: Schema.mutableKey<Schema.Literal<"single-choice">>;
18
57
  readonly options: Schema.mutableKey<Schema.mutable<Schema.$Array<Schema.Struct<{
@@ -28,13 +67,17 @@ export declare const QuestionBlueprintSchema: Schema.Struct<{
28
67
  readonly topic: Schema.String;
29
68
  }>;
30
69
  export type QuestionBlueprint = typeof QuestionBlueprintSchema.Type;
31
- /** Complete source-owned item, including optional shared-stimulus identity. */
70
+ /**
71
+ * Complete source-owned item with optional shared-stimulus identity and points.
72
+ * Points appear only above the default single point and never on a rubric.
73
+ */
32
74
  export declare const QuestionItemSchema: Schema.Struct<{
33
75
  readonly blueprint: Schema.optionalKey<Schema.Struct<{
34
76
  readonly cognitiveLevel: Schema.String;
35
77
  readonly contentDomain: Schema.String;
36
78
  readonly topic: Schema.String;
37
79
  }>>;
80
+ readonly points: Schema.optionalKey<Schema.Int>;
38
81
  readonly responses: Schema.$Record<Schema.Literals<readonly ["en", "id", "de"]>, Schema.optional<Schema.Union<readonly [Schema.Struct<{
39
82
  readonly categories: Schema.mutableKey<Schema.mutable<Schema.$Array<Schema.String>>>;
40
83
  readonly kind: Schema.mutableKey<Schema.Literal<"category">>;
@@ -48,6 +91,45 @@ export declare const QuestionItemSchema: Schema.Struct<{
48
91
  readonly isCorrect: Schema.mutableKey<Schema.Boolean>;
49
92
  readonly label: Schema.mutableKey<Schema.String>;
50
93
  }>>>>;
94
+ }>, Schema.Struct<{
95
+ readonly criteria: Schema.mutableKey<Schema.mutable<Schema.$Array<Schema.Struct<{
96
+ readonly finalAnswer: Schema.mutableKey<Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
97
+ readonly acceptsFractions: Schema.Boolean;
98
+ readonly kind: Schema.Literal<"number">;
99
+ readonly tolerance: Schema.optionalKey<Schema.Struct<{
100
+ readonly kind: Schema.Literals<readonly ["absolute", "relative"]>;
101
+ readonly value: Schema.String;
102
+ }>>;
103
+ readonly value: Schema.String;
104
+ }>, Schema.Struct<{
105
+ readonly acceptedAnswers: Schema.NonEmptyArray<Schema.Trimmed>;
106
+ readonly collapseWhitespace: Schema.Boolean;
107
+ readonly ignoreCase: Schema.Boolean;
108
+ readonly kind: Schema.Literal<"text">;
109
+ }>]>>>;
110
+ readonly label: Schema.mutableKey<Schema.$Record<Schema.Literals<readonly ["en", "id", "de"]>, Schema.String>>;
111
+ readonly levels: Schema.mutableKey<Schema.mutable<Schema.$Array<Schema.Struct<{
112
+ readonly label: Schema.mutableKey<Schema.$Record<Schema.Literals<readonly ["en", "id", "de"]>, Schema.String>>;
113
+ readonly points: Schema.mutableKey<Schema.Int>;
114
+ }>>>>;
115
+ }>>>>;
116
+ readonly kind: Schema.mutableKey<Schema.Literal<"rubric">>;
117
+ }>, Schema.Struct<{
118
+ readonly key: Schema.mutableKey<Schema.Union<readonly [Schema.Struct<{
119
+ readonly acceptsFractions: Schema.Boolean;
120
+ readonly kind: Schema.Literal<"number">;
121
+ readonly tolerance: Schema.optionalKey<Schema.Struct<{
122
+ readonly kind: Schema.Literals<readonly ["absolute", "relative"]>;
123
+ readonly value: Schema.String;
124
+ }>>;
125
+ readonly value: Schema.String;
126
+ }>, Schema.Struct<{
127
+ readonly acceptedAnswers: Schema.NonEmptyArray<Schema.Trimmed>;
128
+ readonly collapseWhitespace: Schema.Boolean;
129
+ readonly ignoreCase: Schema.Boolean;
130
+ readonly kind: Schema.Literal<"text">;
131
+ }>]>>;
132
+ readonly kind: Schema.mutableKey<Schema.Literal<"short-answer">>;
51
133
  }>, Schema.Struct<{
52
134
  readonly kind: Schema.mutableKey<Schema.Literal<"single-choice">>;
53
135
  readonly options: Schema.mutableKey<Schema.mutable<Schema.$Array<Schema.Struct<{
@@ -77,6 +159,7 @@ export declare const questionResponseFor: (item: {
77
159
  readonly contentDomain: string;
78
160
  readonly topic: string;
79
161
  };
162
+ readonly points?: number;
80
163
  readonly responses: {
81
164
  readonly de?: {
82
165
  categories: string[];
@@ -91,6 +174,53 @@ export declare const questionResponseFor: (item: {
91
174
  isCorrect: boolean;
92
175
  label: string;
93
176
  }[];
177
+ } | {
178
+ criteria: {
179
+ finalAnswer?: {
180
+ readonly acceptsFractions: boolean;
181
+ readonly kind: "number";
182
+ readonly tolerance?: {
183
+ readonly kind: "absolute" | "relative";
184
+ readonly value: string;
185
+ };
186
+ readonly value: string;
187
+ } | {
188
+ readonly acceptedAnswers: readonly [string, ...string[]];
189
+ readonly collapseWhitespace: boolean;
190
+ readonly ignoreCase: boolean;
191
+ readonly kind: "text";
192
+ };
193
+ label: {
194
+ readonly de: string;
195
+ readonly en: string;
196
+ readonly id: string;
197
+ };
198
+ levels: {
199
+ label: {
200
+ readonly de: string;
201
+ readonly en: string;
202
+ readonly id: string;
203
+ };
204
+ points: number;
205
+ }[];
206
+ }[];
207
+ kind: "rubric";
208
+ } | {
209
+ key: {
210
+ readonly acceptsFractions: boolean;
211
+ readonly kind: "number";
212
+ readonly tolerance?: {
213
+ readonly kind: "absolute" | "relative";
214
+ readonly value: string;
215
+ };
216
+ readonly value: string;
217
+ } | {
218
+ readonly acceptedAnswers: readonly [string, ...string[]];
219
+ readonly collapseWhitespace: boolean;
220
+ readonly ignoreCase: boolean;
221
+ readonly kind: "text";
222
+ };
223
+ kind: "short-answer";
94
224
  } | {
95
225
  kind: "single-choice";
96
226
  options: {
@@ -111,6 +241,53 @@ export declare const questionResponseFor: (item: {
111
241
  isCorrect: boolean;
112
242
  label: string;
113
243
  }[];
244
+ } | {
245
+ criteria: {
246
+ finalAnswer?: {
247
+ readonly acceptsFractions: boolean;
248
+ readonly kind: "number";
249
+ readonly tolerance?: {
250
+ readonly kind: "absolute" | "relative";
251
+ readonly value: string;
252
+ };
253
+ readonly value: string;
254
+ } | {
255
+ readonly acceptedAnswers: readonly [string, ...string[]];
256
+ readonly collapseWhitespace: boolean;
257
+ readonly ignoreCase: boolean;
258
+ readonly kind: "text";
259
+ };
260
+ label: {
261
+ readonly de: string;
262
+ readonly en: string;
263
+ readonly id: string;
264
+ };
265
+ levels: {
266
+ label: {
267
+ readonly de: string;
268
+ readonly en: string;
269
+ readonly id: string;
270
+ };
271
+ points: number;
272
+ }[];
273
+ }[];
274
+ kind: "rubric";
275
+ } | {
276
+ key: {
277
+ readonly acceptsFractions: boolean;
278
+ readonly kind: "number";
279
+ readonly tolerance?: {
280
+ readonly kind: "absolute" | "relative";
281
+ readonly value: string;
282
+ };
283
+ readonly value: string;
284
+ } | {
285
+ readonly acceptedAnswers: readonly [string, ...string[]];
286
+ readonly collapseWhitespace: boolean;
287
+ readonly ignoreCase: boolean;
288
+ readonly kind: "text";
289
+ };
290
+ kind: "short-answer";
114
291
  } | {
115
292
  kind: "single-choice";
116
293
  options: {
@@ -131,6 +308,53 @@ export declare const questionResponseFor: (item: {
131
308
  isCorrect: boolean;
132
309
  label: string;
133
310
  }[];
311
+ } | {
312
+ criteria: {
313
+ finalAnswer?: {
314
+ readonly acceptsFractions: boolean;
315
+ readonly kind: "number";
316
+ readonly tolerance?: {
317
+ readonly kind: "absolute" | "relative";
318
+ readonly value: string;
319
+ };
320
+ readonly value: string;
321
+ } | {
322
+ readonly acceptedAnswers: readonly [string, ...string[]];
323
+ readonly collapseWhitespace: boolean;
324
+ readonly ignoreCase: boolean;
325
+ readonly kind: "text";
326
+ };
327
+ label: {
328
+ readonly de: string;
329
+ readonly en: string;
330
+ readonly id: string;
331
+ };
332
+ levels: {
333
+ label: {
334
+ readonly de: string;
335
+ readonly en: string;
336
+ readonly id: string;
337
+ };
338
+ points: number;
339
+ }[];
340
+ }[];
341
+ kind: "rubric";
342
+ } | {
343
+ key: {
344
+ readonly acceptsFractions: boolean;
345
+ readonly kind: "number";
346
+ readonly tolerance?: {
347
+ readonly kind: "absolute" | "relative";
348
+ readonly value: string;
349
+ };
350
+ readonly value: string;
351
+ } | {
352
+ readonly acceptedAnswers: readonly [string, ...string[]];
353
+ readonly collapseWhitespace: boolean;
354
+ readonly ignoreCase: boolean;
355
+ readonly kind: "text";
356
+ };
357
+ kind: "short-answer";
134
358
  } | {
135
359
  kind: "single-choice";
136
360
  options: {
@@ -169,5 +393,56 @@ export declare const questionResponseFor: (item: {
169
393
  readonly optionKey: string;
170
394
  readonly order: number;
171
395
  }[];
396
+ } | {
397
+ readonly criteria: readonly {
398
+ readonly criterionKey: string;
399
+ readonly finalAnswer?: {
400
+ readonly acceptsFractions: boolean;
401
+ readonly kind: "number";
402
+ readonly tolerance?: {
403
+ readonly kind: "absolute" | "relative";
404
+ readonly value: string;
405
+ };
406
+ readonly value: string;
407
+ } | {
408
+ readonly acceptedAnswers: readonly [string, ...string[]];
409
+ readonly collapseWhitespace: boolean;
410
+ readonly ignoreCase: boolean;
411
+ readonly kind: "text";
412
+ };
413
+ readonly order: number;
414
+ readonly label: {
415
+ readonly de: string;
416
+ readonly en: string;
417
+ readonly id: string;
418
+ };
419
+ readonly levels: readonly {
420
+ readonly levelKey: string;
421
+ readonly order: number;
422
+ readonly points: number;
423
+ readonly label: {
424
+ readonly de: string;
425
+ readonly en: string;
426
+ readonly id: string;
427
+ };
428
+ }[];
429
+ }[];
430
+ readonly kind: "rubric";
431
+ } | {
432
+ readonly key: {
433
+ readonly acceptsFractions: boolean;
434
+ readonly kind: "number";
435
+ readonly tolerance?: {
436
+ readonly kind: "absolute" | "relative";
437
+ readonly value: string;
438
+ };
439
+ readonly value: string;
440
+ } | {
441
+ readonly acceptedAnswers: readonly [string, ...string[]];
442
+ readonly collapseWhitespace: boolean;
443
+ readonly ignoreCase: boolean;
444
+ readonly kind: "text";
445
+ };
446
+ readonly kind: "short-answer";
172
447
  }, QuestionResponseLocaleMissingError, never>;
173
448
  export {};