@examplary/schemas 1.12.0 → 1.13.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.
@@ -4,14 +4,32 @@ exports.QuestionScoringSchema = exports.RubricType = exports.TopLevelScoringCrit
4
4
  var zod_1 = require("zod");
5
5
  exports.ScoringCriterionSchema = zod_1.z.object({
6
6
  id: zod_1.z.string(),
7
- title: zod_1.z.string().nullish(),
8
- description: zod_1.z.string().nullish(),
9
- points: zod_1.z.number().nullish(),
10
- minPoints: zod_1.z.number().nullish(),
11
- maxPoints: zod_1.z.number().nullish(),
7
+ title: zod_1.z
8
+ .string()
9
+ .nullish()
10
+ .describe("The title of the scoring criterion or level. Only applies to analytical levels and holistic criteria."),
11
+ description: zod_1.z
12
+ .string()
13
+ .nullish()
14
+ .describe("The description of the scoring criterion or level. For analytical levels, this describes the specific requirements to earn the points for that level. For holistic criteria, this describes the overall requirement to earn the points for that criterion."),
15
+ points: zod_1.z
16
+ .number()
17
+ .nullish()
18
+ .describe("The default amount of points to assign if this criterion or level is selected."),
19
+ minPoints: zod_1.z
20
+ .number()
21
+ .nullish()
22
+ .describe("The minimum amount of points that can be assigned if this criterion or level is selected."),
23
+ maxPoints: zod_1.z
24
+ .number()
25
+ .nullish()
26
+ .describe("The maximum amount of points that can be assigned if this criterion or level is selected."),
12
27
  });
13
28
  exports.TopLevelScoringCriterionSchema = exports.ScoringCriterionSchema.extend({
14
- levels: zod_1.z.array(exports.ScoringCriterionSchema).nullish(),
29
+ levels: zod_1.z
30
+ .array(exports.ScoringCriterionSchema)
31
+ .nullish()
32
+ .describe("The levels of a analytical rubric criterion. Each level represents a different point value and description for the same criterion."),
15
33
  });
16
34
  var RubricType;
17
35
  (function (RubricType) {
@@ -21,10 +39,28 @@ var RubricType;
21
39
  RubricType["ExactValues"] = "exact-values";
22
40
  })(RubricType || (exports.RubricType = RubricType = {}));
23
41
  exports.QuestionScoringSchema = zod_1.z.object({
24
- rubricType: zod_1.z.enum(RubricType).nullish(),
25
- criteria: zod_1.z.array(exports.TopLevelScoringCriterionSchema).nullish(),
26
- exactValuesCaseInsensitive: zod_1.z.boolean().nullish(),
27
- guidance: zod_1.z.string().nullish(),
28
- modelAnswer: zod_1.z.string().nullish(),
29
- templateId: zod_1.z.string().nullish(),
42
+ rubricType: zod_1.z
43
+ .enum(RubricType)
44
+ .nullish()
45
+ .describe("The type of rubric. Different rubric types have different shapes."),
46
+ criteria: zod_1.z
47
+ .array(exports.TopLevelScoringCriterionSchema)
48
+ .nullish()
49
+ .describe("The criteria for scoring the question. For 'simple' rubric type, criteria have no levels, and their points stack (total = sum of points for all criteria that apply). For 'analytical' rubric type, there should be at least one criteria, with levels. For each criteria, a matching level is picked. For 'holistic' rubric type, there should be multiple criteria, without levels (score = single selected criteria). For 'exact-values' rubric type, each criteria represents a specific value that must be matched exactly."),
50
+ exactValuesCaseInsensitive: zod_1.z
51
+ .boolean()
52
+ .nullish()
53
+ .describe("Whether exact values matching should be case insensitive. Only applicable for 'exact-values' rubric type."),
54
+ guidance: zod_1.z
55
+ .string()
56
+ .nullish()
57
+ .describe("Optional additional grading guidance text."),
58
+ modelAnswer: zod_1.z
59
+ .string()
60
+ .nullish()
61
+ .describe("Optional example model answer text to show to graders."),
62
+ templateId: zod_1.z
63
+ .string()
64
+ .nullish()
65
+ .describe("The ID of the scoring template applied, if any."),
30
66
  });
