@examplary/schemas 1.15.0 → 1.15.1
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.js +24 -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-scanning-options.js +7 -4
- package/dist/question-type/question-type-setting.js +24 -21
- package/dist/question-type/question-type.js +50 -47
- 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
|
});
|
|
@@ -1,8 +1,24 @@
|
|
|
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-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
|
})
|
|
@@ -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
|
})
|
|
@@ -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"),
|
|
@@ -1,97 +1,100 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QuestionTypeSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const question_type_capabilities_1 = require("./question-type-capabilities");
|
|
6
|
+
const question_type_components_1 = require("./question-type-components");
|
|
7
|
+
const question_type_generation_options_1 = require("./question-type-generation-options");
|
|
8
|
+
const question_type_grading_options_1 = require("./question-type-grading-options");
|
|
9
|
+
const question_type_qti3_1 = require("./question-type-qti3");
|
|
10
|
+
const question_type_scanning_options_1 = require("./question-type-scanning-options");
|
|
11
|
+
const question_type_setting_1 = require("./question-type-setting");
|
|
12
|
+
const scalar_1 = require("../common/scalar");
|
|
13
|
+
const translatable_1 = require("../common/translatable");
|
|
14
|
+
exports.QuestionTypeSchema = zod_1.z
|
|
12
15
|
.object({
|
|
13
|
-
$schema: z.string().optional(),
|
|
14
|
-
id: z
|
|
16
|
+
$schema: zod_1.z.string().optional(),
|
|
17
|
+
id: zod_1.z
|
|
15
18
|
.string()
|
|
16
19
|
.regex(/^([a-z][a-z0-9-]*)(\.[a-z][a-z0-9-]*)+$/, "Valid question type ID format")
|
|
17
20
|
.describe("Unique identifier for the question type (e.g. 'my-org.color-picker')"),
|
|
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
|
|
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
|
|
22
25
|
.string()
|
|
23
26
|
.max(1)
|
|
24
27
|
.optional()
|
|
25
28
|
.describe("Keyboard shortcut for quick access to this question type"),
|
|
26
|
-
generation: QuestionTypeGenerationOptions.optional(),
|
|
27
|
-
grading: QuestionTypeGradingOptions.optional(),
|
|
28
|
-
scanning: QuestionTypeScanningOptions.optional(),
|
|
29
|
-
timeEstimateMinutes: z
|
|
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
|
|
30
33
|
.number()
|
|
31
34
|
.min(1)
|
|
32
35
|
.optional()
|
|
33
36
|
.describe("Estimated time in minutes to complete this question type"),
|
|
34
|
-
isAi: z
|
|
37
|
+
isAi: zod_1.z
|
|
35
38
|
.boolean()
|
|
36
39
|
.optional()
|
|
37
40
|
.describe("Whether this question type uses AI functionality"),
|
|
38
|
-
backgroundColor: z
|
|
41
|
+
backgroundColor: zod_1.z
|
|
39
42
|
.string()
|
|
40
43
|
.optional()
|
|
41
44
|
.describe("Background color for the question type"),
|
|
42
|
-
enforcePosition: z
|
|
45
|
+
enforcePosition: zod_1.z
|
|
43
46
|
.enum(["start", "end"])
|
|
44
47
|
.optional()
|
|
45
48
|
.describe("Position enforcement for this question type"),
|
|
46
|
-
enforceTitle: Translatable.optional().describe("Enforced title for this question type"),
|
|
47
|
-
hideSettings: z
|
|
49
|
+
enforceTitle: translatable_1.Translatable.optional().describe("Enforced title for this question type"),
|
|
50
|
+
hideSettings: zod_1.z
|
|
48
51
|
.boolean()
|
|
49
52
|
.optional()
|
|
50
53
|
.describe("Whether to hide settings for this question type"),
|
|
51
|
-
isPreviewRefreshable: z
|
|
54
|
+
isPreviewRefreshable: zod_1.z
|
|
52
55
|
.boolean()
|
|
53
56
|
.optional()
|
|
54
57
|
.describe("Whether the preview can be refreshed for this question type"),
|
|
55
|
-
hasSimpleScoring: z
|
|
58
|
+
hasSimpleScoring: zod_1.z
|
|
56
59
|
.boolean()
|
|
57
60
|
.optional()
|
|
58
61
|
.describe("Whether this question type has simple scoring"),
|
|
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)
|
|
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)
|
|
65
68
|
.optional()
|
|
66
69
|
.describe("Configuration settings for the question type"),
|
|
67
|
-
public: z
|
|
70
|
+
public: zod_1.z
|
|
68
71
|
.boolean()
|
|
69
72
|
.optional()
|
|
70
73
|
.describe("Whether this question type is public and can be used by all users"),
|
|
71
|
-
translations: z
|
|
72
|
-
.record(z.string(), Translatable)
|
|
74
|
+
translations: zod_1.z
|
|
75
|
+
.record(zod_1.z.string(), translatable_1.Translatable)
|
|
73
76
|
.optional()
|
|
74
77
|
.describe("Custom translations for this question type"),
|
|
75
|
-
capabilities: QuestionTypeCapabilitiesSchema.optional().describe("Capabilities of the question type for various operations"),
|
|
76
|
-
export: z
|
|
78
|
+
capabilities: question_type_capabilities_1.QuestionTypeCapabilitiesSchema.optional().describe("Capabilities of the question type for various operations"),
|
|
79
|
+
export: zod_1.z
|
|
77
80
|
.object({
|
|
78
|
-
qti3: Qti3Mapping.optional().describe("QTI 3.0 mapping configuration for transforming questions to QTI format"),
|
|
81
|
+
qti3: question_type_qti3_1.Qti3Mapping.optional().describe("QTI 3.0 mapping configuration for transforming questions to QTI format"),
|
|
79
82
|
})
|
|
80
83
|
.optional()
|
|
81
84
|
.describe("Export configuration for various formats"),
|
|
82
|
-
import: z
|
|
85
|
+
import: zod_1.z
|
|
83
86
|
.object({
|
|
84
|
-
qti3: Qti3ImportMapping.optional().describe("QTI 3.0 import configuration for mapping incoming QTI items to this question type"),
|
|
87
|
+
qti3: question_type_qti3_1.Qti3ImportMapping.optional().describe("QTI 3.0 import configuration for mapping incoming QTI items to this question type"),
|
|
85
88
|
})
|
|
86
89
|
.optional()
|
|
87
90
|
.describe("Import configuration for various formats"),
|
|
88
|
-
metadata: z
|
|
89
|
-
.record(z.string(), ScalarSchema)
|
|
91
|
+
metadata: zod_1.z
|
|
92
|
+
.record(zod_1.z.string(), scalar_1.ScalarSchema)
|
|
90
93
|
.optional()
|
|
91
94
|
.describe("Optional metadata for the question type, only used by external applications"),
|
|
92
|
-
stylesheet: z.url().optional(),
|
|
93
|
-
index: z.number().optional(),
|
|
94
|
-
isDefault: z.boolean().optional(),
|
|
95
|
+
stylesheet: zod_1.z.url().optional(),
|
|
96
|
+
index: zod_1.z.number().optional(),
|
|
97
|
+
isDefault: zod_1.z.boolean().optional(),
|
|
95
98
|
})
|
|
96
99
|
.strict()
|
|
97
100
|
.describe("Schema for defining question types in the Examplary system");
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@examplary/schemas",
|
|
3
3
|
"packageManager": "yarn@4.8.1",
|
|
4
|
-
"version": "1.15.
|
|
4
|
+
"version": "1.15.1",
|
|
5
5
|
"description": "Schemas for the Examplary platform.",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build:schema": "tsx ./scripts/build.ts",
|
|
8
|
-
"build:tsc": "tsc ./src/index.ts --outDir dist --skipLibCheck --declaration",
|
|
8
|
+
"build:tsc": "tsc ./src/index.ts --outDir dist --skipLibCheck --declaration --module commonjs",
|
|
9
9
|
"dev": "yarn build:tsc --watch",
|
|
10
10
|
"build": "yarn build:tsc && yarn build:schema",
|
|
11
11
|
"deploy": "bash -c 'serverless deploy --verbose --stage ${STAGE/staging/production}'",
|