@examplary/schemas 1.6.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/common/scalar.d.ts +3 -0
  2. package/dist/common/scalar.js +10 -0
  3. package/dist/index.d.ts +6 -8
  4. package/dist/index.js +5 -5
  5. package/dist/question/index.d.ts +4 -0
  6. package/dist/question/index.js +18 -0
  7. package/dist/question/legacy-question-scoring-criteria.d.ts +9 -0
  8. package/dist/question/legacy-question-scoring-criteria.js +10 -0
  9. package/dist/question/question-scoring.d.ts +55 -0
  10. package/dist/question/question-scoring.js +29 -0
  11. package/dist/question/question.d.ts +42 -0
  12. package/dist/question/question.js +26 -0
  13. package/{src/index.ts → dist/question-type/index.d.ts} +0 -5
  14. package/dist/question-type/index.js +20 -0
  15. package/dist/question-type/question-type-qti3.d.ts +60 -0
  16. package/dist/question-type/question-type-qti3.js +48 -0
  17. package/dist/{question-type-setting.js → question-type/question-type-setting.js} +1 -1
  18. package/dist/{question-type.d.ts → question-type/question-type.d.ts} +31 -0
  19. package/dist/{question-type.js → question-type/question-type.js} +13 -1
  20. package/dist/schemas/question-scoring.json +197 -0
  21. package/dist/schemas/question-type.json +179 -74
  22. package/dist/schemas/question.json +364 -0
  23. package/package.json +7 -1
  24. package/.env +0 -1
  25. package/.serverless/cloudformation-template-update-stack.json +0 -175
  26. package/.serverless/meta.json +0 -274
  27. package/.serverless/serverless-state.json +0 -402
  28. package/.turbo/turbo-build.log +0 -1
  29. package/.turbo/turbo-deploy.log +0 -43
  30. package/.turbo/turbo-release.log +0 -114
  31. package/scripts/build.ts +0 -16
  32. package/serverless.yml +0 -25
  33. package/src/question-type-components.ts +0 -36
  34. package/src/question-type-generation-options.ts +0 -21
  35. package/src/question-type-grading-options.ts +0 -21
  36. package/src/question-type-setting.ts +0 -70
  37. package/src/question-type.ts +0 -104
  38. package/src/translatable.ts +0 -17
  39. /package/dist/{translatable.d.ts → common/translatable.d.ts} +0 -0
  40. /package/dist/{translatable.js → common/translatable.js} +0 -0
  41. /package/dist/{question-type-components.d.ts → question-type/question-type-components.d.ts} +0 -0
  42. /package/dist/{question-type-components.js → question-type/question-type-components.js} +0 -0
  43. /package/dist/{question-type-generation-options.d.ts → question-type/question-type-generation-options.d.ts} +0 -0
  44. /package/dist/{question-type-generation-options.js → question-type/question-type-generation-options.js} +0 -0
  45. /package/dist/{question-type-grading-options.d.ts → question-type/question-type-grading-options.d.ts} +0 -0
  46. /package/dist/{question-type-grading-options.js → question-type/question-type-grading-options.js} +0 -0
  47. /package/dist/{question-type-setting.d.ts → question-type/question-type-setting.d.ts} +0 -0
@@ -0,0 +1,3 @@
1
+ import { z } from "zod";
2
+ export declare const ScalarSchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
3
+ export type Scalar = z.infer<typeof ScalarSchema>;
@@ -0,0 +1,10 @@
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(),
10
+ ]);
package/dist/index.d.ts CHANGED
@@ -1,10 +1,8 @@
1
- export * from "./translatable";
2
- export type * from "./translatable";
3
1
  export * from "./question-type";
4
2
  export type * from "./question-type";
