@examplary/schemas 1.11.0 → 1.12.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.
@@ -10,5 +10,7 @@ export * from "./question-type-grading-options";
10
10
  export type * from "./question-type-grading-options";
11
11
  export * from "./question-type-scanning-options";
12
12
  export type * from "./question-type-scanning-options";
13
+ export * from "./question-type-capabilities";
14
+ export type * from "./question-type-capabilities";
13
15
  export * from "./question-type-qti3";
14
16
  export type * from "./question-type-qti3";
@@ -20,4 +20,5 @@ __exportStar(require("./question-type-components"), exports);
20
20
  __exportStar(require("./question-type-generation-options"), exports);
21
21
  __exportStar(require("./question-type-grading-options"), exports);
22
22
  __exportStar(require("./question-type-scanning-options"), exports);
23
+ __exportStar(require("./question-type-capabilities"), exports);
23
24
  __exportStar(require("./question-type-qti3"), exports);
@@ -0,0 +1,5 @@
1
+ import { z } from "zod";
2
+ export declare const QuestionTypeCapabilitiesSchema: z.ZodObject<{
3
+ "answer-scanning": z.ZodOptional<z.ZodBoolean>;
4
+ }, z.core.$loose>;
5
+ export type QuestionTypeCapabilities = z.infer<typeof QuestionTypeCapabilitiesSchema>;
@@ -0,0 +1,10 @@
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
7
+ .boolean()
8
+ .optional()
9
+ .describe("Whether this question type allows the student to scan an answer using their phone. Only supported for practice spaces."),
10
+ });
@@ -21,13 +21,13 @@ export declare const QuestionTypeSetting: z.ZodObject<{
21
21
  }>;
22
22
  index: z.ZodOptional<z.ZodNumber>;
23
23
  hidden: z.ZodOptional<z.ZodBoolean>;
24
- default: z.ZodOptional<z.ZodAny>;
24
+ default: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
25
25
  required: z.ZodOptional<z.ZodBoolean>;
26
26
  options: z.ZodOptional<z.ZodArray<z.ZodObject<{
27
27
  value: z.ZodString;
28
28
  label: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
29
29
  }, z.core.$strict>>>;
30
- placeholder: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>;
30
+ placeholder: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>>;
31
31
  step: z.ZodOptional<z.ZodNumber>;
32
32
  min: z.ZodOptional<z.ZodNumber>;
33
33
  max: z.ZodOptional<z.ZodNumber>;
@@ -39,7 +39,7 @@ exports.QuestionTypeSetting = zod_1.z
39
39
  .boolean()
40
40
  .optional()
41
41
  .describe("Whether the setting is hidden from the user"),
42
- default: zod_1.z.any().optional().describe("Default value for the setting"),
42
+ default: zod_1.z.any().nullish().describe("Default value for the setting"),
43
43
  required: zod_1.z
44
44
  .boolean()
45
45
  .optional()
@@ -48,7 +48,7 @@ exports.QuestionTypeSetting = zod_1.z
48
48
  .array(exports.QuestionTypeSettingOption)
49
49
  .optional()
50
50
  .describe("Available options for enum type settings"),
51
- placeholder: translatable_1.Translatable.optional().describe("Placeholder text for the setting"),
51
+ placeholder: translatable_1.Translatable.nullish().describe("Placeholder text for the setting"),
52
52
  step: zod_1.z.number().optional().describe("Step value for number type settings"),
53
53
  min: zod_1.z
54
54
  .number()
@@ -55,19 +55,22 @@ export declare const QuestionTypeSchema: z.ZodObject<{
55
55
  }>;
56
56
  index: z.ZodOptional<z.ZodNumber>;
57
57
  hidden: z.ZodOptional<z.ZodBoolean>;
58
- default: z.ZodOptional<z.ZodAny>;
58
+ default: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
59
59
  required: z.ZodOptional<z.ZodBoolean>;
60
60
  options: z.ZodOptional<z.ZodArray<z.ZodObject<{
61
61
  value: z.ZodString;
62
62
  label: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
63
63
  }, z.core.$strict>>>;
