@conform-ed/contracts 0.0.13 → 0.0.14
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/.turbo/turbo-format.log +1 -1
- package/.turbo/turbo-lint.log +1 -1
- package/.turbo/turbo-test.log +180 -180
- package/package.json +4 -4
- package/src/adapter.ts +1 -1
- package/src/caliper/v1_2/caliper_v1p2_bootcamp_schema.ts +6 -6
- package/src/caliper/v1_2/shared.ts +2 -2
- package/src/case/v1_1/case_v1p1_openapi3_restbinding_schema.ts +1 -0
- package/src/case/v1_1/index.ts +41 -41
- package/src/cat/v1_0/index.ts +39 -39
- package/src/cat/v1_0/shared.ts +1 -1
- package/src/clr/v2_0/shared.ts +19 -17
- package/src/cmi5/v1_0/index.ts +19 -19
- package/src/common-cartridge/v1_3/ccv1p3_imscp_v1p2_v1p0.ts +3 -3
- package/src/common-cartridge/v1_3/ccv1p3_lomccltilink_v1p0.ts +2 -1
- package/src/common-cartridge/v1_3/ccv1p3_lommanifest_v1p0.ts +2 -1
- package/src/common-cartridge/v1_3/ccv1p3_lomresource_v1p0.ts +2 -1
- package/src/common-cartridge/v1_3/ccv1p3_qtiasiv1p2p1_v1p0.ts +16 -13
- package/src/common-cartridge/v1_3/index.ts +3 -3
- package/src/common-cartridge/v1_3/lom-internal.ts +19 -19
- package/src/common-cartridge/v1_3/shared.ts +1 -1
- package/src/common-cartridge/v1_4/core/ccv1p4_imscp_v1p2_v1p0.ts +6 -6
- package/src/common-cartridge/v1_4/core/ccv1p4_lommanifest_v1p0.ts +2 -1
- package/src/common-cartridge/v1_4/core/ccv1p4_lomresource_v1p0.ts +2 -1
- package/src/common-cartridge/v1_4/extension/ccv1p4_cpextensionv1p2_v1p0.ts +1 -0
- package/src/common-cartridge/v1_4/index.ts +5 -5
- package/src/common-cartridge/v1_4/k12/ccv1p4_lommanifest_v1p0.ts +2 -1
- package/src/common-cartridge/v1_4/k12/ccv1p4_lomresource_v1p0.ts +2 -1
- package/src/common-cartridge/v1_4/lom-internal.ts +30 -27
- package/src/common-cartridge/v1_4/shared/ccv1p4_lomccltilink_v1p0.ts +2 -1
- package/src/common-cartridge/v1_4/shared/ccv1p4_qtiasiv1p2p1_v1p0.ts +16 -13
- package/src/common-cartridge/v1_4/shared.ts +1 -1
- package/src/common-cartridge/v1_4/thin/ccv1p4_imscp_v1p2_v1p0.ts +5 -5
- package/src/common-cartridge/v1_4/thin/ccv1p4_lommanifest_v1p0.ts +2 -1
- package/src/common-cartridge/v1_4/thin/ccv1p4_lomresource_v1p0.ts +2 -1
- package/src/common-cartridge/v1_4/vdex/imsmd_loose_v1p3p2.ts +2 -1
- package/src/common-cartridge/v1_4/vdex/imsvdex_v1p0.ts +1 -1
- package/src/config.ts +3 -3
- package/src/h5p/v1/content.ts +1 -0
- package/src/h5p/v1/h5p-json.ts +4 -3
- package/src/h5p/v1/index.ts +21 -21
- package/src/h5p/v1/library-json.ts +2 -1
- package/src/lti/ags/v2_0/index.ts +12 -12
- package/src/lti/deep-linking/v2_0/index.ts +10 -10
- package/src/lti/index.ts +2 -2
- package/src/lti/nrps/v2_0/index.ts +10 -10
- package/src/lti/proctoring/v1_0/index.ts +11 -11
- package/src/lti/v1_3/index.ts +17 -17
- package/src/oneroster/v1_2/index.ts +45 -45
- package/src/oneroster/v1_2/or_v1p2_gradebook_restbinding_schema.ts +3 -3
- package/src/oneroster/v1_2/or_v1p2_resource_restbinding_schema.ts +1 -1
- package/src/oneroster/v1_2/or_v1p2_rostering_restbinding_schema.ts +1 -1
- package/src/oneroster/v1_2/or_v1p2_rostering_service_schema.ts +1 -1
- package/src/open-badges/v3_0/shared.ts +31 -29
- package/src/qti/v2-internal.ts +12 -11
- package/src/qti/v3_0_1/assessment-internal.ts +198 -178
- package/src/qti/v3_0_1/imsqti_asiv3p0p1_v1p0.ts +4 -4
- package/src/qti/v3_0_1/imsqti_itemv3p0p1_v1p0.ts +1 -1
- package/src/qti/v3_0_1/imsqti_metadatav3p0_v1p0.ts +1 -1
- package/src/qti/v3_0_1/imsqti_responseprocessingv3p0p1_v1p0.ts +1 -1
- package/src/qti/v3_0_1/imsqti_resultv3p0_v1p0.ts +4 -3
- package/src/qti/v3_0_1/imsqti_sectionv3p0p1_v1p0.ts +1 -1
- package/src/qti/v3_0_1/imsqti_stimulusv3p0p1_v1p0.ts +1 -1
- package/src/qti/v3_0_1/imsqti_testv3p0p1_v1p0.ts +2 -2
- package/src/qti/v3_0_1/imsqti_usagedatav3p0_v1p0.ts +1 -1
- package/src/qti/v3_0_1/processing-internal.ts +33 -33
- package/src/qti/v3_0_1/shared.ts +2 -2
- package/src/vc-data-model/v2_0/shared.ts +4 -4
- package/src/xapi/shared.ts +11 -14
- package/src/xapi/v1_0_3/index.ts +54 -54
- package/src/xapi/v2_0/index.ts +56 -56
- package/test/caliper-v1_2.test.ts +1 -1
- package/test/cat-v1_0.test.ts +1 -0
- package/test/cmi5-v1_0.test.ts +33 -31
- package/test/contracts.test.ts +1 -0
- package/test/h5p-v1.test.ts +1 -0
- package/test/lti.test.ts +1 -0
- package/test/qti-v3_0_1.test.ts +1 -0
- package/test/schema-examples.test.ts +1 -0
- package/test/xapi.test.ts +1 -0
package/src/lti/v1_3/index.ts
CHANGED
|
@@ -30,29 +30,29 @@ export const CoreLaunchRequestSchema = strictObject({
|
|
|
30
30
|
name: NonEmptyStringSchema.optional(),
|
|
31
31
|
givenName: NonEmptyStringSchema.optional(),
|
|
32
32
|
familyName: NonEmptyStringSchema.optional(),
|
|
33
|
-
email: z.
|
|
33
|
+
email: z.email().optional(),
|
|
34
34
|
locale: NonEmptyStringSchema.optional(),
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
export const CoreLaunchClaimsSchema = CoreLaunchRequestSchema;
|
|
38
38
|
|
|
39
|
-
export
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
39
|
+
export const LtiV1_3 = {
|
|
40
|
+
Schemas: {
|
|
41
|
+
ResourceLink: ResourceLinkSchema,
|
|
42
|
+
Context: ContextSchema,
|
|
43
|
+
LaunchPresentation: LaunchPresentationSchema,
|
|
44
|
+
Lis: LisSchema,
|
|
45
|
+
CoreLaunchRequest: CoreLaunchRequestSchema,
|
|
46
|
+
CoreLaunchClaims: CoreLaunchClaimsSchema,
|
|
47
|
+
},
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
}
|
|
49
|
+
Shared: {
|
|
50
|
+
Version: LtiVersionSchema,
|
|
51
|
+
Url: UrlSchema,
|
|
52
|
+
NonEmptyString: NonEmptyStringSchema,
|
|
53
|
+
Roles: RolesSchema,
|
|
54
|
+
},
|
|
55
|
+
} as const;
|
|
56
56
|
|
|
57
57
|
export type LtiV1_3Schemas = typeof LtiV1_3.Schemas;
|
|
58
58
|
|
|
@@ -7,51 +7,6 @@ export * from "./or_v1p2_gradebook_restbinding_schema";
|
|
|
7
7
|
export * from "./or_v1p2_resource_restbinding_schema";
|
|
8
8
|
export * from "./or_v1p2_csv_binding_schema";
|
|
9
9
|
|
|
10
|
-
import {
|
|
11
|
-
AcademicSessionSchema,
|
|
12
|
-
AcademicSessionSetSchema,
|
|
13
|
-
ClassSchema,
|
|
14
|
-
ClassSetSchema,
|
|
15
|
-
CourseSchema,
|
|
16
|
-
CourseSetSchema,
|
|
17
|
-
DemographicsSchema,
|
|
18
|
-
DemographicsSetSchema,
|
|
19
|
-
EnrollmentSchema,
|
|
20
|
-
EnrollmentSetSchema,
|
|
21
|
-
OrgSchema,
|
|
22
|
-
OrgSetSchema,
|
|
23
|
-
SingleAcademicSessionSchema,
|
|
24
|
-
SingleClassSchema,
|
|
25
|
-
SingleCourseSchema,
|
|
26
|
-
SingleDemographicsSchema,
|
|
27
|
-
SingleEnrollmentSchema,
|
|
28
|
-
SingleOrgSchema,
|
|
29
|
-
SingleUserSchema,
|
|
30
|
-
UserSchema,
|
|
31
|
-
UserSetSchema,
|
|
32
|
-
} from "./or_v1p2_rostering_service_schema";
|
|
33
|
-
import {
|
|
34
|
-
AssessmentLineItemSchema,
|
|
35
|
-
AssessmentLineItemSetSchema,
|
|
36
|
-
AssessmentResultSchema,
|
|
37
|
-
AssessmentResultSetSchema,
|
|
38
|
-
CategorySchema,
|
|
39
|
-
CategorySetSchema,
|
|
40
|
-
GuidPairSetSchema,
|
|
41
|
-
LineItemSchema,
|
|
42
|
-
LineItemSetSchema,
|
|
43
|
-
ResultSchema,
|
|
44
|
-
ResultSetSchema,
|
|
45
|
-
ScoreScaleSchema,
|
|
46
|
-
ScoreScaleSetSchema,
|
|
47
|
-
SingleAssessmentLineItemSchema,
|
|
48
|
-
SingleAssessmentResultSchema,
|
|
49
|
-
SingleCategorySchema,
|
|
50
|
-
SingleLineItemSchema,
|
|
51
|
-
SingleResultSchema,
|
|
52
|
-
SingleScoreScaleSchema,
|
|
53
|
-
} from "./or_v1p2_gradebook_service_schema";
|
|
54
|
-
import { ResourceSchema, ResourceSetSchema, SingleResourceSchema } from "./or_v1p2_resource_service_schema";
|
|
55
10
|
import {
|
|
56
11
|
AcademicSessionsCsvDocumentSchema,
|
|
57
12
|
CategoriesCsvDocumentSchema,
|
|
@@ -78,8 +33,53 @@ import {
|
|
|
78
33
|
UsersCsvDocumentSchema,
|
|
79
34
|
} from "./or_v1p2_csv_binding_schema";
|
|
80
35
|
import { GradebookRestBindingOperationSchemas } from "./or_v1p2_gradebook_restbinding_schema";
|
|
36
|
+
import {
|
|
37
|
+
AssessmentLineItemSchema,
|
|
38
|
+
AssessmentLineItemSetSchema,
|
|
39
|
+
AssessmentResultSchema,
|
|
40
|
+
AssessmentResultSetSchema,
|
|
41
|
+
CategorySchema,
|
|
42
|
+
CategorySetSchema,
|
|
43
|
+
GuidPairSetSchema,
|
|
44
|
+
LineItemSchema,
|
|
45
|
+
LineItemSetSchema,
|
|
46
|
+
ResultSchema,
|
|
47
|
+
ResultSetSchema,
|
|
48
|
+
ScoreScaleSchema,
|
|
49
|
+
ScoreScaleSetSchema,
|
|
50
|
+
SingleAssessmentLineItemSchema,
|
|
51
|
+
SingleAssessmentResultSchema,
|
|
52
|
+
SingleCategorySchema,
|
|
53
|
+
SingleLineItemSchema,
|
|
54
|
+
SingleResultSchema,
|
|
55
|
+
SingleScoreScaleSchema,
|
|
56
|
+
} from "./or_v1p2_gradebook_service_schema";
|
|
81
57
|
import { ResourceRestBindingOperationSchemas } from "./or_v1p2_resource_restbinding_schema";
|
|
58
|
+
import { ResourceSchema, ResourceSetSchema, SingleResourceSchema } from "./or_v1p2_resource_service_schema";
|
|
82
59
|
import { RosteringRestBindingOperationSchemas } from "./or_v1p2_rostering_restbinding_schema";
|
|
60
|
+
import {
|
|
61
|
+
AcademicSessionSchema,
|
|
62
|
+
AcademicSessionSetSchema,
|
|
63
|
+
ClassSchema,
|
|
64
|
+
ClassSetSchema,
|
|
65
|
+
CourseSchema,
|
|
66
|
+
CourseSetSchema,
|
|
67
|
+
DemographicsSchema,
|
|
68
|
+
DemographicsSetSchema,
|
|
69
|
+
EnrollmentSchema,
|
|
70
|
+
EnrollmentSetSchema,
|
|
71
|
+
OrgSchema,
|
|
72
|
+
OrgSetSchema,
|
|
73
|
+
SingleAcademicSessionSchema,
|
|
74
|
+
SingleClassSchema,
|
|
75
|
+
SingleCourseSchema,
|
|
76
|
+
SingleDemographicsSchema,
|
|
77
|
+
SingleEnrollmentSchema,
|
|
78
|
+
SingleOrgSchema,
|
|
79
|
+
SingleUserSchema,
|
|
80
|
+
UserSchema,
|
|
81
|
+
UserSetSchema,
|
|
82
|
+
} from "./or_v1p2_rostering_service_schema";
|
|
83
83
|
import { ImsxStatusInfoSchema } from "./shared";
|
|
84
84
|
|
|
85
85
|
export const OneRoster12DerivedZodTemplates = {
|
|
@@ -19,7 +19,7 @@ import { ImsxStatusInfoSchema } from "./shared";
|
|
|
19
19
|
|
|
20
20
|
const EmptyPayloadSchema = z.undefined();
|
|
21
21
|
|
|
22
|
-
function gradebookGetOperation(path: string, successResponsePayload: z.
|
|
22
|
+
function gradebookGetOperation(path: string, successResponsePayload: z.ZodType) {
|
|
23
23
|
return {
|
|
24
24
|
method: "GET",
|
|
25
25
|
path,
|
|
@@ -29,7 +29,7 @@ function gradebookGetOperation(path: string, successResponsePayload: z.ZodTypeAn
|
|
|
29
29
|
} as const;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
function gradebookPostOperation(path: string, requestPayload: z.
|
|
32
|
+
function gradebookPostOperation(path: string, requestPayload: z.ZodType, successResponsePayload: z.ZodType) {
|
|
33
33
|
return {
|
|
34
34
|
method: "POST",
|
|
35
35
|
path,
|
|
@@ -39,7 +39,7 @@ function gradebookPostOperation(path: string, requestPayload: z.ZodTypeAny, succ
|
|
|
39
39
|
} as const;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
function gradebookPutOperation(path: string, requestPayload: z.
|
|
42
|
+
function gradebookPutOperation(path: string, requestPayload: z.ZodType) {
|
|
43
43
|
return {
|
|
44
44
|
method: "PUT",
|
|
45
45
|
path,
|
|
@@ -5,7 +5,7 @@ import { ImsxStatusInfoSchema } from "./shared";
|
|
|
5
5
|
|
|
6
6
|
const EmptyPayloadSchema = z.undefined();
|
|
7
7
|
|
|
8
|
-
function resourceGetOperation(path: string, successResponsePayload: z.
|
|
8
|
+
function resourceGetOperation(path: string, successResponsePayload: z.ZodType) {
|
|
9
9
|
return {
|
|
10
10
|
method: "GET",
|
|
11
11
|
path,
|
|
@@ -20,7 +20,7 @@ import { ImsxStatusInfoSchema } from "./shared";
|
|
|
20
20
|
|
|
21
21
|
const EmptyPayloadSchema = z.undefined();
|
|
22
22
|
|
|
23
|
-
function rosteringGetOperation(path: string, successResponsePayload: z.
|
|
23
|
+
function rosteringGetOperation(path: string, successResponsePayload: z.ZodType) {
|
|
24
24
|
return {
|
|
25
25
|
method: "GET",
|
|
26
26
|
path,
|
|
@@ -27,51 +27,53 @@ const OpenBadgesV30ContextUrlSchema = z
|
|
|
27
27
|
.string()
|
|
28
28
|
.regex(/^https:\/\/purl\.imsglobal\.org\/spec\/ob\/v3p0\/context(-3\.\d\.\d)*\.json$/u);
|
|
29
29
|
|
|
30
|
+
// Declared output of a zod schema (z.ZodType<...>): zod's `.optional()` infers `| undefined`, so this must too.
|
|
30
31
|
type Profile = {
|
|
31
32
|
id: UriValue;
|
|
32
33
|
type: unknown;
|
|
33
|
-
name?: TextValue;
|
|
34
|
-
url?: UriValue;
|
|
35
|
-
phone?: TextValue;
|
|
36
|
-
description?: TextValue;
|
|
37
|
-
endorsement?: OneOrManyValue<EndorsementCredential
|
|
38
|
-
endorsementJwt?: OneOrManyValue<CompactJwsValue
|
|
39
|
-
image?: Record<string, unknown
|
|
40
|
-
email?: TextValue;
|
|
41
|
-
address?: Record<string, unknown
|
|
42
|
-
otherIdentifier?: OneOrManyValue<Record<string, unknown
|
|
43
|
-
official?: TextValue;
|
|
44
|
-
parentOrg?: Profile;
|
|
45
|
-
familyName?: TextValue;
|
|
46
|
-
givenName?: TextValue;
|
|
47
|
-
additionalName?: TextValue;
|
|
48
|
-
patronymicName?: TextValue;
|
|
49
|
-
honorificPrefix?: TextValue;
|
|
50
|
-
honorificSuffix?: TextValue;
|
|
51
|
-
familyNamePrefix?: TextValue;
|
|
52
|
-
dateOfBirth?: string;
|
|
34
|
+
name?: TextValue | undefined;
|
|
35
|
+
url?: UriValue | undefined;
|
|
36
|
+
phone?: TextValue | undefined;
|
|
37
|
+
description?: TextValue | undefined;
|
|
38
|
+
endorsement?: OneOrManyValue<EndorsementCredential> | undefined;
|
|
39
|
+
endorsementJwt?: OneOrManyValue<CompactJwsValue> | undefined;
|
|
40
|
+
image?: Record<string, unknown> | undefined;
|
|
41
|
+
email?: TextValue | undefined;
|
|
42
|
+
address?: Record<string, unknown> | undefined;
|
|
43
|
+
otherIdentifier?: OneOrManyValue<Record<string, unknown>> | undefined;
|
|
44
|
+
official?: TextValue | undefined;
|
|
45
|
+
parentOrg?: Profile | undefined;
|
|
46
|
+
familyName?: TextValue | undefined;
|
|
47
|
+
givenName?: TextValue | undefined;
|
|
48
|
+
additionalName?: TextValue | undefined;
|
|
49
|
+
patronymicName?: TextValue | undefined;
|
|
50
|
+
honorificPrefix?: TextValue | undefined;
|
|
51
|
+
honorificSuffix?: TextValue | undefined;
|
|
52
|
+
familyNamePrefix?: TextValue | undefined;
|
|
53
|
+
dateOfBirth?: string | undefined;
|
|
53
54
|
[key: string]: unknown;
|
|
54
55
|
};
|
|
55
56
|
|
|
56
57
|
type ProfileRef = Profile | UriValue;
|
|
57
58
|
|
|
59
|
+
// Declared output of a zod schema (z.ZodType<...>): zod's `.optional()` infers `| undefined`, so this must too.
|
|
58
60
|
type EndorsementCredential = {
|
|
59
61
|
"@context": JsonLdContextEntry[];
|
|
60
62
|
type: unknown;
|
|
61
63
|
id: UriValue;
|
|
62
64
|
name: TextValue;
|
|
63
|
-
description?: TextValue;
|
|
65
|
+
description?: TextValue | undefined;
|
|
64
66
|
credentialSubject: Record<string, unknown>;
|
|
65
|
-
awardedDate?: string;
|
|
67
|
+
awardedDate?: string | undefined;
|
|
66
68
|
issuer: ProfileRef;
|
|
67
69
|
validFrom: string;
|
|
68
|
-
validUntil?: string;
|
|
69
|
-
proof?: OneOrManyValue<Record<string, unknown
|
|
70
|
-
credentialSchema?: OneOrManyValue<Record<string, unknown
|
|
71
|
-
credentialStatus?: Record<string, unknown
|
|
72
|
-
refreshService?: Record<string, unknown
|
|
73
|
-
termsOfUse?: OneOrManyValue<Record<string, unknown
|
|
74
|
-
evidence?: OneOrManyValue<Record<string, unknown
|
|
70
|
+
validUntil?: string | undefined;
|
|
71
|
+
proof?: OneOrManyValue<Record<string, unknown>> | undefined;
|
|
72
|
+
credentialSchema?: OneOrManyValue<Record<string, unknown>> | undefined;
|
|
73
|
+
credentialStatus?: Record<string, unknown> | undefined;
|
|
74
|
+
refreshService?: Record<string, unknown> | undefined;
|
|
75
|
+
termsOfUse?: OneOrManyValue<Record<string, unknown>> | undefined;
|
|
76
|
+
evidence?: OneOrManyValue<Record<string, unknown>> | undefined;
|
|
75
77
|
[key: string]: unknown;
|
|
76
78
|
};
|
|
77
79
|
|
package/src/qti/v2-internal.ts
CHANGED
|
@@ -70,7 +70,7 @@ export function looseObject<T extends z.ZodRawShape>(shape: T) {
|
|
|
70
70
|
|
|
71
71
|
export function addIssue(context: z.RefinementCtx, path: Array<string | number>, message: string) {
|
|
72
72
|
context.addIssue({
|
|
73
|
-
code:
|
|
73
|
+
code: "custom",
|
|
74
74
|
path,
|
|
75
75
|
message,
|
|
76
76
|
});
|
|
@@ -110,7 +110,8 @@ function uniqueIdentifiersRefinement(
|
|
|
110
110
|
function validateDeclaredValues(
|
|
111
111
|
cardinality: z.infer<typeof QtiCardinalitySchema>,
|
|
112
112
|
baseType: z.infer<typeof QtiBaseTypeSchema> | undefined,
|
|
113
|
-
values
|
|
113
|
+
// Receives zod-parsed values; zod's `.optional()` infers `| undefined`, so this must too.
|
|
114
|
+
values: Array<{ fieldIdentifier?: string | undefined }>,
|
|
114
115
|
path: Array<string | number>,
|
|
115
116
|
context: z.RefinementCtx,
|
|
116
117
|
) {
|
|
@@ -147,7 +148,7 @@ export function createQti2Schemas(config: Qti2Config) {
|
|
|
147
148
|
value: z.string(),
|
|
148
149
|
});
|
|
149
150
|
|
|
150
|
-
const QtiContentNodeSchema: z.
|
|
151
|
+
const QtiContentNodeSchema: z.ZodType = z.lazy(() =>
|
|
151
152
|
z.union([
|
|
152
153
|
QtiTextNodeSchema,
|
|
153
154
|
looseObject({
|
|
@@ -814,7 +815,7 @@ export function createQti2Schemas(config: Qti2Config) {
|
|
|
814
815
|
] as const;
|
|
815
816
|
const manyKinds = ["and", "or", "sum", "product", "multiple", "ordered", "gcd", "lcm", "max", "min"] as const;
|
|
816
817
|
|
|
817
|
-
const QtiExpressionSchema: z.
|
|
818
|
+
const QtiExpressionSchema: z.ZodType = z.lazy(() =>
|
|
818
819
|
z
|
|
819
820
|
.union([
|
|
820
821
|
QtiBaseValueExpressionSchema,
|
|
@@ -996,7 +997,7 @@ export function createQti2Schemas(config: Qti2Config) {
|
|
|
996
997
|
}),
|
|
997
998
|
]);
|
|
998
999
|
|
|
999
|
-
const QtiResponseProcessingRuleSchema: z.
|
|
1000
|
+
const QtiResponseProcessingRuleSchema: z.ZodType = z.lazy(() =>
|
|
1000
1001
|
z.union([
|
|
1001
1002
|
QtiSetOutcomeValueSchema,
|
|
1002
1003
|
QtiLookupOutcomeValueRuleSchema,
|
|
@@ -1026,7 +1027,7 @@ export function createQti2Schemas(config: Qti2Config) {
|
|
|
1026
1027
|
]),
|
|
1027
1028
|
);
|
|
1028
1029
|
|
|
1029
|
-
const QtiOutcomeProcessingRuleSchema: z.
|
|
1030
|
+
const QtiOutcomeProcessingRuleSchema: z.ZodType = z.lazy(() =>
|
|
1030
1031
|
z.union([
|
|
1031
1032
|
QtiSetOutcomeValueSchema,
|
|
1032
1033
|
QtiLookupOutcomeValueRuleSchema,
|
|
@@ -1056,7 +1057,7 @@ export function createQti2Schemas(config: Qti2Config) {
|
|
|
1056
1057
|
]),
|
|
1057
1058
|
);
|
|
1058
1059
|
|
|
1059
|
-
const QtiTemplateProcessingRuleSchema: z.
|
|
1060
|
+
const QtiTemplateProcessingRuleSchema: z.ZodType = z.lazy(() =>
|
|
1060
1061
|
z.union([
|
|
1061
1062
|
QtiSetTemplateValueSchema,
|
|
1062
1063
|
QtiSetDefaultValueRuleSchema,
|
|
@@ -1192,7 +1193,7 @@ export function createQti2Schemas(config: Qti2Config) {
|
|
|
1192
1193
|
category: z.array(NonEmptyStringSchema).optional(),
|
|
1193
1194
|
});
|
|
1194
1195
|
|
|
1195
|
-
const QtiAssessmentSectionRawSchema: z.
|
|
1196
|
+
const QtiAssessmentSectionRawSchema: z.ZodType = z.lazy(() =>
|
|
1196
1197
|
strictObject({
|
|
1197
1198
|
identifier: QtiIdentifierSchema,
|
|
1198
1199
|
title: z.string().optional(),
|
|
@@ -1220,7 +1221,7 @@ export function createQti2Schemas(config: Qti2Config) {
|
|
|
1220
1221
|
}),
|
|
1221
1222
|
);
|
|
1222
1223
|
|
|
1223
|
-
const QtiAssessmentSectionSchema: z.
|
|
1224
|
+
const QtiAssessmentSectionSchema: z.ZodType = QtiAssessmentSectionRawSchema.superRefine((input, context) => {
|
|
1224
1225
|
const value = input as { children?: unknown[] };
|
|
1225
1226
|
const identifierValues = asArray(value.children).flatMap((child) => {
|
|
1226
1227
|
if (!child || typeof child !== "object" || !("identifier" in child)) {
|
|
@@ -1276,7 +1277,7 @@ export function createQti2Schemas(config: Qti2Config) {
|
|
|
1276
1277
|
uniqueIdentifiersRefinement(value.templateDeclarations, ["templateDeclarations"], "template declaration", context);
|
|
1277
1278
|
});
|
|
1278
1279
|
|
|
1279
|
-
const QtiAssessmentStimulusSchema: z.
|
|
1280
|
+
const QtiAssessmentStimulusSchema: z.ZodType = config.includeAssessmentStimulus
|
|
1280
1281
|
? strictObject({
|
|
1281
1282
|
identifier: QtiIdentifierSchema,
|
|
1282
1283
|
title: z.string().optional(),
|
|
@@ -1547,7 +1548,7 @@ export function createQti2Schemas(config: Qti2Config) {
|
|
|
1547
1548
|
assessmentSection: QtiAssessmentSectionSchema,
|
|
1548
1549
|
});
|
|
1549
1550
|
|
|
1550
|
-
const QtiAssessmentStimulusDocumentSchema: z.
|
|
1551
|
+
const QtiAssessmentStimulusDocumentSchema: z.ZodType = config.includeAssessmentStimulus
|
|
1551
1552
|
? strictObject({
|
|
1552
1553
|
assessmentStimulus: QtiAssessmentStimulusSchema,
|
|
1553
1554
|
})
|