@intellectif/lk-core 0.12.0 → 0.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +2 -1
  3. package/dist/{activity-B2QxK15j.d.cts → activity-DfAmJ1sl.d.cts} +134 -7
  4. package/dist/{activity-B2QxK15j.d.ts → activity-DfAmJ1sl.d.ts} +134 -7
  5. package/dist/{chunk-VYE6BYON.cjs → chunk-DQKJUMUW.cjs} +38 -15
  6. package/dist/chunk-DQKJUMUW.cjs.map +1 -0
  7. package/dist/{chunk-RK2NVTHZ.js → chunk-FGN4LLSP.js} +50 -6
  8. package/dist/chunk-FGN4LLSP.js.map +1 -0
  9. package/dist/{chunk-O2IVKTHV.cjs → chunk-FT7SAC3X.cjs} +4 -4
  10. package/dist/{chunk-O2IVKTHV.cjs.map → chunk-FT7SAC3X.cjs.map} +1 -1
  11. package/dist/{chunk-UQPNJP2O.js → chunk-PYP3HCRQ.js} +2 -2
  12. package/dist/{chunk-4OHWLCI6.cjs → chunk-UHQVIC3P.cjs} +58 -14
  13. package/dist/chunk-UHQVIC3P.cjs.map +1 -0
  14. package/dist/{chunk-FVN37GIH.js → chunk-XKKKWKRH.js} +1944 -177
  15. package/dist/chunk-XKKKWKRH.js.map +1 -0
  16. package/dist/{chunk-J6POE4HL.cjs → chunk-XONKWL6D.cjs} +1785 -18
  17. package/dist/chunk-XONKWL6D.cjs.map +1 -0
  18. package/dist/{chunk-7JMMPE7O.js → chunk-Y36S3X3L.js} +26 -3
  19. package/dist/chunk-Y36S3X3L.js.map +1 -0
  20. package/dist/{index-B_scInLM.d.cts → index-BefQ8FAS.d.cts} +192 -15
  21. package/dist/{index-CRKtWP5G.d.ts → index-BiIvdASA.d.ts} +192 -15
  22. package/dist/index.cjs +132 -74
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.d.cts +19 -6
  25. package/dist/index.d.ts +19 -6
  26. package/dist/index.js +64 -6
  27. package/dist/index.js.map +1 -1
  28. package/dist/schemas.cjs +17 -3
  29. package/dist/schemas.cjs.map +1 -1
  30. package/dist/schemas.d.cts +2 -2
  31. package/dist/schemas.d.ts +2 -2
  32. package/dist/schemas.js +16 -2
  33. package/dist/scoring.cjs +19 -3
  34. package/dist/scoring.cjs.map +1 -1
  35. package/dist/scoring.d.cts +150 -5
  36. package/dist/scoring.d.ts +150 -5
  37. package/dist/scoring.js +18 -2
  38. package/dist/xapi.cjs +3 -3
  39. package/dist/xapi.d.cts +1 -1
  40. package/dist/xapi.d.ts +1 -1
  41. package/dist/xapi.js +2 -2
  42. package/package.json +1 -1
  43. package/vectors/README.md +9 -1
  44. package/vectors/scoring.json +12023 -1
  45. package/dist/chunk-4OHWLCI6.cjs.map +0 -1
  46. package/dist/chunk-7JMMPE7O.js.map +0 -1
  47. package/dist/chunk-FVN37GIH.js.map +0 -1
  48. package/dist/chunk-J6POE4HL.cjs.map +0 -1
  49. package/dist/chunk-RK2NVTHZ.js.map +0 -1
  50. package/dist/chunk-VYE6BYON.cjs.map +0 -1
  51. /package/dist/{chunk-UQPNJP2O.js.map → chunk-PYP3HCRQ.js.map} +0 -0
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { ScoredItem } from './scoring.js';
2
- export { AssessmentScore, AssessmentSectionInput, Band, CompositionPolicy, DEFAULT_PASS_THRESHOLD, PassFailureReason, RoundingMode, RoundingPolicy, SectionScore, classifyBand, composeAssessmentScore, computePassThreshold, evaluate, gte, roundGrade, score } from './scoring.js';
3
- import { r as ItemOutcome, A as ActivityData, L as LearnerResponse, V as ValidationError, e as ActivityType, a as ActivityDataMap, C as CriterionScore, k as GradeRecord, N as NativeControlHint, c as ActivityMedia, x as ScoringResult, D as DeferredScoringPartial, F as FillInTheBlanksData, f as FillInTheBlanksLearnerResponse, M as MultipleChoiceData, t as MultipleChoiceLearnerResponse, W as WrittenResponseData, E as WrittenResponseLearnerResponse } from './activity-B2QxK15j.js';
4
- export { b as ActivityFeedback, d as ActivityResult, B as BlankConfig, G as GapSelectBank, g as GapSelectChoice, h as GapSelectData, i as GapSelectGap, j as GapSelectLearnerResponse, l as Grader, m as GraderKind, n as GraderUsage, o as GradingState, I as InlineCorrection, p as InteractionEvent, q as InteractionKind, s as LearnerResponseMap, u as MultipleChoiceOption, v as MultipleChoiceOptionMedia, S as ScoringDetail, w as ScoringOutcome, T as TextMatchPolicy, y as TextMatchResult, z as ValidationResult, H as WrittenResponseRubric, J as WrittenResponseRubricCriterion, X as XAPIActor, K as XAPIConfig, O as XAPIContext, P as XAPIContextActivities, Q as XAPIError, R as XAPIObject, U as XAPIResult, Y as XAPIScore, Z as XAPIStatement, _ as XAPIVerbObject, $ as levenshteinDistance, a0 as matchText } from './activity-B2QxK15j.js';
5
- import { O as SequenceSlot, S as SequenceEntry, I as ItemGroup } from './index-CRKtWP5G.js';
6
- export { B as BlankConfigSchema, F as FeedbackSchema, a as FillInTheBlanksDataSchema, G as GapSelectBankSchema, b as GapSelectChoiceSchema, c as GapSelectDataSchema, d as GapSelectGapSchema, e as ItemGroupSchema, M as MediaPlaybackSchema, f as MediaSchema, g as MediaUrlSchema, h as MultipleChoiceDataSchema, i as MultipleChoiceOptionMediaSchema, j as MultipleChoiceOptionSchema, N as NativeControlHintSchema, R as RedactedActivity, k as RedactedBlankConfig, l as RedactedBlankConfigSchema, m as RedactedFillInTheBlanksData, n as RedactedFillInTheBlanksDataSchema, o as RedactedGapSelectBank, p as RedactedGapSelectBankSchema, q as RedactedGapSelectChoice, r as RedactedGapSelectChoiceSchema, s as RedactedGapSelectData, t as RedactedGapSelectDataSchema, u as RedactedGapSelectGap, v as RedactedGapSelectGapSchema, w as RedactedItemGroupSchema, x as RedactedMediaSchema, y as RedactedMultipleChoiceData, z as RedactedMultipleChoiceDataSchema, A as RedactedMultipleChoiceOption, C as RedactedMultipleChoiceOptionMedia, D as RedactedMultipleChoiceOptionMediaSchema, E as RedactedMultipleChoiceOptionSchema, H as RedactedStimulus, J as RedactedStimulusSchema, K as RedactedWrittenResponseData, L as RedactedWrittenResponseDataSchema, P as SequenceSlotGroup, Q as Stimulus, T as StimulusKind, U as StimulusSchema, V as TextMatchPolicySchema, W as WrittenResponseDataSchema, X as WrittenResponseRubricCriterionSchema, Y as WrittenResponseRubricSchema, Z as fillInTheBlanksJsonSchema, _ as gapSelectJsonSchema, $ as itemGroupJsonSchema, a0 as jsonSchemaFor, a1 as multipleChoiceJsonSchema, a2 as stimulusJsonSchema, a3 as validateActivity, a4 as validateItemGroup, a5 as writtenResponseJsonSchema } from './index-CRKtWP5G.js';
2
+ export { AssessmentScore, AssessmentSectionInput, Band, CompositionPolicy, DEFAULT_PASS_THRESHOLD, DICTATION_MAX_ACCEPTED_TRANSCRIPTS, DICTATION_MAX_EQUIVALENCES, DICTATION_MAX_EQUIVALENCE_LENGTH, DICTATION_MAX_TEXT_LENGTH, DICTATION_MAX_TRANSCRIPT_LENGTH, DictationAlignment, DictationCharOp, DictationReference, DictationWordAlignment, PassFailureReason, RoundingMode, RoundingPolicy, ScoringOptions, SectionScore, alignDictation, classifyBand, composeAssessmentScore, computePassThreshold, dictationReferenceWords, diffDictationChars, evaluate, gte, roundGrade, score } from './scoring.js';
3
+ import { w as ItemOutcome, A as ActivityData, L as LearnerResponse, V as ValidationError, e as ActivityType, a as ActivityDataMap, C as CriterionScore, p as GradeRecord, N as NativeControlHint, c as ActivityMedia, K as ScoringResult, D as DeferredScoringPartial, f as DictationData, h as DictationLearnerResponse, F as FillInTheBlanksData, k as FillInTheBlanksLearnerResponse, m as GapSelectData, o as GapSelectLearnerResponse, y as MultipleChoiceData, z as MultipleChoiceLearnerResponse, W as WrittenResponseData, Q as WrittenResponseLearnerResponse } from './activity-DfAmJ1sl.js';
4
+ export { b as ActivityFeedback, d as ActivityResult, B as BlankConfig, g as DictationEquivalence, i as DictationSlowMedia, j as DictationTolerance, G as GapSelectBank, l as GapSelectChoice, n as GapSelectGap, q as Grader, r as GraderKind, s as GraderUsage, t as GradingState, I as InlineCorrection, u as InteractionEvent, v as InteractionKind, x as LearnerResponseMap, M as MediaPlaybackPolicy, E as MultipleChoiceOption, H as MultipleChoiceOptionMedia, S as ScoringDetail, J as ScoringOutcome, T as TextMatchPolicy, O as TextMatchResult, P as ValidationResult, R as WrittenResponseRubric, U as WrittenResponseRubricCriterion, X as XAPIActor, Y as XAPIConfig, Z as XAPIContext, _ as XAPIContextActivities, $ as XAPIError, a0 as XAPIObject, a1 as XAPIResult, a2 as XAPIScore, a3 as XAPIStatement, a4 as XAPIVerbObject, a5 as levenshteinDistance, a6 as matchText } from './activity-DfAmJ1sl.js';
5
+ import { Y as SequenceSlot, X as SequenceEntry, I as ItemGroup } from './index-BiIvdASA.js';
6
+ export { B as BlankConfigSchema, D as DictationDataSchema, a as DictationEquivalenceSchema, b as DictationSlowMediaSchema, c as DictationToleranceSchema, F as FeedbackSchema, d as FillInTheBlanksDataSchema, G as GapSelectBankSchema, e as GapSelectChoiceSchema, f as GapSelectDataSchema, g as GapSelectGapSchema, h as ItemGroupSchema, M as MediaPlaybackSchema, i as MediaSchema, j as MediaUrlSchema, k as MultipleChoiceDataSchema, l as MultipleChoiceOptionMediaSchema, m as MultipleChoiceOptionSchema, N as NativeControlHintSchema, R as RedactedActivity, n as RedactedBlankConfig, o as RedactedBlankConfigSchema, p as RedactedDictationData, q as RedactedDictationDataSchema, r as RedactedDictationSlowMedia, s as RedactedDictationSlowMediaSchema, t as RedactedFillInTheBlanksData, u as RedactedFillInTheBlanksDataSchema, v as RedactedGapSelectBank, w as RedactedGapSelectBankSchema, x as RedactedGapSelectChoice, y as RedactedGapSelectChoiceSchema, z as RedactedGapSelectData, A as RedactedGapSelectDataSchema, C as RedactedGapSelectGap, E as RedactedGapSelectGapSchema, H as RedactedItemGroupSchema, J as RedactedMediaSchema, K as RedactedMultipleChoiceData, L as RedactedMultipleChoiceDataSchema, O as RedactedMultipleChoiceOption, P as RedactedMultipleChoiceOptionMedia, Q as RedactedMultipleChoiceOptionMediaSchema, S as RedactedMultipleChoiceOptionSchema, T as RedactedStimulus, U as RedactedStimulusSchema, V as RedactedWrittenResponseData, W as RedactedWrittenResponseDataSchema, Z as SequenceSlotGroup, _ as Stimulus, $ as StimulusKind, a0 as StimulusSchema, a1 as TextMatchPolicySchema, a2 as WrittenResponseDataSchema, a3 as WrittenResponseRubricCriterionSchema, a4 as WrittenResponseRubricSchema, a5 as dictationJsonSchema, a6 as fillInTheBlanksJsonSchema, a7 as gapSelectJsonSchema, a8 as itemGroupJsonSchema, a9 as jsonSchemaFor, aa as multipleChoiceJsonSchema, ab as stimulusJsonSchema, ac as validateActivity, ad as validateItemGroup, ae as writtenResponseJsonSchema } from './index-BiIvdASA.js';
7
7
  import { z } from 'zod/v4';