64
- placeholder: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>;
64
+ placeholder: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>>;
65
65
  step: z.ZodOptional<z.ZodNumber>;
66
66
  min: z.ZodOptional<z.ZodNumber>;
67
67
  max: z.ZodOptional<z.ZodNumber>;
68
68
  }, z.core.$strict>>>;
69
69
  public: z.ZodOptional<z.ZodBoolean>;
70
70
  translations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>>;
71
+ capabilities: z.ZodOptional<z.ZodObject<{
72
+ "answer-scanning": z.ZodOptional<z.ZodBoolean>;
73
+ }, z.core.$loose>>;
71
74
  export: z.ZodOptional<z.ZodObject<{
72
75
  qti3: z.ZodOptional<z.ZodObject<{
73
76
  interaction: z.ZodObject<{
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.QuestionTypeSchema = void 0;
4
4
  var zod_1 = require("zod");
5
+ var question_type_capabilities_1 = require("./question-type-capabilities");
5
6
  var question_type_components_1 = require("./question-type-components");
6
7
  var question_type_generation_options_1 = require("./question-type-generation-options");
7
8
  var question_type_grading_options_1 = require("./question-type-grading-options");
@@ -74,6 +75,7 @@ exports.QuestionTypeSchema = zod_1.z
74
75
  .record(zod_1.z.string(), translatable_1.Translatable)
75
76
  .optional()
76
77
  .describe("Custom translations for this question type"),
78
+ capabilities: question_type_capabilities_1.QuestionTypeCapabilitiesSchema.optional().describe("Capabilities of the question type for various operations"),
77
79
  export: zod_1.z
78
80
  .object({
79
81
  qti3: question_type_qti3_1.Qti3Mapping.optional().describe("QTI 3.0 mapping configuration for transforming questions to QTI format"),
@@ -354,7 +354,13 @@
354
354
  "type": "boolean"
355
355
  },
356
356
  "default": {
357
- "description": "Default value for the setting"
357
+ "description": "Default value for the setting",
358
+ "anyOf": [
359
+ {},
360
+ {
361
+ "type": "null"
362
+ }
363
+ ]
358
364
  },
359
365
  "required": {
360
366
  "description": "Whether this setting is required",
@@ -403,19 +409,26 @@
403
409
  "description": "Placeholder text for the setting",
404
410
  "anyOf": [
405
411
  {
406
- "type": "string",
407
- "description": "Simple string value"
412
+ "anyOf": [
413
+ {
414
+ "type": "string",
415
+ "description": "Simple string value"
416
+ },
417
+ {
418
+ "type": "object",
419
+ "propertyNames": {
420
+ "type": "string",
421
+ "pattern": "^[a-z]{2}(-[A-Z]{2})?$"
422
+ },
423
+ "additionalProperties": {
424
+ "type": "string"
425
+ },
426
+ "description": "Translation object with language codes as keys"
427
+ }
428
+ ]
408
429
  },
409
430
  {
410
- "type": "object",
411
- "propertyNames": {
412
- "type": "string",
413
- "pattern": "^[a-z]{2}(-[A-Z]{2})?$"
414
- },
415
- "additionalProperties": {
416
- "type": "string"
417
- },
418
- "description": "Translation object with language codes as keys"
431
+ "type": "null"
419
432
  }
420
433
  ]
421
434
  },
@@ -471,6 +484,17 @@
471
484
  ]
472
485
  }
473
486
  },
487
+ "capabilities": {
488
+ "description": "Capabilities of the question type for various operations",
489
+ "type": "object",
490
+ "properties": {
491
+ "answer-scanning": {
492
+ "description": "Whether this question type allows the student to scan an answer using their phone. Only supported for practice spaces.",
493
+ "type": "boolean"
494
+ }
495
+ },
496
+ "additionalProperties": {}
497
+ },
474
498
  "export": {
475
499
  "description": "Export configuration for various formats",
476
500
  "type": "object",
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.11.0",
4
+ "version": "1.12.0",
5
5
  "description": "Schemas for the Examplary platform.",
6
6
  "scripts": {
7
7
  "build:schema": "tsx ./scripts/build.ts",