@examplary/schemas 1.12.0 → 1.14.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.
@@ -1,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ScalarSchema = void 0;
4
- var zod_1 = require("zod");
5
- exports.ScalarSchema = zod_1.z.union([
6
- zod_1.z.string(),
7
- zod_1.z.number(),
8
- zod_1.z.boolean(),
9
- zod_1.z.null(),
1
+ import { z } from "zod";
2
+ export const ScalarSchema = z.union([
3
+ z.string(),
4
+ z.number(),
5
+ z.boolean(),
6
+ z.null(),
10
7
  ]);
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Translatable = void 0;
4
- var zod_1 = require("zod");
1
+ import { z } from "zod";
5
2
  // Translatable type - can be a simple string or translation object
6
- exports.Translatable = zod_1.z.union([
7
- zod_1.z.string().describe("Simple string value"),
8
- zod_1.z
9
- .record(zod_1.z.string().regex(/^[a-z]{2}(-[A-Z]{2})?$/, "Language code format"), zod_1.z.string())
10
- .refine(function (obj) { return Object.keys(obj).length >= 1; }, "Translation object must have at least one property")
3
+ export const Translatable = z.union([
4
+ z.string().describe("Simple string value"),
5
+ z
6
+ .record(z.string().regex(/^[a-z]{2}(-[A-Z]{2})?$/, "Language code format"), z.string())
7
+ .refine((obj) => Object.keys(obj).length >= 1, "Translation object must have at least one property")
11
8
  .describe("Translation object with language codes as keys"),
12
9
  ]);
package/dist/index.js CHANGED
@@ -1,23 +1,7 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
1
  // Question types
18
- __exportStar(require("./question-type"), exports);
2
+ export * from "./question-type";
19
3
  // Questions
20
- __exportStar(require("./question"), exports);
4
+ export * from "./question";
21
5
  // Common
22
- __exportStar(require("./common/scalar"), exports);
23
- __exportStar(require("./common/translatable"), exports);
6
+ export * from "./common/scalar";
7
+ export * from "./common/translatable";
@@ -1,18 +1,2 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./question"), exports);
18
- __exportStar(require("./question-scoring"), exports);
1
+ export * from "./question";
2
+ export * from "./question-scoring";
@@ -1,30 +1,63 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QuestionScoringSchema = exports.RubricType = exports.TopLevelScoringCriterionSchema = exports.ScoringCriterionSchema = void 0;
4
- var zod_1 = require("zod");
5
- exports.ScoringCriterionSchema = zod_1.z.object({
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(),
1
+ import { z } from "zod";
2
+ export const ScoringCriterionSchema = z.object({
3
+ id: z.string(),
4
+ title: z
5
+ .string()
6
+ .nullish()
7
+ .describe("The title of the scoring criterion or level. Only applies to analytical levels and holistic criteria."),
8
+ description: z
9
+ .string()
10
+ .nullish()
11
+ .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."),
12
+ points: z
13
+ .number()
14
+ .nullish()
15
+ .describe("The default amount of points to assign if this criterion or level is selected."),
16
+ minPoints: z
17
+ .number()
18
+ .nullish()
19
+ .describe("The minimum amount of points that can be assigned if this criterion or level is selected."),
20
+ maxPoints: z
21
+ .number()
22
+ .nullish()
23
+ .describe("The maximum amount of points that can be assigned if this criterion or level is selected."),
12
24
  });
13
- exports.TopLevelScoringCriterionSchema = exports.ScoringCriterionSchema.extend({
14
- levels: zod_1.z.array(exports.ScoringCriterionSchema).nullish(),
25
+ export const TopLevelScoringCriterionSchema = ScoringCriterionSchema.extend({
26
+ levels: z
27
+ .array(ScoringCriterionSchema)
28
+ .nullish()
29
+ .describe("The levels of a analytical rubric criterion. Each level represents a different point value and description for the same criterion."),
15
30
  });
16
- var RubricType;
31
+ export var RubricType;
17
32
  (function (RubricType) {
18
33
  RubricType["Simple"] = "simple";
19
34
  RubricType["Analytical"] = "analytical";
20
35
  RubricType["Holistic"] = "holistic";
21
36
  RubricType["ExactValues"] = "exact-values";
22
- })(RubricType || (exports.RubricType = RubricType = {}));
23
- 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(),
37
+ })(RubricType || (RubricType = {}));
38
+ export const QuestionScoringSchema = z.object({
39
+ rubricType: z
40
+ .enum(RubricType)
41
+ .nullish()
42
+ .describe("The type of rubric. Different rubric types have different shapes."),
43
+ criteria: z
44
+ .array(TopLevelScoringCriterionSchema)
45
+ .nullish()
46
+ .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."),
47
+ exactValuesCaseInsensitive: z
48
+ .boolean()
49
+ .nullish()
50
+ .describe("Whether exact values matching should be case insensitive. Only applicable for 'exact-values' rubric type."),
51
+ guidance: z
52
+ .string()
53
+ .nullish()
54
+ .describe("Optional additional grading guidance text."),
55
+ modelAnswer: z
56
+ .string()
57
+ .nullish()
58
+ .describe("Optional example model answer text to show to graders."),
59
+ templateId: z
60
+ .string()
61
+ .nullish()
62
+ .describe("The ID of the scoring template applied, if any."),
30
63
  });
@@ -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>;
@@ -1,26 +1,43 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QuestionSchema = void 0;
4
- var zod_1 = require("zod");
5
- var legacy_question_scoring_criteria_1 = require("./legacy-question-scoring-criteria");
6
- var question_scoring_1 = require("./question-scoring");
7
- var scalar_1 = require("../common/scalar");
8
- 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({}),
1
+ import { z } from "zod";
2
+ import { QuestionScoringSchema } from "./question-scoring";
3
+ import { ScalarSchema } from "../common/scalar";
4
+ export const QuestionSchema = z.looseObject({
5
+ id: z.string().describe("Question ID"),
6
+ type: z.string().describe("ID of the question type"),
7
+ title: z.string().nullish().describe("Title for the question (stem)"),
8
+ description: z
9
+ .string()
10
+ .nullish()
11
+ .describe("Optional description for the question"),
12
+ settings: z
13
+ .looseObject({})
14
+ .describe("Settings for the question, often specific to the question type"),
14
15
  // Scoring
15
- scoring: question_scoring_1.QuestionScoringSchema.nullish(),
16
+ scoring: QuestionScoringSchema.nullish().describe("Scoring configuration for the question"),
16
17
  // 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(),
18
+ tags: z
19
+ .array(z.string())
20
+ .nullish()
21
+ .describe("Tags associated with the question for categorization and search"),
22
+ externalId: z
23
+ .string()
24
+ .nullish()
25
+ .describe("Optional external ID for the question, used to link to external systems"),
26
+ metadata: z
27
+ .record(z.string(), ScalarSchema)
28
+ .nullish()
29
+ .describe("Metadata for the question"),
19
30
  // 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(),
31
+ v: z
32
+ .number()
33
+ .nullish()
34
+ .describe("Version number, incremented when question is edited"),
35
+ questionBankItemId: z
36
+ .string()
37
+ .nullish()
38
+ .describe("ID of the question in the question bank"),
39
+ traceIds: z
40
+ .array(z.string())
41
+ .nullish()
42
+ .describe("Trace IDs for internal tracking of AI generation processes"),
26
43
  });
@@ -1,24 +1,8 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./question-type"), exports);
18
- __exportStar(require("./question-type-setting"), exports);
19
- __exportStar(require("./question-type-components"), exports);
20
- __exportStar(require("./question-type-generation-options"), exports);
21
- __exportStar(require("./question-type-grading-options"), exports);
22
- __exportStar(require("./question-type-scanning-options"), exports);
23
- __exportStar(require("./question-type-capabilities"), exports);
24
- __exportStar(require("./question-type-qti3"), exports);
1
+ export * from "./question-type";
2
+ export * from "./question-type-setting";
3
+ export * from "./question-type-components";
4
+ export * from "./question-type-generation-options";
5
+ export * from "./question-type-grading-options";
6
+ export * from "./question-type-scanning-options";
7
+ export * from "./question-type-capabilities";
8
+ export * from "./question-type-qti3";
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QuestionTypeCapabilitiesSchema = void 0;
4
- var zod_1 = require("zod");
5
- exports.QuestionTypeCapabilitiesSchema = zod_1.z.looseObject({
6
- "answer-scanning": zod_1.z
1
+ import { z } from "zod";
2
+ export const QuestionTypeCapabilitiesSchema = z.looseObject({
3
+ "answer-scanning": z
7
4
  .boolean()
8
5
  .optional()
9
6
  .describe("Whether this question type allows the student to scan an answer using their phone. Only supported for practice spaces."),
@@ -1,20 +1,17 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QuestionTypeComponents = exports.ComponentReference = exports.PathOrUrlReference = void 0;
4
- var zod_1 = require("zod");
1
+ import { z } from "zod";
5
2
  // Path or URL reference type
6
- exports.PathOrUrlReference = zod_1.z
3
+ export const PathOrUrlReference = z
7
4
  .string()
8
5
  .regex(/^(https?:\/\/|\.)([a-zA-Z0-9._~:/?#@!$&'()*+,;=%-]+)$/, "Valid path or URL format");
9
6
  // Component reference type
10
- exports.ComponentReference = exports.PathOrUrlReference.describe("Reference to a component, typically a file path or URL");
7
+ export const ComponentReference = PathOrUrlReference.describe("Reference to a component, typically a file path or URL");
11
8
  // Components configuration
12
- exports.QuestionTypeComponents = zod_1.z
9
+ export const QuestionTypeComponents = z
13
10
  .object({
14
- assessment: exports.ComponentReference.optional().describe("Path to the assessment component (question content)"),
15
- print: exports.ComponentReference.optional().describe("Path to the print component (for printing the question)"),
16
- "settings-area": exports.ComponentReference.optional().describe("Path to the settings area component (for configuring question settings)"),
17
- results: exports.ComponentReference.optional().describe("Path to the results component (for displaying answers)"),
11
+ assessment: ComponentReference.optional().describe("Path to the assessment component (question content)"),
12
+ print: ComponentReference.optional().describe("Path to the print component (for printing the question)"),
13
+ "settings-area": ComponentReference.optional().describe("Path to the settings area component (for configuring question settings)"),
14
+ results: ComponentReference.optional().describe("Path to the results component (for displaying answers)"),
18
15
  })
19
16
  .strict()
20
17
  .describe("Paths to the components used by this question type");
@@ -1,15 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QuestionTypeGenerationOptions = void 0;
4
- var zod_1 = require("zod");
5
- exports.QuestionTypeGenerationOptions = zod_1.z
1
+ import { z } from "zod";
2
+ export const QuestionTypeGenerationOptions = z
6
3
  .object({
7
- enabled: zod_1.z
4
+ enabled: z
8
5
  .boolean()
9
6
  .describe("Whether this question type can be automatically generated using AI (default to false)"),
10
- instructions: zod_1.z
7
+ instructions: z
11
8
  .string()
12
- .or(zod_1.z.array(zod_1.z.string()))
9
+ .or(z.array(z.string()))
13
10
  .optional()
14
11
  .describe("Optional instructions to guide AI in generating this question type"),
15
12
  })
@@ -1,15 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QuestionTypeGradingOptions = void 0;
4
- var zod_1 = require("zod");
5
- exports.QuestionTypeGradingOptions = zod_1.z
1
+ import { z } from "zod";
2
+ export const QuestionTypeGradingOptions = z
6
3
  .object({
7
- enabled: zod_1.z
4
+ enabled: z
8
5
  .boolean()
9
6
  .describe("Whether this question type can be automatically graded using AI (default to false)"),
10
- instructions: zod_1.z
7
+ instructions: z
11
8
  .string()
12
- .or(zod_1.z.array(zod_1.z.string()))
9
+ .or(z.array(z.string()))
13
10
  .optional()
14
11
  .describe("Optional instructions to guide AI in grading this question type"),
15
12
  })
@@ -1,18 +1,15 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Qti3Mapping = exports.QtiInteractionType = void 0;
4
- var zod_1 = require("zod");
1
+ import { z } from "zod";
5
2
  /**
6
3
  * A value that can either be a literal or a JSONata expression string.
7
4
  * JSONata expressions are evaluated at transform time against the question context.
8
5
  */
9
- var JsonataExpr = zod_1.z
10
- .union([zod_1.z.string(), zod_1.z.number(), zod_1.z.boolean(), zod_1.z.array(zod_1.z.any()), zod_1.z.object({})])
6
+ const JsonataExpr = z
7
+ .union([z.string(), z.number(), z.boolean(), z.array(z.any()), z.object({})])
11
8
  .describe("Literal or JSONata expression string starting with '='");
12
9
  /**
13
10
  * Supported QTI 3.0 interaction types
14
11
  */
15
- exports.QtiInteractionType = zod_1.z.enum([
12
+ export const QtiInteractionType = z.enum([
16
13
  "AssociateInteraction",
17
14
  "ChoiceInteraction",
18
15
  "DrawingInteraction",
@@ -38,11 +35,11 @@ exports.QtiInteractionType = zod_1.z.enum([
38
35
  /**
39
36
  * Complete QTI mapping configuration for a question type
40
37
  */
41
- exports.Qti3Mapping = zod_1.z
38
+ export const Qti3Mapping = z
42
39
  .object({
43
- interaction: zod_1.z.object({
44
- type: exports.QtiInteractionType.describe("The QTI interaction type to generate"),
45
- options: zod_1.z.record(zod_1.z.string(), JsonataExpr).optional(),
40
+ interaction: z.object({
41
+ type: QtiInteractionType.describe("The QTI interaction type to generate"),
42
+ options: z.record(z.string(), JsonataExpr).optional(),
46
43
  }),
47
44
  })
48
45
  .describe("QTI 3.0 mapping configuration for transforming questions to QTI format");
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QuestionTypeScanningOptions = void 0;
4
- var zod_1 = require("zod");
5
- exports.QuestionTypeScanningOptions = zod_1.z
1
+ import { z } from "zod";
2
+ export const QuestionTypeScanningOptions = z
6
3
  .object({
7
- instructions: zod_1.z
4
+ instructions: z
8
5
  .string()
9
- .or(zod_1.z.array(zod_1.z.string()))
6
+ .or(z.array(z.string()))
10
7
  .optional()
11
8
  .describe("Optional instructions to guide AI in converting answers for this question type when scanning documents"),
12
9
  })
@@ -1,27 +1,24 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QuestionTypeSetting = exports.QuestionTypeSettingOption = void 0;
4
- var zod_1 = require("zod");
5
- var translatable_1 = require("../common/translatable");
1
+ import { z } from "zod";
2
+ import { Translatable } from "../common/translatable";
6
3
  // Setting option for enum type settings
7
- exports.QuestionTypeSettingOption = zod_1.z
4
+ export const QuestionTypeSettingOption = z
8
5
  .object({
9
- value: zod_1.z.string().describe("Option value"),
10
- label: translatable_1.Translatable.describe("Option label"),
6
+ value: z.string().describe("Option value"),
7
+ label: Translatable.describe("Option label"),
11
8
  })
12
9
  .strict()
13
10
  .describe("Setting option");
14
11
  // Setting configuration
15
- exports.QuestionTypeSetting = zod_1.z
12
+ export const QuestionTypeSetting = z
16
13
  .object({
17
- id: zod_1.z.string().describe("Unique identifier for the setting"),
18
- name: translatable_1.Translatable.describe("Display name for the setting"),
19
- helpText: translatable_1.Translatable.optional().describe("Help text for the setting"),
20
- description: zod_1.z
14
+ id: z.string().describe("Unique identifier for the setting"),
15
+ name: Translatable.describe("Display name for the setting"),
16
+ helpText: Translatable.optional().describe("Help text for the setting"),
17
+ description: z
21
18
  .string()
22
19
  .optional()
23
20
  .describe("Description to help AI agents auto-generate question settings"),
24
- type: zod_1.z
21
+ type: z
25
22
  .enum([
26
23
  "enum",
27
24
  "string",
@@ -34,27 +31,27 @@ exports.QuestionTypeSetting = zod_1.z
34
31
  "question-type",
35
32
  ])
36
33
  .describe("Type of the setting"),
37
- index: zod_1.z.number().optional(),
38
- hidden: zod_1.z
34
+ index: z.number().optional(),
35
+ hidden: z
39
36
  .boolean()
40
37
  .optional()
41
38
  .describe("Whether the setting is hidden from the user"),
42
- default: zod_1.z.any().nullish().describe("Default value for the setting"),
43
- required: zod_1.z
39
+ default: z.any().nullish().describe("Default value for the setting"),
40
+ required: z
44
41
  .boolean()
45
42
  .optional()
46
43
  .describe("Whether this setting is required"),
47
- options: zod_1.z
48
- .array(exports.QuestionTypeSettingOption)
44
+ options: z
45
+ .array(QuestionTypeSettingOption)
49
46
  .optional()
50
47
  .describe("Available options for enum type settings"),
51
- placeholder: translatable_1.Translatable.nullish().describe("Placeholder text for the setting"),
52
- step: zod_1.z.number().optional().describe("Step value for number type settings"),
53
- min: zod_1.z
48
+ placeholder: Translatable.nullish().describe("Placeholder text for the setting"),
49
+ step: z.number().optional().describe("Step value for number type settings"),
50
+ min: z
54
51
  .number()
55
52
  .optional()
56
53
  .describe("Minimum value for number type settings"),
57
- max: zod_1.z
54
+ max: z
58
55
  .number()
59
56
  .optional()
60
57
  .describe("Maximum value for number type settings"),
@@ -1,94 +1,91 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QuestionTypeSchema = void 0;
4
- var zod_1 = require("zod");
5
- var question_type_capabilities_1 = require("./question-type-capabilities");
6
- var question_type_components_1 = require("./question-type-components");
7
- var question_type_generation_options_1 = require("./question-type-generation-options");
8
- var question_type_grading_options_1 = require("./question-type-grading-options");
9
- var question_type_qti3_1 = require("./question-type-qti3");
10
- var question_type_scanning_options_1 = require("./question-type-scanning-options");
11
- var question_type_setting_1 = require("./question-type-setting");
12
- var scalar_1 = require("../common/scalar");
13
- var translatable_1 = require("../common/translatable");
14
- exports.QuestionTypeSchema = zod_1.z
1
+ import { z } from "zod";
2
+ import { QuestionTypeCapabilitiesSchema } from "./question-type-capabilities";
3
+ import { PathOrUrlReference, QuestionTypeComponents, } from "./question-type-components";
4
+ import { QuestionTypeGenerationOptions } from "./question-type-generation-options";
5
+ import { QuestionTypeGradingOptions } from "./question-type-grading-options";
6
+ import { Qti3Mapping } from "./question-type-qti3";
7
+ import { QuestionTypeScanningOptions } from "./question-type-scanning-options";
8
+ import { QuestionTypeSetting } from "./question-type-setting";
9
+ import { ScalarSchema } from "../common/scalar";
10
+ import { Translatable } from "../common/translatable";
11
+ export const QuestionTypeSchema = z
15
12
  .object({
16
- $schema: zod_1.z.string().optional(),
17
- id: zod_1.z
13
+ $schema: z.string().optional(),
14
+ id: z
18
15
  .string()
19
16
  .regex(/^([a-z][a-z0-9-]*)(\.[a-z][a-z0-9-]*)+$/, "Valid question type ID format")
20
17
  .describe("Unique identifier for the question type (e.g. 'my-org.color-picker')"),
21
- name: translatable_1.Translatable.describe("Display name for the question type, can be a simple string or translation object"),
22
- description: translatable_1.Translatable.describe("Description of the question type, can be a simple string or translation object"),
23
- icon: question_type_components_1.PathOrUrlReference.optional().describe("Path to the icon for this question type"),
24
- shortcut: zod_1.z
18
+ name: Translatable.describe("Display name for the question type, can be a simple string or translation object"),
19
+ description: Translatable.describe("Description of the question type, can be a simple string or translation object"),
20
+ icon: PathOrUrlReference.optional().describe("Path to the icon for this question type"),
21
+ shortcut: z
25
22
  .string()
26
23
  .max(1)
27
24
  .optional()
28
25
  .describe("Keyboard shortcut for quick access to this question type"),
29
- generation: question_type_generation_options_1.QuestionTypeGenerationOptions.optional(),
30
- grading: question_type_grading_options_1.QuestionTypeGradingOptions.optional(),
31
- scanning: question_type_scanning_options_1.QuestionTypeScanningOptions.optional(),
32
- timeEstimateMinutes: zod_1.z
26
+ generation: QuestionTypeGenerationOptions.optional(),
27
+ grading: QuestionTypeGradingOptions.optional(),
28
+ scanning: QuestionTypeScanningOptions.optional(),
29
+ timeEstimateMinutes: z
33
30
  .number()
34
31
  .min(1)
35
32
  .optional()
36
33
  .describe("Estimated time in minutes to complete this question type"),
37
- isAi: zod_1.z
34
+ isAi: z
38
35
  .boolean()
39
36
  .optional()
40
37
  .describe("Whether this question type uses AI functionality"),
41
- backgroundColor: zod_1.z
38
+ backgroundColor: z
42
39
  .string()
43
40
  .optional()
44
41
  .describe("Background color for the question type"),
45
- enforcePosition: zod_1.z
42
+ enforcePosition: z
46
43
  .enum(["start", "end"])
47
44
  .optional()
48
45
  .describe("Position enforcement for this question type"),
49
- enforceTitle: translatable_1.Translatable.optional().describe("Enforced title for this question type"),
50
- hideSettings: zod_1.z
46
+ enforceTitle: Translatable.optional().describe("Enforced title for this question type"),
47
+ hideSettings: z
51
48
  .boolean()
52
49
  .optional()
53
50
  .describe("Whether to hide settings for this question type"),
54
- isPreviewRefreshable: zod_1.z
51
+ isPreviewRefreshable: z
55
52
  .boolean()
56
53
  .optional()
57
54
  .describe("Whether the preview can be refreshed for this question type"),
58
- hasSimpleScoring: zod_1.z
55
+ hasSimpleScoring: z
59
56
  .boolean()
60
57
  .optional()
61
58
  .describe("Whether this question type has simple scoring"),
62
- titlePlaceholder: translatable_1.Translatable.optional().describe("Placeholder text for the title field"),
63
- descriptionPlaceholder: translatable_1.Translatable.optional().describe("Placeholder text for the description field"),
64
- untitledPlaceholder: translatable_1.Translatable.optional().describe("Placeholder text for untitled questions"),
65
- components: question_type_components_1.QuestionTypeComponents.optional().describe("Paths to the components used by this question type"),
66
- settings: zod_1.z
67
- .array(question_type_setting_1.QuestionTypeSetting)
59
+ titlePlaceholder: Translatable.optional().describe("Placeholder text for the title field"),
60
+ descriptionPlaceholder: Translatable.optional().describe("Placeholder text for the description field"),
61
+ untitledPlaceholder: Translatable.optional().describe("Placeholder text for untitled questions"),
62
+ components: QuestionTypeComponents.optional().describe("Paths to the components used by this question type"),
63
+ settings: z
64
+ .array(QuestionTypeSetting)
68
65
  .optional()
69
66
  .describe("Configuration settings for the question type"),
70
- public: zod_1.z
67
+ public: z
71
68
  .boolean()
72
69
  .optional()
73
70
  .describe("Whether this question type is public and can be used by all users"),
74
- translations: zod_1.z
75
- .record(zod_1.z.string(), translatable_1.Translatable)
71
+ translations: z
72
+ .record(z.string(), Translatable)
76
73
  .optional()
77
74
  .describe("Custom translations for this question type"),
78
- capabilities: question_type_capabilities_1.QuestionTypeCapabilitiesSchema.optional().describe("Capabilities of the question type for various operations"),
79
- export: zod_1.z
75
+ capabilities: QuestionTypeCapabilitiesSchema.optional().describe("Capabilities of the question type for various operations"),
76
+ export: z
80
77
  .object({
81
- qti3: question_type_qti3_1.Qti3Mapping.optional().describe("QTI 3.0 mapping configuration for transforming questions to QTI format"),
78
+ qti3: Qti3Mapping.optional().describe("QTI 3.0 mapping configuration for transforming questions to QTI format"),
82
79
  })
83
80
  .optional()
84
81
  .describe("Export configuration for various formats"),
85
- metadata: zod_1.z
86
- .record(zod_1.z.string(), scalar_1.ScalarSchema)
82
+ metadata: z
83
+ .record(z.string(), ScalarSchema)
87
84
  .optional()
88
85
  .describe("Optional metadata for the question type, only used by external applications"),
89
- stylesheet: zod_1.z.url().optional(),
90
- index: zod_1.z.number().optional(),
91
- isDefault: zod_1.z.boolean().optional(),
86
+ stylesheet: z.url().optional(),
87
+ index: z.number().optional(),
88
+ isDefault: z.boolean().optional(),
92
89
  })
93
90
  .strict()
94
91
  .describe("Schema for defining question types in the Examplary system");
@@ -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.14.0",
5
5
  "description": "Schemas for the Examplary platform.",
6
6
  "scripts": {
7
7
  "build:schema": "tsx ./scripts/build.ts",
@@ -20,15 +20,15 @@
20
20
  "main": "./dist/index.js",
21
21
  "types": "./dist/index.d.ts",
22
22
  "devDependencies": {
23
- "serverless": "^4.33.0",
23
+ "serverless": "^4.34.0",
24
24
  "serverless-lift": "^1.34.1",
25
25
  "tsx": "^4.20.6",
26
- "typescript": "^5.9.3"
26
+ "typescript": "^6.0.3"
27
27
  },
28
28
  "dependencies": {
29
29
  "zod": "^4.3.6"
30
30
  },
31
- "homepage": "https://developers.examplary.ai/",
31
+ "homepage": "https://examplary.ai/developers",
32
32
  "author": {
33
33
  "name": "Examplary AI",
34
34
  "email": "hi@examplary.ai"
@@ -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
- }));