@@ -29,15 +29,10 @@ export declare const QuestionSchema: z.ZodObject<{
29
29
  templateId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30
30
  }, z.core.$strip>>>;
31
31
  tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
32
+ externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
32
33
  metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>>;
33
34
  v: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
34
35
  questionBankItemId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
35
36
  traceIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
36
- /** @deprecated Replaced with `scoring` object */
37
- scoringCriteria: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
38
- id: z.ZodOptional<z.ZodString>;
39
- description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
40
- points: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
41
- }, z.core.$strip>>>>;
42
37
  }, z.core.$loose>;
43
38
  export type Question = z.infer<typeof QuestionSchema>;
@@ -2,25 +2,45 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.QuestionSchema = void 0;
4
4
  var zod_1 = require("zod");
5
- var legacy_question_scoring_criteria_1 = require("./legacy-question-scoring-criteria");
6
5
  var question_scoring_1 = require("./question-scoring");
7
6
  var scalar_1 = require("../common/scalar");
8
7
  exports.QuestionSchema = zod_1.z.looseObject({
9
- id: zod_1.z.string(),
10
- type: zod_1.z.string(),
11
- title: zod_1.z.string().nullish(),
12
- description: zod_1.z.string().nullish(),
13
- settings: zod_1.z.looseObject({}),
8
+ id: zod_1.z.string().describe("Question ID"),
9
+ type: zod_1.z.string().describe("ID of the question type"),
10
+ title: zod_1.z.string().nullish().describe("Title for the question (stem)"),
11
+ description: zod_1.z
12
+ .string()
13
+ .nullish()
14
+ .describe("Optional description for the question"),
15
+ settings: zod_1.z
16
+ .looseObject({})
17
+ .describe("Settings for the question, often specific to the question type"),
14
18
  // Scoring
15
- scoring: question_scoring_1.QuestionScoringSchema.nullish(),
19
+ scoring: question_scoring_1.QuestionScoringSchema.nullish().describe("Scoring configuration for the question"),
16
20
  // Tags and metadata
17
- tags: zod_1.z.array(zod_1.z.string()).nullish(),
18
- metadata: zod_1.z.record(zod_1.z.string(), scalar_1.ScalarSchema).nullish(),
21
+ tags: zod_1.z
22
+ .array(zod_1.z.string())
23
+ .nullish()
24
+ .describe("Tags associated with the question for categorization and search"),
25
+ externalId: zod_1.z
26
+ .string()
27
+ .nullish()
28
+ .describe("Optional external ID for the question, used to link to external systems"),
29
+ metadata: zod_1.z
30
+ .record(zod_1.z.string(), scalar_1.ScalarSchema)
31
+ .nullish()
32
+ .describe("Metadata for the question"),
19
33
  // Internal tracking
20
- v: zod_1.z.number().nullish(), // version number, incremented when question is edited
21
- questionBankItemId: zod_1.z.string().nullish(),
22
- traceIds: zod_1.z.array(zod_1.z.string()).nullish(),
23
- // Deprecated
24
- /** @deprecated Replaced with `scoring` object */
25
- scoringCriteria: legacy_question_scoring_criteria_1.LegacyQuestionScoringCriteriaSchema.nullish(),
34
+ v: zod_1.z
35
+ .number()
36
+ .nullish()
37
+ .describe("Version number, incremented when question is edited"),
38
+ questionBankItemId: zod_1.z
39
+ .string()
40
+ .nullish()
41
+ .describe("ID of the question in the question bank"),
42
+ traceIds: zod_1.z
43
+ .array(zod_1.z.string())
44
+ .nullish()
45
+ .describe("Trace IDs for internal tracking of AI generation processes"),
26
46
  });
