@intellectif/lk-core 0.19.0 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +31 -2
  3. package/dist/{activity-f0bgZSTP.d.cts → activity-xhGV-Aeh.d.cts} +31 -4
  4. package/dist/{activity-f0bgZSTP.d.ts → activity-xhGV-Aeh.d.ts} +31 -4
  5. package/dist/ai-check.cjs +5 -5
  6. package/dist/ai-check.d.cts +1 -1
  7. package/dist/ai-check.d.ts +1 -1
  8. package/dist/ai-check.js +2 -2
  9. package/dist/{chunk-BIJCO2HM.js → chunk-IHOEP4EB.js} +2 -2
  10. package/dist/{chunk-FVZJ4X3Y.cjs → chunk-NRTP7WCW.cjs} +4 -4
  11. package/dist/{chunk-FVZJ4X3Y.cjs.map → chunk-NRTP7WCW.cjs.map} +1 -1
  12. package/dist/{chunk-MMEQKFFQ.js → chunk-Q7MV3IXJ.js} +196 -8
  13. package/dist/chunk-Q7MV3IXJ.js.map +1 -0
  14. package/dist/{chunk-COBK2RUX.cjs → chunk-WQVZPIN7.cjs} +197 -9
  15. package/dist/chunk-WQVZPIN7.cjs.map +1 -0
  16. package/dist/{index-bpuDhvXV.d.cts → index-BuD8Hc8o.d.cts} +1 -1
  17. package/dist/{index-DMCM3e3P.d.ts → index-DnJ_PI4d.d.ts} +1 -1
  18. package/dist/index.cjs +175 -9
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.cts +177 -7
  21. package/dist/index.d.ts +177 -7
  22. package/dist/index.js +171 -5
  23. package/dist/index.js.map +1 -1
  24. package/dist/schemas.d.cts +2 -2
  25. package/dist/schemas.d.ts +2 -2
  26. package/dist/scoring.cjs +14 -2
  27. package/dist/scoring.cjs.map +1 -1
  28. package/dist/scoring.d.cts +240 -4
  29. package/dist/scoring.d.ts +240 -4
  30. package/dist/scoring.js +13 -1
  31. package/dist/xapi.d.cts +1 -1
  32. package/dist/xapi.d.ts +1 -1
  33. package/package.json +1 -1
  34. package/vectors/README.md +10 -0
  35. package/vectors/scoring.json +2127 -1
  36. package/dist/chunk-COBK2RUX.cjs.map +0 -1
  37. package/dist/chunk-MMEQKFFQ.js.map +0 -1
  38. /package/dist/{chunk-BIJCO2HM.js.map → chunk-IHOEP4EB.js.map} +0 -0
