@examplary/schemas 1.15.0 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/scalar.js +9 -6
- package/dist/common/translatable.js +8 -5
- package/dist/index.js +20 -4
- package/dist/question/index.js +18 -2
- package/dist/question/question-scoring.js +24 -21
- package/dist/question/question.js +22 -19
- package/dist/question-type/index.d.ts +2 -0
- package/dist/question-type/index.js +25 -8
- package/dist/question-type/question-type-capabilities.js +6 -3
- package/dist/question-type/question-type-components.js +11 -8
- package/dist/question-type/question-type-generation-options.js +8 -5
- package/dist/question-type/question-type-grading-options.js +8 -5
- package/dist/question-type/question-type-qti3.js +21 -18
- package/dist/question-type/question-type-response-processing.d.ts +47 -0
- package/dist/question-type/question-type-response-processing.js +28 -0
- package/dist/question-type/question-type-scanning-options.js +7 -4
- package/dist/question-type/question-type-setting.d.ts +1 -1
- package/dist/question-type/question-type-setting.js +24 -21
- package/dist/question-type/question-type.d.ts +46 -1
- package/dist/question-type/question-type.js +52 -47
- package/dist/schemas/question-type.json +430 -0
- package/package.json +2 -2
package/dist/common/scalar.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
z.
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ScalarSchema = void 0;
|
|
4
|
+
const 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(),
|
|
7
10
|
]);
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Translatable = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
2
5
|
// Translatable type - can be a simple string or translation object
|
|
3
|
-
|
|
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())
|
|
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())
|
|
7
10
|
.refine((obj) => Object.keys(obj).length >= 1, "Translation object must have at least one property")
|
|
8
11
|
.describe("Translation object with language codes as keys"),
|
|
9
12
|
]);
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,23 @@
|
|
|
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 });
|
|
1
17
|
// Question types
|
|
2
|
-
|
|
18
|
+
__exportStar(require("./question-type"), exports);
|
|
3
19
|
// Questions
|
|
4
|
-
|
|
20
|
+
__exportStar(require("./question"), exports);
|
|
5
21
|
// Common
|
|
6
|
-
|
|
7
|
-
|
|
22
|
+
__exportStar(require("./common/scalar"), exports);
|
|
23
|
+
__exportStar(require("./common/translatable"), exports);
|
package/dist/question/index.js
CHANGED
|
@@ -1,2 +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,62 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QuestionScoringSchema = exports.RubricType = exports.TopLevelScoringCriterionSchema = exports.ScoringCriterionSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.ScoringCriterionSchema = zod_1.z.object({
|
|
6
|
+
id: zod_1.z.string(),
|
|
7
|
+
title: zod_1.z
|
|
5
8
|
.string()
|
|
6
9
|
.nullish()
|
|
7
10
|
.describe("The title of the scoring criterion or level. Only applies to analytical levels and holistic criteria."),
|
|
8
|
-
description: z
|
|
11
|
+
description: zod_1.z
|
|
9
12
|
.string()
|
|
10
13
|
.nullish()
|
|
11
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."),
|
|
12
|
-
points: z
|
|
15
|
+
points: zod_1.z
|
|
13
16
|
.number()
|
|
14
17
|
.nullish()
|
|
15
18
|
.describe("The default amount of points to assign if this criterion or level is selected."),
|
|
16
|
-
minPoints: z
|
|
19
|
+
minPoints: zod_1.z
|
|
17
20
|
.number()
|
|
18
21
|
.nullish()
|
|
19
22
|
.describe("The minimum amount of points that can be assigned if this criterion or level is selected."),
|
|
20
|
-
maxPoints: z
|
|
23
|
+
maxPoints: zod_1.z
|
|
21
24
|
.number()
|
|
22
25
|
.nullish()
|
|
23
26
|
.describe("The maximum amount of points that can be assigned if this criterion or level is selected."),
|
|
24
27
|
});
|
|
25
|
-
|
|
26
|
-
levels: z
|
|
27
|
-
.array(ScoringCriterionSchema)
|
|
28
|
+
exports.TopLevelScoringCriterionSchema = exports.ScoringCriterionSchema.extend({
|
|
29
|
+
levels: zod_1.z
|
|
30
|
+
.array(exports.ScoringCriterionSchema)
|
|
28
31
|
.nullish()
|
|
29
32
|
.describe("The levels of a analytical rubric criterion. Each level represents a different point value and description for the same criterion."),
|
|
30
33
|
});
|
|
31
|
-
|
|
34
|
+
var RubricType;
|
|
32
35
|
(function (RubricType) {
|
|
33
36
|
RubricType["Simple"] = "simple";
|
|
34
37
|
RubricType["Analytical"] = "analytical";
|
|
35
38
|
RubricType["Holistic"] = "holistic";
|
|
36
39
|
RubricType["ExactValues"] = "exact-values";
|
|
37
|
-
})(RubricType || (RubricType = {}));
|
|
38
|
-
|
|
39
|
-
rubricType: z
|
|
40
|
+
})(RubricType || (exports.RubricType = RubricType = {}));
|
|
41
|
+
exports.QuestionScoringSchema = zod_1.z.object({
|
|
42
|
+
rubricType: zod_1.z
|
|
40
43
|
.enum(RubricType)
|
|
41
44
|
.nullish()
|
|
42
45
|
.describe("The type of rubric. Different rubric types have different shapes."),
|
|
43
|
-
criteria: z
|
|
44
|
-
.array(TopLevelScoringCriterionSchema)
|
|
46
|
+
criteria: zod_1.z
|
|
47
|
+
.array(exports.TopLevelScoringCriterionSchema)
|
|
45
48
|
.nullish()
|
|
46
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."),
|
|
47
|
-
exactValuesCaseInsensitive: z
|
|
50
|
+
exactValuesCaseInsensitive: zod_1.z
|
|
48
51
|
.boolean()
|
|
49
52
|
.nullish()
|
|
50
53
|
.describe("Whether exact values matching should be case insensitive. Only applicable for 'exact-values' rubric type."),
|
|
51
|
-
guidance: z
|
|
54
|
+
guidance: zod_1.z
|
|
52
55
|
.string()
|
|
53
56
|
.nullish()
|
|
54
57
|
.describe("Optional additional grading guidance text."),
|
|
55
|
-
modelAnswer: z
|
|
58
|
+
modelAnswer: zod_1.z
|
|
56
59
|
.string()
|
|
57
60
|
.nullish()
|
|
58
61
|
.describe("Optional example model answer text to show to graders."),
|
|
59
|
-
templateId: z
|
|
62
|
+
templateId: zod_1.z
|
|
60
63
|
.string()
|
|
61
64
|
.nullish()
|
|
62
65
|
.describe("The ID of the scoring template applied, if any."),
|
|
@@ -1,43 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QuestionSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const question_scoring_1 = require("./question-scoring");
|
|
6
|
+
const scalar_1 = require("../common/scalar");
|
|
7
|
+
exports.QuestionSchema = 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
|
|
9
12
|
.string()
|
|
10
13
|
.nullish()
|
|
11
14
|
.describe("Optional description for the question"),
|
|
12
|
-
settings: z
|
|
15
|
+
settings: zod_1.z
|
|
13
16
|
.looseObject({})
|
|
14
17
|
.describe("Settings for the question, often specific to the question type"),
|
|
15
18
|
// Scoring
|
|
16
|
-
scoring: QuestionScoringSchema.nullish().describe("Scoring configuration for the question"),
|
|
19
|
+
scoring: question_scoring_1.QuestionScoringSchema.nullish().describe("Scoring configuration for the question"),
|
|
17
20
|
// Tags and metadata
|
|
18
|
-
tags: z
|
|
19
|
-
.array(z.string())
|
|
21
|
+
tags: zod_1.z
|
|
22
|
+
.array(zod_1.z.string())
|
|
20
23
|
.nullish()
|
|
21
24
|
.describe("Tags associated with the question for categorization and search"),
|
|
22
|
-
externalId: z
|
|
25
|
+
externalId: zod_1.z
|
|
23
26
|
.string()
|
|
24
27
|
.nullish()
|
|
25
28
|
.describe("Optional external ID for the question, used to link to external systems"),
|
|
26
|
-
metadata: z
|
|
27
|
-
.record(z.string(), ScalarSchema)
|
|
29
|
+
metadata: zod_1.z
|
|
30
|
+
.record(zod_1.z.string(), scalar_1.ScalarSchema)
|
|
28
31
|
.nullish()
|
|
29
32
|
.describe("Metadata for the question"),
|
|
30
33
|
// Internal tracking
|
|
31
|
-
v: z
|
|
34
|
+
v: zod_1.z
|
|
32
35
|
.number()
|
|
33
36
|
.nullish()
|
|
34
37
|
.describe("Version number, incremented when question is edited"),
|
|
35
|
-
questionBankItemId: z
|
|
38
|
+
questionBankItemId: zod_1.z
|
|
36
39
|
.string()
|
|
37
40
|
.nullish()
|
|
38
41
|
.describe("ID of the question in the question bank"),
|
|
39
|
-
traceIds: z
|
|
40
|
-
.array(z.string())
|
|
42
|
+
traceIds: zod_1.z
|
|
43
|
+
.array(zod_1.z.string())
|
|
41
44
|
.nullish()
|
|
42
45
|
.describe("Trace IDs for internal tracking of AI generation processes"),
|
|
43
46
|
});
|
|
@@ -12,5 +12,7 @@ export * from "./question-type-scanning-options";
|
|
|
12
12
|
export type * from "./question-type-scanning-options";
|
|
13
13
|
export * from "./question-type-capabilities";
|
|
14
14
|
export type * from "./question-type-capabilities";
|
|
15
|
+
export * from "./question-type-response-processing";
|
|
16
|
+
export type * from "./question-type-response-processing";
|
|
15
17
|
export * from "./question-type-qti3";
|
|
16
18
|
export type * from "./question-type-qti3";
|
|
@@ -1,8 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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-response-processing"), exports);
|
|
25
|
+
__exportStar(require("./question-type-qti3"), exports);
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QuestionTypeCapabilitiesSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.QuestionTypeCapabilitiesSchema = zod_1.z.looseObject({
|
|
6
|
+
"answer-scanning": zod_1.z
|
|
4
7
|
.boolean()
|
|
5
8
|
.optional()
|
|
6
9
|
.describe("Whether this question type allows the student to scan an answer using their phone. Only supported for practice spaces."),
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QuestionTypeComponents = exports.ComponentReference = exports.PathOrUrlReference = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
2
5
|
// Path or URL reference type
|
|
3
|
-
|
|
6
|
+
exports.PathOrUrlReference = zod_1.z
|
|
4
7
|
.string()
|
|
5
8
|
.regex(/^(https?:\/\/|\.)([a-zA-Z0-9._~:/?#@!$&'()*+,;=%-]+)$/, "Valid path or URL format");
|
|
6
9
|
// Component reference type
|
|
7
|
-
|
|
10
|
+
exports.ComponentReference = exports.PathOrUrlReference.describe("Reference to a component, typically a file path or URL");
|
|
8
11
|
// Components configuration
|
|
9
|
-
|
|
12
|
+
exports.QuestionTypeComponents = zod_1.z
|
|
10
13
|
.object({
|
|
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)"),
|
|
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)"),
|
|
15
18
|
})
|
|
16
19
|
.strict()
|
|
17
20
|
.describe("Paths to the components used by this question type");
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QuestionTypeGenerationOptions = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.QuestionTypeGenerationOptions = zod_1.z
|
|
3
6
|
.object({
|
|
4
|
-
enabled: z
|
|
7
|
+
enabled: zod_1.z
|
|
5
8
|
.boolean()
|
|
6
9
|
.describe("Whether this question type can be automatically generated using AI (default to false)"),
|
|
7
|
-
instructions: z
|
|
10
|
+
instructions: zod_1.z
|
|
8
11
|
.string()
|
|
9
|
-
.or(z.array(z.string()))
|
|
12
|
+
.or(zod_1.z.array(zod_1.z.string()))
|
|
10
13
|
.optional()
|
|
11
14
|
.describe("Optional instructions to guide AI in generating this question type"),
|
|
12
15
|
})
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QuestionTypeGradingOptions = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.QuestionTypeGradingOptions = zod_1.z
|
|
3
6
|
.object({
|
|
4
|
-
enabled: z
|
|
7
|
+
enabled: zod_1.z
|
|
5
8
|
.boolean()
|
|
6
9
|
.describe("Whether this question type can be automatically graded using AI (default to false)"),
|
|
7
|
-
instructions: z
|
|
10
|
+
instructions: zod_1.z
|
|
8
11
|
.string()
|
|
9
|
-
.or(z.array(z.string()))
|
|
12
|
+
.or(zod_1.z.array(zod_1.z.string()))
|
|
10
13
|
.optional()
|
|
11
14
|
.describe("Optional instructions to guide AI in grading this question type"),
|
|
12
15
|
})
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Qti3ImportMapping = exports.Qti3Mapping = exports.QtiInteractionType = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
2
5
|
/**
|
|
3
6
|
* A value that can either be a literal or a JSONata expression string.
|
|
4
7
|
* JSONata expressions are evaluated at transform time against the question context.
|
|
5
8
|
*/
|
|
6
|
-
const JsonataExpr = z
|
|
9
|
+
const JsonataExpr = zod_1.z
|
|
7
10
|
.union([
|
|
8
|
-
z.string(),
|
|
9
|
-
z.number(),
|
|
10
|
-
z.boolean(),
|
|
11
|
-
z.array(z.any()),
|
|
12
|
-
z.record(z.string(), z.any()),
|
|
11
|
+
zod_1.z.string(),
|
|
12
|
+
zod_1.z.number(),
|
|
13
|
+
zod_1.z.boolean(),
|
|
14
|
+
zod_1.z.array(zod_1.z.any()),
|
|
15
|
+
zod_1.z.record(zod_1.z.string(), zod_1.z.any()),
|
|
13
16
|
])
|
|
14
17
|
.describe("Literal or JSONata expression string starting with '='");
|
|
15
18
|
/**
|
|
16
19
|
* Supported QTI 3.0 interaction types
|
|
17
20
|
*/
|
|
18
|
-
|
|
21
|
+
exports.QtiInteractionType = zod_1.z.enum([
|
|
19
22
|
"AssociateInteraction",
|
|
20
23
|
"ChoiceInteraction",
|
|
21
24
|
"DrawingInteraction",
|
|
@@ -41,11 +44,11 @@ export const QtiInteractionType = z.enum([
|
|
|
41
44
|
/**
|
|
42
45
|
* Complete QTI mapping configuration for a question type
|
|
43
46
|
*/
|
|
44
|
-
|
|
47
|
+
exports.Qti3Mapping = zod_1.z
|
|
45
48
|
.object({
|
|
46
|
-
interaction: z.object({
|
|
47
|
-
type: QtiInteractionType.describe("The QTI interaction type to generate"),
|
|
48
|
-
options: z.record(z.string(), JsonataExpr).optional(),
|
|
49
|
+
interaction: zod_1.z.object({
|
|
50
|
+
type: exports.QtiInteractionType.describe("The QTI interaction type to generate"),
|
|
51
|
+
options: zod_1.z.record(zod_1.z.string(), JsonataExpr).optional(),
|
|
49
52
|
}),
|
|
50
53
|
})
|
|
51
54
|
.describe("QTI 3.0 mapping configuration for transforming questions to QTI format");
|
|
@@ -59,17 +62,17 @@ export const Qti3Mapping = z
|
|
|
59
62
|
* - correctResponse: string[] of correct response identifiers/values
|
|
60
63
|
* - points: number of points from the QTI score outcome
|
|
61
64
|
*/
|
|
62
|
-
|
|
65
|
+
exports.Qti3ImportMapping = zod_1.z
|
|
63
66
|
.object({
|
|
64
|
-
interaction: z.object({
|
|
65
|
-
type: QtiInteractionType.describe("The QTI interaction type this question type handles on import"),
|
|
67
|
+
interaction: zod_1.z.object({
|
|
68
|
+
type: exports.QtiInteractionType.describe("The QTI interaction type this question type handles on import"),
|
|
66
69
|
}),
|
|
67
|
-
condition: z
|
|
70
|
+
condition: zod_1.z
|
|
68
71
|
.string()
|
|
69
72
|
.optional()
|
|
70
73
|
.describe("Optional JSONata expression (starting with =) that must evaluate to true for this mapping to be used. Evaluated against the same context as settings: { interaction, correctResponse, points }. Useful when multiple question types handle the same interaction type (e.g. single vs multiple choice)."),
|
|
71
|
-
settings: z
|
|
72
|
-
.record(z.string(), JsonataExpr)
|
|
74
|
+
settings: zod_1.z
|
|
75
|
+
.record(zod_1.z.string(), JsonataExpr)
|
|
73
76
|
.optional()
|
|
74
77
|
.describe("JSONata expressions mapping QTI interaction properties to question settings"),
|
|
75
78
|
})
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const QuestionTypeResponseProcessing: z.ZodObject<{
|
|
3
|
+
condition: z.ZodString;
|
|
4
|
+
testCases: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
5
|
+
answer: z.ZodObject<{
|
|
6
|
+
value: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>]>>>>;
|
|
7
|
+
}, z.core.$loose>;
|
|
8
|
+
question: z.ZodObject<{
|
|
9
|
+
id: z.ZodOptional<z.ZodString>;
|
|
10
|
+
type: z.ZodOptional<z.ZodString>;
|
|
11
|
+
title: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
12
|
+
description: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
13
|
+
settings: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
14
|
+
scoring: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
15
|
+
rubricType: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof import("..").RubricType>>>;
|
|
16
|
+
criteria: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
17
|
+
id: z.ZodString;
|
|
18
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
19
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
20
|
+
points: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
21
|
+
minPoints: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
22
|
+
maxPoints: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
23
|
+
levels: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
24
|
+
id: z.ZodString;
|
|
25
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
26
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
27
|
+
points: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
28
|
+
minPoints: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
29
|
+
maxPoints: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
30
|
+
}, z.core.$strip>>>>;
|
|
31
|
+
}, z.core.$strip>>>>;
|
|
32
|
+
exactValuesCaseInsensitive: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
33
|
+
guidance: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
34
|
+
modelAnswer: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
35
|
+
templateId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
36
|
+
}, z.core.$strip>>>>;
|
|
37
|
+
tags: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>>;
|
|
38
|
+
externalId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
39
|
+
metadata: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>>>;
|
|
40
|
+
v: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
41
|
+
questionBankItemId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
42
|
+
traceIds: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>>;
|
|
43
|
+
}, z.core.$loose>;
|
|
44
|
+
expectedOutcome: z.ZodBoolean;
|
|
45
|
+
}, z.core.$strip>>>;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
export type QuestionTypeResponseProcessingType = z.infer<typeof QuestionTypeResponseProcessing>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QuestionTypeResponseProcessing = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const question_1 = require("../question/question");
|
|
6
|
+
const AnswerSchema = zod_1.z.looseObject({
|
|
7
|
+
// TODO: this is a partial answer schema, should we move the Answer schema to this package?
|
|
8
|
+
value: zod_1.z
|
|
9
|
+
.union([zod_1.z.string(), zod_1.z.array(zod_1.z.union([zod_1.z.string(), zod_1.z.null()]))])
|
|
10
|
+
.nullish(),
|
|
11
|
+
});
|
|
12
|
+
const QuestionTypeResponseProcessingTestCase = zod_1.z.object({
|
|
13
|
+
answer: AnswerSchema.partial(),
|
|
14
|
+
question: question_1.QuestionSchema.partial(),
|
|
15
|
+
expectedOutcome: zod_1.z.boolean(),
|
|
16
|
+
});
|
|
17
|
+
exports.QuestionTypeResponseProcessing = zod_1.z
|
|
18
|
+
.object({
|
|
19
|
+
condition: zod_1.z
|
|
20
|
+
.string()
|
|
21
|
+
.regex(/^=/, "Response processing condition must start with '='")
|
|
22
|
+
.describe("JSONata expression string starting with '=' that evaluates to a boolean to determine if the response is correct"),
|
|
23
|
+
testCases: zod_1.z
|
|
24
|
+
.array(QuestionTypeResponseProcessingTestCase)
|
|
25
|
+
.optional()
|
|
26
|
+
.describe("Array of test cases to validate the response processing logic for this question type"),
|
|
27
|
+
})
|
|
28
|
+
.describe("Options for response processing");
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QuestionTypeScanningOptions = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.QuestionTypeScanningOptions = zod_1.z
|
|
3
6
|
.object({
|
|
4
|
-
instructions: z
|
|
7
|
+
instructions: zod_1.z
|
|
5
8
|
.string()
|
|
6
|
-
.or(z.array(z.string()))
|
|
9
|
+
.or(zod_1.z.array(zod_1.z.string()))
|
|
7
10
|
.optional()
|
|
8
11
|
.describe("Optional instructions to guide AI in converting answers for this question type when scanning documents"),
|
|
9
12
|
})
|
|
@@ -14,9 +14,9 @@ export declare const QuestionTypeSetting: z.ZodObject<{
|
|
|
14
14
|
boolean: "boolean";
|
|
15
15
|
enum: "enum";
|
|
16
16
|
custom: "custom";
|
|
17
|
+
tags: "tags";
|
|
17
18
|
"string-array": "string-array";
|
|
18
19
|
"scoring-criteria": "scoring-criteria";
|
|
19
|
-
tags: "tags";
|
|
20
20
|
"question-type": "question-type";
|
|
21
21
|
}>;
|
|
22
22
|
index: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1,24 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QuestionTypeSetting = exports.QuestionTypeSettingOption = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const translatable_1 = require("../common/translatable");
|
|
3
6
|
// Setting option for enum type settings
|
|
4
|
-
|
|
7
|
+
exports.QuestionTypeSettingOption = zod_1.z
|
|
5
8
|
.object({
|
|
6
|
-
value: z.string().describe("Option value"),
|
|
7
|
-
label: Translatable.describe("Option label"),
|
|
9
|
+
value: zod_1.z.string().describe("Option value"),
|
|
10
|
+
label: translatable_1.Translatable.describe("Option label"),
|
|
8
11
|
})
|
|
9
12
|
.strict()
|
|
10
13
|
.describe("Setting option");
|
|
11
14
|
// Setting configuration
|
|
12
|
-
|
|
15
|
+
exports.QuestionTypeSetting = zod_1.z
|
|
13
16
|
.object({
|
|
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
|
|
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
|
|
18
21
|
.string()
|
|
19
22
|
.optional()
|
|
20
23
|
.describe("Description to help AI agents auto-generate question settings"),
|
|
21
|
-
type: z
|
|
24
|
+
type: zod_1.z
|
|
22
25
|
.enum([
|
|
23
26
|
"enum",
|
|
24
27
|
"string",
|
|
@@ -31,27 +34,27 @@ export const QuestionTypeSetting = z
|
|
|
31
34
|
"question-type",
|
|
32
35
|
])
|
|
33
36
|
.describe("Type of the setting"),
|
|
34
|
-
index: z.number().optional(),
|
|
35
|
-
hidden: z
|
|
37
|
+
index: zod_1.z.number().optional(),
|
|
38
|
+
hidden: zod_1.z
|
|
36
39
|
.boolean()
|
|
37
40
|
.optional()
|
|
38
41
|
.describe("Whether the setting is hidden from the user"),
|
|
39
|
-
default: z.any().nullish().describe("Default value for the setting"),
|
|
40
|
-
required: z
|
|
42
|
+
default: zod_1.z.any().nullish().describe("Default value for the setting"),
|
|
43
|
+
required: zod_1.z
|
|
41
44
|
.boolean()
|
|
42
45
|
.optional()
|
|
43
46
|
.describe("Whether this setting is required"),
|
|
44
|
-
options: z
|
|
45
|
-
.array(QuestionTypeSettingOption)
|
|
47
|
+
options: zod_1.z
|
|
48
|
+
.array(exports.QuestionTypeSettingOption)
|
|
46
49
|
.optional()
|
|
47
50
|
.describe("Available options for enum type settings"),
|
|
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
|
|
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
|
|
51
54
|
.number()
|
|
52
55
|
.optional()
|
|
53
56
|
.describe("Minimum value for number type settings"),
|
|
54
|
-
max: z
|
|
57
|
+
max: zod_1.z
|
|
55
58
|
.number()
|
|
56
59
|
.optional()
|
|
57
60
|
.describe("Maximum value for number type settings"),
|