@intellectif/lk-core 1.8.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.
- package/CHANGELOG.md +17 -0
- package/dist/ai-check.cjs +2 -2
- package/dist/ai-check.d.cts +1 -1
- package/dist/ai-check.d.ts +1 -1
- package/dist/ai-check.js +2 -2
- package/dist/{ai-writing-DeIV-GfN.js → ai-writing-DQjI9EFN.js} +130 -5
- package/dist/ai-writing-DQjI9EFN.js.map +1 -0
- package/dist/{ai-writing-Bh2Y53cY.cjs → ai-writing-DbpZpGRk.cjs} +135 -4
- package/dist/ai-writing-DbpZpGRk.cjs.map +1 -0
- package/dist/{ai-Cnm0qE8v.d.cts → ai-zhc9yhRj.d.cts} +160 -2
- package/dist/ai-zhc9yhRj.d.cts.map +1 -0
- package/dist/{ai-Cnm0qE8v.d.ts → ai-zhc9yhRj.d.ts} +160 -2
- package/dist/ai-zhc9yhRj.d.ts.map +1 -0
- package/dist/{index-DMh3OYSb.d.cts → index-BeC8tAWf.d.cts} +2 -2
- package/dist/{index-DMh3OYSb.d.cts.map → index-BeC8tAWf.d.cts.map} +1 -1
- package/dist/{index-CtoPhJAH.d.ts → index-Byar5VVs.d.ts} +2 -2
- package/dist/{index-CtoPhJAH.d.ts.map → index-Byar5VVs.d.ts.map} +1 -1
- package/dist/{index-fZ67k-WR.d.cts → index-Ccj8oL_E.d.cts} +2 -2
- package/dist/{index-fZ67k-WR.d.cts.map → index-Ccj8oL_E.d.cts.map} +1 -1
- package/dist/{index-g-EWIugp.d.ts → index-CxkqS62X.d.ts} +89 -7
- package/dist/index-CxkqS62X.d.ts.map +1 -0
- package/dist/{index-oST8GBFa.d.cts → index-DLsUnGHt.d.cts} +89 -7
- package/dist/index-DLsUnGHt.d.cts.map +1 -0
- package/dist/{index-HXvg0YRQ.d.ts → index-f4YuMgFb.d.ts} +2 -2
- package/dist/{index-HXvg0YRQ.d.ts.map → index-f4YuMgFb.d.ts.map} +1 -1
- package/dist/index.cjs +8 -6
- package/dist/index.d.cts +40 -7
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +40 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -7
- package/dist/{item-group-BceUoxoM.js → item-group-CKZk3txt.js} +2 -2
- package/dist/{item-group-BceUoxoM.js.map → item-group-CKZk3txt.js.map} +1 -1
- package/dist/{item-group-KV4hYu3a.cjs → item-group-COP5OwEC.cjs} +2 -2
- package/dist/{item-group-KV4hYu3a.cjs.map → item-group-COP5OwEC.cjs.map} +1 -1
- package/dist/{registry-tkacvJUI.js → registry-Bw9grsCN.js} +321 -11
- package/dist/registry-Bw9grsCN.js.map +1 -0
- package/dist/{registry-Cymq7Ah0.cjs → registry-C9O9txy5.cjs} +332 -10
- package/dist/registry-C9O9txy5.cjs.map +1 -0
- package/dist/{schemas-DM8sN_f0.js → schemas-BJe3W6Xb.js} +3 -3
- package/dist/{schemas-DM8sN_f0.js.map → schemas-BJe3W6Xb.js.map} +1 -1
- package/dist/{schemas-wDzbKdKa.cjs → schemas-CXlemRvB.cjs} +3 -3
- package/dist/{schemas-wDzbKdKa.cjs.map → schemas-CXlemRvB.cjs.map} +1 -1
- package/dist/schemas.cjs +3 -3
- package/dist/schemas.d.cts +1 -1
- package/dist/schemas.d.ts +1 -1
- package/dist/schemas.js +3 -3
- package/dist/{scoring-DIBmo_cy.js → scoring-BGKdff2i.js} +214 -26
- package/dist/scoring-BGKdff2i.js.map +1 -0
- package/dist/{scoring-D9tFvPEG.cjs → scoring-Db1CZeAn.cjs} +219 -25
- package/dist/scoring-Db1CZeAn.cjs.map +1 -0
- package/dist/scoring.cjs +3 -2
- package/dist/scoring.d.cts +3 -3
- package/dist/scoring.d.ts +3 -3
- package/dist/scoring.js +3 -3
- package/dist/{xapi-gCAo549Q.js → xapi-BtBm8AWZ.js} +2 -2
- package/dist/{xapi-gCAo549Q.js.map → xapi-BtBm8AWZ.js.map} +1 -1
- package/dist/{xapi-Dyqcl3JK.cjs → xapi-DOAqH9__.cjs} +2 -2
- package/dist/{xapi-Dyqcl3JK.cjs.map → xapi-DOAqH9__.cjs.map} +1 -1
- package/dist/xapi.cjs +1 -1
- package/dist/xapi.d.cts +1 -1
- package/dist/xapi.d.ts +1 -1
- package/dist/xapi.js +1 -1
- package/package.json +1 -1
- package/vectors/scoring.json +11967 -1
- package/vectors/validation.json +1298 -1
- package/dist/ai-Cnm0qE8v.d.cts.map +0 -1
- package/dist/ai-Cnm0qE8v.d.ts.map +0 -1
- package/dist/ai-writing-Bh2Y53cY.cjs.map +0 -1
- package/dist/ai-writing-DeIV-GfN.js.map +0 -1
- package/dist/index-g-EWIugp.d.ts.map +0 -1
- package/dist/index-oST8GBFa.d.cts.map +0 -1
- package/dist/registry-Cymq7Ah0.cjs.map +0 -1
- package/dist/registry-tkacvJUI.js.map +0 -1
- package/dist/scoring-D9tFvPEG.cjs.map +0 -1
- package/dist/scoring-DIBmo_cy.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { $ as
|
|
3
|
-
import { A as RedactedStimulus, C as RedactedGapSelectChoice, D as RedactedMultipleChoiceOption, E as RedactedMultipleChoiceData, O as RedactedMultipleChoiceOptionMedia, S as RedactedGapSelectBank, T as RedactedGapSelectGap, _ as RedactedActivity, a as JsonSchemaTarget, b as RedactedDictationSlowMedia, c as fillInTheBlanksJsonSchema, d as jsonSchemaFor, f as multipleChoiceJsonSchema, g as validateItemGroup, h as writtenResponseJsonSchema, i as SCRIPT_MAX_TURNS, j as RedactedWrittenResponseData, k as RedactedReadAloudData, l as gapSelectJsonSchema, m as stimulusJsonSchema, n as validateMedia, o as contentJsonSchema, p as readAloudJsonSchema, r as validateOptionMedia, s as dictationJsonSchema, t as validateActivity, u as itemGroupJsonSchema, v as RedactedBlankConfig, w as RedactedGapSelectData, x as RedactedFillInTheBlanksData, y as RedactedDictationData } from "./index-
|
|
4
|
-
import { a as XAPIObjectParams, c as xapiDefinitionFor, d as XAPI_VERB_DISPLAY, i as SubmittedStatementParams, l as XAPIVerb, n as AnsweredStatementParams, o as XAPIStatementParams, r as CompletedStatementParams, s as xAPIBuilder, t as validateXAPIStatement, u as XAPIVerbKey } from "./index-
|
|
1
|
+
import { $ as AiSpeakingGradingFacts, $n as XAPIContextActivities, $t as ActivityType, A as AiGapSelectFacts, An as ReadAloudLearnerResponse, At as SequenceSlot, B as AiGroupInput, Bn as SpeakingResponseLearnerResponse, Bt as DraftSeverity, C as AiDraftsCall, Cn as MultipleChoiceLearnerResponse, Ct as AiWritingFeedback, D as AiFeature, Dn as ReadAloudData, Dt as MediaProgress, E as AiExplanationRequest, En as NativeControlHint, Et as ItemGroup, F as AiGradingCriterionFact, Fn as ScoringOutcome, Ft as TimelineCue, G as AiOptionFact, Gn as WrittenResponseData, Gt as VersionFinding, H as AiItemFacts, Hn as SpeakingRubricCriterion, Ht as ItemFinding, I as AiGradingFacts, In as ScoringResult, It as DraftComplete, J as AiReadingWordFact, Jn as WrittenResponseRubricCriterion, Jt as ActivityData, K as AiProvenance, Kn as WrittenResponseLearnerResponse, Kt as VersionPaper, L as AiGradingJudgement, Ln as ScriptTurn, Lt as DraftContext, M as AiGeneratedVariant, Mn as RecordingBounds, Mt as Stimulus, N as AiGrade, Nn as RecordingRef, Nt as StimulusKind, O as AiFillInTheBlanksFacts, On as ReadAloudDimension, Ot as MediaTimeline, P as AiGradedCriterion, Pn as ScoringDetail, Pt as TimelineChapter, Q as AiSpeakingCriterionFact, Qn as XAPIContext, Qt as ActivityResult, R as AiGradingRequest, Rn as SpeakingMeasure, Rt as DraftIssue, S as AiDrafts, Sn as MultipleChoiceData, St as AiWritingFacts, T as AiDraftsRun, Tn as MultipleChoiceOptionMedia, Tt as AiWritingFeedbackResult, U as AiMaterialFacts, Un as ValidationError, Ut as ItemFindingSeverity, V as AiHintRequest, Vn as SpeakingRubric, Vt as DraftValidationResult, W as AiMultipleChoiceFacts, Wn as ValidationResult, Wt as VersionComparison, X as AiRubricCriterionFact, Xn as XAPIActor, Xt as ActivityFeedback, Y as AiRefusal, Yn as WrittenResponseRubricLevel, Yt as ActivityDataMap, Z as AiSoundFact, Zn as XAPIConfig, Zt as ActivityMedia, _ as AiDraftCaption, _n as ItemOutcome, _r as TextMatchResult, _t as AiVariantsRun, a as AiCoachingRequest, an as DictationLearnerResponse, ar as XAPIVerbObject, at as AiVariantDifficulty, b as AiDraftSource, bn as MediaPlaybackPolicy, bt as AiWordFact, c as AiCriterionJudgement, cn as FillInTheBlanksData, cr as GradeRouting, ct as AiVariantLevelFacts, d as AiCritiqueFinding, dn as GapSelectChoice, dr as GraderConfiguration, dt as AiVariantPair, en as BlankConfig, er as XAPIError, et as AiSpeakingGradingRequest, f as AiCritiqueFindingResult, fn as GapSelectData, fr as GraderKind, ft as AiVariantSkip, g as AiDictationFacts, gn as InteractionKind, gr as TextMatchPolicy, gt as AiVariantsRequest, h as AiCritiqueResult, hn as InteractionEvent, hr as InlineCorrection, ht as AiVariants, i as AiCoaching, in as DictationEquivalence, ir as XAPIStatement, it as AiTextResult, j as AiGeneratedDraft, jn as ReadAloudSlowMedia, jt as SequenceSlotGroup, k as AiGapFact, kn as ReadAloudDimensionWeight, kt as SequenceEntry, l as AiCritique, ln as FillInTheBlanksLearnerResponse, lr as GradeRoutingReason, lt as AiVariantMismatch, m as AiCritiqueRequest, mn as GapSelectLearnerResponse, mr as GradingState, mt as AiVariantTargets, n as AiActivityInput, nn as DeferredScoringPartial, nr as XAPIResult, nt as AiSpeakingMeasureFact, o as AiCoachingResult, on as DictationSlowMedia, or as CriterionScore, ot as AiVariantExemplarFacts, p as AiCritiqueKind, pn as GapSelectGap, pr as GraderUsage, pt as AiVariantSkipCode, q as AiReadingFacts, qn as WrittenResponseRubric, qt as VersionSlot, r as AiBlankFact, rn as DictationData, rr as XAPIScore, rt as AiSupportedActivityType, s as AiCoachingWord, sn as DictationTolerance, sr as GradeRecord, st as AiVariantImage, t as ActivityAiPermissions, tn as DeferredReason, tr as XAPIObject, tt as AiSpeakingGradingRequestProblem, u as AiCritiqueField, un as GapSelectBank, ur as Grader, ut as AiVariantMissing, v as AiDraftProblem, vn as LearnerResponse, vr as levenshteinDistance, vt as AiVerdict, w as AiDraftsRequest, wn as MultipleChoiceOption, wt as AiWritingFeedbackRequest, x as AiDraftType, xn as MediaTrack, xt as AiWritingCorrection, y as AiDraftSettings, yn as LearnerResponseMap, yr as matchText, yt as AiVideoDraft, z as AiGradingRequestProblem, zn as SpeakingResponseData, zt as DraftNotComplete } from "./ai-zhc9yhRj.js";
|
|
2
|
+
import { $ as gradeFromRubric, A as DictationCharOp, At as SpeechWordError, B as inAuditSample, C as scoreTries, Ct as SpeechPhoneme, D as DICTATION_MAX_EQUIVALENCE_LENGTH, Dt as SpeechUnscorable, E as DICTATION_MAX_EQUIVALENCES, Et as SpeechSyllable, F as alignDictation, Ft as RoundingPolicy, G as CalibrationPair, H as routeGrade, I as dictationReferenceWords, It as classifyBand, J as CriterionCalibration, K as CalibrationReport, L as CalibrationThresholds, Lt as gte, M as DictationAlignment, Mt as WavInspectionPolicy, N as DictationReference, Nt as Band, O as DICTATION_MAX_TEXT_LENGTH, Ot as SpeechUnscorableCode, P as DictationWordAlignment, Pt as RoundingMode, Q as GradeFromRubricOptions, R as GradeRoutingContext, Rt as roundGrade, S as resolveItemScoringPolicy, St as SpeechMeasurement, T as DICTATION_MAX_ACCEPTED_TRANSCRIPTS, Tt as SpeechPlausibilityPolicy, U as GradeFromJudgementOptions, V as outcomeFromRoutedGrade, W as gradeFromJudgement, X as calibrationReport, Y as TotalCalibration, Z as graderConfiguration, _ as alignReadAloud, _t as GradeSpeakingResponseOptions, a as evaluateTries, at as ItemTriesScore, b as DEFAULT_ITEM_SCORING_POLICY, bt as SpeakingEvidence, c as inspectWav, ct as ResolvedItemScoringPolicy, d as READ_ALOUD_MAX_SECONDS, dt as CompositionPolicy, et as hasGrade, f as READ_ALOUD_MAX_TAKES, ft as PassFailureReason, g as validateSpeechAssessment, gt as GradeReadAloudOptions, h as gradeReadAloud, ht as composeAssessmentScore, i as evaluate, it as ItemScoringPolicyIssue, j as diffDictationChars, jt as WavInspection, k as DICTATION_MAX_TRANSCRIPT_LENGTH, kt as SpeechWord, l as READ_ALOUD_MAX_DIMENSION_WEIGHT, lt as AssessmentScore, m as gradeSpeakingResponse, mt as SectionScore, n as ItemTriesOutcome, nt as ItemScoringCount, o as score, ot as ItemTry, p as SPEECH_ASSESSMENT_MAX_WORDS, pt as ScoredItem, q as CalibrationScope, r as ScoringOptions, rt as ItemScoringPolicy, s as outcomeFromUnscorable, st as ItemTryScore, t as EvaluateOptions, tt as outcomeFromGrade, u as READ_ALOUD_MAX_REFERENCE_LENGTH, ut as AssessmentSectionInput, v as DEFAULT_PASS_THRESHOLD, vt as ReadAloudWordAlignment, w as validateItemScoringPolicy, wt as SpeechPhonemeCandidate, x as ITEM_SCORING_MAX_RETRIES, xt as SpeechAssessment, y as computePassThreshold, yt as ReadAloudWordState, z as GradeRoutingPolicy } from "./index-CxkqS62X.js";
|
|
3
|
+
import { A as RedactedStimulus, C as RedactedGapSelectChoice, D as RedactedMultipleChoiceOption, E as RedactedMultipleChoiceData, O as RedactedMultipleChoiceOptionMedia, S as RedactedGapSelectBank, T as RedactedGapSelectGap, _ as RedactedActivity, a as JsonSchemaTarget, b as RedactedDictationSlowMedia, c as fillInTheBlanksJsonSchema, d as jsonSchemaFor, f as multipleChoiceJsonSchema, g as validateItemGroup, h as writtenResponseJsonSchema, i as SCRIPT_MAX_TURNS, j as RedactedWrittenResponseData, k as RedactedReadAloudData, l as gapSelectJsonSchema, m as stimulusJsonSchema, n as validateMedia, o as contentJsonSchema, p as readAloudJsonSchema, r as validateOptionMedia, s as dictationJsonSchema, t as validateActivity, u as itemGroupJsonSchema, v as RedactedBlankConfig, w as RedactedGapSelectData, x as RedactedFillInTheBlanksData, y as RedactedDictationData } from "./index-f4YuMgFb.js";
|
|
4
|
+
import { a as XAPIObjectParams, c as xapiDefinitionFor, d as XAPI_VERB_DISPLAY, i as SubmittedStatementParams, l as XAPIVerb, n as AnsweredStatementParams, o as XAPIStatementParams, r as CompletedStatementParams, s as xAPIBuilder, t as validateXAPIStatement, u as XAPIVerbKey } from "./index-Byar5VVs.js";
|
|
5
5
|
/**
|
|
6
6
|
* What a model is told about the group a question sits in: the material the
|
|
7
7
|
* learner reads and sees beside it.
|
|
@@ -425,6 +425,39 @@ export declare function aiGradingRequest(input: {
|
|
|
425
425
|
problem: AiGradingRequestProblem;
|
|
426
426
|
path?: (string | number)[];
|
|
427
427
|
};
|
|
428
|
+
/**
|
|
429
|
+
* The request for a model's grade of a spoken answer (1.9), or why there is
|
|
430
|
+
* none to make.
|
|
431
|
+
*
|
|
432
|
+
* Built as a written response's is, on the server and from the whole item, with
|
|
433
|
+
* the take's evidence: the model reads `assessment.transcript` — the
|
|
434
|
+
* transcriber's verbatim text, the same text the engine measured the take
|
|
435
|
+
* against — and scores the criteria a judge scores: those that name no
|
|
436
|
+
* `measure`, or every criterion when `judgeMeasures` is set. The measured
|
|
437
|
+
* criteria go with it as context, with the engine's scores, so feedback can
|
|
438
|
+
* speak of them; the model does not score them.
|
|
439
|
+
*
|
|
440
|
+
* The evidence is checked as `gradeSpeakingResponse` checks it — valid,
|
|
441
|
+
* unscripted, for this item's locale and this response's recording — so a model
|
|
442
|
+
* is never paid to judge a take the grade would refuse. Read the reply with
|
|
443
|
+
* `checkAiGrading`, and grade with `gradeSpeakingResponse` under the same
|
|
444
|
+
* `judgeMeasures`.
|
|
445
|
+
*/
|
|
446
|
+
export declare function aiSpeakingGradingRequest(input: {
|
|
447
|
+
data: AiActivityInput;
|
|
448
|
+
response: LearnerResponse | null;
|
|
449
|
+
assessment: SpeechAssessment | null;
|
|
450
|
+
judgeMeasures?: boolean;
|
|
451
|
+
group?: AiGroupInput;
|
|
452
|
+
learnerLocale?: string;
|
|
453
|
+
}): {
|
|
454
|
+
ok: true;
|
|
455
|
+
request: AiSpeakingGradingRequest;
|
|
456
|
+
} | {
|
|
457
|
+
ok: false;
|
|
458
|
+
problem: AiSpeakingGradingRequestProblem;
|
|
459
|
+
path?: (string | number)[];
|
|
460
|
+
};
|
|
428
461
|
type Refused = {
|
|
429
462
|
ok: false;
|
|
430
463
|
refusal: AiRefusal;
|
|
@@ -454,7 +487,7 @@ type Refused = {
|
|
|
454
487
|
* The total is not computed here: `gradeFromJudgement` computes it, as
|
|
455
488
|
* `gradeFromRubric` computes every grade in the SDK.
|
|
456
489
|
*/
|
|
457
|
-
export declare function checkAiGrading(raw: unknown, request: AiGradingRequest): {
|
|
490
|
+
export declare function checkAiGrading(raw: unknown, request: AiGradingRequest | AiSpeakingGradingRequest): {
|
|
458
491
|
ok: true;
|
|
459
492
|
judgement: AiGradingJudgement;
|
|
460
493
|
} | Refused;
|
|
@@ -1314,7 +1347,7 @@ export declare function critiqueDraft(type: ActivityType, draft: unknown): ItemF
|
|
|
1314
1347
|
* The SDK's own registry holds exactly these, in this order, before a host
|
|
1315
1348
|
* registers anything.
|
|
1316
1349
|
*/
|
|
1317
|
-
export declare const BUILT_IN_ACTIVITY_TYPES: readonly ["multiple-choice", "fill-in-the-blanks", "written-response", "gap-select", "dictation", "read-aloud"];
|
|
1350
|
+
export declare const BUILT_IN_ACTIVITY_TYPES: readonly ["multiple-choice", "fill-in-the-blanks", "written-response", "gap-select", "dictation", "read-aloud", "speaking-response"];
|
|
1318
1351
|
/** One of {@link BUILT_IN_ACTIVITY_TYPES}: an activity type the SDK ships, not one a host registered. */
|
|
1319
1352
|
type BuiltInActivityType = (typeof BUILT_IN_ACTIVITY_TYPES)[number];
|
|
1320
1353
|
/** Whether `type` names an activity type the SDK ships. */
|
|
@@ -2394,5 +2427,5 @@ export declare function critiqueVersions(a: VersionPaper, b: VersionPaper, optio
|
|
|
2394
2427
|
lengthTolerance?: LengthTolerance;
|
|
2395
2428
|
allowSharedImages?: boolean;
|
|
2396
2429
|
}): VersionComparison;
|
|
2397
|
-
export { type ActivityAiPermissions, type ActivityData, type ActivityDataMap, type ActivityFeedback, type ActivityMedia, type ActivityResult, type ActivityType, type ActivityTypeAuthoring, type ActivityTypeDescriptor, type ActivityTypeInterop, type ActivityTypeScoring, type AiActivityInput, type AiBlankFact, type AiCoaching, type AiCoachingRequest, type AiCoachingResult, type AiCoachingWord, type AiCriterionJudgement, type AiCritique, type AiCritiqueField, type AiCritiqueFinding, type AiCritiqueFindingResult, type AiCritiqueKind, type AiCritiqueRequest, type AiCritiqueResult, type AiDictationFacts, type AiDraftCaption, type AiDraftProblem, type AiDraftSettings, type AiDraftSource, type AiDraftType, type AiDrafts, type AiDraftsCall, type AiDraftsRequest, type AiDraftsRun, type AiExplanationRequest, type AiFeature, type AiFillInTheBlanksFacts, type AiGapFact, type AiGapSelectFacts, type AiGeneratedDraft, type AiGeneratedVariant, type AiGrade, type AiGradedCriterion, type AiGradingCriterionFact, type AiGradingFacts, type AiGradingJudgement, type AiGradingRequest, type AiGradingRequestProblem, type AiGroupInput, type AiHintRequest, type AiItemFacts, type AiMaterialFacts, type AiMultipleChoiceFacts, type AiOptionFact, type AiProvenance, type AiReadingFacts, type AiReadingWordFact, type AiRefusal, type AiRubricCriterionFact, type AiSoundFact, type AiSupportedActivityType, type AiTextResult, type AiVariantDifficulty, type AiVariantExemplarFacts, type AiVariantImage, type AiVariantLevelFacts, type AiVariantMismatch, type AiVariantMissing, type AiVariantPair, type AiVariantSkip, type AiVariantSkipCode, type AiVariantTargets, type AiVariants, type AiVariantsRequest, type AiVariantsRun, type AiVerdict, type AiVideoDraft, type AiWordFact, type AiWritingCorrection, type AiWritingFacts, type AiWritingFeedback, type AiWritingFeedbackRequest, type AiWritingFeedbackResult, type AnsweredStatementParams, type AssessmentScore, type AssessmentSectionInput, type AttemptPlan, type AttemptPlanDrift, type AttemptPlanSlot, type AttemptState, type Band, type BlankConfig, type BuiltInActivityType, type CalibrationPair, type CalibrationReport, type CalibrationScope, type CalibrationThresholds, type CompletedStatementParams, type CompositionPolicy, type CriterionCalibration, type CriterionScore, DEFAULT_ITEM_SCORING_POLICY, DEFAULT_PASS_THRESHOLD, DICTATION_MAX_ACCEPTED_TRANSCRIPTS, DICTATION_MAX_EQUIVALENCES, DICTATION_MAX_EQUIVALENCE_LENGTH, DICTATION_MAX_TEXT_LENGTH, DICTATION_MAX_TRANSCRIPT_LENGTH, type DeferredReason, type DeferredScoringPartial, type DeliveryPolicy, type DeliveryPolicyIssue, type DictationAlignment, type DictationCharOp, type DictationData, type DictationEquivalence, type DictationLearnerResponse, type DictationReference, type DictationSlowMedia, type DictationTolerance, type DictationWordAlignment, type DraftComplete, type DraftContext, type DraftIssue, type DraftNotComplete, type DraftSeverity, type DraftValidationResult, EvaluateOptions, type FieldPolicy, type FillInTheBlanksData, type FillInTheBlanksLearnerResponse, type GapSelectBank, type GapSelectChoice, type GapSelectData, type GapSelectGap, type GapSelectLearnerResponse, type GradeFromJudgementOptions, GradeFromRubricOptions, type GradeReadAloudOptions, type GradeRecord, type GradeRouting, type GradeRoutingContext, type GradeRoutingPolicy, type GradeRoutingReason, type Grader, type GraderConfiguration, type GraderKind, type GraderUsage, type GradingState, ITEM_SCORING_MAX_RETRIES, type InlineCorrection, type InteractionEvent, type InteractionKind, type ItemFinding, type ItemFindingSeverity, type ItemGroup, type ItemOutcome, type ItemScoringCount, type ItemScoringPolicy, type ItemScoringPolicyIssue, ItemTriesOutcome, type ItemTriesScore, type ItemTry, type ItemTryScore, type JsonSchemaTarget, type LearnerResponse, type LearnerResponseMap, type LengthTolerance, type MediaBudgetRef, type MediaPlayClaim, type MediaPlayGrant, type MediaPlayLedger, type MediaPlayLedgerEntry, type MediaPlaybackPolicy, type MediaProgress, type MediaSlot, type MediaTimeline, type MediaTrack, type MultipleChoiceData, type MultipleChoiceLearnerResponse, type MultipleChoiceOption, type MultipleChoiceOptionMedia, type NativeControlHint, type PartialScoringResult, type PassFailureReason, READ_ALOUD_MAX_DIMENSION_WEIGHT, READ_ALOUD_MAX_REFERENCE_LENGTH, READ_ALOUD_MAX_SECONDS, READ_ALOUD_MAX_TAKES, type ReadAloudData, type ReadAloudDimension, type ReadAloudDimensionWeight, type ReadAloudLearnerResponse, type ReadAloudSlowMedia, type ReadAloudWordAlignment, type ReadAloudWordState, type RecordingBounds, type RecordingRef, type RedactedActivity, type RedactedBlankConfig, type RedactedDictationData, type RedactedDictationSlowMedia, type RedactedFillInTheBlanksData, type RedactedGapSelectBank, type RedactedGapSelectChoice, type RedactedGapSelectData, type RedactedGapSelectGap, type RedactedMultipleChoiceData, type RedactedMultipleChoiceOption, type RedactedMultipleChoiceOptionMedia, type RedactedReadAloudData, type RedactedStimulus, type RedactedWrittenResponseData, type RegisteredActivityTypeDescriptor, type ResolvedDeliveryPolicy, type ResolvedItemScoringPolicy, type ResponseDiffEntry, type RoundingMode, type RoundingPolicy, SCRIPT_MAX_TURNS, SPEECH_ASSESSMENT_MAX_WORDS, type ScoredItem, type ScoringDetail, ScoringOptions, type ScoringOutcome, type ScoringResult, type ScriptTurn, type SectionScore, type Sensitivity, type SequenceEntry, type SequenceSlot, type SequenceSlotGroup, type SpeechAssessment, type SpeechMeasurement, type SpeechPhoneme, type SpeechPhonemeCandidate, type SpeechPlausibilityPolicy, type SpeechSyllable, type SpeechUnscorable, type SpeechUnscorableCode, type SpeechWord, type SpeechWordError, type StandardSchemaV1, type Stimulus, type StimulusKind, type SubmittedStatementParams, type TextMatchPolicy, type TextMatchResult, type ThemeTokens, type TimelineChapter, type TimelineCue, type TotalCalibration, type ValidationError, type ValidationResult, type VersionComparison, type VersionFinding, type VersionPaper, type VersionSlot, type WavInspection, type WavInspectionPolicy, type WrittenResponseData, type WrittenResponseLearnerResponse, type WrittenResponseRubric, type WrittenResponseRubricCriterion, type WrittenResponseRubricLevel, type XAPIActor, type XAPIConfig, type XAPIContext, type XAPIContextActivities, type XAPIError, type XAPIInteractionType, type XAPIObject, type XAPIObjectParams, type XAPIResult, type XAPIScore, type XAPIStatement, type XAPIStatementParams, XAPIVerb, type XAPIVerbKey, type XAPIVerbObject, XAPI_VERB_DISPLAY, alignDictation, alignReadAloud, calibrationReport, classifyBand, composeAssessmentScore, computePassThreshold, contentJsonSchema, dictationJsonSchema, dictationReferenceWords, diffDictationChars, evaluate, evaluateTries, fillInTheBlanksJsonSchema, gapSelectJsonSchema, gradeFromJudgement, gradeFromRubric, gradeReadAloud, graderConfiguration, gte, hasGrade, inAuditSample, inspectWav, itemGroupJsonSchema, jsonSchemaFor, levenshteinDistance, matchText, multipleChoiceJsonSchema, outcomeFromGrade, outcomeFromRoutedGrade, outcomeFromUnscorable, readAloudJsonSchema, resolveItemScoringPolicy, roundGrade, routeGrade, score, scoreTries, stimulusJsonSchema, validateActivity, validateItemGroup, validateItemScoringPolicy, validateMedia, validateOptionMedia, validateSpeechAssessment, validateXAPIStatement, writtenResponseJsonSchema, xAPIBuilder, xapiDefinitionFor };
|
|
2430
|
+
export { type ActivityAiPermissions, type ActivityData, type ActivityDataMap, type ActivityFeedback, type ActivityMedia, type ActivityResult, type ActivityType, type ActivityTypeAuthoring, type ActivityTypeDescriptor, type ActivityTypeInterop, type ActivityTypeScoring, type AiActivityInput, type AiBlankFact, type AiCoaching, type AiCoachingRequest, type AiCoachingResult, type AiCoachingWord, type AiCriterionJudgement, type AiCritique, type AiCritiqueField, type AiCritiqueFinding, type AiCritiqueFindingResult, type AiCritiqueKind, type AiCritiqueRequest, type AiCritiqueResult, type AiDictationFacts, type AiDraftCaption, type AiDraftProblem, type AiDraftSettings, type AiDraftSource, type AiDraftType, type AiDrafts, type AiDraftsCall, type AiDraftsRequest, type AiDraftsRun, type AiExplanationRequest, type AiFeature, type AiFillInTheBlanksFacts, type AiGapFact, type AiGapSelectFacts, type AiGeneratedDraft, type AiGeneratedVariant, type AiGrade, type AiGradedCriterion, type AiGradingCriterionFact, type AiGradingFacts, type AiGradingJudgement, type AiGradingRequest, type AiGradingRequestProblem, type AiGroupInput, type AiHintRequest, type AiItemFacts, type AiMaterialFacts, type AiMultipleChoiceFacts, type AiOptionFact, type AiProvenance, type AiReadingFacts, type AiReadingWordFact, type AiRefusal, type AiRubricCriterionFact, type AiSoundFact, type AiSpeakingCriterionFact, type AiSpeakingGradingFacts, type AiSpeakingGradingRequest, type AiSpeakingGradingRequestProblem, type AiSpeakingMeasureFact, type AiSupportedActivityType, type AiTextResult, type AiVariantDifficulty, type AiVariantExemplarFacts, type AiVariantImage, type AiVariantLevelFacts, type AiVariantMismatch, type AiVariantMissing, type AiVariantPair, type AiVariantSkip, type AiVariantSkipCode, type AiVariantTargets, type AiVariants, type AiVariantsRequest, type AiVariantsRun, type AiVerdict, type AiVideoDraft, type AiWordFact, type AiWritingCorrection, type AiWritingFacts, type AiWritingFeedback, type AiWritingFeedbackRequest, type AiWritingFeedbackResult, type AnsweredStatementParams, type AssessmentScore, type AssessmentSectionInput, type AttemptPlan, type AttemptPlanDrift, type AttemptPlanSlot, type AttemptState, type Band, type BlankConfig, type BuiltInActivityType, type CalibrationPair, type CalibrationReport, type CalibrationScope, type CalibrationThresholds, type CompletedStatementParams, type CompositionPolicy, type CriterionCalibration, type CriterionScore, DEFAULT_ITEM_SCORING_POLICY, DEFAULT_PASS_THRESHOLD, DICTATION_MAX_ACCEPTED_TRANSCRIPTS, DICTATION_MAX_EQUIVALENCES, DICTATION_MAX_EQUIVALENCE_LENGTH, DICTATION_MAX_TEXT_LENGTH, DICTATION_MAX_TRANSCRIPT_LENGTH, type DeferredReason, type DeferredScoringPartial, type DeliveryPolicy, type DeliveryPolicyIssue, type DictationAlignment, type DictationCharOp, type DictationData, type DictationEquivalence, type DictationLearnerResponse, type DictationReference, type DictationSlowMedia, type DictationTolerance, type DictationWordAlignment, type DraftComplete, type DraftContext, type DraftIssue, type DraftNotComplete, type DraftSeverity, type DraftValidationResult, EvaluateOptions, type FieldPolicy, type FillInTheBlanksData, type FillInTheBlanksLearnerResponse, type GapSelectBank, type GapSelectChoice, type GapSelectData, type GapSelectGap, type GapSelectLearnerResponse, type GradeFromJudgementOptions, GradeFromRubricOptions, type GradeReadAloudOptions, type GradeRecord, type GradeRouting, type GradeRoutingContext, type GradeRoutingPolicy, type GradeRoutingReason, type GradeSpeakingResponseOptions, type Grader, type GraderConfiguration, type GraderKind, type GraderUsage, type GradingState, ITEM_SCORING_MAX_RETRIES, type InlineCorrection, type InteractionEvent, type InteractionKind, type ItemFinding, type ItemFindingSeverity, type ItemGroup, type ItemOutcome, type ItemScoringCount, type ItemScoringPolicy, type ItemScoringPolicyIssue, ItemTriesOutcome, type ItemTriesScore, type ItemTry, type ItemTryScore, type JsonSchemaTarget, type LearnerResponse, type LearnerResponseMap, type LengthTolerance, type MediaBudgetRef, type MediaPlayClaim, type MediaPlayGrant, type MediaPlayLedger, type MediaPlayLedgerEntry, type MediaPlaybackPolicy, type MediaProgress, type MediaSlot, type MediaTimeline, type MediaTrack, type MultipleChoiceData, type MultipleChoiceLearnerResponse, type MultipleChoiceOption, type MultipleChoiceOptionMedia, type NativeControlHint, type PartialScoringResult, type PassFailureReason, READ_ALOUD_MAX_DIMENSION_WEIGHT, READ_ALOUD_MAX_REFERENCE_LENGTH, READ_ALOUD_MAX_SECONDS, READ_ALOUD_MAX_TAKES, type ReadAloudData, type ReadAloudDimension, type ReadAloudDimensionWeight, type ReadAloudLearnerResponse, type ReadAloudSlowMedia, type ReadAloudWordAlignment, type ReadAloudWordState, type RecordingBounds, type RecordingRef, type RedactedActivity, type RedactedBlankConfig, type RedactedDictationData, type RedactedDictationSlowMedia, type RedactedFillInTheBlanksData, type RedactedGapSelectBank, type RedactedGapSelectChoice, type RedactedGapSelectData, type RedactedGapSelectGap, type RedactedMultipleChoiceData, type RedactedMultipleChoiceOption, type RedactedMultipleChoiceOptionMedia, type RedactedReadAloudData, type RedactedStimulus, type RedactedWrittenResponseData, type RegisteredActivityTypeDescriptor, type ResolvedDeliveryPolicy, type ResolvedItemScoringPolicy, type ResponseDiffEntry, type RoundingMode, type RoundingPolicy, SCRIPT_MAX_TURNS, SPEECH_ASSESSMENT_MAX_WORDS, type ScoredItem, type ScoringDetail, ScoringOptions, type ScoringOutcome, type ScoringResult, type ScriptTurn, type SectionScore, type Sensitivity, type SequenceEntry, type SequenceSlot, type SequenceSlotGroup, type SpeakingEvidence, type SpeakingMeasure, type SpeakingResponseData, type SpeakingResponseLearnerResponse, type SpeakingRubric, type SpeakingRubricCriterion, type SpeechAssessment, type SpeechMeasurement, type SpeechPhoneme, type SpeechPhonemeCandidate, type SpeechPlausibilityPolicy, type SpeechSyllable, type SpeechUnscorable, type SpeechUnscorableCode, type SpeechWord, type SpeechWordError, type StandardSchemaV1, type Stimulus, type StimulusKind, type SubmittedStatementParams, type TextMatchPolicy, type TextMatchResult, type ThemeTokens, type TimelineChapter, type TimelineCue, type TotalCalibration, type ValidationError, type ValidationResult, type VersionComparison, type VersionFinding, type VersionPaper, type VersionSlot, type WavInspection, type WavInspectionPolicy, type WrittenResponseData, type WrittenResponseLearnerResponse, type WrittenResponseRubric, type WrittenResponseRubricCriterion, type WrittenResponseRubricLevel, type XAPIActor, type XAPIConfig, type XAPIContext, type XAPIContextActivities, type XAPIError, type XAPIInteractionType, type XAPIObject, type XAPIObjectParams, type XAPIResult, type XAPIScore, type XAPIStatement, type XAPIStatementParams, XAPIVerb, type XAPIVerbKey, type XAPIVerbObject, XAPI_VERB_DISPLAY, alignDictation, alignReadAloud, calibrationReport, classifyBand, composeAssessmentScore, computePassThreshold, contentJsonSchema, dictationJsonSchema, dictationReferenceWords, diffDictationChars, evaluate, evaluateTries, fillInTheBlanksJsonSchema, gapSelectJsonSchema, gradeFromJudgement, gradeFromRubric, gradeReadAloud, gradeSpeakingResponse, graderConfiguration, gte, hasGrade, inAuditSample, inspectWav, itemGroupJsonSchema, jsonSchemaFor, levenshteinDistance, matchText, multipleChoiceJsonSchema, outcomeFromGrade, outcomeFromRoutedGrade, outcomeFromUnscorable, readAloudJsonSchema, resolveItemScoringPolicy, roundGrade, routeGrade, score, scoreTries, stimulusJsonSchema, validateActivity, validateItemGroup, validateItemScoringPolicy, validateMedia, validateOptionMedia, validateSpeechAssessment, validateXAPIStatement, writtenResponseJsonSchema, xAPIBuilder, xapiDefinitionFor };
|
|
2398
2431
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["_$__registry_js0.ActivityTypeDescriptor"],"sources":["../src/ai-material.ts","../src/ai.ts","../src/ai-coaching.ts","../src/ai-critique.ts","../src/ai-drafts.ts","../src/ai-grading.ts","../src/variant-rules.ts","../src/ai-variants.ts","../src/ai-written.ts","../src/ai-writing.ts","../src/types/delivery.ts","../src/types/attempt-plan.ts","../src/attempt-plan.ts","../src/types/attempt-state.ts","../src/attempt-state.ts","../src/authoring/item-group.ts","../src/authoring/index.ts","../src/built-in-types.ts","../src/content-hash.ts","../src/count-words.ts","../src/delivery.ts","../src/errors.ts","../src/item-group.ts","../src/types/media-budget.ts","../src/media-budget.ts","../src/media-refs.ts","../src/standard-schema.ts","../src/registry/define.ts","../src/registry/registry.ts","../src/redact.ts","../src/registry/builtins.ts","../src/shuffle.ts","../src/timeline.ts","../src/timeline-limits.ts","../src/types/theme.ts","../src/versions.ts"],"mappings":";;;;;;;;;;;;;;;;qBAiBa;;;;;;qBCoBA,+BAA+B;qBAM/B,wBAAwB;;qBAOxB;;;;;;wBASG,WAAW,sBAAsB,SAAS;;;;;;;;;wBAmB1C,mBAAmB,MAAM,iBAAiB,SAAS;;wBAUnD,UAAU;EAAU;EAAe;EAAkB;IAAoB;;;;;;;;;;wBAoFzE,aACd,MAAM,iBACN,UAAU,wBACV,kBAAkB,yBACjB;;;;;;;;;;;;;;;;;wBAyKa,qBAAqB;EACnC,MAAM;EACN,UAAU;EACV,UAAU;EACV,QAAQ;EACR;IACE;;;;;;;;;;;;;;wBAoDY,cAAc;EAC5B,MAAM;EACN,UAAU;EACV;EACA,QAAQ;EACR;IACE;;;;;;wBAmCY,iBACd;EACG;EAAU,QAAQ;;EAAmB;EAAW,SAAS;;;;;;;;wBAqC9C,mBACd,cACA,SAAS;EACN;EAAU,QAAQ;;EAAmB;EAAW,SAAS;;;;;;;wBAgB9C,YACd,cACA,SAAS;EACN;EAAU,QAAQ;;EAAmB;EAAW,SAAS;;;;;;;;;;;;;;;;;wBA4B9C,kBAAkB,OAAO,aAAa;;qBCngBzC;;qBAGA;;;;;;;;;;;;;;;;;wBA4JG,kBAAkB;EAChC,MAAM;EACN,aAAa;EACb,QAAQ;EACR;IACE;;;;;;;;;;;;;;;;;;;;;;;;wBAmFY,gBACd,cACA,SAAS;EACN;EAAU,UAAU;;EAAiB;EAAW,SAAS;;;qBC7PjD;;qBAGA;;;;;;;;;;;;;;;;wBAqFG,kBAAkB;EAChC,MAAM;EACN;EACA;EACA;IACE;;;;;;;;;;;;;;;;;;wBAmDY,gBACd,cACA,SAAS;EACN;EAAU,UAAU;;EAAiB;EAAW,SAAS;;;qBCxIjD;;qBAGA;;;;;;;;;;;;;;;;;;;;;;;wBAoNG,gBAAgB;EAC9B,gBAAgB;EAChB,QAAQ;EACR;EACA;EACA;EACA;EACA,WAAW;IACT;;;;;;;;;;;;;;;;;;;;;;;;wBAsVY,cACd,cACA,SAAS,iBACT;EAAW;;EACR;EAAU,QAAQ;;EAAe;EAAW,SAAS;;;;;;;;;;;wBAiE1C,sBACd,SAAS,iBACT,QAAQ,oBAAoB,qBAC3B;;;;;;;;;;;;;;;;;;;;;;;;;;wBA4DmB,eAAe;EACnC,SAAS;EACT,OAAO,SAAS,oBAAoB;EACpC;EACA;IACE,QAAQ;;;;;;;;;;;;;;;;;;;;wBAmGI,2BAA2B;EACzC,SAAS;EACT,QAAQ,WAAW,uBAAuB;EAC1C,OAAO;EACP;EACA;EACA;IACE;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["_$__registry_js0.ActivityTypeDescriptor"],"sources":["../src/ai-material.ts","../src/ai.ts","../src/ai-coaching.ts","../src/ai-critique.ts","../src/ai-drafts.ts","../src/ai-grading.ts","../src/variant-rules.ts","../src/ai-variants.ts","../src/ai-written.ts","../src/ai-writing.ts","../src/types/delivery.ts","../src/types/attempt-plan.ts","../src/attempt-plan.ts","../src/types/attempt-state.ts","../src/attempt-state.ts","../src/authoring/item-group.ts","../src/authoring/index.ts","../src/built-in-types.ts","../src/content-hash.ts","../src/count-words.ts","../src/delivery.ts","../src/errors.ts","../src/item-group.ts","../src/types/media-budget.ts","../src/media-budget.ts","../src/media-refs.ts","../src/standard-schema.ts","../src/registry/define.ts","../src/registry/registry.ts","../src/redact.ts","../src/registry/builtins.ts","../src/shuffle.ts","../src/timeline.ts","../src/timeline-limits.ts","../src/types/theme.ts","../src/versions.ts"],"mappings":";;;;;;;;;;;;;;;;qBAiBa;;;;;;qBCoBA,+BAA+B;qBAM/B,wBAAwB;;qBAOxB;;;;;;wBASG,WAAW,sBAAsB,SAAS;;;;;;;;;wBAmB1C,mBAAmB,MAAM,iBAAiB,SAAS;;wBAUnD,UAAU;EAAU;EAAe;EAAkB;IAAoB;;;;;;;;;;wBAoFzE,aACd,MAAM,iBACN,UAAU,wBACV,kBAAkB,yBACjB;;;;;;;;;;;;;;;;;wBAyKa,qBAAqB;EACnC,MAAM;EACN,UAAU;EACV,UAAU;EACV,QAAQ;EACR;IACE;;;;;;;;;;;;;;wBAoDY,cAAc;EAC5B,MAAM;EACN,UAAU;EACV;EACA,QAAQ;EACR;IACE;;;;;;wBAmCY,iBACd;EACG;EAAU,QAAQ;;EAAmB;EAAW,SAAS;;;;;;;;wBAqC9C,mBACd,cACA,SAAS;EACN;EAAU,QAAQ;;EAAmB;EAAW,SAAS;;;;;;;wBAgB9C,YACd,cACA,SAAS;EACN;EAAU,QAAQ;;EAAmB;EAAW,SAAS;;;;;;;;;;;;;;;;;wBA4B9C,kBAAkB,OAAO,aAAa;;qBCngBzC;;qBAGA;;;;;;;;;;;;;;;;;wBA4JG,kBAAkB;EAChC,MAAM;EACN,a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_VIDEO_ITEM_TYPES, c as TIMELINE_MAX_QUIZZES, i as validateItemGroup, l as TIMELINE_MAX_TITLE_LENGTH, n as RedactedItemGroupSchema, o as TIMELINE_MAX_CHAPTERS, s as TIMELINE_MAX_ITEMS, u as isInteractiveVideoItemType } from "./item-group-
|
|
5
|
-
import { a as dictationJsonSchema, c as itemGroupJsonSchema, d as readAloudJsonSchema, f as stimulusJsonSchema, i as contentJsonSchema, l as jsonSchemaFor, n as validateMedia, o as fillInTheBlanksJsonSchema, p as writtenResponseJsonSchema, r as validateOptionMedia, s as gapSelectJsonSchema, t as validateActivity, u as multipleChoiceJsonSchema } from "./schemas-
|
|
6
|
-
import { a as validateXAPIStatement, i as XAPI_VERB_DISPLAY, n as xapiDefinitionFor, r as XAPIVerb, t as xAPIBuilder } from "./xapi-
|
|
1
|
+
import { $ as AI_EXPLANATION_TYPES, A as validateDraft, B as optionSet, C as interactiveVideoFromDrafts, D as checkAiCritique, E as aiCritiqueRequest, F as validateItemGroupDraft, G as textsOf, H as shownScore, I as AI_VARIANT_LENGTH_BANDS, J as transcriptOf, K as listMediaRefs, L as AI_VARIANT_NEAR_COPY_THRESHOLD, M as createItemGroupDraft, N as critiqueDrafts, O as createDraft, P as critiqueItemGroupDraft, Q as checkAiCoaching, R as keysOf, S as generateDrafts, T as AI_CRITIQUE_MAX_FINDINGS, U as structureMisses, V as sharedAnswers, W as textSimilarity, X as AI_COACHING_MAX_WORDS, Y as AI_COACHING_MAX_TIP_LENGTH, Z as aiCoachingRequest, _ as AI_DRAFTS_MAX_COUNT, a as AI_VARIANTS_MAX_REPAIRS, at as aiHintRequest, b as aiDraftsRequest, c as aiVariantsRequest, ct as checkAiExplanation, d as AI_GRADING_PROBABILITY_TOLERANCE, dt as readAiTextResult, et as AI_HINT_TYPES, f as aiGradingRequest, ft as AI_MATERIAL_MAX_LENGTH, g as AI_WRITING_MAX_FIELD_LENGTH, h as AI_WRITING_MAX_CORRECTIONS, i as AI_VARIANTS_MAX_MATERIAL_LENGTH, it as aiGradeOf, j as createInteractiveVideoDraft, k as critiqueDraft, l as checkAiVariants, lt as checkAiHint, m as checkAiGrading, n as checkAiWritingFeedback, nt as aiAllowedByContent, o as AI_VARIANT_CODE_SEVERITY, ot as aiSupports, p as aiSpeakingGradingRequest, q as mapMediaRefs, r as AI_VARIANTS_MAX_EXEMPLARS, rt as aiExplanationRequest, s as aiVariantsRepairRequest, st as buildAiFacts, t as aiWritingFeedbackRequest, tt as AI_TEXT_MAX_LENGTH, u as generateVariants, ut as hintRevealsAnswer, v as AI_DRAFTS_MAX_REPAIRS, w as AI_CRITIQUE_MAX_FIELD_LENGTH, x as checkAiDrafts, y as aiDraftsRepairRequest, z as lengthMisses } from "./ai-writing-DQjI9EFN.js";
|
|
2
|
+
import { At as SCRIPT_MAX_TURNS, B as countWords, C as READ_ALOUD_MAX_REFERENCE_LENGTH, D as SPEECH_ASSESSMENT_MAX_WORDS, F as matchText, P as levenshteinDistance, S as READ_ALOUD_MAX_DIMENSION_WEIGHT, T as READ_ALOUD_MAX_TAKES, _t as BUILT_IN_ACTIVITY_TYPES, a as readSchema, c as dictationType, ct as dictationReferenceWords, d as multipleChoiceType, dt as DICTATION_MAX_EQUIVALENCE_LENGTH, f as readAloudType, ft as DICTATION_MAX_TEXT_LENGTH, h as defineActivityType, it as UnknownActivityTypeError, l as fillInTheBlanksType, lt as DICTATION_MAX_ACCEPTED_TRANSCRIPTS, m as guardOf, n as registerActivityType, nt as DeferredScoringError, ot as alignDictation, p as writtenResponseType, pt as DICTATION_MAX_TRANSCRIPT_LENGTH, r as registeredActivityTypes, rt as RedactedScoringError, s as MEDIA_FIELD_POLICY, t as getActivityTypeDescriptor, tt as ActivitySchemaError, u as gapSelectType, ut as DICTATION_MAX_EQUIVALENCES, w as READ_ALOUD_MAX_SECONDS, yt as isBuiltInActivityType } from "./registry-Bw9grsCN.js";
|
|
3
|
+
import { A as roundGrade, C as canonicalJson, D as computePassThreshold, E as DEFAULT_PASS_THRESHOLD, F as validateItemScoringPolicy, M as ITEM_SCORING_MAX_RETRIES, N as resolveItemScoringPolicy, O as classifyBand, P as scoreTries, S as graderConfiguration, T as fingerprint, _ as gradeFromJudgement, a as inspectWav, b as outcomeFromGrade, c as alignReadAloud, d as composeAssessmentScore, f as inAuditSample, g as seededShuffle, h as hashSeed, i as outcomeFromUnscorable, j as DEFAULT_ITEM_SCORING_POLICY, k as gte, l as validateSpeechAssessment, m as routeGrade, n as evaluateTries, o as gradeSpeakingResponse, p as outcomeFromRoutedGrade, r as score, s as gradeReadAloud, t as evaluate, u as diffDictationChars, v as gradeFromRubric, w as contentHash, x as calibrationReport, y as hasGrade } from "./scoring-BGKdff2i.js";
|
|
4
|
+
import { a as INTERACTIVE_VIDEO_ITEM_TYPES, c as TIMELINE_MAX_QUIZZES, i as validateItemGroup, l as TIMELINE_MAX_TITLE_LENGTH, n as RedactedItemGroupSchema, o as TIMELINE_MAX_CHAPTERS, s as TIMELINE_MAX_ITEMS, u as isInteractiveVideoItemType } from "./item-group-CKZk3txt.js";
|
|
5
|
+
import { a as dictationJsonSchema, c as itemGroupJsonSchema, d as readAloudJsonSchema, f as stimulusJsonSchema, i as contentJsonSchema, l as jsonSchemaFor, n as validateMedia, o as fillInTheBlanksJsonSchema, p as writtenResponseJsonSchema, r as validateOptionMedia, s as gapSelectJsonSchema, t as validateActivity, u as multipleChoiceJsonSchema } from "./schemas-BJe3W6Xb.js";
|
|
6
|
+
import { a as validateXAPIStatement, i as XAPI_VERB_DISPLAY, n as xapiDefinitionFor, r as XAPIVerb, t as xAPIBuilder } from "./xapi-BtBm8AWZ.js";
|
|
7
7
|
// src/delivery.ts
|
|
8
8
|
/**
|
|
9
9
|
* The policy that restricts nothing: every setting `true`. It is what an absent
|
|
@@ -1354,6 +1354,6 @@ function critiqueVersions(a, b, options = {}) {
|
|
|
1354
1354
|
}
|
|
1355
1355
|
};
|
|
1356
1356
|
}
|
|
1357
|
-
export { AI_COACHING_MAX_TIP_LENGTH, AI_COACHING_MAX_WORDS, AI_CRITIQUE_MAX_FIELD_LENGTH, AI_CRITIQUE_MAX_FINDINGS, AI_DRAFTS_MAX_COUNT, AI_DRAFTS_MAX_REPAIRS, AI_EXPLANATION_TYPES, AI_GRADING_PROBABILITY_TOLERANCE, AI_HINT_TYPES, AI_MATERIAL_MAX_LENGTH, AI_TEXT_MAX_LENGTH, AI_VARIANTS_MAX_EXEMPLARS, AI_VARIANTS_MAX_MATERIAL_LENGTH, AI_VARIANTS_MAX_REPAIRS, AI_VARIANT_CODE_SEVERITY, AI_VARIANT_LENGTH_BANDS, AI_VARIANT_NEAR_COPY_THRESHOLD, AI_WRITING_MAX_CORRECTIONS, AI_WRITING_MAX_FIELD_LENGTH, ActivitySchemaError, BUILT_IN_ACTIVITY_TYPES, DEFAULT_ITEM_SCORING_POLICY, DEFAULT_PASS_THRESHOLD, DICTATION_MAX_ACCEPTED_TRANSCRIPTS, DICTATION_MAX_EQUIVALENCES, DICTATION_MAX_EQUIVALENCE_LENGTH, DICTATION_MAX_TEXT_LENGTH, DICTATION_MAX_TRANSCRIPT_LENGTH, DeferredScoringError, INTERACTIVE_VIDEO_ITEM_TYPES, ITEM_SCORING_MAX_RETRIES, OPEN_DELIVERY_POLICY, READ_ALOUD_MAX_DIMENSION_WEIGHT, READ_ALOUD_MAX_REFERENCE_LENGTH, READ_ALOUD_MAX_SECONDS, READ_ALOUD_MAX_TAKES, RedactedScoringError, SCRIPT_MAX_TURNS, SPEECH_ASSESSMENT_MAX_WORDS, TIMELINE_MAX_CHAPTERS, TIMELINE_MAX_ITEMS, TIMELINE_MAX_QUIZZES, TIMELINE_MAX_TITLE_LENGTH, UnknownActivityTypeError, VERSION_FINDING_SEVERITY, XAPIVerb, XAPI_VERB_DISPLAY, aiAllowedByContent, aiCoachingRequest, aiCritiqueRequest, aiDraftsRepairRequest, aiDraftsRequest, aiExplanationRequest, aiGradeOf, aiGradingRequest, aiHintRequest, aiSupports, aiVariantsRepairRequest, aiVariantsRequest, aiWritingFeedbackRequest, alignDictation, alignReadAloud, assertRedacted, assertRedactedItemGroup, buildAiFacts, calibrationReport, canonicalJson, checkAiCoaching, checkAiCritique, checkAiDrafts, checkAiExplanation, checkAiGrading, checkAiHint, checkAiVariants, checkAiWritingFeedback, classifyBand, combineDeliveryPolicies, composeAssessmentScore, composeTimelineScore, computePassThreshold, contentHash, contentJsonSchema, countWords, createDraft, createInteractiveVideoDraft, createItemGroupDraft, critiqueDraft, critiqueDrafts, critiqueItemGroupDraft, critiqueVersions, defineActivityType, dictationJsonSchema, dictationReferenceWords, dictationType, diffDictationChars, diffResponses, entryKeyOf, evaluate, evaluateTries, fillInTheBlanksJsonSchema, fillInTheBlanksType, fingerprint, flattenSequence, gapSelectJsonSchema, gapSelectType, generateDrafts, generateVariants, getActivityTypeDescriptor, gradeFromJudgement, gradeFromRubric, gradeReadAloud, graderConfiguration, gte, hasGrade, hashSeed, hintRevealsAnswer, inAuditSample, inspectWav, interactiveVideoFromDrafts, isBuiltInActivityType, isInteractiveVideoItemType, isItemGroup, itemGroupJsonSchema, jsonSchemaFor, levenshteinDistance, listMediaRefs, mapMediaRefs, matchText, multipleChoiceJsonSchema, multipleChoiceType, outcomeFromGrade, outcomeFromRoutedGrade, outcomeFromUnscorable, planAttempt, planMediaBudgets, readAiTextResult, readAloudJsonSchema, readAloudType, readMediaProgress, redact, redactItemGroup, registerActivityType, registeredActivityTypes, resolveDeliveryPolicy, resolveItemScoringPolicy, resolvePlaybackPolicy, restoreAttemptState, restoreMediaPlayLedger, roundGrade, routeGrade, score, scoreTries, scoredItemsFromPlan, seededShuffle, serializeAttemptState, serializeMediaPlayLedger, slotMediaKey, stimulusJsonSchema, stimulusMediaKey, transcriptOf, validateActivity, validateDeliveryPolicy, validateDraft, validateItemGroup, validateItemGroupDraft, validateItemScoringPolicy, validateMedia, validateOptionMedia, validateSpeechAssessment, validateXAPIStatement, verifyAttemptPlan, withoutAuthorOnly, writtenResponseJsonSchema, writtenResponseType, xAPIBuilder, xapiDefinitionFor };
|
|
1357
|
+
export { AI_COACHING_MAX_TIP_LENGTH, AI_COACHING_MAX_WORDS, AI_CRITIQUE_MAX_FIELD_LENGTH, AI_CRITIQUE_MAX_FINDINGS, AI_DRAFTS_MAX_COUNT, AI_DRAFTS_MAX_REPAIRS, AI_EXPLANATION_TYPES, AI_GRADING_PROBABILITY_TOLERANCE, AI_HINT_TYPES, AI_MATERIAL_MAX_LENGTH, AI_TEXT_MAX_LENGTH, AI_VARIANTS_MAX_EXEMPLARS, AI_VARIANTS_MAX_MATERIAL_LENGTH, AI_VARIANTS_MAX_REPAIRS, AI_VARIANT_CODE_SEVERITY, AI_VARIANT_LENGTH_BANDS, AI_VARIANT_NEAR_COPY_THRESHOLD, AI_WRITING_MAX_CORRECTIONS, AI_WRITING_MAX_FIELD_LENGTH, ActivitySchemaError, BUILT_IN_ACTIVITY_TYPES, DEFAULT_ITEM_SCORING_POLICY, DEFAULT_PASS_THRESHOLD, DICTATION_MAX_ACCEPTED_TRANSCRIPTS, DICTATION_MAX_EQUIVALENCES, DICTATION_MAX_EQUIVALENCE_LENGTH, DICTATION_MAX_TEXT_LENGTH, DICTATION_MAX_TRANSCRIPT_LENGTH, DeferredScoringError, INTERACTIVE_VIDEO_ITEM_TYPES, ITEM_SCORING_MAX_RETRIES, OPEN_DELIVERY_POLICY, READ_ALOUD_MAX_DIMENSION_WEIGHT, READ_ALOUD_MAX_REFERENCE_LENGTH, READ_ALOUD_MAX_SECONDS, READ_ALOUD_MAX_TAKES, RedactedScoringError, SCRIPT_MAX_TURNS, SPEECH_ASSESSMENT_MAX_WORDS, TIMELINE_MAX_CHAPTERS, TIMELINE_MAX_ITEMS, TIMELINE_MAX_QUIZZES, TIMELINE_MAX_TITLE_LENGTH, UnknownActivityTypeError, VERSION_FINDING_SEVERITY, XAPIVerb, XAPI_VERB_DISPLAY, aiAllowedByContent, aiCoachingRequest, aiCritiqueRequest, aiDraftsRepairRequest, aiDraftsRequest, aiExplanationRequest, aiGradeOf, aiGradingRequest, aiHintRequest, aiSpeakingGradingRequest, aiSupports, aiVariantsRepairRequest, aiVariantsRequest, aiWritingFeedbackRequest, alignDictation, alignReadAloud, assertRedacted, assertRedactedItemGroup, buildAiFacts, calibrationReport, canonicalJson, checkAiCoaching, checkAiCritique, checkAiDrafts, checkAiExplanation, checkAiGrading, checkAiHint, checkAiVariants, checkAiWritingFeedback, classifyBand, combineDeliveryPolicies, composeAssessmentScore, composeTimelineScore, computePassThreshold, contentHash, contentJsonSchema, countWords, createDraft, createInteractiveVideoDraft, createItemGroupDraft, critiqueDraft, critiqueDrafts, critiqueItemGroupDraft, critiqueVersions, defineActivityType, dictationJsonSchema, dictationReferenceWords, dictationType, diffDictationChars, diffResponses, entryKeyOf, evaluate, evaluateTries, fillInTheBlanksJsonSchema, fillInTheBlanksType, fingerprint, flattenSequence, gapSelectJsonSchema, gapSelectType, generateDrafts, generateVariants, getActivityTypeDescriptor, gradeFromJudgement, gradeFromRubric, gradeReadAloud, gradeSpeakingResponse, graderConfiguration, gte, hasGrade, hashSeed, hintRevealsAnswer, inAuditSample, inspectWav, interactiveVideoFromDrafts, isBuiltInActivityType, isInteractiveVideoItemType, isItemGroup, itemGroupJsonSchema, jsonSchemaFor, levenshteinDistance, listMediaRefs, mapMediaRefs, matchText, multipleChoiceJsonSchema, multipleChoiceType, outcomeFromGrade, outcomeFromRoutedGrade, outcomeFromUnscorable, planAttempt, planMediaBudgets, readAiTextResult, readAloudJsonSchema, readAloudType, readMediaProgress, redact, redactItemGroup, registerActivityType, registeredActivityTypes, resolveDeliveryPolicy, resolveItemScoringPolicy, resolvePlaybackPolicy, restoreAttemptState, restoreMediaPlayLedger, roundGrade, routeGrade, score, scoreTries, scoredItemsFromPlan, seededShuffle, serializeAttemptState, serializeMediaPlayLedger, slotMediaKey, stimulusJsonSchema, stimulusMediaKey, transcriptOf, validateActivity, validateDeliveryPolicy, validateDraft, validateItemGroup, validateItemGroupDraft, validateItemScoringPolicy, validateMedia, validateOptionMedia, validateSpeechAssessment, validateXAPIStatement, verifyAttemptPlan, withoutAuthorOnly, writtenResponseJsonSchema, writtenResponseType, xAPIBuilder, xapiDefinitionFor };
|
|
1358
1358
|
|
|
1359
1359
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as GROUP_CAPTIONS_REVEAL_DICTATION, Mt as maxUnits, Ot as MediaSchema, a as readSchema, et as groupCaptionsField, jt as ScriptSchema, kt as RedactedMediaSchema, t as getActivityTypeDescriptor } from "./registry-Bw9grsCN.js";
|
|
2
2
|
import * as z from "zod/v4";
|
|
3
3
|
// src/timeline-limits.ts
|
|
4
4
|
/**
|
|
@@ -441,4 +441,4 @@ function validateItemGroup(data) {
|
|
|
441
441
|
}
|
|
442
442
|
export { INTERACTIVE_VIDEO_ITEM_TYPES as a, TIMELINE_MAX_QUIZZES as c, validateItemGroup as i, TIMELINE_MAX_TITLE_LENGTH as l, RedactedItemGroupSchema as n, TIMELINE_MAX_CHAPTERS as o, StimulusSchema as r, TIMELINE_MAX_ITEMS as s, ItemGroupSchema as t, isInteractiveVideoItemType as u };
|
|
443
443
|
|
|
444
|
-
//# sourceMappingURL=item-group-
|
|
444
|
+
//# sourceMappingURL=item-group-CKZk3txt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item-group-BceUoxoM.js","names":[],"sources":["../src/timeline-limits.ts","../src/schemas/item-group.ts"],"sourcesContent":["/**\n * The bounds of an interactive video — an item group with a `timeline`.\n *\n * A leaf module on purpose: the schemas, the authoring checks and the timeline\n * helpers all read these, and nothing here may import any of them back.\n */\n\n/**\n * The item types an interactive video may present. CLOSED on purpose: a type\n * added to the SDK later, or a custom type a host registers, is not silently\n * embeddable. Each one here was chosen, and each works inside a paused video —\n * a read-aloud's microphone included, because every quiz pauses the video\n * first.\n */\nexport const INTERACTIVE_VIDEO_ITEM_TYPES = [\n 'multiple-choice',\n 'fill-in-the-blanks',\n 'gap-select',\n 'dictation',\n 'read-aloud',\n] as const;\n\n/** One of {@link INTERACTIVE_VIDEO_ITEM_TYPES}. */\nexport type InteractiveVideoItemType = (typeof INTERACTIVE_VIDEO_ITEM_TYPES)[number];\n\n/** Whether `type` is one of the item types an interactive video may present. */\nexport function isInteractiveVideoItemType(type: unknown): type is InteractiveVideoItemType {\n return (INTERACTIVE_VIDEO_ITEM_TYPES as readonly unknown[]).includes(type);\n}\n\n/** The most quizzes one video may hold. */\nexport const TIMELINE_MAX_QUIZZES = 100;\n\n/**\n * The most questions one interactive video may hold, across all its quizzes.\n * The player keeps every one of them mounted, so an answer survives the\n * learner rewinding past its quiz.\n */\nexport const TIMELINE_MAX_ITEMS = 200;\n\n/** The most chapters one video may hold. */\nexport const TIMELINE_MAX_CHAPTERS = 100;\n\n/** The longest quiz or chapter title, in UTF-16 units. A title sits on one line of the player. */\nexport const TIMELINE_MAX_TITLE_LENGTH = 120;\n","import * as z from 'zod/v4';\nimport { getActivityTypeDescriptor } from '../registry/index.js';\nimport {\n INTERACTIVE_VIDEO_ITEM_TYPES,\n isInteractiveVideoItemType,\n TIMELINE_MAX_CHAPTERS,\n TIMELINE_MAX_ITEMS,\n TIMELINE_MAX_QUIZZES,\n TIMELINE_MAX_TITLE_LENGTH,\n} from '../timeline-limits.js';\nimport type { ActivityData, ValidationError, ValidationResult } from '../types/activity.js';\nimport type { ItemGroup, StimulusKind } from '../types/item-group.js';\nimport { GROUP_CAPTIONS_REVEAL_DICTATION, groupCaptionsField } from './dictation.js';\nimport { MediaSchema, RedactedMediaSchema, ScriptSchema } from './media.js';\nimport { readSchema } from './read-schema.js';\nimport { maxUnits } from './text-length.js';\n\n/**\n * An authored slot key.\n *\n * A `.` is rejected here, not at render time: `flattenSequence` uses the first\n * `.` to separate a group from its item, so a key containing one would produce\n * an ambiguous slot id. `keyOf` already threw on it — this moves the rejection\n * to `validateItemGroup`, where an author finds it, instead of leaving it to\n * surface when a learner opens the paper. Content that would newly fail\n * validation already threw at flatten time, so it can never have been sat.\n */\nconst SlotKeySchema = z\n .string()\n .min(1)\n .refine((key) => !key.includes('.'), {\n error:\n 'slotKey must not contain \".\" — that character separates a group from its item in a slot id, so a key containing one would make the slot ambiguous.',\n });\n\nfunction hasBody(stimulus: { body?: string | undefined }): boolean {\n return typeof stimulus.body === 'string' && stimulus.body.trim().length > 0;\n}\n\n/** Which media types can carry a stimulus of each kind. `text`/`mixed` accept any. */\nfunction mediaFits(kind: StimulusKind, mediaType: string | undefined): boolean {\n switch (kind) {\n case 'audio':\n return mediaType === 'audio';\n case 'video':\n return mediaType === 'video' || mediaType === 'embed';\n case 'image':\n return mediaType === 'image';\n default:\n return true;\n }\n}\n\n/**\n * Zod schema for a {@link Stimulus}. Loose: unknown keys preserved.\n *\n * The semantic guards exist because a stimulus that does not carry what its\n * `kind` promises is an authoring error that must not reach an exam: an\n * \"audio\" stimulus with no recording renders as a blank panel above six\n * listening questions. Unrepresentable in JSON Schema; dropped from\n * `stimulusJsonSchema` by design.\n */\nexport const StimulusSchema = z\n .looseObject({\n id: z.string().min(1),\n kind: z.enum(['text', 'audio', 'video', 'image', 'mixed']),\n title: z.string().optional(),\n body: z.string().optional(),\n bodyHtml: z.string().optional(),\n media: MediaSchema.optional(),\n transcript: z.string().optional(),\n script: ScriptSchema.optional(),\n locale: z.string().optional(),\n attribution: z.string().optional(),\n })\n .refine((stimulus) => stimulus.bodyHtml === undefined || hasBody(stimulus), {\n error:\n 'bodyHtml requires a plain-text body: it is the accessible fallback rendered when no sanitiser is supplied.',\n path: ['body'],\n })\n .refine(\n (stimulus) => (stimulus.kind !== 'text' && stimulus.kind !== 'mixed') || hasBody(stimulus),\n {\n error: 'A text or mixed stimulus needs a non-empty body.',\n path: ['body'],\n },\n )\n .refine((stimulus) => stimulus.kind === 'text' || stimulus.media !== undefined, {\n error: 'An audio, video, image or mixed stimulus needs media.',\n path: ['media'],\n })\n .refine(\n (stimulus) => stimulus.media === undefined || mediaFits(stimulus.kind, stimulus.media.type),\n {\n error:\n 'media.type does not fit the stimulus kind: audio needs audio; video needs video or embed; image needs image.',\n path: ['media', 'type'],\n },\n );\n\nconst TimelineTitleSchema = maxUnits(z.string(), TIMELINE_MAX_TITLE_LENGTH).refine(\n (title) => title.trim().length > 0,\n { error: 'A title must not be empty.' },\n);\n\n/** Seconds from the start of the video. zod rejects NaN and ±Infinity itself. */\nconst TimelineTimeSchema = z.number().min(0, { error: 'A time is 0 seconds or more.' });\n\n/**\n * A quiz. STRICT, like every part of a timeline: a misspelt `requried` would\n * otherwise be kept and the quiz silently optional on a paper that believed it\n * was required.\n */\nexport const TimelineCueSchema = z.strictObject({\n id: maxUnits(z.string().min(1), 64),\n at: TimelineTimeSchema,\n itemIds: z.array(z.string().min(1)).min(1).max(TIMELINE_MAX_ITEMS),\n title: TimelineTitleSchema.optional(),\n required: z.boolean().optional(),\n});\n\nexport const TimelineChapterSchema = z.strictObject({\n at: TimelineTimeSchema,\n title: TimelineTitleSchema,\n});\n\n/**\n * A timeline on its own: its quizzes, chapters and navigation. The rules that\n * need the group — every item in exactly one quiz, a video stimulus, the five\n * item types — are {@link timelineIssues}, which both group schemas run.\n */\nexport const MediaTimelineSchema = z\n .strictObject({\n cues: z.array(TimelineCueSchema).max(TIMELINE_MAX_QUIZZES),\n chapters: z.array(TimelineChapterSchema).max(TIMELINE_MAX_CHAPTERS).optional(),\n navigation: z.enum(['free', 'no-skip-ahead']).optional(),\n })\n .check((ctx) => {\n const seen = new Set<string>();\n ctx.value.cues.forEach((cue, index) => {\n if (seen.has(cue.id)) {\n ctx.issues.push({\n code: 'custom',\n input: cue.id,\n message: `Quiz id \"${cue.id}\" is used twice: events, drafts and the contents panel name a quiz by its id.`,\n path: ['cues', index, 'id'],\n });\n }\n seen.add(cue.id);\n });\n // Strictly increasing, not merely sorted: two chapters starting at one\n // moment leave the first with no length, and the scrubber no room to draw it.\n const chapters = ctx.value.chapters ?? [];\n chapters.forEach((chapter, index) => {\n const previous = chapters[index - 1];\n if (previous !== undefined && chapter.at <= previous.at) {\n ctx.issues.push({\n code: 'custom',\n input: chapter.at,\n message: 'Chapter times must be strictly increasing.',\n path: ['chapters', index, 'at'],\n });\n }\n });\n });\n\n/** A URL only this document can resolve, or one that inlines the bytes. */\nfunction isLocalOnlyUrl(url: unknown): boolean {\n return typeof url === 'string' && /^(data|blob):/i.test(url);\n}\n\n/**\n * The rules of an interactive video that span the timeline, the stimulus and\n * the items. Run by the content schema and, for everything but the two\n * authoring-only rules, by the strict redacted schema — a projection built by\n * hand never passed through the content schema.\n *\n * Items are read defensively: the redacted schema leaves them opaque, and each\n * is proven against its own type's schema elsewhere.\n */\nfunction timelineIssues(\n group: {\n stimulus: {\n kind: string;\n media?:\n | {\n type: string;\n url: string;\n poster?: string | undefined;\n tracks?: readonly { src: string }[] | undefined;\n }\n | undefined;\n };\n items: readonly unknown[];\n shuffle?: string | undefined;\n timeline?: { cues: readonly { itemIds: readonly string[] }[] } | undefined;\n },\n scope: 'content' | 'redacted',\n): { path: (string | number)[]; message: string; input: unknown }[] {\n const timeline = group.timeline;\n if (timeline === undefined) {\n return [];\n }\n const issues: { path: (string | number)[]; message: string; input: unknown }[] = [];\n const media = group.stimulus.media;\n\n // Reported at the field that is wrong, so an editor's own check at that path\n // can stand in for it without hiding anything else about the stimulus.\n if (group.stimulus.kind !== 'video') {\n issues.push({\n path: ['stimulus', 'kind'],\n input: group.stimulus.kind,\n message:\n 'An interactive video needs a video stimulus: quizzes open at moments of a video, and nothing else has them.',\n });\n } else if (media !== undefined && media.type !== 'video') {\n issues.push({\n path: ['stimulus', 'media', 'type'],\n input: media.type,\n message:\n 'An interactive video needs a video file. An embedded provider player cannot be paused at the moment a quiz opens.',\n });\n }\n if (group.shuffle === 'within-group') {\n issues.push({\n path: ['shuffle'],\n input: group.shuffle,\n message:\n 'An interactive video presents its questions in the order its quizzes open; shuffle: \"within-group\" cannot apply to it.',\n });\n }\n if (group.items.length > TIMELINE_MAX_ITEMS) {\n issues.push({\n path: ['items'],\n input: group.items.length,\n message: `An interactive video holds at most ${TIMELINE_MAX_ITEMS} questions.`,\n });\n }\n\n const itemIds = new Map<string, number>();\n group.items.forEach((item, index) => {\n const {\n id,\n type,\n media: itemMedia,\n } = (item ?? {}) as { id?: unknown; type?: unknown; media?: unknown };\n if (typeof id === 'string') {\n itemIds.set(id, index);\n }\n if (!isInteractiveVideoItemType(type)) {\n issues.push({\n path: ['items', index, 'type'],\n input: type,\n message: `An interactive video may hold only ${INTERACTIVE_VIDEO_ITEM_TYPES.join(', ')} questions.`,\n });\n }\n // The \"play the stimulus\" fallback a dictation has in a listening group\n // means nothing halfway through a video.\n if (scope === 'content' && type === 'dictation' && itemMedia === undefined) {\n issues.push({\n path: ['items', index, 'media'],\n input: itemMedia,\n message: 'A dictation inside an interactive video needs its own recording.',\n });\n }\n });\n\n const placed = new Set<string>();\n timeline.cues.forEach((cue, cueIndex) => {\n cue.itemIds.forEach((itemId, position) => {\n const path = ['timeline', 'cues', cueIndex, 'itemIds', position];\n if (!itemIds.has(itemId)) {\n issues.push({\n path,\n input: itemId,\n message: `No item in this group has the id \"${itemId}\".`,\n });\n } else if (placed.has(itemId)) {\n issues.push({\n path,\n input: itemId,\n message: `Item \"${itemId}\" is placed twice: every question belongs to exactly one quiz.`,\n });\n }\n placed.add(itemId);\n });\n });\n for (const [itemId, index] of itemIds) {\n if (!placed.has(itemId)) {\n issues.push({\n path: ['items', index],\n input: itemId,\n message: `Item \"${itemId}\" is in no quiz, so the video would never show it.`,\n });\n }\n }\n\n // A `data:` video swells the payload and every fingerprint over it; a stored\n // `blob:` URL means nothing in another document.\n if (scope === 'content' && media !== undefined) {\n const urls: [unknown, (string | number)[]][] = [\n [media.url, ['stimulus', 'media', 'url']],\n [media.poster, ['stimulus', 'media', 'poster']],\n ...(media.tracks ?? []).map((track, index): [unknown, (string | number)[]] => [\n track.src,\n ['stimulus', 'media', 'tracks', index, 'src'],\n ]),\n ];\n for (const [url, path] of urls) {\n if (isLocalOnlyUrl(url)) {\n issues.push({\n path,\n input: url,\n message:\n 'An interactive video is stored and served: its URLs cannot be data: or blob: URLs.',\n });\n }\n }\n }\n return issues;\n}\n\n/**\n * The structural minimum of an item as seen by the CONTAINER schema. Each\n * item's own contract is checked against its registered schema by\n * {@link validateItemGroup} — a zod schema cannot dispatch on a registry\n * that consumers extend at runtime.\n */\nconst ItemShapeSchema = z.looseObject({\n type: z.string().min(1),\n id: z.string().min(1),\n slotKey: SlotKeySchema.optional(),\n});\n\n/**\n * Zod schema for an {@link ItemGroup} CONTAINER. Loose: unknown keys\n * preserved. Validates the group's own fields and the stimulus in full, and\n * each item only structurally (`type` and `id`); use {@link validateItemGroup}\n * to validate the items against their registered schemas as well.\n */\nexport const ItemGroupSchema = z\n .looseObject({\n schemaVersion: z.literal('1.0'),\n type: z.literal('item-group'),\n id: z.string().min(1),\n title: z.string().optional(),\n slotKey: SlotKeySchema.optional(),\n stimulus: StimulusSchema,\n items: z.array(ItemShapeSchema).min(1),\n shuffle: z.enum(['none', 'within-group']).optional(),\n timeline: MediaTimelineSchema.optional(),\n })\n .refine((group) => group.items.every((item) => item.type !== 'item-group'), {\n error: 'Item groups do not nest: every item must be an activity.',\n path: ['items'],\n })\n .refine((group) => new Set(group.items.map((item) => item.id)).size === group.items.length, {\n error: 'Item ids must be unique within a group.',\n path: ['items'],\n })\n .check((ctx) => {\n for (const issue of timelineIssues(ctx.value, 'content')) {\n ctx.issues.push({ code: 'custom', ...issue });\n }\n });\n\n/** Strict learner-safe stimulus: everything but the author-only `transcript`. */\nexport const RedactedStimulusSchema = z.strictObject({\n id: z.string().min(1),\n kind: z.enum(['text', 'audio', 'video', 'image', 'mixed']),\n title: z.string().optional(),\n body: z.string().optional(),\n bodyHtml: z.string().optional(),\n media: RedactedMediaSchema.optional(),\n locale: z.string().optional(),\n attribution: z.string().optional(),\n});\n\n/**\n * Strict learner-safe item group. Items are left opaque here — each is proven\n * learner-safe by `assertRedacted` against its OWN type's redacted schema,\n * which is the only place that knowledge lives. The one exception is the one\n * rule that spans the container and an item: a captioned stimulus recording\n * played to a dictation is not learner-safe, because the captions are the\n * dictation's answer.\n */\nexport const RedactedItemGroupSchema = z\n .strictObject({\n redacted: z.literal(true),\n schemaVersion: z.literal('1.0'),\n type: z.literal('item-group'),\n id: z.string().min(1),\n title: z.string().optional(),\n slotKey: SlotKeySchema.optional(),\n stimulus: RedactedStimulusSchema,\n items: z.array(z.unknown()).min(1),\n shuffle: z.enum(['none', 'within-group']).optional(),\n timeline: MediaTimelineSchema.optional(),\n })\n .check((ctx) => {\n for (const issue of timelineIssues(ctx.value, 'redacted')) {\n ctx.issues.push({ code: 'custom', ...issue });\n }\n const captions = groupCaptionsField(ctx.value);\n if (captions !== undefined) {\n ctx.issues.push({\n code: 'custom',\n input: ctx.value.stimulus.media?.[captions],\n message: GROUP_CAPTIONS_REVEAL_DICTATION,\n path: ['stimulus', 'media', captions],\n });\n }\n });\n\nfunction toValidationErrors(\n issues: readonly { path: readonly PropertyKey[]; message: string; code: string }[],\n prefix: string[],\n): ValidationError[] {\n return issues.map((issue) => ({\n path: [...prefix, ...issue.path.map(String)],\n message: issue.message,\n code: issue.code,\n }));\n}\n\n/**\n * Validates an item group in full: the container and stimulus against\n * {@link ItemGroupSchema}, then every item against the schema registered for\n * its `type`. Errors from items are reported at `items.<index>.…`.\n *\n * Unlike `validateActivity`, an item whose type is not registered is REPORTED\n * (code `unknown_activity_type`) rather than thrown: a group is validated as\n * a whole, and an author fixing a six-item group wants every problem listed,\n * not the first one that happened to throw.\n */\nexport function validateItemGroup(data: unknown): ValidationResult<ItemGroup> {\n const container = ItemGroupSchema.safeParse(data);\n if (!container.success) {\n return { success: false, errors: toValidationErrors(container.error.issues, []) };\n }\n\n const errors: ValidationError[] = [];\n const items: ActivityData[] = [];\n container.data.items.forEach((item, index) => {\n const descriptor = getActivityTypeDescriptor(item.type);\n if (descriptor === undefined) {\n errors.push({\n path: ['items', String(index), 'type'],\n message: `Activity type \"${item.type}\" is not registered`,\n code: 'unknown_activity_type',\n });\n return;\n }\n const parsed = readSchema(descriptor.schema, item, `Activity type \"${descriptor.type}\"`);\n if (!parsed.success) {\n errors.push(...toValidationErrors(parsed.issues, ['items', String(index)]));\n return;\n }\n items.push(parsed.data as ActivityData);\n });\n const captions = groupCaptionsField(container.data);\n if (captions !== undefined) {\n errors.push({\n path: ['stimulus', 'media', captions],\n message: GROUP_CAPTIONS_REVEAL_DICTATION,\n code: 'custom',\n });\n }\n\n if (errors.length > 0) {\n return { success: false, errors };\n }\n // zod4 optional outputs are `T | undefined`; the wire type uses exact\n // optionals. Structurally identical at runtime — the cast is type-level.\n return { success: true, data: { ...container.data, items } as unknown as ItemGroup };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAcA,MAAa,+BAA+B;CAC1C;CACA;CACA;CACA;CACA;AACF;;AAMA,SAAgB,2BAA2B,MAAiD;CAC1F,OAAQ,6BAAoD,SAAS,IAAI;AAC3E;;AAGA,MAAa,uBAAuB;;;;;;AAOpC,MAAa,qBAAqB;;AAGlC,MAAa,wBAAwB;;AAGrC,MAAa,4BAA4B;;;;;;;;;;;;ACjBzC,MAAM,gBAAgB,EACnB,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,QAAQ,QAAQ,CAAC,IAAI,SAAS,GAAG,GAAG,EACnC,OACE,uJACJ,CAAC;AAEH,SAAS,QAAQ,UAAkD;CACjE,OAAO,OAAO,SAAS,SAAS,YAAY,SAAS,KAAK,KAAK,CAAC,CAAC,SAAS;AAC5E;;AAGA,SAAS,UAAU,MAAoB,WAAwC;CAC7E,QAAQ,MAAR;EACE,KAAK,SACH,OAAO,cAAc;EACvB,KAAK,SACH,OAAO,cAAc,WAAW,cAAc;EAChD,KAAK,SACH,OAAO,cAAc;EACvB,SACE,OAAO;CACX;AACF;;;;;;;;;;AAWA,MAAa,iBAAiB,EAC3B,YAAY;CACX,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACpB,MAAM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D;EACF;EACA,MAAM,SAAS,WAAW,WAAW,QAAQ,MAAM,kBAAkB,WAAW,KAAK,EAAE;EACvF,IAAI,CAAC,OAAO,SAAS;GACnB,OAAO,KAAK,GAAG,mBAAmB,OAAO,QAAQ,CAAC,SAAS,OAAO,KAAK,CAAC,CAAC,CAAC;GAC1E;EACF;EACA,MAAM,KAAK,OAAO,IAAoB;CACxC,CAAC;CACD,MAAM,WAAW,mBAAmB,UAAU,IAAI;CAClD,IAAI,aAAa,KAAA,GACf,OAAO,KAAK;EACV,MAAM;GAAC;GAAY;GAAS;EAAQ;EACpC,SAAS;EACT,MAAM;CACR,CAAC;CAGH,IAAI,OAAO,SAAS,GAClB,OAAO;EAAE,SAAS;EAAO;CAAO;CAIlC,OAAO;EAAE,SAAS;EAAM,MAAM;GAAE,GAAG,UAAU;GAAM;EAAM;CAA0B;AACrF"}
|
|
1
|
+
{"version":3,"file":"item-group-CKZk3txt.js","names":[],"sources":["../src/timeline-limits.ts","../src/schemas/item-group.ts"],"sourcesContent":["/**\n * The bounds of an interactive video — an item group with a `timeline`.\n *\n * A leaf module on purpose: the schemas, the authoring checks and the timeline\n * helpers all read these, and nothing here may import any of them back.\n */\n\n/**\n * The item types an interactive video may present. CLOSED on purpose: a type\n * added to the SDK later, or a custom type a host registers, is not silently\n * embeddable. Each one here was chosen, and each works inside a paused video —\n * a read-aloud's microphone included, because every quiz pauses the video\n * first.\n */\nexport const INTERACTIVE_VIDEO_ITEM_TYPES = [\n 'multiple-choice',\n 'fill-in-the-blanks',\n 'gap-select',\n 'dictation',\n 'read-aloud',\n] as const;\n\n/** One of {@link INTERACTIVE_VIDEO_ITEM_TYPES}. */\nexport type InteractiveVideoItemType = (typeof INTERACTIVE_VIDEO_ITEM_TYPES)[number];\n\n/** Whether `type` is one of the item types an interactive video may present. */\nexport function isInteractiveVideoItemType(type: unknown): type is InteractiveVideoItemType {\n return (INTERACTIVE_VIDEO_ITEM_TYPES as readonly unknown[]).includes(type);\n}\n\n/** The most quizzes one video may hold. */\nexport const TIMELINE_MAX_QUIZZES = 100;\n\n/**\n * The most questions one interactive video may hold, across all its quizzes.\n * The player keeps every one of them mounted, so an answer survives the\n * learner rewinding past its quiz.\n */\nexport const TIMELINE_MAX_ITEMS = 200;\n\n/** The most chapters one video may hold. */\nexport const TIMELINE_MAX_CHAPTERS = 100;\n\n/** The longest quiz or chapter title, in UTF-16 units. A title sits on one line of the player. */\nexport const TIMELINE_MAX_TITLE_LENGTH = 120;\n","import * as z from 'zod/v4';\nimport { getActivityTypeDescriptor } from '../registry/index.js';\nimport {\n INTERACTIVE_VIDEO_ITEM_TYPES,\n isInteractiveVideoItemType,\n TIMELINE_MAX_CHAPTERS,\n TIMELINE_MAX_ITEMS,\n TIMELINE_MAX_QUIZZES,\n TIMELINE_MAX_TITLE_LENGTH,\n} from '../timeline-limits.js';\nimport type { ActivityData, ValidationError, ValidationResult } from '../types/activity.js';\nimport type { ItemGroup, StimulusKind } from '../types/item-group.js';\nimport { GROUP_CAPTIONS_REVEAL_DICTATION, groupCaptionsField } from './dictation.js';\nimport { MediaSchema, RedactedMediaSchema, ScriptSchema } from './media.js';\nimport { readSchema } from './read-schema.js';\nimport { maxUnits } from './text-length.js';\n\n/**\n * An authored slot key.\n *\n * A `.` is rejected here, not at render time: `flattenSequence` uses the first\n * `.` to separate a group from its item, so a key containing one would produce\n * an ambiguous slot id. `keyOf` already threw on it — this moves the rejection\n * to `validateItemGroup`, where an author finds it, instead of leaving it to\n * surface when a learner opens the paper. Content that would newly fail\n * validation already threw at flatten time, so it can never have been sat.\n */\nconst SlotKeySchema = z\n .string()\n .min(1)\n .refine((key) => !key.includes('.'), {\n error:\n 'slotKey must not contain \".\" — that character separates a group from its item in a slot id, so a key containing one would make the slot ambiguous.',\n });\n\nfunction hasBody(stimulus: { body?: string | undefined }): boolean {\n return typeof stimulus.body === 'string' && stimulus.body.trim().length > 0;\n}\n\n/** Which media types can carry a stimulus of each kind. `text`/`mixed` accept any. */\nfunction mediaFits(kind: StimulusKind, mediaType: string | undefined): boolean {\n switch (kind) {\n case 'audio':\n return mediaType === 'audio';\n case 'video':\n return mediaType === 'video' || mediaType === 'embed';\n case 'image':\n return mediaType === 'image';\n default:\n return true;\n }\n}\n\n/**\n * Zod schema for a {@link Stimulus}. Loose: unknown keys preserved.\n *\n * The semantic guards exist because a stimulus that does not carry what its\n * `kind` promises is an authoring error that must not reach an exam: an\n * \"audio\" stimulus with no recording renders as a blank panel above six\n * listening questions. Unrepresentable in JSON Schema; dropped from\n * `stimulusJsonSchema` by design.\n */\nexport const StimulusSchema = z\n .looseObject({\n id: z.string().min(1),\n kind: z.enum(['text', 'audio', 'video', 'image', 'mixed']),\n title: z.string().optional(),\n body: z.string().optional(),\n bodyHtml: z.string().optional(),\n media: MediaSchema.optional(),\n transcript: z.string().optional(),\n script: ScriptSchema.optional(),\n locale: z.string().optional(),\n attribution: z.string().optional(),\n })\n .refine((stimulus) => stimulus.bodyHtml === undefined || hasBody(stimulus), {\n error:\n 'bodyHtml requires a plain-text body: it is the accessible fallback rendered when no sanitiser is supplied.',\n path: ['body'],\n })\n .refine(\n (stimulus) => (stimulus.kind !== 'text' && stimulus.kind !== 'mixed') || hasBody(stimulus),\n {\n error: 'A text or mixed stimulus needs a non-empty body.',\n path: ['body'],\n },\n )\n .refine((stimulus) => stimulus.kind === 'text' || stimulus.media !== undefined, {\n error: 'An audio, video, image or mixed stimulus needs media.',\n path: ['media'],\n })\n .refine(\n (stimulus) => stimulus.media === undefined || mediaFits(stimulus.kind, stimulus.media.type),\n {\n error:\n 'media.type does not fit the stimulus kind: audio needs audio; video needs video or embed; image needs image.',\n path: ['media', 'type'],\n },\n );\n\nconst TimelineTitleSchema = maxUnits(z.string(), TIMELINE_MAX_TITLE_LENGTH).refine(\n (title) => title.trim().length > 0,\n { error: 'A title must not be empty.' },\n);\n\n/** Seconds from the start of the video. zod rejects NaN and ±Infinity itself. */\nconst TimelineTimeSchema = z.number().min(0, { error: 'A time is 0 seconds or more.' });\n\n/**\n * A quiz. STRICT, like every part of a timeline: a misspelt `requried` would\n * otherwise be kept and the quiz silently optional on a paper that believed it\n * was required.\n */\nexport const TimelineCueSchema = z.strictObject({\n id: maxUnits(z.string().min(1), 64),\n at: TimelineTimeSchema,\n itemIds: z.array(z.string().min(1)).min(1).max(TIMELINE_MAX_ITEMS),\n title: TimelineTitleSchema.optional(),\n required: z.boolean().optional(),\n});\n\nexport const TimelineChapterSchema = z.strictObject({\n at: TimelineTimeSchema,\n title: TimelineTitleSchema,\n});\n\n/**\n * A timeline on its own: its quizzes, chapters and navigation. The rules that\n * need the group — every item in exactly one quiz, a video stimulus, the five\n * item types — are {@link timelineIssues}, which both group schemas run.\n */\nexport const MediaTimelineSchema = z\n .strictObject({\n cues: z.array(TimelineCueSchema).max(TIMELINE_MAX_QUIZZES),\n chapters: z.array(TimelineChapterSchema).max(TIMELINE_MAX_CHAPTERS).optional(),\n navigation: z.enum(['free', 'no-skip-ahead']).optional(),\n })\n .check((ctx) => {\n const seen = new Set<string>();\n ctx.value.cues.forEach((cue, index) => {\n if (seen.has(cue.id)) {\n ctx.issues.push({\n code: 'custom',\n input: cue.id,\n message: `Quiz id \"${cue.id}\" is used twice: events, drafts and the contents panel name a quiz by its id.`,\n path: ['cues', index, 'id'],\n });\n }\n seen.add(cue.id);\n });\n // Strictly increasing, not merely sorted: two chapters starting at one\n // moment leave the first with no length, and the scrubber no room to draw it.\n const chapters = ctx.value.chapters ?? [];\n chapters.forEach((chapter, index) => {\n const previous = chapters[index - 1];\n if (previous !== undefined && chapter.at <= previous.at) {\n ctx.issues.push({\n code: 'custom',\n input: chapter.at,\n message: 'Chapter times must be strictly increasing.',\n path: ['chapters', index, 'at'],\n });\n }\n });\n });\n\n/** A URL only this document can resolve, or one that inlines the bytes. */\nfunction isLocalOnlyUrl(url: unknown): boolean {\n return typeof url === 'string' && /^(data|blob):/i.test(url);\n}\n\n/**\n * The rules of an interactive video that span the timeline, the stimulus and\n * the items. Run by the content schema and, for everything but the two\n * authoring-only rules, by the strict redacted schema — a projection built by\n * hand never passed through the content schema.\n *\n * Items are read defensively: the redacted schema leaves them opaque, and each\n * is proven against its own type's schema elsewhere.\n */\nfunction timelineIssues(\n group: {\n stimulus: {\n kind: string;\n media?:\n | {\n type: string;\n url: string;\n poster?: string | undefined;\n tracks?: readonly { src: string }[] | undefined;\n }\n | undefined;\n };\n items: readonly unknown[];\n shuffle?: string | undefined;\n timeline?: { cues: readonly { itemIds: readonly string[] }[] } | undefined;\n },\n scope: 'content' | 'redacted',\n): { path: (string | number)[]; message: string; input: unknown }[] {\n const timeline = group.timeline;\n if (timeline === undefined) {\n return [];\n }\n const issues: { path: (string | number)[]; message: string; input: unknown }[] = [];\n const media = group.stimulus.media;\n\n // Reported at the field that is wrong, so an editor's own check at that path\n // can stand in for it without hiding anything else about the stimulus.\n if (group.stimulus.kind !== 'video') {\n issues.push({\n path: ['stimulus', 'kind'],\n input: group.stimulus.kind,\n message:\n 'An interactive video needs a video stimulus: quizzes open at moments of a video, and nothing else has them.',\n });\n } else if (media !== undefined && media.type !== 'video') {\n issues.push({\n path: ['stimulus', 'media', 'type'],\n input: media.type,\n message:\n 'An interactive video needs a video file. An embedded provider player cannot be paused at the moment a quiz opens.',\n });\n }\n if (group.shuffle === 'within-group') {\n issues.push({\n path: ['shuffle'],\n input: group.shuffle,\n message:\n 'An interactive video presents its questions in the order its quizzes open; shuffle: \"within-group\" cannot apply to it.',\n });\n }\n if (group.items.length > TIMELINE_MAX_ITEMS) {\n issues.push({\n path: ['items'],\n input: group.items.length,\n message: `An interactive video holds at most ${TIMELINE_MAX_ITEMS} questions.`,\n });\n }\n\n const itemIds = new Map<string, number>();\n group.items.forEach((item, index) => {\n const {\n id,\n type,\n media: itemMedia,\n } = (item ?? {}) as { id?: unknown; type?: unknown; media?: unknown };\n if (typeof id === 'string') {\n itemIds.set(id, index);\n }\n if (!isInteractiveVideoItemType(type)) {\n issues.push({\n path: ['items', index, 'type'],\n input: type,\n message: `An interactive video may hold only ${INTERACTIVE_VIDEO_ITEM_TYPES.join(', ')} questions.`,\n });\n }\n // The \"play the stimulus\" fallback a dictation has in a listening group\n // means nothing halfway through a video.\n if (scope === 'content' && type === 'dictation' && itemMedia === undefined) {\n issues.push({\n path: ['items', index, 'media'],\n input: itemMedia,\n message: 'A dictation inside an interactive video needs its own recording.',\n });\n }\n });\n\n const placed = new Set<string>();\n timeline.cues.forEach((cue, cueIndex) => {\n cue.itemIds.forEach((itemId, position) => {\n const path = ['timeline', 'cues', cueIndex, 'itemIds', position];\n if (!itemIds.has(itemId)) {\n issues.push({\n path,\n input: itemId,\n message: `No item in this group has the id \"${itemId}\".`,\n });\n } else if (placed.has(itemId)) {\n issues.push({\n path,\n input: itemId,\n message: `Item \"${itemId}\" is placed twice: every question belongs to exactly one quiz.`,\n });\n }\n placed.add(itemId);\n });\n });\n for (const [itemId, index] of itemIds) {\n if (!placed.has(itemId)) {\n issues.push({\n path: ['items', index],\n input: itemId,\n message: `Item \"${itemId}\" is in no quiz, so the video would never show it.`,\n });\n }\n }\n\n // A `data:` video swells the payload and every fingerprint over it; a stored\n // `blob:` URL means nothing in another document.\n if (scope === 'content' && media !== undefined) {\n const urls: [unknown, (string | number)[]][] = [\n [media.url, ['stimulus', 'media', 'url']],\n [media.poster, ['stimulus', 'media', 'poster']],\n ...(media.tracks ?? []).map((track, index): [unknown, (string | number)[]] => [\n track.src,\n ['stimulus', 'media', 'tracks', index, 'src'],\n ]),\n ];\n for (const [url, path] of urls) {\n if (isLocalOnlyUrl(url)) {\n issues.push({\n path,\n input: url,\n message:\n 'An interactive video is stored and served: its URLs cannot be data: or blob: URLs.',\n });\n }\n }\n }\n return issues;\n}\n\n/**\n * The structural minimum of an item as seen by the CONTAINER schema. Each\n * item's own contract is checked against its registered schema by\n * {@link validateItemGroup} — a zod schema cannot dispatch on a registry\n * that consumers extend at runtime.\n */\nconst ItemShapeSchema = z.looseObject({\n type: z.string().min(1),\n id: z.string().min(1),\n slotKey: SlotKeySchema.optional(),\n});\n\n/**\n * Zod schema for an {@link ItemGroup} CONTAINER. Loose: unknown keys\n * preserved. Validates the group's own fields and the stimulus in full, and\n * each item only structurally (`type` and `id`); use {@link validateItemGroup}\n * to validate the items against their registered schemas as well.\n */\nexport const ItemGroupSchema = z\n .looseObject({\n schemaVersion: z.literal('1.0'),\n type: z.literal('item-group'),\n id: z.string().min(1),\n title: z.string().optional(),\n slotKey: SlotKeySchema.optional(),\n stimulus: StimulusSchema,\n items: z.array(ItemShapeSchema).min(1),\n shuffle: z.enum(['none', 'within-group']).optional(),\n timeline: MediaTimelineSchema.optional(),\n })\n .refine((group) => group.items.every((item) => item.type !== 'item-group'), {\n error: 'Item groups do not nest: every item must be an activity.',\n path: ['items'],\n })\n .refine((group) => new Set(group.items.map((item) => item.id)).size === group.items.length, {\n error: 'Item ids must be unique within a group.',\n path: ['items'],\n })\n .check((ctx) => {\n for (const issue of timelineIssues(ctx.value, 'content')) {\n ctx.issues.push({ code: 'custom', ...issue });\n }\n });\n\n/** Strict learner-safe stimulus: everything but the author-only `transcript`. */\nexport const RedactedStimulusSchema = z.strictObject({\n id: z.string().min(1),\n kind: z.enum(['text', 'audio', 'video', 'image', 'mixed']),\n title: z.string().optional(),\n body: z.string().optional(),\n bodyHtml: z.string().optional(),\n media: RedactedMediaSchema.optional(),\n locale: z.string().optional(),\n attribution: z.string().optional(),\n});\n\n/**\n * Strict learner-safe item group. Items are left opaque here — each is proven\n * learner-safe by `assertRedacted` against its OWN type's redacted schema,\n * which is the only place that knowledge lives. The one exception is the one\n * rule that spans the container and an item: a captioned stimulus recording\n * played to a dictation is not learner-safe, because the captions are the\n * dictation's answer.\n */\nexport const RedactedItemGroupSchema = z\n .strictObject({\n redacted: z.literal(true),\n schemaVersion: z.literal('1.0'),\n type: z.literal('item-group'),\n id: z.string().min(1),\n title: z.string().optional(),\n slotKey: SlotKeySchema.optional(),\n stimulus: RedactedStimulusSchema,\n items: z.array(z.unknown()).min(1),\n shuffle: z.enum(['none', 'within-group']).optional(),\n timeline: MediaTimelineSchema.optional(),\n })\n .check((ctx) => {\n for (const issue of timelineIssues(ctx.value, 'redacted')) {\n ctx.issues.push({ code: 'custom', ...issue });\n }\n const captions = groupCaptionsField(ctx.value);\n if (captions !== undefined) {\n ctx.issues.push({\n code: 'custom',\n input: ctx.value.stimulus.media?.[captions],\n message: GROUP_CAPTIONS_REVEAL_DICTATION,\n path: ['stimulus', 'media', captions],\n });\n }\n });\n\nfunction toValidationErrors(\n issues: readonly { path: readonly PropertyKey[]; message: string; code: string }[],\n prefix: string[],\n): ValidationError[] {\n return issues.map((issue) => ({\n path: [...prefix, ...issue.path.map(String)],\n message: issue.message,\n code: issue.code,\n }));\n}\n\n/**\n * Validates an item group in full: the container and stimulus against\n * {@link ItemGroupSchema}, then every item against the schema registered for\n * its `type`. Errors from items are reported at `items.<index>.…`.\n *\n * Unlike `validateActivity`, an item whose type is not registered is REPORTED\n * (code `unknown_activity_type`) rather than thrown: a group is validated as\n * a whole, and an author fixing a six-item group wants every problem listed,\n * not the first one that happened to throw.\n */\nexport function validateItemGroup(data: unknown): ValidationResult<ItemGroup> {\n const container = ItemGroupSchema.safeParse(data);\n if (!container.success) {\n return { success: false, errors: toValidationErrors(container.error.issues, []) };\n }\n\n const errors: ValidationError[] = [];\n const items: ActivityData[] = [];\n container.data.items.forEach((item, index) => {\n const descriptor = getActivityTypeDescriptor(item.type);\n if (descriptor === undefined) {\n errors.push({\n path: ['items', String(index), 'type'],\n message: `Activity type \"${item.type}\" is not registered`,\n code: 'unknown_activity_type',\n });\n return;\n }\n const parsed = readSchema(descriptor.schema, item, `Activity type \"${descriptor.type}\"`);\n if (!parsed.success) {\n errors.push(...toValidationErrors(parsed.issues, ['items', String(index)]));\n return;\n }\n items.push(parsed.data as ActivityData);\n });\n const captions = groupCaptionsField(container.data);\n if (captions !== undefined) {\n errors.push({\n path: ['stimulus', 'media', captions],\n message: GROUP_CAPTIONS_REVEAL_DICTATION,\n code: 'custom',\n });\n }\n\n if (errors.length > 0) {\n return { success: false, errors };\n }\n // zod4 optional outputs are `T | undefined`; the wire type uses exact\n // optionals. Structurally identical at runtime — the cast is type-level.\n return { success: true, data: { ...container.data, items } as unknown as ItemGroup };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAcA,MAAa,+BAA+B;CAC1C;CACA;CACA;CACA;CACA;AACF;;AAMA,SAAgB,2BAA2B,MAAiD;CAC1F,OAAQ,6BAAoD,SAAS,IAAI;AAC3E;;AAGA,MAAa,uBAAuB;;;;;;AAOpC,MAAa,qBAAqB;;AAGlC,MAAa,wBAAwB;;AAGrC,MAAa,4BAA4B;;;;;;;;;;;;ACjBzC,MAAM,gBAAgB,EACnB,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,QAAQ,QAAQ,CAAC,IAAI,SAAS,GAAG,GAAG,EACnC,OACE,uJACJ,CAAC;AAEH,SAAS,QAAQ,UAAkD;CACjE,OAAO,OAAO,SAAS,SAAS,YAAY,SAAS,KAAK,KAAK,CAAC,CAAC,SAAS;AAC5E;;AAGA,SAAS,UAAU,MAAoB,WAAwC;CAC7E,QAAQ,MAAR;EACE,KAAK,SACH,OAAO,cAAc;EACvB,KAAK,SACH,OAAO,cAAc,WAAW,cAAc;EAChD,KAAK,SACH,OAAO,cAAc;EACvB,SACE,OAAO;CACX;AACF;;;;;;;;;;AAWA,MAAa,iBAAiB,EAC3B,YAAY;CACX,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACpB,MAAM,EAAE,KAAK;EAAC;EAAQ;EAAS;EAAS;EAAS;CAAO,CAAC;CACzD,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS;CAC3B,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS;CAC1B,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;CAC9B,OAAO,YAAY,SAAS;CAC5B,YAAY,EAAE,OAAO,CAAC,CAAC,SAAS;CAChC,QAAQ,aAAa,SAAS;CAC9B,QAA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,IAAI,aAAa,KAAA,GACf,OAAO,KAAK;EACV,MAAM;GAAC;GAAY;GAAS;EAAQ;EACpC,SAAS;EACT,MAAM;CACR,CAAC;CAGH,IAAI,OAAO,SAAS,GAClB,OAAO;EAAE,SAAS;EAAO;CAAO;CAIlC,OAAO;EAAE,SAAS;EAAM,MAAM;GAAE,GAAG,UAAU;GAAM;EAAM;CAA0B;AACrF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_registry = require("./registry-
|
|
1
|
+
const require_registry = require("./registry-C9O9txy5.cjs");
|
|
2
2
|
let zod_v4 = require("zod/v4");
|
|
3
3
|
zod_v4 = require_registry.__toESM(zod_v4, 1);
|
|
4
4
|
// src/timeline-limits.ts
|
|
@@ -501,4 +501,4 @@ Object.defineProperty(exports, "validateItemGroup", {
|
|
|
501
501
|
}
|
|
502
502
|
});
|
|
503
503
|
|
|
504
|
-
//# sourceMappingURL=item-group-
|
|
504
|
+
//# sourceMappingURL=item-group-COP5OwEC.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item-group-KV4hYu3a.cjs","names":["z","MediaSchema","ScriptSchema","maxUnits","RedactedMediaSchema","groupCaptionsField","GROUP_CAPTIONS_REVEAL_DICTATION","getActivityTypeDescriptor","readSchema"],"sources":["../src/timeline-limits.ts","../src/schemas/item-group.ts"],"sourcesContent":["/**\n * The bounds of an interactive video — an item group with a `timeline`.\n *\n * A leaf module on purpose: the schemas, the authoring checks and the timeline\n * helpers all read these, and nothing here may import any of them back.\n */\n\n/**\n * The item types an interactive video may present. CLOSED on purpose: a type\n * added to the SDK later, or a custom type a host registers, is not silently\n * embeddable. Each one here was chosen, and each works inside a paused video —\n * a read-aloud's microphone included, because every quiz pauses the video\n * first.\n */\nexport const INTERACTIVE_VIDEO_ITEM_TYPES = [\n 'multiple-choice',\n 'fill-in-the-blanks',\n 'gap-select',\n 'dictation',\n 'read-aloud',\n] as const;\n\n/** One of {@link INTERACTIVE_VIDEO_ITEM_TYPES}. */\nexport type InteractiveVideoItemType = (typeof INTERACTIVE_VIDEO_ITEM_TYPES)[number];\n\n/** Whether `type` is one of the item types an interactive video may present. */\nexport function isInteractiveVideoItemType(type: unknown): type is InteractiveVideoItemType {\n return (INTERACTIVE_VIDEO_ITEM_TYPES as readonly unknown[]).includes(type);\n}\n\n/** The most quizzes one video may hold. */\nexport const TIMELINE_MAX_QUIZZES = 100;\n\n/**\n * The most questions one interactive video may hold, across all its quizzes.\n * The player keeps every one of them mounted, so an answer survives the\n * learner rewinding past its quiz.\n */\nexport const TIMELINE_MAX_ITEMS = 200;\n\n/** The most chapters one video may hold. */\nexport const TIMELINE_MAX_CHAPTERS = 100;\n\n/** The longest quiz or chapter title, in UTF-16 units. A title sits on one line of the player. */\nexport const TIMELINE_MAX_TITLE_LENGTH = 120;\n","import * as z from 'zod/v4';\nimport { getActivityTypeDescriptor } from '../registry/index.js';\nimport {\n INTERACTIVE_VIDEO_ITEM_TYPES,\n isInteractiveVideoItemType,\n TIMELINE_MAX_CHAPTERS,\n TIMELINE_MAX_ITEMS,\n TIMELINE_MAX_QUIZZES,\n TIMELINE_MAX_TITLE_LENGTH,\n} from '../timeline-limits.js';\nimport type { ActivityData, ValidationError, ValidationResult } from '../types/activity.js';\nimport type { ItemGroup, StimulusKind } from '../types/item-group.js';\nimport { GROUP_CAPTIONS_REVEAL_DICTATION, groupCaptionsField } from './dictation.js';\nimport { MediaSchema, RedactedMediaSchema, ScriptSchema } from './media.js';\nimport { readSchema } from './read-schema.js';\nimport { maxUnits } from './text-length.js';\n\n/**\n * An authored slot key.\n *\n * A `.` is rejected here, not at render time: `flattenSequence` uses the first\n * `.` to separate a group from its item, so a key containing one would produce\n * an ambiguous slot id. `keyOf` already threw on it — this moves the rejection\n * to `validateItemGroup`, where an author finds it, instead of leaving it to\n * surface when a learner opens the paper. Content that would newly fail\n * validation already threw at flatten time, so it can never have been sat.\n */\nconst SlotKeySchema = z\n .string()\n .min(1)\n .refine((key) => !key.includes('.'), {\n error:\n 'slotKey must not contain \".\" — that character separates a group from its item in a slot id, so a key containing one would make the slot ambiguous.',\n });\n\nfunction hasBody(stimulus: { body?: string | undefined }): boolean {\n return typeof stimulus.body === 'string' && stimulus.body.trim().length > 0;\n}\n\n/** Which media types can carry a stimulus of each kind. `text`/`mixed` accept any. */\nfunction mediaFits(kind: StimulusKind, mediaType: string | undefined): boolean {\n switch (kind) {\n case 'audio':\n return mediaType === 'audio';\n case 'video':\n return mediaType === 'video' || mediaType === 'embed';\n case 'image':\n return mediaType === 'image';\n default:\n return true;\n }\n}\n\n/**\n * Zod schema for a {@link Stimulus}. Loose: unknown keys preserved.\n *\n * The semantic guards exist because a stimulus that does not carry what its\n * `kind` promises is an authoring error that must not reach an exam: an\n * \"audio\" stimulus with no recording renders as a blank panel above six\n * listening questions. Unrepresentable in JSON Schema; dropped from\n * `stimulusJsonSchema` by design.\n */\nexport const StimulusSchema = z\n .looseObject({\n id: z.string().min(1),\n kind: z.enum(['text', 'audio', 'video', 'image', 'mixed']),\n title: z.string().optional(),\n body: z.string().optional(),\n bodyHtml: z.string().optional(),\n media: MediaSchema.optional(),\n transcript: z.string().optional(),\n script: ScriptSchema.optional(),\n locale: z.string().optional(),\n attribution: z.string().optional(),\n })\n .refine((stimulus) => stimulus.bodyHtml === undefined || hasBody(stimulus), {\n error:\n 'bodyHtml requires a plain-text body: it is the accessible fallback rendered when no sanitiser is supplied.',\n path: ['body'],\n })\n .refine(\n (stimulus) => (stimulus.kind !== 'text' && stimulus.kind !== 'mixed') || hasBody(stimulus),\n {\n error: 'A text or mixed stimulus needs a non-empty body.',\n path: ['body'],\n },\n )\n .refine((stimulus) => stimulus.kind === 'text' || stimulus.media !== undefined, {\n error: 'An audio, video, image or mixed stimulus needs media.',\n path: ['media'],\n })\n .refine(\n (stimulus) => stimulus.media === undefined || mediaFits(stimulus.kind, stimulus.media.type),\n {\n error:\n 'media.type does not fit the stimulus kind: audio needs audio; video needs video or embed; image needs image.',\n path: ['media', 'type'],\n },\n );\n\nconst TimelineTitleSchema = maxUnits(z.string(), TIMELINE_MAX_TITLE_LENGTH).refine(\n (title) => title.trim().length > 0,\n { error: 'A title must not be empty.' },\n);\n\n/** Seconds from the start of the video. zod rejects NaN and ±Infinity itself. */\nconst TimelineTimeSchema = z.number().min(0, { error: 'A time is 0 seconds or more.' });\n\n/**\n * A quiz. STRICT, like every part of a timeline: a misspelt `requried` would\n * otherwise be kept and the quiz silently optional on a paper that believed it\n * was required.\n */\nexport const TimelineCueSchema = z.strictObject({\n id: maxUnits(z.string().min(1), 64),\n at: TimelineTimeSchema,\n itemIds: z.array(z.string().min(1)).min(1).max(TIMELINE_MAX_ITEMS),\n title: TimelineTitleSchema.optional(),\n required: z.boolean().optional(),\n});\n\nexport const TimelineChapterSchema = z.strictObject({\n at: TimelineTimeSchema,\n title: TimelineTitleSchema,\n});\n\n/**\n * A timeline on its own: its quizzes, chapters and navigation. The rules that\n * need the group — every item in exactly one quiz, a video stimulus, the five\n * item types — are {@link timelineIssues}, which both group schemas run.\n */\nexport const MediaTimelineSchema = z\n .strictObject({\n cues: z.array(TimelineCueSchema).max(TIMELINE_MAX_QUIZZES),\n chapters: z.array(TimelineChapterSchema).max(TIMELINE_MAX_CHAPTERS).optional(),\n navigation: z.enum(['free', 'no-skip-ahead']).optional(),\n })\n .check((ctx) => {\n const seen = new Set<string>();\n ctx.value.cues.forEach((cue, index) => {\n if (seen.has(cue.id)) {\n ctx.issues.push({\n code: 'custom',\n input: cue.id,\n message: `Quiz id \"${cue.id}\" is used twice: events, drafts and the contents panel name a quiz by its id.`,\n path: ['cues', index, 'id'],\n });\n }\n seen.add(cue.id);\n });\n // Strictly increasing, not merely sorted: two chapters starting at one\n // moment leave the first with no length, and the scrubber no room to draw it.\n const chapters = ctx.value.chapters ?? [];\n chapters.forEach((chapter, index) => {\n const previous = chapters[index - 1];\n if (previous !== undefined && chapter.at <= previous.at) {\n ctx.issues.push({\n code: 'custom',\n input: chapter.at,\n message: 'Chapter times must be strictly increasing.',\n path: ['chapters', index, 'at'],\n });\n }\n });\n });\n\n/** A URL only this document can resolve, or one that inlines the bytes. */\nfunction isLocalOnlyUrl(url: unknown): boolean {\n return typeof url === 'string' && /^(data|blob):/i.test(url);\n}\n\n/**\n * The rules of an interactive video that span the timeline, the stimulus and\n * the items. Run by the content schema and, for everything but the two\n * authoring-only rules, by the strict redacted schema — a projection built by\n * hand never passed through the content schema.\n *\n * Items are read defensively: the redacted schema leaves them opaque, and each\n * is proven against its own type's schema elsewhere.\n */\nfunction timelineIssues(\n group: {\n stimulus: {\n kind: string;\n media?:\n | {\n type: string;\n url: string;\n poster?: string | undefined;\n tracks?: readonly { src: string }[] | undefined;\n }\n | undefined;\n };\n items: readonly unknown[];\n shuffle?: string | undefined;\n timeline?: { cues: readonly { itemIds: readonly string[] }[] } | undefined;\n },\n scope: 'content' | 'redacted',\n): { path: (string | number)[]; message: string; input: unknown }[] {\n const timeline = group.timeline;\n if (timeline === undefined) {\n return [];\n }\n const issues: { path: (string | number)[]; message: string; input: unknown }[] = [];\n const media = group.stimulus.media;\n\n // Reported at the field that is wrong, so an editor's own check at that path\n // can stand in for it without hiding anything else about the stimulus.\n if (group.stimulus.kind !== 'video') {\n issues.push({\n path: ['stimulus', 'kind'],\n input: group.stimulus.kind,\n message:\n 'An interactive video needs a video stimulus: quizzes open at moments of a video, and nothing else has them.',\n });\n } else if (media !== undefined && media.type !== 'video') {\n issues.push({\n path: ['stimulus', 'media', 'type'],\n input: media.type,\n message:\n 'An interactive video needs a video file. An embedded provider player cannot be paused at the moment a quiz opens.',\n });\n }\n if (group.shuffle === 'within-group') {\n issues.push({\n path: ['shuffle'],\n input: group.shuffle,\n message:\n 'An interactive video presents its questions in the order its quizzes open; shuffle: \"within-group\" cannot apply to it.',\n });\n }\n if (group.items.length > TIMELINE_MAX_ITEMS) {\n issues.push({\n path: ['items'],\n input: group.items.length,\n message: `An interactive video holds at most ${TIMELINE_MAX_ITEMS} questions.`,\n });\n }\n\n const itemIds = new Map<string, number>();\n group.items.forEach((item, index) => {\n const {\n id,\n type,\n media: itemMedia,\n } = (item ?? {}) as { id?: unknown; type?: unknown; media?: unknown };\n if (typeof id === 'string') {\n itemIds.set(id, index);\n }\n if (!isInteractiveVideoItemType(type)) {\n issues.push({\n path: ['items', index, 'type'],\n input: type,\n message: `An interactive video may hold only ${INTERACTIVE_VIDEO_ITEM_TYPES.join(', ')} questions.`,\n });\n }\n // The \"play the stimulus\" fallback a dictation has in a listening group\n // means nothing halfway through a video.\n if (scope === 'content' && type === 'dictation' && itemMedia === undefined) {\n issues.push({\n path: ['items', index, 'media'],\n input: itemMedia,\n message: 'A dictation inside an interactive video needs its own recording.',\n });\n }\n });\n\n const placed = new Set<string>();\n timeline.cues.forEach((cue, cueIndex) => {\n cue.itemIds.forEach((itemId, position) => {\n const path = ['timeline', 'cues', cueIndex, 'itemIds', position];\n if (!itemIds.has(itemId)) {\n issues.push({\n path,\n input: itemId,\n message: `No item in this group has the id \"${itemId}\".`,\n });\n } else if (placed.has(itemId)) {\n issues.push({\n path,\n input: itemId,\n message: `Item \"${itemId}\" is placed twice: every question belongs to exactly one quiz.`,\n });\n }\n placed.add(itemId);\n });\n });\n for (const [itemId, index] of itemIds) {\n if (!placed.has(itemId)) {\n issues.push({\n path: ['items', index],\n input: itemId,\n message: `Item \"${itemId}\" is in no quiz, so the video would never show it.`,\n });\n }\n }\n\n // A `data:` video swells the payload and every fingerprint over it; a stored\n // `blob:` URL means nothing in another document.\n if (scope === 'content' && media !== undefined) {\n const urls: [unknown, (string | number)[]][] = [\n [media.url, ['stimulus', 'media', 'url']],\n [media.poster, ['stimulus', 'media', 'poster']],\n ...(media.tracks ?? []).map((track, index): [unknown, (string | number)[]] => [\n track.src,\n ['stimulus', 'media', 'tracks', index, 'src'],\n ]),\n ];\n for (const [url, path] of urls) {\n if (isLocalOnlyUrl(url)) {\n issues.push({\n path,\n input: url,\n message:\n 'An interactive video is stored and served: its URLs cannot be data: or blob: URLs.',\n });\n }\n }\n }\n return issues;\n}\n\n/**\n * The structural minimum of an item as seen by the CONTAINER schema. Each\n * item's own contract is checked against its registered schema by\n * {@link validateItemGroup} — a zod schema cannot dispatch on a registry\n * that consumers extend at runtime.\n */\nconst ItemShapeSchema = z.looseObject({\n type: z.string().min(1),\n id: z.string().min(1),\n slotKey: SlotKeySchema.optional(),\n});\n\n/**\n * Zod schema for an {@link ItemGroup} CONTAINER. Loose: unknown keys\n * preserved. Validates the group's own fields and the stimulus in full, and\n * each item only structurally (`type` and `id`); use {@link validateItemGroup}\n * to validate the items against their registered schemas as well.\n */\nexport const ItemGroupSchema = z\n .looseObject({\n schemaVersion: z.literal('1.0'),\n type: z.literal('item-group'),\n id: z.string().min(1),\n title: z.string().optional(),\n slotKey: SlotKeySchema.optional(),\n stimulus: StimulusSchema,\n items: z.array(ItemShapeSchema).min(1),\n shuffle: z.enum(['none', 'within-group']).optional(),\n timeline: MediaTimelineSchema.optional(),\n })\n .refine((group) => group.items.every((item) => item.type !== 'item-group'), {\n error: 'Item groups do not nest: every item must be an activity.',\n path: ['items'],\n })\n .refine((group) => new Set(group.items.map((item) => item.id)).size === group.items.length, {\n error: 'Item ids must be unique within a group.',\n path: ['items'],\n })\n .check((ctx) => {\n for (const issue of timelineIssues(ctx.value, 'content')) {\n ctx.issues.push({ code: 'custom', ...issue });\n }\n });\n\n/** Strict learner-safe stimulus: everything but the author-only `transcript`. */\nexport const RedactedStimulusSchema = z.strictObject({\n id: z.string().min(1),\n kind: z.enum(['text', 'audio', 'video', 'image', 'mixed']),\n title: z.string().optional(),\n body: z.string().optional(),\n bodyHtml: z.string().optional(),\n media: RedactedMediaSchema.optional(),\n locale: z.string().optional(),\n attribution: z.string().optional(),\n});\n\n/**\n * Strict learner-safe item group. Items are left opaque here — each is proven\n * learner-safe by `assertRedacted` against its OWN type's redacted schema,\n * which is the only place that knowledge lives. The one exception is the one\n * rule that spans the container and an item: a captioned stimulus recording\n * played to a dictation is not learner-safe, because the captions are the\n * dictation's answer.\n */\nexport const RedactedItemGroupSchema = z\n .strictObject({\n redacted: z.literal(true),\n schemaVersion: z.literal('1.0'),\n type: z.literal('item-group'),\n id: z.string().min(1),\n title: z.string().optional(),\n slotKey: SlotKeySchema.optional(),\n stimulus: RedactedStimulusSchema,\n items: z.array(z.unknown()).min(1),\n shuffle: z.enum(['none', 'within-group']).optional(),\n timeline: MediaTimelineSchema.optional(),\n })\n .check((ctx) => {\n for (const issue of timelineIssues(ctx.value, 'redacted')) {\n ctx.issues.push({ code: 'custom', ...issue });\n }\n const captions = groupCaptionsField(ctx.value);\n if (captions !== undefined) {\n ctx.issues.push({\n code: 'custom',\n input: ctx.value.stimulus.media?.[captions],\n message: GROUP_CAPTIONS_REVEAL_DICTATION,\n path: ['stimulus', 'media', captions],\n });\n }\n });\n\nfunction toValidationErrors(\n issues: readonly { path: readonly PropertyKey[]; message: string; code: string }[],\n prefix: string[],\n): ValidationError[] {\n return issues.map((issue) => ({\n path: [...prefix, ...issue.path.map(String)],\n message: issue.message,\n code: issue.code,\n }));\n}\n\n/**\n * Validates an item group in full: the container and stimulus against\n * {@link ItemGroupSchema}, then every item against the schema registered for\n * its `type`. Errors from items are reported at `items.<index>.…`.\n *\n * Unlike `validateActivity`, an item whose type is not registered is REPORTED\n * (code `unknown_activity_type`) rather than thrown: a group is validated as\n * a whole, and an author fixing a six-item group wants every problem listed,\n * not the first one that happened to throw.\n */\nexport function validateItemGroup(data: unknown): ValidationResult<ItemGroup> {\n const container = ItemGroupSchema.safeParse(data);\n if (!container.success) {\n return { success: false, errors: toValidationErrors(container.error.issues, []) };\n }\n\n const errors: ValidationError[] = [];\n const items: ActivityData[] = [];\n container.data.items.forEach((item, index) => {\n const descriptor = getActivityTypeDescriptor(item.type);\n if (descriptor === undefined) {\n errors.push({\n path: ['items', String(index), 'type'],\n message: `Activity type \"${item.type}\" is not registered`,\n code: 'unknown_activity_type',\n });\n return;\n }\n const parsed = readSchema(descriptor.schema, item, `Activity type \"${descriptor.type}\"`);\n if (!parsed.success) {\n errors.push(...toValidationErrors(parsed.issues, ['items', String(index)]));\n return;\n }\n items.push(parsed.data as ActivityData);\n });\n const captions = groupCaptionsField(container.data);\n if (captions !== undefined) {\n errors.push({\n path: ['stimulus', 'media', captions],\n message: GROUP_CAPTIONS_REVEAL_DICTATION,\n code: 'custom',\n });\n }\n\n if (errors.length > 0) {\n return { success: false, errors };\n }\n // zod4 optional outputs are `T | undefined`; the wire type uses exact\n // optionals. Structurally identical at runtime — the cast is type-level.\n return { success: true, data: { ...container.data, items } as unknown as ItemGroup };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAcA,MAAa,+BAA+B;CAC1C;CACA;CACA;CACA;CACA;AACF;;AAMA,SAAgB,2BAA2B,MAAiD;CAC1F,OAAQ,6BAAoD,SAAS,IAAI;AAC3E;;AAGA,MAAa,uBAAuB;;;;;;AAOpC,MAAa,qBAAqB;;AAGlC,MAAa,wBAAwB;;AAGrC,MAAa,4BAA4B;;;;;;;;;;;;ACjBzC,MAAM,gBAAgBA,OACnB,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,QAAQ,QAAQ,CAAC,IAAI,SAAS,GAAG,GAAG,EACnC,OACE,uJACJ,CAAC;AAEH,SAAS,QAAQ,UAAkD;CACjE,OAAO,OAAO,SAAS,SAAS,YAAY,SAAS,KAAK,KAAK,CAAC,CAAC,SAAS;AAC5E;;AAGA,SAAS,UAAU,MAAoB,WAAwC;CAC7E,QAAQ,MAAR;EACE,KAAK,SACH,OAAO,cAAc;EACvB,KAAK,SACH,OAAO,cAAc,WAAW,cAAc;EAChD,KAAK,SACH,OAAO,cAAc;EACvB,SACE,OAAO;CACX;AACF;;;;;;;;;;AAWA,MAAa,iBAAiBA,OAC3B,YAAY;CACX,IAAIA,OAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACpB,MAAMA,OAAE,KAAK;EAAC;EAAQ;EAAS;EAAS;EAAS;CAAO,CAAC;CACzD,OAAOA,O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AAS,kBAAkB,KAAK,KAAK;IACrC,MAAM;GACR,CAAC;GACD;EACF;EACA,MAAM,SAASC,iBAAAA,WAAW,WAAW,QAAQ,MAAM,kBAAkB,WAAW,KAAK,EAAE;EACvF,IAAI,CAAC,OAAO,SAAS;GACnB,OAAO,KAAK,GAAG,mBAAmB,OAAO,QAAQ,CAAC,SAAS,OAAO,KAAK,CAAC,CAAC,CAAC;GAC1E;EACF;EACA,MAAM,KAAK,OAAO,IAAoB;CACxC,CAAC;CACD,MAAM,WAAWH,iBAAAA,mBAAmB,UAAU,IAAI;CAClD,IAAI,aAAa,KAAA,GACf,OAAO,KAAK;EACV,MAAM;GAAC;GAAY;GAAS;EAAQ;EACpC,SAASC,iBAAAA;EACT,MAAM;CACR,CAAC;CAGH,IAAI,OAAO,SAAS,GAClB,OAAO;EAAE,SAAS;EAAO;CAAO;CAIlC,OAAO;EAAE,SAAS;EAAM,MAAM;GAAE,GAAG,UAAU;GAAM;EAAM;CAA0B;AACrF"}
|
|
1
|
+
{"version":3,"file":"item-group-COP5OwEC.cjs","names":["z","MediaSchema","ScriptSchema","maxUnits","RedactedMediaSchema","groupCaptionsField","GROUP_CAPTIONS_REVEAL_DICTATION","getActivityTypeDescriptor","readSchema"],"sources":["../src/timeline-limits.ts","../src/schemas/item-group.ts"],"sourcesContent":["/**\n * The bounds of an interactive video — an item group with a `timeline`.\n *\n * A leaf module on purpose: the schemas, the authoring checks and the timeline\n * helpers all read these, and nothing here may import any of them back.\n */\n\n/**\n * The item types an interactive video may present. CLOSED on purpose: a type\n * added to the SDK later, or a custom type a host registers, is not silently\n * embeddable. Each one here was chosen, and each works inside a paused video —\n * a read-aloud's microphone included, because every quiz pauses the video\n * first.\n */\nexport const INTERACTIVE_VIDEO_ITEM_TYPES = [\n 'multiple-choice',\n 'fill-in-the-blanks',\n 'gap-select',\n 'dictation',\n 'read-aloud',\n] as const;\n\n/** One of {@link INTERACTIVE_VIDEO_ITEM_TYPES}. */\nexport type InteractiveVideoItemType = (typeof INTERACTIVE_VIDEO_ITEM_TYPES)[number];\n\n/** Whether `type` is one of the item types an interactive video may present. */\nexport function isInteractiveVideoItemType(type: unknown): type is InteractiveVideoItemType {\n return (INTERACTIVE_VIDEO_ITEM_TYPES as readonly unknown[]).includes(type);\n}\n\n/** The most quizzes one video may hold. */\nexport const TIMELINE_MAX_QUIZZES = 100;\n\n/**\n * The most questions one interactive video may hold, across all its quizzes.\n * The player keeps every one of them mounted, so an answer survives the\n * learner rewinding past its quiz.\n */\nexport const TIMELINE_MAX_ITEMS = 200;\n\n/** The most chapters one video may hold. */\nexport const TIMELINE_MAX_CHAPTERS = 100;\n\n/** The longest quiz or chapter title, in UTF-16 units. A title sits on one line of the player. */\nexport const TIMELINE_MAX_TITLE_LENGTH = 120;\n","import * as z from 'zod/v4';\nimport { getActivityTypeDescriptor } from '../registry/index.js';\nimport {\n INTERACTIVE_VIDEO_ITEM_TYPES,\n isInteractiveVideoItemType,\n TIMELINE_MAX_CHAPTERS,\n TIMELINE_MAX_ITEMS,\n TIMELINE_MAX_QUIZZES,\n TIMELINE_MAX_TITLE_LENGTH,\n} from '../timeline-limits.js';\nimport type { ActivityData, ValidationError, ValidationResult } from '../types/activity.js';\nimport type { ItemGroup, StimulusKind } from '../types/item-group.js';\nimport { GROUP_CAPTIONS_REVEAL_DICTATION, groupCaptionsField } from './dictation.js';\nimport { MediaSchema, RedactedMediaSchema, ScriptSchema } from './media.js';\nimport { readSchema } from './read-schema.js';\nimport { maxUnits } from './text-length.js';\n\n/**\n * An authored slot key.\n *\n * A `.` is rejected here, not at render time: `flattenSequence` uses the first\n * `.` to separate a group from its item, so a key containing one would produce\n * an ambiguous slot id. `keyOf` already threw on it — this moves the rejection\n * to `validateItemGroup`, where an author finds it, instead of leaving it to\n * surface when a learner opens the paper. Content that would newly fail\n * validation already threw at flatten time, so it can never have been sat.\n */\nconst SlotKeySchema = z\n .string()\n .min(1)\n .refine((key) => !key.includes('.'), {\n error:\n 'slotKey must not contain \".\" — that character separates a group from its item in a slot id, so a key containing one would make the slot ambiguous.',\n });\n\nfunction hasBody(stimulus: { body?: string | undefined }): boolean {\n return typeof stimulus.body === 'string' && stimulus.body.trim().length > 0;\n}\n\n/** Which media types can carry a stimulus of each kind. `text`/`mixed` accept any. */\nfunction mediaFits(kind: StimulusKind, mediaType: string | undefined): boolean {\n switch (kind) {\n case 'audio':\n return mediaType === 'audio';\n case 'video':\n return mediaType === 'video' || mediaType === 'embed';\n case 'image':\n return mediaType === 'image';\n default:\n return true;\n }\n}\n\n/**\n * Zod schema for a {@link Stimulus}. Loose: unknown keys preserved.\n *\n * The semantic guards exist because a stimulus that does not carry what its\n * `kind` promises is an authoring error that must not reach an exam: an\n * \"audio\" stimulus with no recording renders as a blank panel above six\n * listening questions. Unrepresentable in JSON Schema; dropped from\n * `stimulusJsonSchema` by design.\n */\nexport const StimulusSchema = z\n .looseObject({\n id: z.string().min(1),\n kind: z.enum(['text', 'audio', 'video', 'image', 'mixed']),\n title: z.string().optional(),\n body: z.string().optional(),\n bodyHtml: z.string().optional(),\n media: MediaSchema.optional(),\n transcript: z.string().optional(),\n script: ScriptSchema.optional(),\n locale: z.string().optional(),\n attribution: z.string().optional(),\n })\n .refine((stimulus) => stimulus.bodyHtml === undefined || hasBody(stimulus), {\n error:\n 'bodyHtml requires a plain-text body: it is the accessible fallback rendered when no sanitiser is supplied.',\n path: ['body'],\n })\n .refine(\n (stimulus) => (stimulus.kind !== 'text' && stimulus.kind !== 'mixed') || hasBody(stimulus),\n {\n error: 'A text or mixed stimulus needs a non-empty body.',\n path: ['body'],\n },\n )\n .refine((stimulus) => stimulus.kind === 'text' || stimulus.media !== undefined, {\n error: 'An audio, video, image or mixed stimulus needs media.',\n path: ['media'],\n })\n .refine(\n (stimulus) => stimulus.media === undefined || mediaFits(stimulus.kind, stimulus.media.type),\n {\n error:\n 'media.type does not fit the stimulus kind: audio needs audio; video needs video or embed; image needs image.',\n path: ['media', 'type'],\n },\n );\n\nconst TimelineTitleSchema = maxUnits(z.string(), TIMELINE_MAX_TITLE_LENGTH).refine(\n (title) => title.trim().length > 0,\n { error: 'A title must not be empty.' },\n);\n\n/** Seconds from the start of the video. zod rejects NaN and ±Infinity itself. */\nconst TimelineTimeSchema = z.number().min(0, { error: 'A time is 0 seconds or more.' });\n\n/**\n * A quiz. STRICT, like every part of a timeline: a misspelt `requried` would\n * otherwise be kept and the quiz silently optional on a paper that believed it\n * was required.\n */\nexport const TimelineCueSchema = z.strictObject({\n id: maxUnits(z.string().min(1), 64),\n at: TimelineTimeSchema,\n itemIds: z.array(z.string().min(1)).min(1).max(TIMELINE_MAX_ITEMS),\n title: TimelineTitleSchema.optional(),\n required: z.boolean().optional(),\n});\n\nexport const TimelineChapterSchema = z.strictObject({\n at: TimelineTimeSchema,\n title: TimelineTitleSchema,\n});\n\n/**\n * A timeline on its own: its quizzes, chapters and navigation. The rules that\n * need the group — every item in exactly one quiz, a video stimulus, the five\n * item types — are {@link timelineIssues}, which both group schemas run.\n */\nexport const MediaTimelineSchema = z\n .strictObject({\n cues: z.array(TimelineCueSchema).max(TIMELINE_MAX_QUIZZES),\n chapters: z.array(TimelineChapterSchema).max(TIMELINE_MAX_CHAPTERS).optional(),\n navigation: z.enum(['free', 'no-skip-ahead']).optional(),\n })\n .check((ctx) => {\n const seen = new Set<string>();\n ctx.value.cues.forEach((cue, index) => {\n if (seen.has(cue.id)) {\n ctx.issues.push({\n code: 'custom',\n input: cue.id,\n message: `Quiz id \"${cue.id}\" is used twice: events, drafts and the contents panel name a quiz by its id.`,\n path: ['cues', index, 'id'],\n });\n }\n seen.add(cue.id);\n });\n // Strictly increasing, not merely sorted: two chapters starting at one\n // moment leave the first with no length, and the scrubber no room to draw it.\n const chapters = ctx.value.chapters ?? [];\n chapters.forEach((chapter, index) => {\n const previous = chapters[index - 1];\n if (previous !== undefined && chapter.at <= previous.at) {\n ctx.issues.push({\n code: 'custom',\n input: chapter.at,\n message: 'Chapter times must be strictly increasing.',\n path: ['chapters', index, 'at'],\n });\n }\n });\n });\n\n/** A URL only this document can resolve, or one that inlines the bytes. */\nfunction isLocalOnlyUrl(url: unknown): boolean {\n return typeof url === 'string' && /^(data|blob):/i.test(url);\n}\n\n/**\n * The rules of an interactive video that span the timeline, the stimulus and\n * the items. Run by the content schema and, for everything but the two\n * authoring-only rules, by the strict redacted schema — a projection built by\n * hand never passed through the content schema.\n *\n * Items are read defensively: the redacted schema leaves them opaque, and each\n * is proven against its own type's schema elsewhere.\n */\nfunction timelineIssues(\n group: {\n stimulus: {\n kind: string;\n media?:\n | {\n type: string;\n url: string;\n poster?: string | undefined;\n tracks?: readonly { src: string }[] | undefined;\n }\n | undefined;\n };\n items: readonly unknown[];\n shuffle?: string | undefined;\n timeline?: { cues: readonly { itemIds: readonly string[] }[] } | undefined;\n },\n scope: 'content' | 'redacted',\n): { path: (string | number)[]; message: string; input: unknown }[] {\n const timeline = group.timeline;\n if (timeline === undefined) {\n return [];\n }\n const issues: { path: (string | number)[]; message: string; input: unknown }[] = [];\n const media = group.stimulus.media;\n\n // Reported at the field that is wrong, so an editor's own check at that path\n // can stand in for it without hiding anything else about the stimulus.\n if (group.stimulus.kind !== 'video') {\n issues.push({\n path: ['stimulus', 'kind'],\n input: group.stimulus.kind,\n message:\n 'An interactive video needs a video stimulus: quizzes open at moments of a video, and nothing else has them.',\n });\n } else if (media !== undefined && media.type !== 'video') {\n issues.push({\n path: ['stimulus', 'media', 'type'],\n input: media.type,\n message:\n 'An interactive video needs a video file. An embedded provider player cannot be paused at the moment a quiz opens.',\n });\n }\n if (group.shuffle === 'within-group') {\n issues.push({\n path: ['shuffle'],\n input: group.shuffle,\n message:\n 'An interactive video presents its questions in the order its quizzes open; shuffle: \"within-group\" cannot apply to it.',\n });\n }\n if (group.items.length > TIMELINE_MAX_ITEMS) {\n issues.push({\n path: ['items'],\n input: group.items.length,\n message: `An interactive video holds at most ${TIMELINE_MAX_ITEMS} questions.`,\n });\n }\n\n const itemIds = new Map<string, number>();\n group.items.forEach((item, index) => {\n const {\n id,\n type,\n media: itemMedia,\n } = (item ?? {}) as { id?: unknown; type?: unknown; media?: unknown };\n if (typeof id === 'string') {\n itemIds.set(id, index);\n }\n if (!isInteractiveVideoItemType(type)) {\n issues.push({\n path: ['items', index, 'type'],\n input: type,\n message: `An interactive video may hold only ${INTERACTIVE_VIDEO_ITEM_TYPES.join(', ')} questions.`,\n });\n }\n // The \"play the stimulus\" fallback a dictation has in a listening group\n // means nothing halfway through a video.\n if (scope === 'content' && type === 'dictation' && itemMedia === undefined) {\n issues.push({\n path: ['items', index, 'media'],\n input: itemMedia,\n message: 'A dictation inside an interactive video needs its own recording.',\n });\n }\n });\n\n const placed = new Set<string>();\n timeline.cues.forEach((cue, cueIndex) => {\n cue.itemIds.forEach((itemId, position) => {\n const path = ['timeline', 'cues', cueIndex, 'itemIds', position];\n if (!itemIds.has(itemId)) {\n issues.push({\n path,\n input: itemId,\n message: `No item in this group has the id \"${itemId}\".`,\n });\n } else if (placed.has(itemId)) {\n issues.push({\n path,\n input: itemId,\n message: `Item \"${itemId}\" is placed twice: every question belongs to exactly one quiz.`,\n });\n }\n placed.add(itemId);\n });\n });\n for (const [itemId, index] of itemIds) {\n if (!placed.has(itemId)) {\n issues.push({\n path: ['items', index],\n input: itemId,\n message: `Item \"${itemId}\" is in no quiz, so the video would never show it.`,\n });\n }\n }\n\n // A `data:` video swells the payload and every fingerprint over it; a stored\n // `blob:` URL means nothing in another document.\n if (scope === 'content' && media !== undefined) {\n const urls: [unknown, (string | number)[]][] = [\n [media.url, ['stimulus', 'media', 'url']],\n [media.poster, ['stimulus', 'media', 'poster']],\n ...(media.tracks ?? []).map((track, index): [unknown, (string | number)[]] => [\n track.src,\n ['stimulus', 'media', 'tracks', index, 'src'],\n ]),\n ];\n for (const [url, path] of urls) {\n if (isLocalOnlyUrl(url)) {\n issues.push({\n path,\n input: url,\n message:\n 'An interactive video is stored and served: its URLs cannot be data: or blob: URLs.',\n });\n }\n }\n }\n return issues;\n}\n\n/**\n * The structural minimum of an item as seen by the CONTAINER schema. Each\n * item's own contract is checked against its registered schema by\n * {@link validateItemGroup} — a zod schema cannot dispatch on a registry\n * that consumers extend at runtime.\n */\nconst ItemShapeSchema = z.looseObject({\n type: z.string().min(1),\n id: z.string().min(1),\n slotKey: SlotKeySchema.optional(),\n});\n\n/**\n * Zod schema for an {@link ItemGroup} CONTAINER. Loose: unknown keys\n * preserved. Validates the group's own fields and the stimulus in full, and\n * each item only structurally (`type` and `id`); use {@link validateItemGroup}\n * to validate the items against their registered schemas as well.\n */\nexport const ItemGroupSchema = z\n .looseObject({\n schemaVersion: z.literal('1.0'),\n type: z.literal('item-group'),\n id: z.string().min(1),\n title: z.string().optional(),\n slotKey: SlotKeySchema.optional(),\n stimulus: StimulusSchema,\n items: z.array(ItemShapeSchema).min(1),\n shuffle: z.enum(['none', 'within-group']).optional(),\n timeline: MediaTimelineSchema.optional(),\n })\n .refine((group) => group.items.every((item) => item.type !== 'item-group'), {\n error: 'Item groups do not nest: every item must be an activity.',\n path: ['items'],\n })\n .refine((group) => new Set(group.items.map((item) => item.id)).size === group.items.length, {\n error: 'Item ids must be unique within a group.',\n path: ['items'],\n })\n .check((ctx) => {\n for (const issue of timelineIssues(ctx.value, 'content')) {\n ctx.issues.push({ code: 'custom', ...issue });\n }\n });\n\n/** Strict learner-safe stimulus: everything but the author-only `transcript`. */\nexport const RedactedStimulusSchema = z.strictObject({\n id: z.string().min(1),\n kind: z.enum(['text', 'audio', 'video', 'image', 'mixed']),\n title: z.string().optional(),\n body: z.string().optional(),\n bodyHtml: z.string().optional(),\n media: RedactedMediaSchema.optional(),\n locale: z.string().optional(),\n attribution: z.string().optional(),\n});\n\n/**\n * Strict learner-safe item group. Items are left opaque here — each is proven\n * learner-safe by `assertRedacted` against its OWN type's redacted schema,\n * which is the only place that knowledge lives. The one exception is the one\n * rule that spans the container and an item: a captioned stimulus recording\n * played to a dictation is not learner-safe, because the captions are the\n * dictation's answer.\n */\nexport const RedactedItemGroupSchema = z\n .strictObject({\n redacted: z.literal(true),\n schemaVersion: z.literal('1.0'),\n type: z.literal('item-group'),\n id: z.string().min(1),\n title: z.string().optional(),\n slotKey: SlotKeySchema.optional(),\n stimulus: RedactedStimulusSchema,\n items: z.array(z.unknown()).min(1),\n shuffle: z.enum(['none', 'within-group']).optional(),\n timeline: MediaTimelineSchema.optional(),\n })\n .check((ctx) => {\n for (const issue of timelineIssues(ctx.value, 'redacted')) {\n ctx.issues.push({ code: 'custom', ...issue });\n }\n const captions = groupCaptionsField(ctx.value);\n if (captions !== undefined) {\n ctx.issues.push({\n code: 'custom',\n input: ctx.value.stimulus.media?.[captions],\n message: GROUP_CAPTIONS_REVEAL_DICTATION,\n path: ['stimulus', 'media', captions],\n });\n }\n });\n\nfunction toValidationErrors(\n issues: readonly { path: readonly PropertyKey[]; message: string; code: string }[],\n prefix: string[],\n): ValidationError[] {\n return issues.map((issue) => ({\n path: [...prefix, ...issue.path.map(String)],\n message: issue.message,\n code: issue.code,\n }));\n}\n\n/**\n * Validates an item group in full: the container and stimulus against\n * {@link ItemGroupSchema}, then every item against the schema registered for\n * its `type`. Errors from items are reported at `items.<index>.…`.\n *\n * Unlike `validateActivity`, an item whose type is not registered is REPORTED\n * (code `unknown_activity_type`) rather than thrown: a group is validated as\n * a whole, and an author fixing a six-item group wants every problem listed,\n * not the first one that happened to throw.\n */\nexport function validateItemGroup(data: unknown): ValidationResult<ItemGroup> {\n const container = ItemGroupSchema.safeParse(data);\n if (!container.success) {\n return { success: false, errors: toValidationErrors(container.error.issues, []) };\n }\n\n const errors: ValidationError[] = [];\n const items: ActivityData[] = [];\n container.data.items.forEach((item, index) => {\n const descriptor = getActivityTypeDescriptor(item.type);\n if (descriptor === undefined) {\n errors.push({\n path: ['items', String(index), 'type'],\n message: `Activity type \"${item.type}\" is not registered`,\n code: 'unknown_activity_type',\n });\n return;\n }\n const parsed = readSchema(descriptor.schema, item, `Activity type \"${descriptor.type}\"`);\n if (!parsed.success) {\n errors.push(...toValidationErrors(parsed.issues, ['items', String(index)]));\n return;\n }\n items.push(parsed.data as ActivityData);\n });\n const captions = groupCaptionsField(container.data);\n if (captions !== undefined) {\n errors.push({\n path: ['stimulus', 'media', captions],\n message: GROUP_CAPTIONS_REVEAL_DICTATION,\n code: 'custom',\n });\n }\n\n if (errors.length > 0) {\n return { success: false, errors };\n }\n // zod4 optional outputs are `T | undefined`; the wire type uses exact\n // optionals. Structurally identical at runtime — the cast is type-level.\n return { success: true, data: { ...container.data, items } as unknown as ItemGroup };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAcA,MAAa,+BAA+B;CAC1C;CACA;CACA;CACA;CACA;AACF;;AAMA,SAAgB,2BAA2B,MAAiD;CAC1F,OAAQ,6BAAoD,SAAS,IAAI;AAC3E;;AAGA,MAAa,uBAAuB;;;;;;AAOpC,MAAa,qBAAqB;;AAGlC,MAAa,wBAAwB;;AAGrC,MAAa,4BAA4B;;;;;;;;;;;;ACjBzC,MAAM,gBAAgBA,OACnB,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,QAAQ,QAAQ,CAAC,IAAI,SAAS,GAAG,GAAG,EACnC,OACE,uJACJ,CAAC;AAEH,SAAS,QAAQ,UAAkD;CACjE,OAAO,OAAO,SAAS,SAAS,YAAY,SAAS,KAAK,KAAK,CAAC,CAAC,SAAS;AAC5E;;AAGA,SAAS,UAAU,MAAoB,WAAwC;CAC7E,QAAQ,MAAR;EACE,KAAK,SACH,OAAO,cAAc;EACvB,KAAK,SACH,OAAO,cAAc,WAAW,cAAc;EAChD,KAAK,SACH,OAAO,cAAc;EACvB,SACE,OAAO;CACX;AACF;;;;;;;;;;AAWA,MAAa,iBAAiBA,OAC3B,YAAY;CACX,IAAIA,OAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACpB,MAAMA,OAAE,KAAK;EAAC;EAAQ;EAAS;EAAS;EAAS;CAAO,CAAC;CACzD,OAAOA,OAAE,OAAO,CAAC,CAAC,SAAS;C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