8
8
  export { AnsweredStatementParams, CompletedStatementParams, SubmittedStatementParams, XAPIObjectParams, XAPIStatementParams, XAPIVerb, XAPIVerbKey, XAPI_VERB_DISPLAY, validateXAPIStatement, xAPIBuilder, xapiDefinitionFor } from './xapi.js';
9
9
 
@@ -413,6 +413,11 @@ declare function createItemGroupDraft(context: DraftContext): ItemGroup;
413
413
  *
414
414
  * The group is `complete` only when the container passes, every item passes its
415
415
  * own schema, and every item is itself `complete`.
416
+ *
417
+ * @throws the error a registered item type's `checkDraft` or schema throws, as
418
+ * `validateDraft` does for that item on its own. Only an unregistered type is
419
+ * turned into an issue: a fault in a type's own code is not a problem with the
420
+ * draft, and reporting it as an unknown type would hide it.
416
421
  */
417
422
  declare function validateItemGroupDraft(draft: unknown): DraftValidationResult<ItemGroup>;
418
423
 
@@ -1082,6 +1087,14 @@ declare const fillInTheBlanksType: ActivityTypeDescriptor<FillInTheBlanksData, F
1082
1087
  * count is informational, never trusted.
1083
1088
  */
1084
1089
  declare const writtenResponseType: ActivityTypeDescriptor<WrittenResponseData, WrittenResponseLearnerResponse>;