5
- export * from "./question-type-setting";
6
- export type * from "./question-type-setting";
7
- export * from "./question-type-components";
8
- export type * from "./question-type-components";
9
- export * from "./question-type-generation-options";
10
- export type * from "./question-type-generation-options";
3
+ export * from "./question";
4
+ export type * from "./question";
5
+ export * from "./common/scalar";
6
+ export type * from "./common/scalar";
7
+ export * from "./common/translatable";
8
+ export type * from "./common/translatable";
package/dist/index.js CHANGED
@@ -14,10 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- // General
18
- __exportStar(require("./translatable"), exports);
19
17
  // Question types
20
18
  __exportStar(require("./question-type"), exports);
21
- __exportStar(require("./question-type-setting"), exports);
22
- __exportStar(require("./question-type-components"), exports);
23
- __exportStar(require("./question-type-generation-options"), exports);
19
+ // Questions
20
+ __exportStar(require("./question"), exports);
21
+ // Common
22
+ __exportStar(require("./common/scalar"), exports);
23
+ __exportStar(require("./common/translatable"), exports);
@@ -0,0 +1,4 @@
1
+ export * from "./question";
2
+ export type * from "./question";
3
+ export * from "./question-scoring";
4
+ export type * from "./question-scoring";
@@ -0,0 +1,18 @@
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);
@@ -0,0 +1,9 @@
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>;
@@ -0,0 +1,10 @@
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
+ }));
@@ -0,0 +1,55 @@
1
+ import { z } from "zod";
2
+ export declare const ScoringCriterionSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
5
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6
+ points: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
7
+ minPoints: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
8
+ maxPoints: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
9
+ }, z.core.$strip>;
10
+ export type ScoringCriterion = z.infer<typeof ScoringCriterionSchema>;
11
+ export declare const TopLevelScoringCriterionSchema: z.ZodObject<{
12
+ id: z.ZodString;
13
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
14
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
15
+ points: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
16
+ minPoints: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
17
+ maxPoints: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
18
+ levels: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
19
+ id: z.ZodString;
20
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
21
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
22
+ points: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
23
+ minPoints: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
24
+ maxPoints: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
25
+ }, z.core.$strip>>>>;
26
+ }, z.core.$strip>;
27
+ export declare enum RubricType {
28
+ Simple = "simple",
29
+ Analytical = "analytical",
30
+ Holistic = "holistic",
31
+ ExactValues = "exact-values"
32
+ }
33
+ export declare const QuestionScoringSchema: z.ZodObject<{
34
+ rubricType: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof RubricType>>>;
35
+ criteria: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
36
+ id: z.ZodString;
37
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
38
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
39
+ points: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
40
+ minPoints: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
41
+ maxPoints: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
42
+ levels: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
43
+ id: z.ZodString;
44
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
45
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
46
+ points: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
47
+ minPoints: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
48
+ maxPoints: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
49
+ }, z.core.$strip>>>>;
50
+ }, z.core.$strip>>>>;
51
+ guidance: z.ZodOptional<z.ZodNullable<z.ZodString>>;
52
+ modelAnswer: z.ZodOptional<z.ZodNullable<z.ZodString>>;
53
+ templateId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
54
+ }, z.core.$strip>;
55
+ export type QuestionScoring = z.infer<typeof QuestionScoringSchema>;
@@ -0,0 +1,29 @@
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(),
12
+ });
13
+ exports.TopLevelScoringCriterionSchema = exports.ScoringCriterionSchema.extend({
14
+ levels: zod_1.z.array(exports.ScoringCriterionSchema).nullish(),
15
+ });
16
+ var RubricType;
17
+ (function (RubricType) {
18
+ RubricType["Simple"] = "simple";
19
+ RubricType["Analytical"] = "analytical";
20
+ RubricType["Holistic"] = "holistic";
21
+ 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
+ guidance: zod_1.z.string().nullish(),
27
+ modelAnswer: zod_1.z.string().nullish(),
28
+ templateId: zod_1.z.string().nullish(),
29
+ });
@@ -0,0 +1,42 @@
1
+ import { z } from "zod";
2
+ export declare const QuestionSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ type: z.ZodString;
5
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7
+ settings: z.ZodObject<{}, z.core.$loose>;
8
+ scoring: z.ZodOptional<z.ZodNullable<z.ZodObject<{
9
+ rubricType: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof import("./question-scoring").RubricType>>>;
10
+ criteria: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
11
+ id: z.ZodString;
12
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
13
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
14
+ points: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
15
+ minPoints: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
16
+ maxPoints: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
17
+ levels: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
18
+ id: z.ZodString;
19
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
20
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
21
+ points: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
22
+ minPoints: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
23
+ maxPoints: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
24
+ }, z.core.$strip>>>>;
25
+ }, z.core.$strip>>>>;
26
+ guidance: z.ZodOptional<z.ZodNullable<z.ZodString>>;
27
+ modelAnswer: z.ZodOptional<z.ZodNullable<z.ZodString>>;
28
+ templateId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
29
+ }, z.core.$strip>>>;
30
+ tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
31
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>>;
32
+ v: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
33
+ questionBankItemId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
34
+ traceIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
35
+ /** @deprecated Replaced with `scoring` object */
36
+ scoringCriteria: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
37
+ id: z.ZodOptional<z.ZodString>;
38
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
39
+ points: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
40
+ }, z.core.$strip>>>>;
41
+ }, z.core.$loose>;
42
+ export type Question = z.infer<typeof QuestionSchema>;
@@ -0,0 +1,26 @@
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({}),
14
+ // Scoring
15
+ scoring: question_scoring_1.QuestionScoringSchema.nullish(),
16
+ // 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(),
19
+ // 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(),
26
+ });
@@ -1,8 +1,3 @@
1
- // General
2
- export * from "./translatable";
3
- export type * from "./translatable";
4
-
5
- // Question types
6
1
  export * from "./question-type";