package/dist/index.d.cts CHANGED
@@ -1,9 +1,9 @@
1
- import { v as AiSupportedActivityType, g as AiActivityInput, k as AiFeature, Z as LearnerResponse, Y as ItemOutcome, j as AiExplanationRequest, o as AiGrade, p as AiHintRequest, ad as ScoringDetail, q as AiItemFacts, w as AiTextResult, u as AiRefusal, a as ActivityData, ai as ValidationError, f as ActivityType, b as ActivityDataMap, C as CriterionScore, Q as GradeRecord, a5 as NativeControlHint, d as ActivityMedia, af as ScoringResult, z as DeferredScoringPartial, E as DictationData, G as DictationLearnerResponse, J as FillInTheBlanksData, K as FillInTheBlanksLearnerResponse, N as GapSelectData, P as GapSelectLearnerResponse, a1 as MultipleChoiceData, a2 as MultipleChoiceLearnerResponse, a6 as ReadAloudData, a9 as ReadAloudLearnerResponse, ak as WrittenResponseData, al as WrittenResponseLearnerResponse } from './activity-f0bgZSTP.cjs';
2
- export { A as ActivityAiPermissions, c as ActivityFeedback, e as ActivityResult, h as AiBlankFact, i as AiDictationFacts, l as AiFillInTheBlanksFacts, m as AiGapFact, n as AiGapSelectFacts, r as AiMultipleChoiceFacts, s as AiOptionFact, t as AiProvenance, x as AiVerdict, y as AiWordFact, B as BlankConfig, D as DeferredReason, F as DictationEquivalence, H as DictationSlowMedia, I as DictationTolerance, L as GapSelectBank, M as GapSelectChoice, O as GapSelectGap, R as Grader, S as GraderKind, T as GraderUsage, U as GradingState, V as InlineCorrection, W as InteractionEvent, X as InteractionKind, _ as LearnerResponseMap, $ as MediaPlaybackPolicy, a0 as MediaTrack, a3 as MultipleChoiceOption, a4 as MultipleChoiceOptionMedia, a7 as ReadAloudDimension, a8 as ReadAloudDimensionWeight, aa as ReadAloudSlowMedia, ab as RecordingBounds, ac as RecordingRef, ae as ScoringOutcome, ag as TextMatchPolicy, ah as TextMatchResult, aj as ValidationResult, am as WrittenResponseRubric, an as WrittenResponseRubricCriterion, ao as XAPIActor, ap as XAPIConfig, aq as XAPIContext, ar as XAPIContextActivities, as as XAPIError, at as XAPIObject, au as XAPIResult, av as XAPIScore, aw as XAPIStatement, ax as XAPIVerbObject, ay as levenshteinDistance, az as matchText } from './activity-f0bgZSTP.cjs';
3
- import { ScoredItem, RoundingPolicy, CompositionPolicy, AssessmentScore } from './scoring.cjs';
4
- export { AssessmentSectionInput, Band, 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, GradeReadAloudOptions, PassFailureReason, READ_ALOUD_MAX_DIMENSION_WEIGHT, READ_ALOUD_MAX_REFERENCE_LENGTH, READ_ALOUD_MAX_SECONDS, READ_ALOUD_MAX_TAKES, ReadAloudWordAlignment, ReadAloudWordState, RoundingMode, SPEECH_ASSESSMENT_MAX_WORDS, ScoringOptions, SectionScore, SpeechAssessment, SpeechMeasurement, SpeechPhoneme, SpeechPhonemeCandidate, SpeechPlausibilityPolicy, SpeechSyllable, SpeechUnscorable, SpeechUnscorableCode, SpeechWord, SpeechWordError, WavInspection, WavInspectionPolicy, alignDictation, alignReadAloud, classifyBand, composeAssessmentScore, computePassThreshold, dictationReferenceWords, diffDictationChars, evaluate, gradeReadAloud, gte, inspectWav, outcomeFromUnscorable, roundGrade, score, validateSpeechAssessment } from './scoring.cjs';
5
- import { a5 as SequenceSlot, a4 as SequenceEntry, I as ItemGroup, i as MediaProgress } from './index-bpuDhvXV.cjs';
6
- export { A as AiPermissionsSchema, 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, j as MediaSchema, k as MediaTimeline, l as MediaTimelineSchema, m as MediaTrackSchema, n as MediaUrlSchema, o as MultipleChoiceDataSchema, p as MultipleChoiceOptionMediaSchema, q as MultipleChoiceOptionSchema, N as NativeControlHintSchema, R as ReadAloudDataSchema, r as ReadAloudSlowMediaSchema, s as RedactedActivity, t as RedactedBlankConfig, u as RedactedBlankConfigSchema, v as RedactedDictationData, w as RedactedDictationDataSchema, x as RedactedDictationSlowMedia, y as RedactedDictationSlowMediaSchema, z as RedactedFillInTheBlanksData, C as RedactedFillInTheBlanksDataSchema, E as RedactedGapSelectBank, H as RedactedGapSelectBankSchema, J as RedactedGapSelectChoice, K as RedactedGapSelectChoiceSchema, L as RedactedGapSelectData, O as RedactedGapSelectDataSchema, P as RedactedGapSelectGap, Q as RedactedGapSelectGapSchema, S as RedactedItemGroupSchema, T as RedactedMediaSchema, U as RedactedMultipleChoiceData, V as RedactedMultipleChoiceDataSchema, W as RedactedMultipleChoiceOption, X as RedactedMultipleChoiceOptionMedia, Y as RedactedMultipleChoiceOptionMediaSchema, Z as RedactedMultipleChoiceOptionSchema, _ as RedactedReadAloudData, $ as RedactedReadAloudDataSchema, a0 as RedactedStimulus, a1 as RedactedStimulusSchema, a2 as RedactedWrittenResponseData, a3 as RedactedWrittenResponseDataSchema, a6 as SequenceSlotGroup, a7 as Stimulus, a8 as StimulusKind, a9 as StimulusSchema, aa as TextMatchPolicySchema, ab as TimelineChapter, ac as TimelineChapterSchema, ad as TimelineCue, ae as TimelineCueSchema, af as WrittenResponseDataSchema, ag as WrittenResponseRubricCriterionSchema, ah as WrittenResponseRubricSchema, ai as dictationJsonSchema, aj as fillInTheBlanksJsonSchema, ak as gapSelectJsonSchema, al as itemGroupJsonSchema, am as jsonSchemaFor, an as multipleChoiceJsonSchema, ao as readAloudJsonSchema, ap as stimulusJsonSchema, aq as validateActivity, ar as validateItemGroup, as as writtenResponseJsonSchema } from './index-bpuDhvXV.cjs';
1
+ import { v as AiSupportedActivityType, g as AiActivityInput, k as AiFeature, Z as LearnerResponse, Y as ItemOutcome, j as AiExplanationRequest, o as AiGrade, p as AiHintRequest, ad as ScoringDetail, q as AiItemFacts, w as AiTextResult, u as AiRefusal, a as ActivityData, ai as ValidationError, f as ActivityType, b as ActivityDataMap, C as CriterionScore, Q as GradeRecord, a5 as NativeControlHint, d as ActivityMedia, af as ScoringResult, z as DeferredScoringPartial, E as DictationData, G as DictationLearnerResponse, J as FillInTheBlanksData, K as FillInTheBlanksLearnerResponse, N as GapSelectData, P as GapSelectLearnerResponse, a1 as MultipleChoiceData, a2 as MultipleChoiceLearnerResponse, a6 as ReadAloudData, a9 as ReadAloudLearnerResponse, ak as WrittenResponseData, al as WrittenResponseLearnerResponse } from './activity-xhGV-Aeh.cjs';
2
+ export { A as ActivityAiPermissions, c as ActivityFeedback, e as ActivityResult, h as AiBlankFact, i as AiDictationFacts, l as AiFillInTheBlanksFacts, m as AiGapFact, n as AiGapSelectFacts, r as AiMultipleChoiceFacts, s as AiOptionFact, t as AiProvenance, x as AiVerdict, y as AiWordFact, B as BlankConfig, D as DeferredReason, F as DictationEquivalence, H as DictationSlowMedia, I as DictationTolerance, L as GapSelectBank, M as GapSelectChoice, O as GapSelectGap, R as Grader, S as GraderKind, T as GraderUsage, U as GradingState, V as InlineCorrection, W as InteractionEvent, X as InteractionKind, _ as LearnerResponseMap, $ as MediaPlaybackPolicy, a0 as MediaTrack, a3 as MultipleChoiceOption, a4 as MultipleChoiceOptionMedia, a7 as ReadAloudDimension, a8 as ReadAloudDimensionWeight, aa as ReadAloudSlowMedia, ab as RecordingBounds, ac as RecordingRef, ae as ScoringOutcome, ag as TextMatchPolicy, ah as TextMatchResult, aj as ValidationResult, am as WrittenResponseRubric, an as WrittenResponseRubricCriterion, ao as XAPIActor, ap as XAPIConfig, aq as XAPIContext, ar as XAPIContextActivities, as as XAPIError, at as XAPIObject, au as XAPIResult, av as XAPIScore, aw as XAPIStatement, ax as XAPIVerbObject, ay as levenshteinDistance, az as matchText } from './activity-xhGV-Aeh.cjs';
3
+ import { ResolvedItemScoringPolicy, ItemScoringPolicy, ScoredItem, RoundingPolicy, CompositionPolicy, AssessmentScore } from './scoring.cjs';
4
+ export { AssessmentSectionInput, Band, 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, DictationAlignment, DictationCharOp, DictationReference, DictationWordAlignment, EvaluateOptions, GradeReadAloudOptions, ITEM_SCORING_MAX_RETRIES, ItemScoringCount, ItemScoringPolicyIssue, ItemTriesOutcome, ItemTriesScore, ItemTry, ItemTryScore, PassFailureReason, READ_ALOUD_MAX_DIMENSION_WEIGHT, READ_ALOUD_MAX_REFERENCE_LENGTH, READ_ALOUD_MAX_SECONDS, READ_ALOUD_MAX_TAKES, ReadAloudWordAlignment, ReadAloudWordState, RoundingMode, SPEECH_ASSESSMENT_MAX_WORDS, ScoringOptions, SectionScore, SpeechAssessment, SpeechMeasurement, SpeechPhoneme, SpeechPhonemeCandidate, SpeechPlausibilityPolicy, SpeechSyllable, SpeechUnscorable, SpeechUnscorableCode, SpeechWord, SpeechWordError, WavInspection, WavInspectionPolicy, alignDictation, alignReadAloud, classifyBand, composeAssessmentScore, computePassThreshold, dictationReferenceWords, diffDictationChars, evaluate, evaluateTries, gradeReadAloud, gte, inspectWav, outcomeFromUnscorable, resolveItemScoringPolicy, roundGrade, score, scoreTries, validateItemScoringPolicy, validateSpeechAssessment } from './scoring.cjs';
5
+ import { a5 as SequenceSlot, a4 as SequenceEntry, I as ItemGroup, i as MediaProgress } from './index-BuD8Hc8o.cjs';
6
+ export { A as AiPermissionsSchema, 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, j as MediaSchema, k as MediaTimeline, l as MediaTimelineSchema, m as MediaTrackSchema, n as MediaUrlSchema, o as MultipleChoiceDataSchema, p as MultipleChoiceOptionMediaSchema, q as MultipleChoiceOptionSchema, N as NativeControlHintSchema, R as ReadAloudDataSchema, r as ReadAloudSlowMediaSchema, s as RedactedActivity, t as RedactedBlankConfig, u as RedactedBlankConfigSchema, v as RedactedDictationData, w as RedactedDictationDataSchema, x as RedactedDictationSlowMedia, y as RedactedDictationSlowMediaSchema, z as RedactedFillInTheBlanksData, C as RedactedFillInTheBlanksDataSchema, E as RedactedGapSelectBank, H as RedactedGapSelectBankSchema, J as RedactedGapSelectChoice, K as RedactedGapSelectChoiceSchema, L as RedactedGapSelectData, O as RedactedGapSelectDataSchema, P as RedactedGapSelectGap, Q as RedactedGapSelectGapSchema, S as RedactedItemGroupSchema, T as RedactedMediaSchema, U as RedactedMultipleChoiceData, V as RedactedMultipleChoiceDataSchema, W as RedactedMultipleChoiceOption, X as RedactedMultipleChoiceOptionMedia, Y as RedactedMultipleChoiceOptionMediaSchema, Z as RedactedMultipleChoiceOptionSchema, _ as RedactedReadAloudData, $ as RedactedReadAloudDataSchema, a0 as RedactedStimulus, a1 as RedactedStimulusSchema, a2 as RedactedWrittenResponseData, a3 as RedactedWrittenResponseDataSchema, a6 as SequenceSlotGroup, a7 as Stimulus, a8 as StimulusKind, a9 as StimulusSchema, aa as TextMatchPolicySchema, ab as TimelineChapter, ac as TimelineChapterSchema, ad as TimelineCue, ae as TimelineCueSchema, af as WrittenResponseDataSchema, ag as WrittenResponseRubricCriterionSchema, ah as WrittenResponseRubricSchema, ai as dictationJsonSchema, aj as fillInTheBlanksJsonSchema, ak as gapSelectJsonSchema, al as itemGroupJsonSchema, am as jsonSchemaFor, an as multipleChoiceJsonSchema, ao as readAloudJsonSchema, ap as stimulusJsonSchema, aq as validateActivity, ar as validateItemGroup, as as writtenResponseJsonSchema } from './index-BuD8Hc8o.cjs';
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.cjs';
9
9
 