1090
+ /** Built-in Gap Select descriptor. */
1091
+ declare const gapSelectType: ActivityTypeDescriptor<GapSelectData, GapSelectLearnerResponse>;
1092
+ /**
1093
+ * Built-in Dictation descriptor. Graded synchronously: the score is the
1094
+ * character-level similarity of the typed text to the transcript, a pure
1095
+ * computation identical in a browser and on a server.
1096
+ */
1097
+ declare const dictationType: ActivityTypeDescriptor<DictationData, DictationLearnerResponse>;
1085
1098
 
1086
1099
  /**
1087
1100
  * Seeded, deterministic shuffling — the ONE algorithm every presentation-order
@@ -1182,4 +1195,4 @@ interface ThemeTokens {
1182
1195
  '--lk-transition-base': string;
1183
1196
  }
1184
1197
 
1185
- export { ActivityData, ActivityDataMap, ActivityMedia, ActivitySchemaError, ActivityType, type ActivityTypeAuthoring, type ActivityTypeDescriptor, type ActivityTypeInterop, type ActivityTypeScoring, type AttemptPlan, type AttemptPlanDrift, type AttemptPlanSlot, type AttemptProgress, type AttemptState, CriterionScore, DeferredScoringError, DeferredScoringPartial, type DraftComplete, type DraftContext, type DraftIssue, type DraftNotComplete, type DraftSeverity, type DraftValidationResult, type FieldPolicy, FillInTheBlanksData, FillInTheBlanksLearnerResponse, type FlattenSequenceOptions, type GradeFromRubricOptions, GradeRecord, ItemGroup, ItemOutcome, LearnerResponse, type MediaBudgetRef, type MediaPlayClaim, type MediaPlayGrant, type MediaPlayLedger, type MediaPlayLedgerEntry, type MissingOutcomePolicy, MultipleChoiceData, MultipleChoiceLearnerResponse, type PartialScoringResult, type PlanAttemptOptions, type PlannableEntry, type RedactOptions, type RedactedActivityData, type RedactedItemGroup, RedactedScoringError, type RegisteredActivityTypeDescriptor, type ResolvedPlaybackPolicy, type ResponseDiffEntry, ScoredItem, ScoringResult, type SeededShuffleOptions, type Sensitivity, SequenceEntry, SequenceSlot, type ShuffleVersion, type ThemeTokens, UnknownActivityTypeError, ValidationError, WrittenResponseData, WrittenResponseLearnerResponse, type XAPIInteractionType, assertRedacted, assertRedactedItemGroup, canonicalJson, contentHash, countWords, createDraft, createItemGroupDraft, defineActivityType, diffResponses, entryKeyOf, fillInTheBlanksType, fingerprint, flattenSequence, getActivityTypeDescriptor, gradeFromRubric, hasGrade, hashSeed, isItemGroup, multipleChoiceType, outcomeFromGrade, planAttempt, planMediaBudgets, redact, redactItemGroup, registerActivityType, registeredActivityTypes, resolvePlaybackPolicy, restoreAttemptState, restoreMediaPlayLedger, scoredItemsFromPlan, seededShuffle, serializeAttemptState, serializeMediaPlayLedger, slotMediaKey, stimulusMediaKey, validateDraft, validateItemGroupDraft, verifyAttemptPlan, writtenResponseType };
1198
+ export { ActivityData, ActivityDataMap, ActivityMedia, ActivitySchemaError, ActivityType, type ActivityTypeAuthoring, type ActivityTypeDescriptor, type ActivityTypeInterop, type ActivityTypeScoring, type AttemptPlan, type AttemptPlanDrift, type AttemptPlanSlot, type AttemptProgress, type AttemptState, CriterionScore, DeferredScoringError, DeferredScoringPartial, DictationData, DictationLearnerResponse, type DraftComplete, type DraftContext, type DraftIssue, type DraftNotComplete, type DraftSeverity, type DraftValidationResult, type FieldPolicy, FillInTheBlanksData, FillInTheBlanksLearnerResponse, type FlattenSequenceOptions, GapSelectData, GapSelectLearnerResponse, type GradeFromRubricOptions, GradeRecord, ItemGroup, ItemOutcome, LearnerResponse, type MediaBudgetRef, type MediaPlayClaim, type MediaPlayGrant, type MediaPlayLedger, type MediaPlayLedgerEntry, type MissingOutcomePolicy, MultipleChoiceData, MultipleChoiceLearnerResponse, NativeControlHint, type PartialScoringResult, type PlanAttemptOptions, type PlannableEntry, type RedactOptions, type RedactedActivityData, type RedactedItemGroup, RedactedScoringError, type RegisteredActivityTypeDescriptor, type ResolvedPlaybackPolicy, type ResponseDiffEntry, ScoredItem, ScoringResult, type SeededShuffleOptions, type Sensitivity, SequenceEntry, SequenceSlot, type ShuffleVersion, type ThemeTokens, UnknownActivityTypeError, ValidationError, WrittenResponseData, WrittenResponseLearnerResponse, type XAPIInteractionType, assertRedacted, assertRedactedItemGroup, canonicalJson, contentHash, countWords, createDraft, createItemGroupDraft, defineActivityType, dictationType, diffResponses, entryKeyOf, fillInTheBlanksType, fingerprint, flattenSequence, gapSelectType, getActivityTypeDescriptor, gradeFromRubric, hasGrade, hashSeed, isItemGroup, multipleChoiceType, outcomeFromGrade, planAttempt, planMediaBudgets, redact, redactItemGroup, registerActivityType, registeredActivityTypes, resolvePlaybackPolicy, restoreAttemptState, restoreMediaPlayLedger, scoredItemsFromPlan, seededShuffle, serializeAttemptState, serializeMediaPlayLedger, slotMediaKey, stimulusMediaKey, validateDraft, validateItemGroupDraft, verifyAttemptPlan, writtenResponseType };
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@ import {
3
3
  classifyBand,
4
4
  composeAssessmentScore,
5
5
  computePassThreshold,
6
+ diffDictationChars,
6
7
  evaluate,
7
8
  gradeFromRubric,
8
9
  gte,
@@ -10,19 +11,20 @@ import {
10
11
  outcomeFromGrade,
11
12
  roundGrade,
12
13
  score
13
- } from "./chunk-RK2NVTHZ.js";
14
+ } from "./chunk-FGN4LLSP.js";
14
15
  import {
15
16
  XAPIVerb,
16
17
  XAPI_VERB_DISPLAY,
17
18
  validateXAPIStatement,
18
19
  xAPIBuilder,
19
20
  xapiDefinitionFor
20
- } from "./chunk-UQPNJP2O.js";
21
+ } from "./chunk-PYP3HCRQ.js";
21
22
  import {
22
23
  ItemGroupSchema,
23
24
  RedactedItemGroupSchema,
24
25
  RedactedStimulusSchema,
25
26
  StimulusSchema,
27
+ dictationJsonSchema,
26
28
  fillInTheBlanksJsonSchema,
27
29
  gapSelectJsonSchema,
28
30
  itemGroupJsonSchema,
@@ -32,14 +34,24 @@ import {
32
34
  validateActivity,
33
35
  validateItemGroup,
34
36
  writtenResponseJsonSchema
35
- } from "./chunk-7JMMPE7O.js";
37
+ } from "./chunk-Y36S3X3L.js";
36
38
  import {
37
39
  ActivitySchemaError,
38
40
  BlankConfigSchema,
41
+ DICTATION_MAX_ACCEPTED_TRANSCRIPTS,
42
+ DICTATION_MAX_EQUIVALENCES,
43
+ DICTATION_MAX_EQUIVALENCE_LENGTH,
44
+ DICTATION_MAX_TEXT_LENGTH,
45
+ DICTATION_MAX_TRANSCRIPT_LENGTH,
39
46
  DRAFT_ISSUE_SEVERITY,
40
47
  DeferredScoringError,
48
+ DictationDataSchema,
49
+ DictationEquivalenceSchema,
50
+ DictationSlowMediaSchema,
51
+ DictationToleranceSchema,
41
52
  FeedbackSchema,
42
53
  FillInTheBlanksDataSchema,
54
+ GROUP_CAPTIONS_REVEAL_DICTATION,
43
55
  GapSelectBankSchema,
44
56
  GapSelectChoiceSchema,
45
57
  GapSelectDataSchema,
@@ -53,6 +65,8 @@ import {
53
65
  MultipleChoiceOptionSchema,
54
66
  NativeControlHintSchema,
55
67
  RedactedBlankConfigSchema,
68
+ RedactedDictationDataSchema,
69
+ RedactedDictationSlowMediaSchema,
56
70
  RedactedFillInTheBlanksDataSchema,
57
71
  RedactedGapSelectBankSchema,
58
72
  RedactedGapSelectChoiceSchema,
@@ -69,12 +83,18 @@ import {
69
83
  WrittenResponseDataSchema,
70
84
  WrittenResponseRubricCriterionSchema,
71
85
  WrittenResponseRubricSchema,
86
+ alignDictation,
72
87
  checkMedia,
73
88
  countWords,
89
+ coveredPathsOf,
74
90
  covers,
75
91
  defineActivityType,
92
+ dictationReferenceWords,
93
+ dictationType,
76
94
  fillInTheBlanksType,
95
+ gapSelectType,
77
96
  getActivityTypeDescriptor,
97
+ groupCaptionsRevealDictation,
78
98
  isMissingId,
79
99
  isRecord,
80
100
  isUnset,
@@ -83,11 +103,13 @@ import {
83
103
  levenshteinDistance,
84
104
  matchText,
85
105
  multipleChoiceType,
106
+ pathKey,
86
107
  refusesEmpty,
87
108
  registerActivityType,
88
109
  registeredActivityTypes,
110
+ withValidationScope,
89
111
  writtenResponseType
90
- } from "./chunk-FVN37GIH.js";
112
+ } from "./chunk-XKKKWKRH.js";
91
113
 
92
114
  // src/content-hash.ts
93
115
  function canonicalJson(value, seen = /* @__PURE__ */ new Set()) {
@@ -616,6 +638,9 @@ function createItemGroupDraft(context) {
616
638
  };
617
639
  }