7
2
  export type * from "./question-type";
8
3
  export * from "./question-type-setting";
@@ -0,0 +1,20 @@
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);
@@ -0,0 +1,60 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Supported QTI 3.0 interaction types
4
+ */
5
+ export declare const QtiInteractionType: z.ZodEnum<{
6
+ AssociateInteraction: "AssociateInteraction";
7
+ ChoiceInteraction: "ChoiceInteraction";
8
+ DrawingInteraction: "DrawingInteraction";
9
+ EndAttemptInteraction: "EndAttemptInteraction";
10
+ ExtendedTextInteraction: "ExtendedTextInteraction";
11
+ GapMatchInteraction: "GapMatchInteraction";
12
+ GraphicAssociateInteraction: "GraphicAssociateInteraction";
13
+ GraphicGapMatchInteraction: "GraphicGapMatchInteraction";
14
+ GraphicOrderInteraction: "GraphicOrderInteraction";
15
+ HotspotInteraction: "HotspotInteraction";
16
+ HottextInteraction: "HottextInteraction";
17
+ InlineChoiceInteraction: "InlineChoiceInteraction";
18
+ MatchInteraction: "MatchInteraction";
19
+ MediaInteraction: "MediaInteraction";
20
+ OrderInteraction: "OrderInteraction";
21
+ PortableCustomInteraction: "PortableCustomInteraction";
22
+ PositionObjectInteraction: "PositionObjectInteraction";
23
+ SelectPointInteraction: "SelectPointInteraction";
24
+ SliderInteraction: "SliderInteraction";
25
+ TextEntryInteraction: "TextEntryInteraction";
26
+ UploadInteraction: "UploadInteraction";
27
+ }>;
28
+ export type QtiInteractionType = z.infer<typeof QtiInteractionType>;
29
+ /**
30
+ * Complete QTI mapping configuration for a question type
31
+ */
32
+ export declare const Qti3Mapping: z.ZodObject<{
33
+ interaction: z.ZodObject<{
34
+ type: z.ZodEnum<{
35
+ AssociateInteraction: "AssociateInteraction";
36
+ ChoiceInteraction: "ChoiceInteraction";
37
+ DrawingInteraction: "DrawingInteraction";
38
+ EndAttemptInteraction: "EndAttemptInteraction";
39
+ ExtendedTextInteraction: "ExtendedTextInteraction";
40
+ GapMatchInteraction: "GapMatchInteraction";
41
+ GraphicAssociateInteraction: "GraphicAssociateInteraction";
42
+ GraphicGapMatchInteraction: "GraphicGapMatchInteraction";
43
+ GraphicOrderInteraction: "GraphicOrderInteraction";
44
+ HotspotInteraction: "HotspotInteraction";
45
+ HottextInteraction: "HottextInteraction";
46
+ InlineChoiceInteraction: "InlineChoiceInteraction";
47
+ MatchInteraction: "MatchInteraction";
48
+ MediaInteraction: "MediaInteraction";
49
+ OrderInteraction: "OrderInteraction";
50
+ PortableCustomInteraction: "PortableCustomInteraction";
51
+ PositionObjectInteraction: "PositionObjectInteraction";
52
+ SelectPointInteraction: "SelectPointInteraction";
53
+ SliderInteraction: "SliderInteraction";
54
+ TextEntryInteraction: "TextEntryInteraction";
55
+ UploadInteraction: "UploadInteraction";
56
+ }>;
57
+ options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodAny>, z.ZodObject<{}, z.core.$strip>]>>>;
58
+ }, z.core.$strip>;
59
+ }, z.core.$strip>;
60
+ export type Qti3Mapping = z.infer<typeof Qti3Mapping>;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Qti3Mapping = exports.QtiInteractionType = void 0;
4
+ var zod_1 = require("zod");
5
+ /**
6
+ * A value that can either be a literal or a JSONata expression string.
7
+ * JSONata expressions are evaluated at transform time against the question context.
8
+ */
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({})])
11
+ .describe("Literal or JSONata expression string starting with '='");
12
+ /**
13
+ * Supported QTI 3.0 interaction types
14
+ */
15
+ exports.QtiInteractionType = zod_1.z.enum([
16
+ "AssociateInteraction",
17
+ "ChoiceInteraction",
18
+ "DrawingInteraction",
19
+ "EndAttemptInteraction",
20
+ "ExtendedTextInteraction",
21
+ "GapMatchInteraction",
22
+ "GraphicAssociateInteraction",
23
+ "GraphicGapMatchInteraction",
24
+ "GraphicOrderInteraction",
25
+ "HotspotInteraction",
26
+ "HottextInteraction",
27
+ "InlineChoiceInteraction",
28
+ "MatchInteraction",
29
+ "MediaInteraction",
30
+ "OrderInteraction",
31
+ "PortableCustomInteraction",
32
+ "PositionObjectInteraction",
33
+ "SelectPointInteraction",
34
+ "SliderInteraction",
35
+ "TextEntryInteraction",
36
+ "UploadInteraction",
37
+ ]);
38
+ /**
39
+ * Complete QTI mapping configuration for a question type
40
+ */
41
+ exports.Qti3Mapping = zod_1.z
42
+ .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(),
46
+ }),
47
+ })
48
+ .describe("QTI 3.0 mapping configuration for transforming questions to QTI format");
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.QuestionTypeSetting = exports.QuestionTypeSettingOption = void 0;
4
4
  var zod_1 = require("zod");