@@ -128,6 +128,80 @@ declare function checkAiHint(raw: unknown, request: AiHintRequest): {
128
128
  */
129
129
  declare function hintRevealsAnswer(facts: AiItemFacts, hint: string): boolean;
130
130
 
131
+ /**
132
+ * How a paper is delivered: what a learner is shown around the questions, as
133
+ * the school running it decides — separately from the content, so that one
134
+ * item serves a practice lesson and a final exam without being authored twice.
135
+ *
136
+ * Every setting is a RESTRICTION on what the SDK does by default, and every
137
+ * one defaults to `true`: an empty policy is exactly the behaviour there was
138
+ * before policies existed. A policy can take something away; it can never make
139
+ * a mode show what that mode cannot — no policy makes an `exam` reveal a grade,
140
+ * because the client in an exam has no answer key to grade with.
141
+ */
142
+ interface DeliveryPolicy {
143
+ /**
144
+ * Whether a graded answer shows as graded: right and wrong marks, the score,
145
+ * and the author's feedback. `false` leaves the learner with "Answer
146
+ * submitted." — a homework quiz marked on the client and shown to the
147
+ * learner at the end, or a review that shows what was answered and not how
148
+ * it was marked. Never on in `exam`.
149
+ */
150
+ feedback?: boolean | null;
151
+ /**
152
+ * Whether the right answer is shown beside a wrong one, wherever an activity
153
+ * would show it: the correct option of a multiple-choice question, the
154
+ * correct answers `showCorrectAnswers` puts in the blanks, a dictation's
155
+ * transcript. `false` still marks what the learner answered right or wrong.
156
+ * Use it on a paper that will be sat again, or before a retry.
157
+ */
158
+ solutions?: boolean | null;
159
+ /**
160
+ * Whether the learner can ask for hints: the author's hints on a
161
+ * fill-in-the-blanks blank, a dictation's word hints, and AI hints. `false`
162
+ * switches every kind off.
163
+ *
164
+ * **The author's fill-in-the-blanks hints are on in `exam` unless this says
165
+ * otherwise** — they are public content, and were designed to be. Set
166
+ * `hints: false` on a paper of record whose hints are not part of the test.
167
+ */
168
+ hints?: boolean | null;
169
+ /**
170
+ * The deployment's switches for AI help, beside the author's switch on the
171
+ * item and the ports the host supplies: a feature appears only where all
172
+ * three allow it. `false` switches a feature off; nothing here can switch one
173
+ * on, and nothing switches AI help on in an `exam`.
174
+ *
175
+ * `ai: false` switches both off and `ai: true` leaves both as the other
176
+ * settings allow — the same as leaving `ai` out.
177
+ */
178
+ ai?: boolean | {
179
+ hints?: boolean | null;
180
+ explanations?: boolean | null;
181
+ } | null;
182
+ }
183
+ /**
184
+ * A policy with every setting spelled out: what {@link resolveDeliveryPolicy}
185
+ * returns, and what an attempt plan records, so the record of the conditions
186
+ * a learner sat a paper under never depends on a default that may one day
187
+ * change.
188
+ */
189
+ interface ResolvedDeliveryPolicy {
190
+ feedback: boolean;
191
+ solutions: boolean;
192
+ hints: boolean;
193
+ ai: {
194
+ hints: boolean;
195
+ explanations: boolean;
196
+ };
197
+ }
198
+ /** One thing {@link validateDeliveryPolicy} found wrong with a policy. */
199
+ interface DeliveryPolicyIssue {
200
+ /** Where, as a dotted path: `hints`, `ai.explanations`, or `''` for the policy itself. */
201
+ path: string;
202
+ message: string;
203
+ }
204
+
131
205
  /**
132
206
  * The frozen record of what one attempt was served.
133
207
  *
@@ -140,6 +214,7 @@ declare function hintRevealsAnswer(facts: AiItemFacts, hint: string): boolean;
140
214
  *
141
215
  * This is the thing you persist next to the responses.
142
216
  */
217
+
143
218
  /** One planned position: an item, its identity, its worth, and its fingerprint. */
144
219
  interface AttemptPlanSlot {
145
220
  /**
@@ -227,6 +302,19 @@ interface AttemptPlan {
227
302
  * later; the per-slot hashes then say WHICH item moved.
228
303
  */
229
304
  planHash: string;
305
+ /**
306
+ * The delivery policy the attempt was sat under, every setting spelled out:
307
+ * whether feedback, solutions and hints showed, and which AI help was on.
308
+ * Absent when `planAttempt` was given none. Part of `planHash` when present.
309
+ */
310
+ delivery?: ResolvedDeliveryPolicy;
311
+ /**
312
+ * The scoring policy the attempt was sat under, every setting spelled out:
313
+ * the tries each question gave, which counted, and what tries and hints
314
+ * cost. Absent when `planAttempt` was given none. Part of `planHash` when
315
+ * present.
316
+ */
317
+ scoring?: ResolvedItemScoringPolicy;
230
318
  slots: AttemptPlanSlot[];
231
319
  /** Sum of every slot's `points`, frozen. The denominator of the paper. */
232
320
  totalPoints: number;
@@ -257,6 +345,22 @@ interface AttemptPlanDrift {
257
345
  changedPointsSlotIds: string[];
258
346
  /** Slots presented at a different position now than they were then. */
259
347
  reorderedSlotIds: string[];
348
+ /**
349
+ * The delivery policy differs: one plan records a policy the other does not,
350
+ * or a setting differs. Not a change to any question, but a change to the
351
+ * conditions it was asked under — hints on in one, off in the other — so it
352
+ * breaks `matches` like any other difference.
353
+ *
354
+ * Present only when it is `true`, so a report between two plans without a
355
+ * policy has exactly the shape it had before policies existed.
356
+ */
357
+ deliveryChanged?: true;
358
+ /**
359
+ * The scoring policy differs: one plan records a policy the other does not,
360
+ * or a setting differs. The same answers are worth something else under
361
+ * another policy, so it breaks `matches`. Present only when it is `true`.
362
+ */
363
+ scoringChanged?: true;
260
364
  }
261
365
 
262
366
  /** Options for {@link planAttempt}. */
@@ -281,6 +385,33 @@ interface PlanAttemptOptions<TItem> {
281
385
  * number — a slot worth `NaN` points would poison the whole total.
282
386
  */
283
387
  points?: (slot: SequenceSlot<TItem>) => number;
388
+ /**
389
+ * The delivery policy this attempt is sat under — whether hints were
390
+ * offered, whether AI help was, whether feedback and solutions showed.
391
+ * Frozen into the plan with every setting spelled out, so the record of the
392
+ * conditions a grade was earned under does not depend on today's defaults.
393
+ *
394
+ * Recorded only when given: a plan made without one is byte-identical to a
395
+ * plan made before policies existed, `planHash` included.
396
+ *
397
+ * @throws Error when the policy does not pass `validateDeliveryPolicy` —
398
+ * a misspelled restriction is no restriction, and a plan is the
399
+ * record an appeal reads.
400
+ */
401
+ delivery?: DeliveryPolicy | null;
402
+ /**
403
+ * The scoring policy this attempt is sat under — how many tries each
404
+ * question gives, which one counts, and what tries and hints cost. Frozen
405
+ * into the plan with every setting spelled out, like `delivery`, and for a
406
+ * stronger reason: every setting in it moves a grade, so a re-grade must
407
+ * apply the rules the learner sat under, not today's.
408
+ *
409
+ * Recorded only when given: a plan made without one is byte-identical to a
410
+ * plan made before scoring policies existed, `planHash` included.
411
+ *
412
+ * @throws Error when the policy does not pass `validateItemScoringPolicy`.
413
+ */
414
+ scoring?: ItemScoringPolicy | null;
284
415
  }
285
416
  /**
286
417
  * Freezes what an attempt is being served: the presented order, each slot's
@@ -676,6 +807,45 @@ declare function contentHash(value: unknown): string;
676
807
  */
677
808
  declare function countWords(text: string): number;
678
809
 
810
+ /**
811
+ * The policy that restricts nothing: every setting `true`. It is what an absent
812
+ * policy resolves to, and it is exactly the behaviour the SDK had before
813
+ * delivery policies existed.
814
+ */
815
+ declare const OPEN_DELIVERY_POLICY: ResolvedDeliveryPolicy;
816
+ /**
817
+ * A policy with every setting spelled out — see {@link DeliveryPolicy}.
818
+ *
819
+ * Tolerant, because it runs where a learner is waiting: nothing here throws.
820
+ * A value it cannot read restricts rather than allows (see above), and a
821
+ * policy that is not an object at all restricts everything. Check a policy
822
+ * before you store it with {@link validateDeliveryPolicy}; `planAttempt` does.
823
+ */
824
+ declare function resolveDeliveryPolicy(policy: unknown): ResolvedDeliveryPolicy;
825
+ /**
826
+ * The strictest of several policies: a setting is on only where every one of
827
+ * them leaves it on. How a course's policy and an assessment's combine, and
828
+ * how a pager's policy wins over whatever a question it draws was handed.
829
+ */
830
+ declare function combineDeliveryPolicies(...policies: unknown[]): ResolvedDeliveryPolicy;
831
+ /**
832
+ * Checks a policy before it is stored: each setting `true`, `false`, `null`
833
+ * or absent, and nothing else — no misspelled setting, no string standing in
834
+ * for a boolean.
835
+ *
836
+ * Stricter than {@link resolveDeliveryPolicy} on purpose. A misspelled
837
+ * restriction (`hint: false`) is silently no restriction at all, and a
838
+ * policy is a record of the conditions a paper was sat under: it is worth
839
+ * refusing before it is written down, rather than read charitably after.
840
+ */
841
+ declare function validateDeliveryPolicy(policy: unknown): {
842
+ success: true;
843
+ data: DeliveryPolicy;
844
+ } | {
845
+ success: false;
846
+ issues: DeliveryPolicyIssue[];
847
+ };
848
+
679
849
  /** Thrown when activity data fails schema validation at a component boundary. */
680
850
  declare class ActivitySchemaError extends Error {
681
851
  readonly activityType: string;
@@ -1468,4 +1638,4 @@ interface ThemeTokens {
1468
1638
  '--lk-transition-base': string;
1469
1639
  }
1470
1640
 
1471
- export { AI_EXPLANATION_TYPES, AI_HINT_TYPES, AI_TEXT_MAX_LENGTH, ActivityData, ActivityDataMap, ActivityMedia, ActivitySchemaError, ActivityType, type ActivityTypeAuthoring, type ActivityTypeDescriptor, type ActivityTypeInterop, type ActivityTypeScoring, AiActivityInput, AiExplanationRequest, AiFeature, AiGrade, AiHintRequest, AiItemFacts, AiRefusal, AiSupportedActivityType, AiTextResult, AssessmentScore, type AttemptPlan, type AttemptPlanDrift, type AttemptPlanSlot, type AttemptProgress, type AttemptState, CompositionPolicy, 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, INTERACTIVE_VIDEO_ITEM_TYPES, type InteractiveVideoItemType, ItemGroup, ItemOutcome, LearnerResponse, type MediaBudgetRef, type MediaPlayClaim, type MediaPlayGrant, type MediaPlayLedger, type MediaPlayLedgerEntry, MediaProgress, type MissingOutcomePolicy, MultipleChoiceData, MultipleChoiceLearnerResponse, NativeControlHint, type PartialScoringResult, type PlanAttemptOptions, type PlannableEntry, ReadAloudData, ReadAloudLearnerResponse, type RedactOptions, type RedactedActivityData, type RedactedItemGroup, RedactedScoringError, type RegisteredActivityTypeDescriptor, type ResolvedPlaybackPolicy, type ResponseDiffEntry, RoundingPolicy, ScoredItem, ScoringDetail, ScoringResult, type SeededShuffleOptions, type Sensitivity, SequenceEntry, SequenceSlot, type ShuffleVersion, TIMELINE_MAX_CHAPTERS, TIMELINE_MAX_ITEMS, TIMELINE_MAX_QUIZZES, TIMELINE_MAX_TITLE_LENGTH, type ThemeTokens, UnknownActivityTypeError, ValidationError, WrittenResponseData, WrittenResponseLearnerResponse, type XAPIInteractionType, aiAllowedByContent, aiExplanationRequest, aiGradeOf, aiHintRequest, aiSupports, assertRedacted, assertRedactedItemGroup, buildAiFacts, canonicalJson, checkAiExplanation, checkAiHint, composeTimelineScore, contentHash, countWords, createDraft, createInteractiveVideoDraft, createItemGroupDraft, defineActivityType, dictationType, diffResponses, entryKeyOf, fillInTheBlanksType, fingerprint, flattenSequence, gapSelectType, getActivityTypeDescriptor, gradeFromRubric, hasGrade, hashSeed, hintRevealsAnswer, isInteractiveVideoItemType, isItemGroup, multipleChoiceType, outcomeFromGrade, planAttempt, planMediaBudgets, readAiTextResult, readAloudType, readMediaProgress, redact, redactItemGroup, registerActivityType, registeredActivityTypes, resolvePlaybackPolicy, restoreAttemptState, restoreMediaPlayLedger, scoredItemsFromPlan, seededShuffle, serializeAttemptState, serializeMediaPlayLedger, slotMediaKey, stimulusMediaKey, validateDraft, validateItemGroupDraft, verifyAttemptPlan, writtenResponseType };
1641
+ export { AI_EXPLANATION_TYPES, AI_HINT_TYPES, AI_TEXT_MAX_LENGTH, ActivityData, ActivityDataMap, ActivityMedia, ActivitySchemaError, ActivityType, type ActivityTypeAuthoring, type ActivityTypeDescriptor, type ActivityTypeInterop, type ActivityTypeScoring, AiActivityInput, AiExplanationRequest, AiFeature, AiGrade, AiHintRequest, AiItemFacts, AiRefusal, AiSupportedActivityType, AiTextResult, AssessmentScore, type AttemptPlan, type AttemptPlanDrift, type AttemptPlanSlot, type AttemptProgress, type AttemptState, CompositionPolicy, CriterionScore, DeferredScoringError, DeferredScoringPartial, type DeliveryPolicy, type DeliveryPolicyIssue, 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, INTERACTIVE_VIDEO_ITEM_TYPES, type InteractiveVideoItemType, ItemGroup, ItemOutcome, ItemScoringPolicy, LearnerResponse, type MediaBudgetRef, type MediaPlayClaim, type MediaPlayGrant, type MediaPlayLedger, type MediaPlayLedgerEntry, MediaProgress, type MissingOutcomePolicy, MultipleChoiceData, MultipleChoiceLearnerResponse, NativeControlHint, OPEN_DELIVERY_POLICY, type PartialScoringResult, type PlanAttemptOptions, type PlannableEntry, ReadAloudData, ReadAloudLearnerResponse, type RedactOptions, type RedactedActivityData, type RedactedItemGroup, RedactedScoringError, type RegisteredActivityTypeDescriptor, type ResolvedDeliveryPolicy, ResolvedItemScoringPolicy, type ResolvedPlaybackPolicy, type ResponseDiffEntry, RoundingPolicy, ScoredItem, ScoringDetail, ScoringResult, type SeededShuffleOptions, type Sensitivity, SequenceEntry, SequenceSlot, type ShuffleVersion, TIMELINE_MAX_CHAPTERS, TIMELINE_MAX_ITEMS, TIMELINE_MAX_QUIZZES, TIMELINE_MAX_TITLE_LENGTH, type ThemeTokens, UnknownActivityTypeError, ValidationError, WrittenResponseData, WrittenResponseLearnerResponse, type XAPIInteractionType, aiAllowedByContent, aiExplanationRequest, aiGradeOf, aiHintRequest, aiSupports, assertRedacted, assertRedactedItemGroup, buildAiFacts, canonicalJson, checkAiExplanation, checkAiHint, combineDeliveryPolicies, composeTimelineScore, contentHash, countWords, createDraft, createInteractiveVideoDraft, createItemGroupDraft, defineActivityType, dictationType, diffResponses, entryKeyOf, fillInTheBlanksType, fingerprint, flattenSequence, gapSelectType, getActivityTypeDescriptor, gradeFromRubric, hasGrade, hashSeed, hintRevealsAnswer, isInteractiveVideoItemType, isItemGroup, multipleChoiceType, outcomeFromGrade, planAttempt, planMediaBudgets, readAiTextResult, readAloudType, readMediaProgress, redact, redactItemGroup, registerActivityType, registeredActivityTypes, resolveDeliveryPolicy, resolvePlaybackPolicy, restoreAttemptState, restoreMediaPlayLedger, scoredItemsFromPlan, seededShuffle, serializeAttemptState, serializeMediaPlayLedger, slotMediaKey, stimulusMediaKey, validateDeliveryPolicy, validateDraft, validateItemGroupDraft, verifyAttemptPlan, writtenResponseType };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { v as AiSupportedActivityType, g as AiActivityInput, k as AiFeature, Z as LearnerResponse, Y as ItemOutcome, j as AiExplanationRequest, o as AiGrade, p as AiHintRequest, ad as ScoringDetail, q as AiItemFacts, w as AiTextResult, u as AiRefusal, a as ActivityData, ai as ValidationError, f as ActivityType, b as ActivityDataMap, C as CriterionScore, Q as GradeRecord, a5 as NativeControlHint, d as ActivityMedia, af as ScoringResult, z as DeferredScoringPartial, E as DictationData, G as DictationLearnerResponse, J as FillInTheBlanksData, K as FillInTheBlanksLearnerResponse, N as GapSelectData, P as GapSelectLearnerResponse, a1 as MultipleChoiceData, a2 as MultipleChoiceLearnerResponse, a6 as ReadAloudData, a9 as ReadAloudLearnerResponse, ak as WrittenResponseData, al as WrittenResponseLearnerResponse } from './activity-f0bgZSTP.js';
2
- export { A as ActivityAiPermissions, c as ActivityFeedback, e as ActivityResult, h as AiBlankFact, i as AiDictationFacts, l as AiFillInTheBlanksFacts, m as AiGapFact, n as AiGapSelectFacts, r as AiMultipleChoiceFacts, s as AiOptionFact, t as AiProvenance, x as AiVerdict, y as AiWordFact, B as BlankConfig, D as DeferredReason, F as DictationEquivalence, H as DictationSlowMedia, I as DictationTolerance, L as GapSelectBank, M as GapSelectChoice, O as GapSelectGap, R as Grader, S as GraderKind, T as GraderUsage, U as GradingState, V as InlineCorrection, W as InteractionEvent, X as InteractionKind, _ as LearnerResponseMap, $ as MediaPlaybackPolicy, a0 as MediaTrack, a3 as MultipleChoiceOption, a4 as MultipleChoiceOptionMedia, a7 as ReadAloudDimension, a8 as ReadAloudDimensionWeight, aa as ReadAloudSlowMedia, ab as RecordingBounds, ac as RecordingRef, ae as ScoringOutcome, ag as TextMatchPolicy, ah as TextMatchResult, aj as ValidationResult, am as WrittenResponseRubric, an as WrittenResponseRubricCriterion, ao as XAPIActor, ap as XAPIConfig, aq as XAPIContext, ar as XAPIContextActivities, as as XAPIError, at as XAPIObject, au as XAPIResult, av as XAPIScore, aw as XAPIStatement, ax as XAPIVerbObject, ay as levenshteinDistance, az as matchText } from './activity-f0bgZSTP.js';
3
- import { ScoredItem, RoundingPolicy, CompositionPolicy, AssessmentScore } from './scoring.js';
4
- export { AssessmentSectionInput, Band, 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, GradeReadAloudOptions, PassFailureReason, READ_ALOUD_MAX_DIMENSION_WEIGHT, READ_ALOUD_MAX_REFERENCE_LENGTH, READ_ALOUD_MAX_SECONDS, READ_ALOUD_MAX_TAKES, ReadAloudWordAlignment, ReadAloudWordState, RoundingMode, SPEECH_ASSESSMENT_MAX_WORDS, ScoringOptions, SectionScore, SpeechAssessment, SpeechMeasurement, SpeechPhoneme, SpeechPhonemeCandidate, SpeechPlausibilityPolicy, SpeechSyllable, SpeechUnscorable, SpeechUnscorableCode, SpeechWord, SpeechWordError, WavInspection, WavInspectionPolicy, alignDictation, alignReadAloud, classifyBand, composeAssessmentScore, computePassThreshold, dictationReferenceWords, diffDictationChars, evaluate, gradeReadAloud, gte, inspectWav, outcomeFromUnscorable, roundGrade, score, validateSpeechAssessment } from './scoring.js';
5
- import { a5 as SequenceSlot, a4 as SequenceEntry, I as ItemGroup, i as MediaProgress } from './index-DMCM3e3P.js';
6
- export { A as AiPermissionsSchema, 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, j as MediaSchema, k as MediaTimeline, l as MediaTimelineSchema, m as MediaTrackSchema, n as MediaUrlSchema, o as MultipleChoiceDataSchema, p as MultipleChoiceOptionMediaSchema, q as MultipleChoiceOptionSchema, N as NativeControlHintSchema, R as ReadAloudDataSchema, r as ReadAloudSlowMediaSchema, s as RedactedActivity, t as RedactedBlankConfig, u as RedactedBlankConfigSchema, v as RedactedDictationData, w as RedactedDictationDataSchema, x as RedactedDictationSlowMedia, y as RedactedDictationSlowMediaSchema, z as RedactedFillInTheBlanksData, C as RedactedFillInTheBlanksDataSchema, E as RedactedGapSelectBank, H as RedactedGapSelectBankSchema, J as RedactedGapSelectChoice, K as RedactedGapSelectChoiceSchema, L as RedactedGapSelectData, O as RedactedGapSelectDataSchema, P as RedactedGapSelectGap, Q as RedactedGapSelectGapSchema, S as RedactedItemGroupSchema, T as RedactedMediaSchema, U as RedactedMultipleChoiceData, V as RedactedMultipleChoiceDataSchema, W as RedactedMultipleChoiceOption, X as RedactedMultipleChoiceOptionMedia, Y as RedactedMultipleChoiceOptionMediaSchema, Z as RedactedMultipleChoiceOptionSchema, _ as RedactedReadAloudData, $ as RedactedReadAloudDataSchema, a0 as RedactedStimulus, a1 as RedactedStimulusSchema, a2 as RedactedWrittenResponseData, a3 as RedactedWrittenResponseDataSchema, a6 as SequenceSlotGroup, a7 as Stimulus, a8 as StimulusKind, a9 as StimulusSchema, aa as TextMatchPolicySchema, ab as TimelineChapter, ac as TimelineChapterSchema, ad as TimelineCue, ae as TimelineCueSchema, af as WrittenResponseDataSchema, ag as WrittenResponseRubricCriterionSchema, ah as WrittenResponseRubricSchema, ai as dictationJsonSchema, aj as fillInTheBlanksJsonSchema, ak as gapSelectJsonSchema, al as itemGroupJsonSchema, am as jsonSchemaFor, an as multipleChoiceJsonSchema, ao as readAloudJsonSchema, ap as stimulusJsonSchema, aq as validateActivity, ar as validateItemGroup, as as writtenResponseJsonSchema } from './index-DMCM3e3P.js';
1
+ import { v as AiSupportedActivityType, g as AiActivityInput, k as AiFeature, Z as LearnerResponse, Y as ItemOutcome, j as AiExplanationRequest, o as AiGrade, p as AiHintRequest, ad as ScoringDetail, q as AiItemFacts, w as AiTextResult, u as AiRefusal, a as ActivityData, ai as ValidationError, f as ActivityType, b as ActivityDataMap, C as CriterionScore, Q as GradeRecord, a5 as NativeControlHint, d as ActivityMedia, af as ScoringResult, z as DeferredScoringPartial, E as DictationData, G as DictationLearnerResponse, J as FillInTheBlanksData, K as FillInTheBlanksLearnerResponse, N as GapSelectData, P as GapSelectLearnerResponse, a1 as MultipleChoiceData, a2 as MultipleChoiceLearnerResponse, a6 as ReadAloudData, a9 as ReadAloudLearnerResponse, ak as WrittenResponseData, al as WrittenResponseLearnerResponse } from './activity-xhGV-Aeh.js';
2
+ export { A as ActivityAiPermissions, c as ActivityFeedback, e as ActivityResult, h as AiBlankFact, i as AiDictationFacts, l as AiFillInTheBlanksFacts, m as AiGapFact, n as AiGapSelectFacts, r as AiMultipleChoiceFacts, s as AiOptionFact, t as AiProvenance, x as AiVerdict, y as AiWordFact, B as BlankConfig, D as DeferredReason, F as DictationEquivalence, H as DictationSlowMedia, I as DictationTolerance, L as GapSelectBank, M as GapSelectChoice, O as GapSelectGap, R as Grader, S as GraderKind, T as GraderUsage, U as GradingState, V as InlineCorrection, W as InteractionEvent, X as InteractionKind, _ as LearnerResponseMap, $ as MediaPlaybackPolicy, a0 as MediaTrack, a3 as MultipleChoiceOption, a4 as MultipleChoiceOptionMedia, a7 as ReadAloudDimension, a8 as ReadAloudDimensionWeight, aa as ReadAloudSlowMedia, ab as RecordingBounds, ac as RecordingRef, ae as ScoringOutcome, ag as TextMatchPolicy, ah as TextMatchResult, aj as ValidationResult, am as WrittenResponseRubric, an as WrittenResponseRubricCriterion, ao as XAPIActor, ap as XAPIConfig, aq as XAPIContext, ar as XAPIContextActivities, as as XAPIError, at as XAPIObject, au as XAPIResult, av as XAPIScore, aw as XAPIStatement, ax as XAPIVerbObject, ay as levenshteinDistance, az as matchText } from './activity-xhGV-Aeh.js';
3
+ import { ResolvedItemScoringPolicy, ItemScoringPolicy, ScoredItem, RoundingPolicy, CompositionPolicy, AssessmentScore } from './scoring.js';
4
+ export { AssessmentSectionInput, Band, 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, DictationAlignment, DictationCharOp, DictationReference, DictationWordAlignment, EvaluateOptions, GradeReadAloudOptions, ITEM_SCORING_MAX_RETRIES, ItemScoringCount, ItemScoringPolicyIssue, ItemTriesOutcome, ItemTriesScore, ItemTry, ItemTryScore, PassFailureReason, READ_ALOUD_MAX_DIMENSION_WEIGHT, READ_ALOUD_MAX_REFERENCE_LENGTH, READ_ALOUD_MAX_SECONDS, READ_ALOUD_MAX_TAKES, ReadAloudWordAlignment, ReadAloudWordState, RoundingMode, SPEECH_ASSESSMENT_MAX_WORDS, ScoringOptions, SectionScore, SpeechAssessment, SpeechMeasurement, SpeechPhoneme, SpeechPhonemeCandidate, SpeechPlausibilityPolicy, SpeechSyllable, SpeechUnscorable, SpeechUnscorableCode, SpeechWord, SpeechWordError, WavInspection, WavInspectionPolicy, alignDictation, alignReadAloud, classifyBand, composeAssessmentScore, computePassThreshold, dictationReferenceWords, diffDictationChars, evaluate, evaluateTries, gradeReadAloud, gte, inspectWav, outcomeFromUnscorable, resolveItemScoringPolicy, roundGrade, score, scoreTries, validateItemScoringPolicy, validateSpeechAssessment } from './scoring.js';
5
+ import { a5 as SequenceSlot, a4 as SequenceEntry, I as ItemGroup, i as MediaProgress } from './index-DnJ_PI4d.js';
6
+ export { A as AiPermissionsSchema, 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, j as MediaSchema, k as MediaTimeline, l as MediaTimelineSchema, m as MediaTrackSchema, n as MediaUrlSchema, o as MultipleChoiceDataSchema, p as MultipleChoiceOptionMediaSchema, q as MultipleChoiceOptionSchema, N as NativeControlHintSchema, R as ReadAloudDataSchema, r as ReadAloudSlowMediaSchema, s as RedactedActivity, t as RedactedBlankConfig, u as RedactedBlankConfigSchema, v as RedactedDictationData, w as RedactedDictationDataSchema, x as RedactedDictationSlowMedia, y as RedactedDictationSlowMediaSchema, z as RedactedFillInTheBlanksData, C as RedactedFillInTheBlanksDataSchema, E as RedactedGapSelectBank, H as RedactedGapSelectBankSchema, J as RedactedGapSelectChoice, K as RedactedGapSelectChoiceSchema, L as RedactedGapSelectData, O as RedactedGapSelectDataSchema, P as RedactedGapSelectGap, Q as RedactedGapSelectGapSchema, S as RedactedItemGroupSchema, T as RedactedMediaSchema, U as RedactedMultipleChoiceData, V as RedactedMultipleChoiceDataSchema, W as RedactedMultipleChoiceOption, X as RedactedMultipleChoiceOptionMedia, Y as RedactedMultipleChoiceOptionMediaSchema, Z as RedactedMultipleChoiceOptionSchema, _ as RedactedReadAloudData, $ as RedactedReadAloudDataSchema, a0 as RedactedStimulus, a1 as RedactedStimulusSchema, a2 as RedactedWrittenResponseData, a3 as RedactedWrittenResponseDataSchema, a6 as SequenceSlotGroup, a7 as Stimulus, a8 as StimulusKind, a9 as StimulusSchema, aa as TextMatchPolicySchema, ab as TimelineChapter, ac as TimelineChapterSchema, ad as TimelineCue, ae as TimelineCueSchema, af as WrittenResponseDataSchema, ag as WrittenResponseRubricCriterionSchema, ah as WrittenResponseRubricSchema, ai as dictationJsonSchema, aj as fillInTheBlanksJsonSchema, ak as gapSelectJsonSchema, al as itemGroupJsonSchema, am as jsonSchemaFor, an as multipleChoiceJsonSchema, ao as readAloudJsonSchema, ap as stimulusJsonSchema, aq as validateActivity, ar as validateItemGroup, as as writtenResponseJsonSchema } from './index-DnJ_PI4d.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
 
@@ -128,6 +128,80 @@ declare function checkAiHint(raw: unknown, request: AiHintRequest): {
128
128
  */
129
129
  declare function hintRevealsAnswer(facts: AiItemFacts, hint: string): boolean;
130
130
 
131
+ /**
132
+ * How a paper is delivered: what a learner is shown around the questions, as
133
+ * the school running it decides — separately from the content, so that one
134
+ * item serves a practice lesson and a final exam without being authored twice.
135
+ *
136
+ * Every setting is a RESTRICTION on what the SDK does by default, and every
137
+ * one defaults to `true`: an empty policy is exactly the behaviour there was
138
+ * before policies existed. A policy can take something away; it can never make
139
+ * a mode show what that mode cannot — no policy makes an `exam` reveal a grade,
140
+ * because the client in an exam has no answer key to grade with.
141
+ */
142
+ interface DeliveryPolicy {
143
+ /**
144
+ * Whether a graded answer shows as graded: right and wrong marks, the score,
145
+ * and the author's feedback. `false` leaves the learner with "Answer
146
+ * submitted." — a homework quiz marked on the client and shown to the
147
+ * learner at the end, or a review that shows what was answered and not how
148
+ * it was marked. Never on in `exam`.
149
+ */
150
+ feedback?: boolean | null;
151
+ /**
152
+ * Whether the right answer is shown beside a wrong one, wherever an activity
153
+ * would show it: the correct option of a multiple-choice question, the
154
+ * correct answers `showCorrectAnswers` puts in the blanks, a dictation's
155
+ * transcript. `false` still marks what the learner answered right or wrong.
156
+ * Use it on a paper that will be sat again, or before a retry.
157
+ */
158
+ solutions?: boolean | null;
159
+ /**
160
+ * Whether the learner can ask for hints: the author's hints on a
161
+ * fill-in-the-blanks blank, a dictation's word hints, and AI hints. `false`
162
+ * switches every kind off.
163
+ *
164
+ * **The author's fill-in-the-blanks hints are on in `exam` unless this says
165
+ * otherwise** — they are public content, and were designed to be. Set
166
+ * `hints: false` on a paper of record whose hints are not part of the test.
167
+ */
168
+ hints?: boolean | null;
169
+ /**
170
+ * The deployment's switches for AI help, beside the author's switch on the
171
+ * item and the ports the host supplies: a feature appears only where all
172
+ * three allow it. `false` switches a feature off; nothing here can switch one
173
+ * on, and nothing switches AI help on in an `exam`.
174
+ *
175
+ * `ai: false` switches both off and `ai: true` leaves both as the other
176
+ * settings allow — the same as leaving `ai` out.
177
+ */
178
+ ai?: boolean | {
179
+ hints?: boolean | null;
180
+ explanations?: boolean | null;
181
+ } | null;
182
+ }
183
+ /**
184
+ * A policy with every setting spelled out: what {@link resolveDeliveryPolicy}
185
+ * returns, and what an attempt plan records, so the record of the conditions
186
+ * a learner sat a paper under never depends on a default that may one day
187
+ * change.
188
+ */
189
+ interface ResolvedDeliveryPolicy {
190
+ feedback: boolean;
191
+ solutions: boolean;
192
+ hints: boolean;
193
+ ai: {
194
+ hints: boolean;
195
+ explanations: boolean;
196
+ };
197
+ }
198
+ /** One thing {@link validateDeliveryPolicy} found wrong with a policy. */
199
+ interface DeliveryPolicyIssue {
200
+ /** Where, as a dotted path: `hints`, `ai.explanations`, or `''` for the policy itself. */
201
+ path: string;
202
+ message: string;
203
+ }
204
+
131
205
  /**
132
206
  * The frozen record of what one attempt was served.
133
207
  *
@@ -140,6 +214,7 @@ declare function hintRevealsAnswer(facts: AiItemFacts, hint: string): boolean;
140
214
  *
141
215
  * This is the thing you persist next to the responses.
142
216
  */
217
+
143
218
  /** One planned position: an item, its identity, its worth, and its fingerprint. */
144
219
  interface AttemptPlanSlot {
145
220
  /**
@@ -227,6 +302,19 @@ interface AttemptPlan {
227
302
  * later; the per-slot hashes then say WHICH item moved.
228
303
  */
229
304
  planHash: string;
305
+ /**
306
+ * The delivery policy the attempt was sat under, every setting spelled out:
307
+ * whether feedback, solutions and hints showed, and which AI help was on.
308
+ * Absent when `planAttempt` was given none. Part of `planHash` when present.
309
+ */
310
+ delivery?: ResolvedDeliveryPolicy;
311
+ /**
312
+ * The scoring policy the attempt was sat under, every setting spelled out:
313
+ * the tries each question gave, which counted, and what tries and hints
314
+ * cost. Absent when `planAttempt` was given none. Part of `planHash` when
315
+ * present.
316
+ */
317
+ scoring?: ResolvedItemScoringPolicy;
230
318
  slots: AttemptPlanSlot[];
231
319
  /** Sum of every slot's `points`, frozen. The denominator of the paper. */
232
320
  totalPoints: number;
@@ -257,6 +345,22 @@ interface AttemptPlanDrift {
257
345
  changedPointsSlotIds: string[];
258
346
  /** Slots presented at a different position now than they were then. */
259
347
  reorderedSlotIds: string[];
348
+ /**
349
+ * The delivery policy differs: one plan records a policy the other does not,
350
+ * or a setting differs. Not a change to any question, but a change to the
351
+ * conditions it was asked under — hints on in one, off in the other — so it
352
+ * breaks `matches` like any other difference.
353
+ *
354
+ * Present only when it is `true`, so a report between two plans without a
355
+ * policy has exactly the shape it had before policies existed.
356
+ */
357
+ deliveryChanged?: true;
358
+ /**
359
+ * The scoring policy differs: one plan records a policy the other does not,
360
+ * or a setting differs. The same answers are worth something else under
361
+ * another policy, so it breaks `matches`. Present only when it is `true`.
362
+ */
363
+ scoringChanged?: true;
260
364
  }
261
365
 
262
366
  /** Options for {@link planAttempt}. */
@@ -281,6 +385,33 @@ interface PlanAttemptOptions<TItem> {
281
385
  * number — a slot worth `NaN` points would poison the whole total.
282
386
  */
283
387
  points?: (slot: SequenceSlot<TItem>) => number;
388
+ /**
389
+ * The delivery policy this attempt is sat under — whether hints were
390
+ * offered, whether AI help was, whether feedback and solutions showed.
391
+ * Frozen into the plan with every setting spelled out, so the record of the
392
+ * conditions a grade was earned under does not depend on today's defaults.
393
+ *
394
+ * Recorded only when given: a plan made without one is byte-identical to a
395
+ * plan made before policies existed, `planHash` included.
396
+ *
397
+ * @throws Error when the policy does not pass `validateDeliveryPolicy` —
398
+ * a misspelled restriction is no restriction, and a plan is the
399
+ * record an appeal reads.
400
+ */
401
+ delivery?: DeliveryPolicy | null;
402
+ /**
403
+ * The scoring policy this attempt is sat under — how many tries each
404
+ * question gives, which one counts, and what tries and hints cost. Frozen
405
+ * into the plan with every setting spelled out, like `delivery`, and for a
406
+ * stronger reason: every setting in it moves a grade, so a re-grade must
407
+ * apply the rules the learner sat under, not today's.
408
+ *
409
+ * Recorded only when given: a plan made without one is byte-identical to a
410
+ * plan made before scoring policies existed, `planHash` included.
411
+ *
412
+ * @throws Error when the policy does not pass `validateItemScoringPolicy`.
413
+ */
414
+ scoring?: ItemScoringPolicy | null;
284
415
  }
285
416
  /**
286
417
  * Freezes what an attempt is being served: the presented order, each slot's
@@ -676,6 +807,45 @@ declare function contentHash(value: unknown): string;
676
807
  */
677
808
  declare function countWords(text: string): number;
678
809
 
810
+ /**
811
+ * The policy that restricts nothing: every setting `true`. It is what an absent
812
+ * policy resolves to, and it is exactly the behaviour the SDK had before
813
+ * delivery policies existed.
814
+ */
815
+ declare const OPEN_DELIVERY_POLICY: ResolvedDeliveryPolicy;
816
+ /**
817
+ * A policy with every setting spelled out — see {@link DeliveryPolicy}.
818
+ *
819
+ * Tolerant, because it runs where a learner is waiting: nothing here throws.
820
+ * A value it cannot read restricts rather than allows (see above), and a
821
+ * policy that is not an object at all restricts everything. Check a policy
822
+ * before you store it with {@link validateDeliveryPolicy}; `planAttempt` does.
823
+ */
824
+ declare function resolveDeliveryPolicy(policy: unknown): ResolvedDeliveryPolicy;
825
+ /**
826
+ * The strictest of several policies: a setting is on only where every one of
827
+ * them leaves it on. How a course's policy and an assessment's combine, and
828
+ * how a pager's policy wins over whatever a question it draws was handed.
829
+ */
830
+ declare function combineDeliveryPolicies(...policies: unknown[]): ResolvedDeliveryPolicy;
831
+ /**
832
+ * Checks a policy before it is stored: each setting `true`, `false`, `null`
833
+ * or absent, and nothing else — no misspelled setting, no string standing in
834
+ * for a boolean.
835
+ *
836
+ * Stricter than {@link resolveDeliveryPolicy} on purpose. A misspelled
837
+ * restriction (`hint: false`) is silently no restriction at all, and a
838
+ * policy is a record of the conditions a paper was sat under: it is worth
839
+ * refusing before it is written down, rather than read charitably after.
840
+ */
841
+ declare function validateDeliveryPolicy(policy: unknown): {
842
+ success: true;
843
+ data: DeliveryPolicy;
844
+ } | {
845
+ success: false;
846
+ issues: DeliveryPolicyIssue[];
847
+ };
848
+
679
849
  /** Thrown when activity data fails schema validation at a component boundary. */
680
850
  declare class ActivitySchemaError extends Error {
681
851
  readonly activityType: string;
@@ -1468,4 +1638,4 @@ interface ThemeTokens {
1468
1638
  '--lk-transition-base': string;
1469
1639
  }
1470
1640
 
1471
- export { AI_EXPLANATION_TYPES, AI_HINT_TYPES, AI_TEXT_MAX_LENGTH, ActivityData, ActivityDataMap, ActivityMedia, ActivitySchemaError, ActivityType, type ActivityTypeAuthoring, type ActivityTypeDescriptor, type ActivityTypeInterop, type ActivityTypeScoring, AiActivityInput, AiExplanationRequest, AiFeature, AiGrade, AiHintRequest, AiItemFacts, AiRefusal, AiSupportedActivityType, AiTextResult, AssessmentScore, type AttemptPlan, type AttemptPlanDrift, type AttemptPlanSlot, type AttemptProgress, type AttemptState, CompositionPolicy, 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, INTERACTIVE_VIDEO_ITEM_TYPES, type InteractiveVideoItemType, ItemGroup, ItemOutcome, LearnerResponse, type MediaBudgetRef, type MediaPlayClaim, type MediaPlayGrant, type MediaPlayLedger, type MediaPlayLedgerEntry, MediaProgress, type MissingOutcomePolicy, MultipleChoiceData, MultipleChoiceLearnerResponse, NativeControlHint, type PartialScoringResult, type PlanAttemptOptions, type PlannableEntry, ReadAloudData, ReadAloudLearnerResponse, type RedactOptions, type RedactedActivityData, type RedactedItemGroup, RedactedScoringError, type RegisteredActivityTypeDescriptor, type ResolvedPlaybackPolicy, type ResponseDiffEntry, RoundingPolicy, ScoredItem, ScoringDetail, ScoringResult, type SeededShuffleOptions, type Sensitivity, SequenceEntry, SequenceSlot, type ShuffleVersion, TIMELINE_MAX_CHAPTERS, TIMELINE_MAX_ITEMS, TIMELINE_MAX_QUIZZES, TIMELINE_MAX_TITLE_LENGTH, type ThemeTokens, UnknownActivityTypeError, ValidationError, WrittenResponseData, WrittenResponseLearnerResponse, type XAPIInteractionType, aiAllowedByContent, aiExplanationRequest, aiGradeOf, aiHintRequest, aiSupports, assertRedacted, assertRedactedItemGroup, buildAiFacts, canonicalJson, checkAiExplanation, checkAiHint, composeTimelineScore, contentHash, countWords, createDraft, createInteractiveVideoDraft, createItemGroupDraft, defineActivityType, dictationType, diffResponses, entryKeyOf, fillInTheBlanksType, fingerprint, flattenSequence, gapSelectType, getActivityTypeDescriptor, gradeFromRubric, hasGrade, hashSeed, hintRevealsAnswer, isInteractiveVideoItemType, isItemGroup, multipleChoiceType, outcomeFromGrade, planAttempt, planMediaBudgets, readAiTextResult, readAloudType, readMediaProgress, redact, redactItemGroup, registerActivityType, registeredActivityTypes, resolvePlaybackPolicy, restoreAttemptState, restoreMediaPlayLedger, scoredItemsFromPlan, seededShuffle, serializeAttemptState, serializeMediaPlayLedger, slotMediaKey, stimulusMediaKey, validateDraft, validateItemGroupDraft, verifyAttemptPlan, writtenResponseType };
1641
+ export { AI_EXPLANATION_TYPES, AI_HINT_TYPES, AI_TEXT_MAX_LENGTH, ActivityData, ActivityDataMap, ActivityMedia, ActivitySchemaError, ActivityType, type ActivityTypeAuthoring, type ActivityTypeDescriptor, type ActivityTypeInterop, type ActivityTypeScoring, AiActivityInput, AiExplanationRequest, AiFeature, AiGrade, AiHintRequest, AiItemFacts, AiRefusal, AiSupportedActivityType, AiTextResult, AssessmentScore, type AttemptPlan, type AttemptPlanDrift, type AttemptPlanSlot, type AttemptProgress, type AttemptState, CompositionPolicy, CriterionScore, DeferredScoringError, DeferredScoringPartial, type DeliveryPolicy, type DeliveryPolicyIssue, 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, INTERACTIVE_VIDEO_ITEM_TYPES, type InteractiveVideoItemType, ItemGroup, ItemOutcome, ItemScoringPolicy, LearnerResponse, type MediaBudgetRef, type MediaPlayClaim, type MediaPlayGrant, type MediaPlayLedger, type MediaPlayLedgerEntry, MediaProgress, type MissingOutcomePolicy, MultipleChoiceData, MultipleChoiceLearnerResponse, NativeControlHint, OPEN_DELIVERY_POLICY, type PartialScoringResult, type PlanAttemptOptions, type PlannableEntry, ReadAloudData, ReadAloudLearnerResponse, type RedactOptions, type RedactedActivityData, type RedactedItemGroup, RedactedScoringError, type RegisteredActivityTypeDescriptor, type ResolvedDeliveryPolicy, ResolvedItemScoringPolicy, type ResolvedPlaybackPolicy, type ResponseDiffEntry, RoundingPolicy, ScoredItem, ScoringDetail, ScoringResult, type SeededShuffleOptions, type Sensitivity, SequenceEntry, SequenceSlot, type ShuffleVersion, TIMELINE_MAX_CHAPTERS, TIMELINE_MAX_ITEMS, TIMELINE_MAX_QUIZZES, TIMELINE_MAX_TITLE_LENGTH, type ThemeTokens, UnknownActivityTypeError, ValidationError, WrittenResponseData, WrittenResponseLearnerResponse, type XAPIInteractionType, aiAllowedByContent, aiExplanationRequest, aiGradeOf, aiHintRequest, aiSupports, assertRedacted, assertRedactedItemGroup, buildAiFacts, canonicalJson, checkAiExplanation, checkAiHint, combineDeliveryPolicies, composeTimelineScore, contentHash, countWords, createDraft, createInteractiveVideoDraft, createItemGroupDraft, defineActivityType, dictationType, diffResponses, entryKeyOf, fillInTheBlanksType, fingerprint, flattenSequence, gapSelectType, getActivityTypeDescriptor, gradeFromRubric, hasGrade, hashSeed, hintRevealsAnswer, isInteractiveVideoItemType, isItemGroup, multipleChoiceType, outcomeFromGrade, planAttempt, planMediaBudgets, readAiTextResult, readAloudType, readMediaProgress, redact, redactItemGroup, registerActivityType, registeredActivityTypes, resolveDeliveryPolicy, resolvePlaybackPolicy, restoreAttemptState, restoreMediaPlayLedger, scoredItemsFromPlan, seededShuffle, serializeAttemptState, serializeMediaPlayLedger, slotMediaKey, stimulusMediaKey, validateDeliveryPolicy, validateDraft, validateItemGroupDraft, verifyAttemptPlan, writtenResponseType };