618
640
  function validateItemGroupDraft(draft) {
641
+ return withValidationScope(() => validateItemGroupDraftInScope(draft));
642
+ }
643
+ function validateItemGroupDraftInScope(draft) {
619
644
  const issues = [];
620
645
  if (!isRecord(draft)) {
621
646
  issues.push(
@@ -636,6 +661,15 @@ function validateItemGroupDraft(draft) {
636
661
  );
637
662
  }
638
663
  issues.push(...checkItems(draft));
664
+ if (groupCaptionsRevealDictation(draft, (captionsUrl) => !isUnwritten(captionsUrl))) {
665
+ issues.push(
666
+ issue(
667
+ "dc_captions_not_allowed",
668
+ ["stimulus", "media", "captionsUrl"],
669
+ GROUP_CAPTIONS_REVEAL_DICTATION
670
+ )
671
+ );
672
+ }
639
673
  const parsed = ItemGroupSchema.safeParse(draft, { reportInput: true });
640
674
  if (!parsed.success) {
641
675
  for (const schemaIssue of parsed.error.issues) {
@@ -824,7 +858,10 @@ function checkItems(draft) {
824
858
  let result;
825
859
  try {
826
860
  result = validateDraft(item.type, item);
827
- } catch {
861
+ } catch (error) {
862
+ if (!(error instanceof UnknownActivityTypeError) || error.activityType !== item.type) {
863
+ throw error;
864
+ }
828
865
  issues.push(
829
866
  issue(
830
867
  "ig_item_type_unknown",
@@ -848,6 +885,9 @@ function checkItems(draft) {
848
885
 
849
886
  // src/authoring/index.ts
850
887
  function validateDraft(type, draft) {
888
+ return withValidationScope(() => validateDraftInScope(type, draft));
889
+ }
890
+ function validateDraftInScope(type, draft) {
851
891
  const descriptor = getActivityTypeDescriptor(type);
852
892
  if (descriptor === void 0) {
853
893
  throw new UnknownActivityTypeError(String(type));
@@ -856,10 +896,11 @@ function validateDraft(type, draft) {
856
896
  const issues = [...reported];
857
897
  const parsed = descriptor.schema.safeParse(draft, { reportInput: true });
858
898
  if (!parsed.success) {
899
+ const covered = coveredPathsOf(reported);
859
900
  const reportedEmpty = /* @__PURE__ */ new Set();
860
901
  for (const schemaIssue of parsed.error.issues) {
861
902
  const path = schemaIssue.path.map(String);
862
- if (reported.some((known) => covers(known.path, path))) {
903
+ if (covered.has(pathKey(path))) {
863
904
  continue;
864
905
  }
865
906
  if (path.length > 0 && refusesEmpty(draft, schemaIssue)) {
@@ -1145,7 +1186,16 @@ export {
1145
1186
  ActivitySchemaError,
1146
1187
  BlankConfigSchema,
1147
1188
  DEFAULT_PASS_THRESHOLD,
1189
+ DICTATION_MAX_ACCEPTED_TRANSCRIPTS,
1190
+ DICTATION_MAX_EQUIVALENCES,
1191
+ DICTATION_MAX_EQUIVALENCE_LENGTH,
1192
+ DICTATION_MAX_TEXT_LENGTH,
1193
+ DICTATION_MAX_TRANSCRIPT_LENGTH,
1148
1194
  DeferredScoringError,
1195
+ DictationDataSchema,
1196
+ DictationEquivalenceSchema,
1197
+ DictationSlowMediaSchema,
1198
+ DictationToleranceSchema,
1149
1199
  FeedbackSchema,
1150
1200
  FillInTheBlanksDataSchema,
1151
1201
  GapSelectBankSchema,
@@ -1161,6 +1211,8 @@ export {
1161
1211
  MultipleChoiceOptionSchema,
1162
1212
  NativeControlHintSchema,
1163
1213
  RedactedBlankConfigSchema,
1214
+ RedactedDictationDataSchema,
1215
+ RedactedDictationSlowMediaSchema,
1164
1216
  RedactedFillInTheBlanksDataSchema,
1165
1217
  RedactedGapSelectBankSchema,
1166
1218
  RedactedGapSelectChoiceSchema,
@@ -1182,6 +1234,7 @@ export {
1182
1234
  WrittenResponseRubricSchema,
1183
1235
  XAPIVerb,
1184
1236
  XAPI_VERB_DISPLAY,
1237
+ alignDictation,
1185
1238
  assertRedacted,
1186
1239
  assertRedactedItemGroup,
1187
1240
  canonicalJson,
@@ -1193,6 +1246,10 @@ export {
1193
1246
  createDraft,
1194
1247
  createItemGroupDraft,
1195
1248
  defineActivityType,
1249
+ dictationJsonSchema,
1250
+ dictationReferenceWords,
1251
+ dictationType,
1252
+ diffDictationChars,
1196
1253
  diffResponses,
1197
1254
  entryKeyOf,
1198
1255
  evaluate,
@@ -1201,6 +1258,7 @@ export {
1201
1258
  fingerprint,
1202
1259
  flattenSequence,
1203
1260
  gapSelectJsonSchema,
1261
+ gapSelectType,
1204
1262
  getActivityTypeDescriptor,
1205
1263
  gradeFromRubric,
1206
1264
  gte,