5
- var translatable_1 = require("./translatable");
5
+ var translatable_1 = require("../common/translatable");
6
6
  // Setting option for enum type settings
7
7
  exports.QuestionTypeSettingOption = zod_1.z
8
8
  .object({
@@ -65,7 +65,38 @@ export declare const QuestionTypeSchema: z.ZodObject<{
65
65
  }, z.core.$strict>>>;
66
66
  public: z.ZodOptional<z.ZodBoolean>;
67
67
  translations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>>;
68
+ export: z.ZodOptional<z.ZodObject<{
69
+ qti3: z.ZodOptional<z.ZodObject<{
70
+ interaction: z.ZodObject<{
71
+ type: z.ZodEnum<{
72
+ AssociateInteraction: "AssociateInteraction";
73
+ ChoiceInteraction: "ChoiceInteraction";
74
+ DrawingInteraction: "DrawingInteraction";
75
+ EndAttemptInteraction: "EndAttemptInteraction";
76
+ ExtendedTextInteraction: "ExtendedTextInteraction";
77
+ GapMatchInteraction: "GapMatchInteraction";
78
+ GraphicAssociateInteraction: "GraphicAssociateInteraction";
79
+ GraphicGapMatchInteraction: "GraphicGapMatchInteraction";
80
+ GraphicOrderInteraction: "GraphicOrderInteraction";
81
+ HotspotInteraction: "HotspotInteraction";
82
+ HottextInteraction: "HottextInteraction";
83
+ InlineChoiceInteraction: "InlineChoiceInteraction";
84
+ MatchInteraction: "MatchInteraction";
85
+ MediaInteraction: "MediaInteraction";
86
+ OrderInteraction: "OrderInteraction";
87
+ PortableCustomInteraction: "PortableCustomInteraction";
88
+ PositionObjectInteraction: "PositionObjectInteraction";
89
+ SelectPointInteraction: "SelectPointInteraction";
90
+ SliderInteraction: "SliderInteraction";
91
+ TextEntryInteraction: "TextEntryInteraction";
92
+ UploadInteraction: "UploadInteraction";
93
+ }>;
94
+ options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodAny>, z.ZodObject<{}, z.core.$strip>]>>>;
95
+ }, z.core.$strip>;
96
+ }, z.core.$strip>>;
97
+ }, z.core.$strip>>;
68
98
  stylesheet: z.ZodOptional<z.ZodURL>;
69
99
  index: z.ZodOptional<z.ZodNumber>;
100
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
70
101
  }, z.core.$strict>;