@@ -3,6 +3,7 @@
3
3
  "type": "object",
4
4
  "properties": {
5
5
  "rubricType": {
6
+ "description": "The type of rubric. Different rubric types have different shapes.",
6
7
  "anyOf": [
7
8
  {
8
9
  "type": "string",
@@ -19,6 +20,7 @@
19
20
  ]
20
21
  },
21
22
  "criteria": {
23
+ "description": "The criteria for scoring the question. For 'simple' rubric type, criteria have no levels, and their points stack (total = sum of points for all criteria that apply). For 'analytical' rubric type, there should be at least one criteria, with levels. For each criteria, a matching level is picked. For 'holistic' rubric type, there should be multiple criteria, without levels (score = single selected criteria). For 'exact-values' rubric type, each criteria represents a specific value that must be matched exactly.",
22
24
  "anyOf": [
23
25
  {
24
26
  "type": "array",
@@ -29,6 +31,7 @@
29
31
  "type": "string"
30
32
  },
31
33
  "title": {
34
+ "description": "The title of the scoring criterion or level. Only applies to analytical levels and holistic criteria.",
32
35
  "anyOf": [
33
36
  {
34
37
  "type": "string"
@@ -39,6 +42,7 @@
39
42
  ]
40
43
  },
41
44
  "description": {
45
+ "description": "The description of the scoring criterion or level. For analytical levels, this describes the specific requirements to earn the points for that level. For holistic criteria, this describes the overall requirement to earn the points for that criterion.",
42
46
  "anyOf": [
43
47
  {
44
48
  "type": "string"
@@ -49,6 +53,7 @@
49
53
  ]
50
54
  },
51
55
  "points": {
56
+ "description": "The default amount of points to assign if this criterion or level is selected.",
52
57
  "anyOf": [
53
58
  {
54
59
  "type": "number"
@@ -59,6 +64,7 @@
59
64
  ]
60
65
  },
61
66
  "minPoints": {
67
+ "description": "The minimum amount of points that can be assigned if this criterion or level is selected.",
62
68
  "anyOf": [
63
69
  {
64
70
  "type": "number"
@@ -69,6 +75,7 @@
69
75
  ]
70
76
  },
71
77
  "maxPoints": {
78
+ "description": "The maximum amount of points that can be assigned if this criterion or level is selected.",
72
79
  "anyOf": [
73
80
  {
74
81
  "type": "number"
@@ -79,6 +86,7 @@
79
86
  ]
80
87
  },
81
88
  "levels": {
89
+ "description": "The levels of a analytical rubric criterion. Each level represents a different point value and description for the same criterion.",
82
90
  "anyOf": [
83
91
  {
84
92
  "type": "array",
@@ -89,6 +97,7 @@
89
97
  "type": "string"
90
98
  },
91
99
  "title": {
100
+ "description": "The title of the scoring criterion or level. Only applies to analytical levels and holistic criteria.",
92
101
  "anyOf": [
93
102
  {
94
103
  "type": "string"
@@ -99,6 +108,7 @@
99
108
  ]
100
109
  },
101
110
  "description": {
111
+ "description": "The description of the scoring criterion or level. For analytical levels, this describes the specific requirements to earn the points for that level. For holistic criteria, this describes the overall requirement to earn the points for that criterion.",
102
112
  "anyOf": [
103
113
  {
104
114
  "type": "string"
@@ -109,6 +119,7 @@
109
119
  ]
110
120
  },
111
121
  "points": {
122
+ "description": "The default amount of points to assign if this criterion or level is selected.",
112
123
  "anyOf": [
113
124
  {
114
125
  "type": "number"
@@ -119,6 +130,7 @@
119
130
  ]
120
131
  },
121
132
  "minPoints": {
133
+ "description": "The minimum amount of points that can be assigned if this criterion or level is selected.",
122
134
  "anyOf": [
123
135
  {
124
136
  "type": "number"
@@ -129,6 +141,7 @@
129
141
  ]
130
142
  },
131
143
  "maxPoints": {
144
+ "description": "The maximum amount of points that can be assigned if this criterion or level is selected.",
132
145
  "anyOf": [
133
146
  {
134
147
  "type": "number"
@@ -163,6 +176,7 @@
163
176
  ]
164
177
  },
165
178
  "exactValuesCaseInsensitive": {
179
+ "description": "Whether exact values matching should be case insensitive. Only applicable for 'exact-values' rubric type.",
166
180
  "anyOf": [
167
181
  {
168
182
  "type": "boolean"
@@ -173,6 +187,7 @@
173
187
  ]
174
188
  },
175
189
  "guidance": {
190
+ "description": "Optional additional grading guidance text.",
176
191
  "anyOf": [
177
192
  {
178
193
  "type": "string"
@@ -183,6 +198,7 @@
183
198
  ]
184
199
  },
185
200
  "modelAnswer": {
201
+ "description": "Optional example model answer text to show to graders.",
186
202
  "anyOf": [
187
203
  {
188
204
  "type": "string"
@@ -193,6 +209,7 @@
193
209
  ]
194
210
  },
195
211
  "templateId": {
212
+ "description": "The ID of the scoring template applied, if any.",
196
213
  "anyOf": [
197
214
  {
198
215
  "type": "string"
@@ -3,12 +3,15 @@
3
3
  "type": "object",
4
4
  "properties": {
5
5
  "id": {
6
- "type": "string"
6
+ "type": "string",
7
+ "description": "Question ID"
7
8
  },
8
9
  "type": {
9
- "type": "string"
10
+ "type": "string",
11
+ "description": "ID of the question type"
10
12
  },
11
13
  "title": {
14
+ "description": "Title for the question (stem)",
12
15
  "anyOf": [
13
16
  {
14
17
  "type": "string"
@@ -19,6 +22,7 @@
19
22
  ]
20
23
  },
21
24
  "description": {
25
+ "description": "Optional description for the question",
22
26
  "anyOf": [
23
27
  {
24
28
  "type": "string"
@@ -31,14 +35,17 @@
31
35
  "settings": {
32
36
  "type": "object",
33
37
  "properties": {},
34
- "additionalProperties": {}
38
+ "additionalProperties": {},
39
+ "description": "Settings for the question, often specific to the question type"
35
40
  },
36
41
  "scoring": {
42
+ "description": "Scoring configuration for the question",
37
43
  "anyOf": [
38
44
  {
39
45
  "type": "object",
40
46
  "properties": {
41
47
  "rubricType": {
48
+ "description": "The type of rubric. Different rubric types have different shapes.",
42
49
  "anyOf": [
43
50
  {
44
51
  "type": "string",
@@ -55,6 +62,7 @@
55
62
  ]
56
63
  },
57
64
  "criteria": {
65
+ "description": "The criteria for scoring the question. For 'simple' rubric type, criteria have no levels, and their points stack (total = sum of points for all criteria that apply). For 'analytical' rubric type, there should be at least one criteria, with levels. For each criteria, a matching level is picked. For 'holistic' rubric type, there should be multiple criteria, without levels (score = single selected criteria). For 'exact-values' rubric type, each criteria represents a specific value that must be matched exactly.",
58
66
  "anyOf": [
59
67
  {
60
68
  "type": "array",
@@ -65,6 +73,7 @@
65
73
  "type": "string"
66
74
  },
67
75
  "title": {
76
+ "description": "The title of the scoring criterion or level. Only applies to analytical levels and holistic criteria.",
68
77
  "anyOf": [
69
78
  {
70
79
  "type": "string"
@@ -75,6 +84,7 @@
75
84
  ]
76
85
  },
77
86
  "description": {
87
+ "description": "The description of the scoring criterion or level. For analytical levels, this describes the specific requirements to earn the points for that level. For holistic criteria, this describes the overall requirement to earn the points for that criterion.",
78
88
  "anyOf": [
79
89
  {
80
90
  "type": "string"
@@ -85,6 +95,7 @@
85
95
  ]
86
96
  },
87
97
  "points": {
98
+ "description": "The default amount of points to assign if this criterion or level is selected.",
88
99
  "anyOf": [
89
100
  {
90
101
  "type": "number"
@@ -95,6 +106,7 @@
95
106
  ]
96
107
  },
97
108
  "minPoints": {
109
+ "description": "The minimum amount of points that can be assigned if this criterion or level is selected.",
98
110
  "anyOf": [
99
111
  {
100
112
  "type": "number"
@@ -105,6 +117,7 @@
105
117
  ]
106
118
  },
107
119
  "maxPoints": {
120
+ "description": "The maximum amount of points that can be assigned if this criterion or level is selected.",
108
121
  "anyOf": [
109
122
  {
110
123
  "type": "number"
@@ -115,6 +128,7 @@
115
128
  ]
116
129
  },
117
130
  "levels": {
131
+ "description": "The levels of a analytical rubric criterion. Each level represents a different point value and description for the same criterion.",
118
132
  "anyOf": [
119
133
  {
120
134
  "type": "array",
@@ -125,6 +139,7 @@
125
139
  "type": "string"
126
140
  },
127
141
  "title": {
142
+ "description": "The title of the scoring criterion or level. Only applies to analytical levels and holistic criteria.",
128
143
  "anyOf": [
129
144
  {
130
145
  "type": "string"
@@ -135,6 +150,7 @@
135
150
  ]
136
151
  },
137
152
  "description": {
153
+ "description": "The description of the scoring criterion or level. For analytical levels, this describes the specific requirements to earn the points for that level. For holistic criteria, this describes the overall requirement to earn the points for that criterion.",
138
154
  "anyOf": [
139
155
  {
140
156
  "type": "string"
@@ -145,6 +161,7 @@
145
161
  ]
146
162
  },
147
163
  "points": {
164
+ "description": "The default amount of points to assign if this criterion or level is selected.",
148
165
  "anyOf": [
149
166
  {
150
167
  "type": "number"
@@ -155,6 +172,7 @@
155
172
  ]
156
173
  },
157
174
  "minPoints": {
175
+ "description": "The minimum amount of points that can be assigned if this criterion or level is selected.",
158
176
  "anyOf": [
159
177
  {
160
178
  "type": "number"
@@ -165,6 +183,7 @@
165
183
  ]
166
184
  },
167
185
  "maxPoints": {
186
+ "description": "The maximum amount of points that can be assigned if this criterion or level is selected.",
168
187
  "anyOf": [
169
188
  {
170
189
  "type": "number"
@@ -199,6 +218,7 @@
199
218
  ]
200
219
  },
201
220
  "exactValuesCaseInsensitive": {
221
+ "description": "Whether exact values matching should be case insensitive. Only applicable for 'exact-values' rubric type.",
202
222
  "anyOf": [
203
223
  {
204
224
  "type": "boolean"
@@ -209,6 +229,7 @@
209
229
  ]
210
230
  },
211
231
  "guidance": {
232
+ "description": "Optional additional grading guidance text.",
212
233
  "anyOf": [
213
234
  {
214
235
  "type": "string"
@@ -219,6 +240,7 @@
219
240
  ]
220
241
  },
221
242
  "modelAnswer": {
243
+ "description": "Optional example model answer text to show to graders.",
222
244
  "anyOf": [
223
245
  {
224
246
  "type": "string"
@@ -229,6 +251,7 @@
229
251
  ]
230
252
  },
231
253
  "templateId": {
254
+ "description": "The ID of the scoring template applied, if any.",
232
255
  "anyOf": [
233
256
  {
234
257
  "type": "string"
@@ -247,6 +270,7 @@
247
270
  ]
248
271
  },
249
272
  "tags": {
273
+ "description": "Tags associated with the question for categorization and search",
250
274
  "anyOf": [
251
275
  {
252
276
  "type": "array",
@@ -259,7 +283,19 @@
259
283
  }
260
284
  ]
261
285
  },
286
+ "externalId": {
287
+ "description": "Optional external ID for the question, used to link to external systems",
288
+ "anyOf": [
289
+ {
290
+ "type": "string"
291
+ },
292
+ {
293
+ "type": "null"
294
+ }
295
+ ]
296
+ },
262
297
  "metadata": {
298
+ "description": "Metadata for the question",
263
299
  "anyOf": [
264
300
  {
265
301
  "type": "object",
@@ -289,6 +325,7 @@
289
325
  ]
290
326
  },
291
327
  "v": {
328
+ "description": "Version number, incremented when question is edited",
292
329
  "anyOf": [
293
330
  {
294
331
  "type": "number"
@@ -299,6 +336,7 @@
299
336
  ]
300
337
  },
301
338
  "questionBankItemId": {
339
+ "description": "ID of the question in the question bank",
302
340
  "anyOf": [
303
341
  {
304
342
  "type": "string"
@@ -309,6 +347,7 @@
309
347
  ]
310
348
  },
311
349
  "traceIds": {
350
+ "description": "Trace IDs for internal tracking of AI generation processes",
312
351
  "anyOf": [
313
352
  {
314
353
  "type": "array",
@@ -320,49 +359,6 @@
320
359
  "type": "null"
321
360
  }
322
361
  ]
323
- },
324
- "scoringCriteria": {
325
- "anyOf": [
326
- {
327
- "type": "array",
328
- "items": {
329
- "type": "object",
330
- "properties": {
331
- "id": {
332
- "type": "string"
333
- },
334
- "description": {
335
- "anyOf": [
336
- {
337
- "type": "string"
338
- },
339
- {
340
- "type": "null"
341
- }
342
- ]
343
- },
344
- "points": {
345
- "default": 1,
346
- "anyOf": [
347
- {
348
- "type": "number"
349
- },
350
- {
351
- "type": "null"
352
- }
353
- ]
354
- }
355
- },
356
- "required": [
357
- "points"
358
- ],
359
- "additionalProperties": false
360
- }
361
- },
362
- {
363
- "type": "null"
364
- }
365
- ]
366
362
  }
367
363
  },
368
364
  "required": [
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@examplary/schemas",
3
3
  "packageManager": "yarn@4.8.1",
4
- "version": "1.12.0",
4
+ "version": "1.13.0",
5
5
  "description": "Schemas for the Examplary platform.",
6
6
  "scripts": {
7
7
  "build:schema": "tsx ./scripts/build.ts",
@@ -1,9 +0,0 @@
1
- import { z } from "zod";
2
- /** @deprecated Replaced with `scoring` object */
3
- export declare const LegacyQuestionScoringCriteriaSchema: z.ZodArray<z.ZodObject<{
4
- id: z.ZodOptional<z.ZodString>;
5
- description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6
- points: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
7
- }, z.core.$strip>>;
8
- /** @deprecated Replaced with `scoring` object */
9
- export type LegacyQuestionScoringCriteria = z.infer<typeof LegacyQuestionScoringCriteriaSchema>;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LegacyQuestionScoringCriteriaSchema = void 0;
4
- var zod_1 = require("zod");
5
- /** @deprecated Replaced with `scoring` object */
6
- exports.LegacyQuestionScoringCriteriaSchema = zod_1.z.array(zod_1.z.object({
7
- id: zod_1.z.string().optional(),
8
- description: zod_1.z.string().nullish(),
9
- points: zod_1.z.number().nullish().default(1),
10
- }));