71
102
  export type QuestionType = z.infer<typeof QuestionTypeSchema>;
@@ -5,8 +5,10 @@ var zod_1 = require("zod");
5
5
  var question_type_components_1 = require("./question-type-components");
6
6
  var question_type_generation_options_1 = require("./question-type-generation-options");
7
7
  var question_type_grading_options_1 = require("./question-type-grading-options");
8
+ var question_type_qti3_1 = require("./question-type-qti3");
8
9
  var question_type_setting_1 = require("./question-type-setting");
9
- var translatable_1 = require("./translatable");
10
+ var scalar_1 = require("../common/scalar");
11
+ var translatable_1 = require("../common/translatable");
10
12
  exports.QuestionTypeSchema = zod_1.z
11
13
  .object({
12
14
  $schema: zod_1.z.string().optional(),
@@ -70,8 +72,18 @@ exports.QuestionTypeSchema = zod_1.z
70
72
  .record(zod_1.z.string(), translatable_1.Translatable)
71
73
  .optional()
72
74
  .describe("Custom translations for this question type"),
75
+ export: zod_1.z
76
+ .object({
77
+ qti3: question_type_qti3_1.Qti3Mapping.optional().describe("QTI 3.0 mapping configuration for transforming questions to QTI format"),
78
+ })
79
+ .optional()
80
+ .describe("Export configuration for various formats"),
73
81
  stylesheet: zod_1.z.url().optional(),
74
82
  index: zod_1.z.number().optional(),
83
+ metadata: zod_1.z
84
+ .record(zod_1.z.string(), scalar_1.ScalarSchema)
85
+ .optional()
86
+ .describe("Optional metadata for the question type, only used by external applications"),
75
87
  })
76
88
  .strict()
77
89
  .describe("Schema for defining question types in the Examplary system");