@intellectif/lk-core 0.16.0 → 0.18.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 (48) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/README.md +2 -2
  3. package/dist/{activity-DcxtpX7Z.d.cts → activity-HH8dxN1v.d.cts} +234 -4
  4. package/dist/{activity-DcxtpX7Z.d.ts → activity-HH8dxN1v.d.ts} +234 -4
  5. package/dist/{chunk-FJJ2GVBA.cjs → chunk-2CV6NU32.cjs} +19 -19
  6. package/dist/{chunk-FJJ2GVBA.cjs.map → chunk-2CV6NU32.cjs.map} +1 -1
  7. package/dist/{chunk-6P6XK2LI.cjs → chunk-COBK2RUX.cjs} +74 -39
  8. package/dist/chunk-COBK2RUX.cjs.map +1 -0
  9. package/dist/{chunk-IRUD73IQ.js → chunk-D3GP5MET.js} +683 -638
  10. package/dist/chunk-D3GP5MET.js.map +1 -0
  11. package/dist/{chunk-F7UOLKWV.cjs → chunk-D4TOPSHV.cjs} +518 -473
  12. package/dist/chunk-D4TOPSHV.cjs.map +1 -0
  13. package/dist/{chunk-VFTVZJO5.cjs → chunk-EOFWSGLU.cjs} +4 -4
  14. package/dist/{chunk-VFTVZJO5.cjs.map → chunk-EOFWSGLU.cjs.map} +1 -1
  15. package/dist/{chunk-S63IOKFP.js → chunk-MMEQKFFQ.js} +44 -9
  16. package/dist/chunk-MMEQKFFQ.js.map +1 -0
  17. package/dist/{chunk-OXF7VT7S.js → chunk-X5DAXBJI.js} +2 -2
  18. package/dist/{chunk-GOZGBVJP.js → chunk-Z7QQZ53L.js} +2 -2
  19. package/dist/{chunk-GOZGBVJP.js.map → chunk-Z7QQZ53L.js.map} +1 -1
  20. package/dist/{index-DRJqwO2y.d.ts → index-BrBBUb1i.d.ts} +141 -83
  21. package/dist/{index-BWpwZRQw.d.cts → index-DejnxQpK.d.cts} +141 -83
  22. package/dist/index.cjs +547 -127
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.d.cts +145 -9
  25. package/dist/index.d.ts +145 -9
  26. package/dist/index.js +427 -7
  27. package/dist/index.js.map +1 -1
  28. package/dist/schemas.cjs +5 -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 +4 -2
  33. package/dist/scoring.cjs +3 -3
  34. package/dist/scoring.d.cts +33 -5
  35. package/dist/scoring.d.ts +33 -5
  36. package/dist/scoring.js +2 -2
  37. package/dist/xapi.cjs +3 -3
  38. package/dist/xapi.d.cts +1 -1
  39. package/dist/xapi.d.ts +1 -1
  40. package/dist/xapi.js +2 -2
  41. package/package.json +1 -1
  42. package/vectors/README.md +9 -3
  43. package/vectors/scoring.json +1258 -10
  44. package/dist/chunk-6P6XK2LI.cjs.map +0 -1
  45. package/dist/chunk-F7UOLKWV.cjs.map +0 -1
  46. package/dist/chunk-IRUD73IQ.js.map +0 -1
  47. package/dist/chunk-S63IOKFP.js.map +0 -1
  48. /package/dist/{chunk-OXF7VT7S.js.map → chunk-X5DAXBJI.js.map} +0 -0
package/dist/index.d.cts CHANGED
@@ -1,12 +1,133 @@
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-HH8dxN1v.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-HH8dxN1v.cjs';
1
3
  import { ScoredItem, RoundingPolicy, CompositionPolicy, AssessmentScore } from './scoring.cjs';
2
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';
3
- import { x as ItemOutcome, A as ActivityData, L as LearnerResponse, _ as ValidationError, e as ActivityType, a as ActivityDataMap, C as CriterionScore, q as GradeRecord, N as NativeControlHint, c as ActivityMedia, X as ScoringResult, f as DeferredScoringPartial, g as DictationData, i as DictationLearnerResponse, F as FillInTheBlanksData, l as FillInTheBlanksLearnerResponse, n as GapSelectData, p as GapSelectLearnerResponse, E as MultipleChoiceData, H as MultipleChoiceLearnerResponse, R as ReadAloudData, Q as ReadAloudLearnerResponse, a0 as WrittenResponseData, a1 as WrittenResponseLearnerResponse } from './activity-DcxtpX7Z.cjs';
4
- export { b as ActivityFeedback, d as ActivityResult, B as BlankConfig, D as DeferredReason, h as DictationEquivalence, j as DictationSlowMedia, k as DictationTolerance, G as GapSelectBank, m as GapSelectChoice, o as GapSelectGap, r as Grader, s as GraderKind, t as GraderUsage, u as GradingState, I as InlineCorrection, v as InteractionEvent, w as InteractionKind, y as LearnerResponseMap, M as MediaPlaybackPolicy, z as MediaTrack, J as MultipleChoiceOption, K as MultipleChoiceOptionMedia, O as ReadAloudDimension, P as ReadAloudDimensionWeight, S as ReadAloudSlowMedia, T as RecordingBounds, U as RecordingRef, V as ScoringDetail, W as ScoringOutcome, Y as TextMatchPolicy, Z as TextMatchResult, $ as ValidationResult, a2 as WrittenResponseRubric, a3 as WrittenResponseRubricCriterion, a4 as XAPIActor, a5 as XAPIConfig, a6 as XAPIContext, a7 as XAPIContextActivities, a8 as XAPIError, a9 as XAPIObject, aa as XAPIResult, ab as XAPIScore, ac as XAPIStatement, ad as XAPIVerbObject, ae as levenshteinDistance, af as matchText } from './activity-DcxtpX7Z.cjs';
5
- import { a4 as SequenceSlot, a3 as SequenceEntry, I as ItemGroup, i as MediaProgress } from './index-BWpwZRQw.cjs';
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, 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, A as RedactedFillInTheBlanksDataSchema, C as RedactedGapSelectBank, E as RedactedGapSelectBankSchema, H as RedactedGapSelectChoice, J as RedactedGapSelectChoiceSchema, K as RedactedGapSelectData, L as RedactedGapSelectDataSchema, O as RedactedGapSelectGap, P as RedactedGapSelectGapSchema, Q as RedactedItemGroupSchema, S as RedactedMediaSchema, T as RedactedMultipleChoiceData, U as RedactedMultipleChoiceDataSchema, V as RedactedMultipleChoiceOption, W as RedactedMultipleChoiceOptionMedia, X as RedactedMultipleChoiceOptionMediaSchema, Y as RedactedMultipleChoiceOptionSchema, Z as RedactedReadAloudData, _ as RedactedReadAloudDataSchema, $ as RedactedStimulus, a0 as RedactedStimulusSchema, a1 as RedactedWrittenResponseData, a2 as RedactedWrittenResponseDataSchema, a5 as SequenceSlotGroup, a6 as Stimulus, a7 as StimulusKind, a8 as StimulusSchema, a9 as TextMatchPolicySchema, aa as TimelineChapter, ab as TimelineChapterSchema, ac as TimelineCue, ad as TimelineCueSchema, ae as WrittenResponseDataSchema, af as WrittenResponseRubricCriterionSchema, ag as WrittenResponseRubricSchema, ah as dictationJsonSchema, ai as fillInTheBlanksJsonSchema, aj as gapSelectJsonSchema, ak as itemGroupJsonSchema, al as jsonSchemaFor, am as multipleChoiceJsonSchema, an as readAloudJsonSchema, ao as stimulusJsonSchema, ap as validateActivity, aq as validateItemGroup, ar as writtenResponseJsonSchema } from './index-BWpwZRQw.cjs';
5
+ import { a5 as SequenceSlot, a4 as SequenceEntry, I as ItemGroup, i as MediaProgress } from './index-DejnxQpK.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-DejnxQpK.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
 
10
+ /**
11
+ * The activity types the SDK builds facts for, and which of them take hints.
12
+ * A dictation takes none: its answer is the whole sentence, and it has
13
+ * word-by-word hints of its own.
14
+ */
15
+ declare const AI_EXPLANATION_TYPES: readonly AiSupportedActivityType[];
16
+ declare const AI_HINT_TYPES: readonly AiSupportedActivityType[];
17
+ /** The longest AI text shown, in code points. Longer is refused, not cut. */
18
+ declare const AI_TEXT_MAX_LENGTH = 2000;
19
+ /**
20
+ * Whether the SDK supports `feature` for this activity type. A type it builds
21
+ * no facts for — a written response, a read-aloud, a consumer's own — has
22
+ * neither.
23
+ */
24
+ declare function aiSupports(activityType: string, feature: AiFeature): boolean;
25
+ /**
26
+ * Whether the item's author allows `feature`. Only an explicit `false`
27
+ * switches it off: an author can refuse a feature, never force one on.
28
+ */
29
+ declare function aiAllowedByContent(data: AiActivityInput, feature: AiFeature): boolean;
30
+ /** A grade as an explanation must speak to it: all marks, some, or none. */
31
+ declare function aiGradeOf(result: {
32
+ score: number;
33
+ maxScore: number;
34
+ passed: boolean;
35
+ }): AiGrade;
36
+ /**
37
+ * The facts a model is given about one item and one answer. `details` are the
38
+ * SDK's per-part verdicts — from its own scorer, or from a server's outcome in
39
+ * review — and every `correct` is `null` without them. A redacted item yields
40
+ * facts without a key, which is what the learner's side holds; a port that
41
+ * needs the key loads the item on its server.
42
+ *
43
+ * `null` for a type the SDK builds no facts for.
44
+ */
45
+ declare function buildAiFacts(data: AiActivityInput, response: LearnerResponse | null, details: readonly ScoringDetail[] | null): AiItemFacts | null;
46
+ /**
47
+ * The request for an explanation of `response`, or `null` when there is none
48
+ * to give: an unsupported type, an author who switched explanations off,
49
+ * nothing graded to explain, or a grade of record that cannot be a grade.
50
+ *
51
+ * A scored `outcome` — the grade of record a review shows — wins over grading
52
+ * locally, so the explanation speaks to the grade on the screen. One whose
53
+ * numbers cannot be a grade (the rule `outcomeFromGrade` applies: `maxScore`
54
+ * positive and finite, `score` finite from 0 to it) gets no explanation at all:
55
+ * explaining 85 "out of 1" would tell the model a wrong answer was correct, and
56
+ * grading locally instead would speak to a grade the screen does not show.
57
+ */
58
+ declare function aiExplanationRequest(input: {
59
+ data: AiActivityInput;
60
+ response: LearnerResponse | null;
61
+ outcome?: ItemOutcome;
62
+ learnerLocale?: string;
63
+ }): AiExplanationRequest | null;
64
+ /**
65
+ * The request for the next hint on an unsubmitted answer, or `null` when
66
+ * there is none to give: an unsupported type, an author who switched hints
67
+ * off, or a redacted item — hints are for practice, where the item is whole.
68
+ *
69
+ * The facts carry the key, and which parts the learner has right so far, so a
70
+ * model can hint where it helps. The learner never sees them; a hint that
71
+ * contains an answer is refused by {@link checkAiHint}.
72
+ */
73
+ declare function aiHintRequest(input: {
74
+ data: AiActivityInput;
75
+ response: LearnerResponse | null;
76
+ previousHints: readonly string[];
77
+ learnerLocale?: string;
78
+ }): AiHintRequest | null;
79
+ /**
80
+ * Reads what a port returned. Anything but an object with a string `text` is
81
+ * `malformed`; text that is empty once cleaned, or longer than
82
+ * {@link AI_TEXT_MAX_LENGTH}, is refused rather than shown or cut.
83
+ */
84
+ declare function readAiTextResult(raw: unknown): {
85
+ ok: true;
86
+ result: AiTextResult;
87
+ } | {
88
+ ok: false;
89
+ refusal: AiRefusal;
90
+ };
91
+ /**
92
+ * Checks an explanation a port returned for `request`. On top of
93
+ * {@link readAiTextResult}: an explanation that states a verdict other than
94
+ * the SDK's grade is refused (`contradicts-grade`) — it explains an answer
95
+ * the learner did not get.
96
+ */
97
+ declare function checkAiExplanation(raw: unknown, request: AiExplanationRequest): {
98
+ ok: true;
99
+ result: AiTextResult;
100
+ } | {
101
+ ok: false;
102
+ refusal: AiRefusal;
103
+ };
104
+ /**
105
+ * Checks a hint a port returned for `request`. On top of
106
+ * {@link readAiTextResult}: a hint that contains an answer is refused
107
+ * (`reveals-answer`) — see {@link hintRevealsAnswer}.
108
+ */
109
+ declare function checkAiHint(raw: unknown, request: AiHintRequest): {
110
+ ok: true;
111
+ result: AiTextResult;
112
+ } | {
113
+ ok: false;
114
+ refusal: AiRefusal;
115
+ };
116
+ /**
117
+ * Whether a hint gives away an answer, judged against the facts it was asked
118
+ * for. It is a floor, not a proof: it finds an answer written out, not one
119
+ * spelled letter by letter or described.
120
+ *
121
+ * - **Multiple choice:** the text of any correct option, as whole words.
122
+ * - **Fill-in-the-blanks and gap select:** any accepted answer, as whole words.
123
+ * An answer of one short word ("is", "the") counts only where the hint
124
+ * writes it beside a neighbour it has in the passage — "name is", "is
125
+ * Rossi" — so a hint may still use the word on its own.
126
+ *
127
+ * Case, accents and punctuation are ignored on both sides.
128
+ */
129
+ declare function hintRevealsAnswer(facts: AiItemFacts, hint: string): boolean;
130
+
10
131
  /**
11
132
  * The frozen record of what one attempt was served.
12
133
  *
@@ -626,10 +747,12 @@ interface GradeFromRubricOptions {
626
747
  * total a pure function of the judgements, so a grade can be recomputed and
627
748
  * audited years later.
628
749
  *
629
- * Weights are normalised by their sum, so they need not add to 1. Criteria
630
- * marked `notApplicable`, and those carrying no numeric `score` (a purely
631
- * banded judgement), are excluded from both numerator and denominator. When
632
- * nothing scoreable remains the result is `unscorable`, never a zero.
750
+ * Weights are normalised by their sum, so they need not add to 1; each must be
751
+ * zero or more, and their sum a positive, finite number, or the result is
752
+ * `unscorable`. Criteria marked `notApplicable`, and those carrying no numeric
753
+ * `score` (a purely banded judgement), are excluded from both numerator and
754
+ * denominator, weight included. When nothing scoreable remains the result is
755
+ * `unscorable`, never a zero.
633
756
  *
634
757
  * Scores need not be in [0,1]: set `maxScore` on a criterion to declare what
635
758
  * its score is out of, and each is normalised before weighting. A grader
@@ -654,6 +777,19 @@ declare function gradeFromRubric(criteria: readonly CriterionScore[], activityDa
654
777
  * a grade that arrived asynchronously renders through the same path as a
655
778
  * synchronously scored item. The score/passed/feedback fields are mirrored
656
779
  * onto the outcome for uniform reads; `grade` carries the full record.
780
+ *
781
+ * A record whose numbers cannot be a grade is refused, as `evaluate` refuses a
782
+ * non-finite score and {@link gradeFromRubric} one outside [0,1]. `maxScore`
783
+ * must be a positive, finite number and `score` a finite number from 0 to it (a
784
+ * hair above, one part in a billion, is float noise and passes as it is).
785
+ * Anything else — NaN, 85 "out of 1", a score out of 0 — comes back as
786
+ * `{ status: 'deferred', reason: 'grade_rejected', maxScore: 1, rejectedGrade }`
787
+ * with the record kept verbatim. Not `graded`, or its `passed` would be read as
788
+ * a verdict; not `unscorable`, which `composeAssessmentScore` drops from the
789
+ * denominator while letting the attempt go final — so a failing grade on the
790
+ * wrong scale would vanish and the rest would be recorded as a pass. Deferred
791
+ * is what it is: the slot is still owed a real grade, so a composed attempt
792
+ * stays `provisional` and names the slot in `rejectedSlotIds`.
657
793
  */
658
794
  declare function outcomeFromGrade(grade: GradeRecord): ItemOutcome;
659
795
  /**
@@ -1332,4 +1468,4 @@ interface ThemeTokens {
1332
1468
  '--lk-transition-base': string;
1333
1469
  }
1334
1470
 
1335
- export { ActivityData, ActivityDataMap, ActivityMedia, ActivitySchemaError, ActivityType, type ActivityTypeAuthoring, type ActivityTypeDescriptor, type ActivityTypeInterop, type ActivityTypeScoring, 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, 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, assertRedacted, assertRedactedItemGroup, canonicalJson, composeTimelineScore, contentHash, countWords, createDraft, createInteractiveVideoDraft, createItemGroupDraft, defineActivityType, dictationType, diffResponses, entryKeyOf, fillInTheBlanksType, fingerprint, flattenSequence, gapSelectType, getActivityTypeDescriptor, gradeFromRubric, hasGrade, hashSeed, isInteractiveVideoItemType, isItemGroup, multipleChoiceType, outcomeFromGrade, planAttempt, planMediaBudgets, readAloudType, readMediaProgress, redact, redactItemGroup, registerActivityType, registeredActivityTypes, resolvePlaybackPolicy, restoreAttemptState, restoreMediaPlayLedger, scoredItemsFromPlan, seededShuffle, serializeAttemptState, serializeMediaPlayLedger, slotMediaKey, stimulusMediaKey, validateDraft, validateItemGroupDraft, verifyAttemptPlan, writtenResponseType };
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 };
package/dist/index.d.ts CHANGED
@@ -1,12 +1,133 @@
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-HH8dxN1v.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-HH8dxN1v.js';
1
3
  import { ScoredItem, RoundingPolicy, CompositionPolicy, AssessmentScore } from './scoring.js';
2
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';
3
- import { x as ItemOutcome, A as ActivityData, L as LearnerResponse, _ as ValidationError, e as ActivityType, a as ActivityDataMap, C as CriterionScore, q as GradeRecord, N as NativeControlHint, c as ActivityMedia, X as ScoringResult, f as DeferredScoringPartial, g as DictationData, i as DictationLearnerResponse, F as FillInTheBlanksData, l as FillInTheBlanksLearnerResponse, n as GapSelectData, p as GapSelectLearnerResponse, E as MultipleChoiceData, H as MultipleChoiceLearnerResponse, R as ReadAloudData, Q as ReadAloudLearnerResponse, a0 as WrittenResponseData, a1 as WrittenResponseLearnerResponse } from './activity-DcxtpX7Z.js';
4
- export { b as ActivityFeedback, d as ActivityResult, B as BlankConfig, D as DeferredReason, h as DictationEquivalence, j as DictationSlowMedia, k as DictationTolerance, G as GapSelectBank, m as GapSelectChoice, o as GapSelectGap, r as Grader, s as GraderKind, t as GraderUsage, u as GradingState, I as InlineCorrection, v as InteractionEvent, w as InteractionKind, y as LearnerResponseMap, M as MediaPlaybackPolicy, z as MediaTrack, J as MultipleChoiceOption, K as MultipleChoiceOptionMedia, O as ReadAloudDimension, P as ReadAloudDimensionWeight, S as ReadAloudSlowMedia, T as RecordingBounds, U as RecordingRef, V as ScoringDetail, W as ScoringOutcome, Y as TextMatchPolicy, Z as TextMatchResult, $ as ValidationResult, a2 as WrittenResponseRubric, a3 as WrittenResponseRubricCriterion, a4 as XAPIActor, a5 as XAPIConfig, a6 as XAPIContext, a7 as XAPIContextActivities, a8 as XAPIError, a9 as XAPIObject, aa as XAPIResult, ab as XAPIScore, ac as XAPIStatement, ad as XAPIVerbObject, ae as levenshteinDistance, af as matchText } from './activity-DcxtpX7Z.js';
5
- import { a4 as SequenceSlot, a3 as SequenceEntry, I as ItemGroup, i as MediaProgress } from './index-DRJqwO2y.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, 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, A as RedactedFillInTheBlanksDataSchema, C as RedactedGapSelectBank, E as RedactedGapSelectBankSchema, H as RedactedGapSelectChoice, J as RedactedGapSelectChoiceSchema, K as RedactedGapSelectData, L as RedactedGapSelectDataSchema, O as RedactedGapSelectGap, P as RedactedGapSelectGapSchema, Q as RedactedItemGroupSchema, S as RedactedMediaSchema, T as RedactedMultipleChoiceData, U as RedactedMultipleChoiceDataSchema, V as RedactedMultipleChoiceOption, W as RedactedMultipleChoiceOptionMedia, X as RedactedMultipleChoiceOptionMediaSchema, Y as RedactedMultipleChoiceOptionSchema, Z as RedactedReadAloudData, _ as RedactedReadAloudDataSchema, $ as RedactedStimulus, a0 as RedactedStimulusSchema, a1 as RedactedWrittenResponseData, a2 as RedactedWrittenResponseDataSchema, a5 as SequenceSlotGroup, a6 as Stimulus, a7 as StimulusKind, a8 as StimulusSchema, a9 as TextMatchPolicySchema, aa as TimelineChapter, ab as TimelineChapterSchema, ac as TimelineCue, ad as TimelineCueSchema, ae as WrittenResponseDataSchema, af as WrittenResponseRubricCriterionSchema, ag as WrittenResponseRubricSchema, ah as dictationJsonSchema, ai as fillInTheBlanksJsonSchema, aj as gapSelectJsonSchema, ak as itemGroupJsonSchema, al as jsonSchemaFor, am as multipleChoiceJsonSchema, an as readAloudJsonSchema, ao as stimulusJsonSchema, ap as validateActivity, aq as validateItemGroup, ar as writtenResponseJsonSchema } from './index-DRJqwO2y.js';
5
+ import { a5 as SequenceSlot, a4 as SequenceEntry, I as ItemGroup, i as MediaProgress } from './index-BrBBUb1i.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-BrBBUb1i.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
 
10
+ /**
11
+ * The activity types the SDK builds facts for, and which of them take hints.
12
+ * A dictation takes none: its answer is the whole sentence, and it has
13
+ * word-by-word hints of its own.
14
+ */
15
+ declare const AI_EXPLANATION_TYPES: readonly AiSupportedActivityType[];
16
+ declare const AI_HINT_TYPES: readonly AiSupportedActivityType[];
17
+ /** The longest AI text shown, in code points. Longer is refused, not cut. */
18
+ declare const AI_TEXT_MAX_LENGTH = 2000;
19
+ /**
20
+ * Whether the SDK supports `feature` for this activity type. A type it builds
21
+ * no facts for — a written response, a read-aloud, a consumer's own — has
22
+ * neither.
23
+ */
24
+ declare function aiSupports(activityType: string, feature: AiFeature): boolean;
25
+ /**
26
+ * Whether the item's author allows `feature`. Only an explicit `false`
27
+ * switches it off: an author can refuse a feature, never force one on.
28
+ */
29
+ declare function aiAllowedByContent(data: AiActivityInput, feature: AiFeature): boolean;
30
+ /** A grade as an explanation must speak to it: all marks, some, or none. */
31
+ declare function aiGradeOf(result: {
32
+ score: number;
33
+ maxScore: number;
34
+ passed: boolean;
35
+ }): AiGrade;
36
+ /**
37
+ * The facts a model is given about one item and one answer. `details` are the
38
+ * SDK's per-part verdicts — from its own scorer, or from a server's outcome in
39
+ * review — and every `correct` is `null` without them. A redacted item yields
40
+ * facts without a key, which is what the learner's side holds; a port that
41
+ * needs the key loads the item on its server.
42
+ *
43
+ * `null` for a type the SDK builds no facts for.
44
+ */
45
+ declare function buildAiFacts(data: AiActivityInput, response: LearnerResponse | null, details: readonly ScoringDetail[] | null): AiItemFacts | null;
46
+ /**
47
+ * The request for an explanation of `response`, or `null` when there is none
48
+ * to give: an unsupported type, an author who switched explanations off,
49
+ * nothing graded to explain, or a grade of record that cannot be a grade.
50
+ *
51
+ * A scored `outcome` — the grade of record a review shows — wins over grading
52
+ * locally, so the explanation speaks to the grade on the screen. One whose
53
+ * numbers cannot be a grade (the rule `outcomeFromGrade` applies: `maxScore`
54
+ * positive and finite, `score` finite from 0 to it) gets no explanation at all:
55
+ * explaining 85 "out of 1" would tell the model a wrong answer was correct, and
56
+ * grading locally instead would speak to a grade the screen does not show.
57
+ */
58
+ declare function aiExplanationRequest(input: {
59
+ data: AiActivityInput;
60
+ response: LearnerResponse | null;
61
+ outcome?: ItemOutcome;
62
+ learnerLocale?: string;
63
+ }): AiExplanationRequest | null;
64
+ /**
65
+ * The request for the next hint on an unsubmitted answer, or `null` when
66
+ * there is none to give: an unsupported type, an author who switched hints
67
+ * off, or a redacted item — hints are for practice, where the item is whole.
68
+ *
69
+ * The facts carry the key, and which parts the learner has right so far, so a
70
+ * model can hint where it helps. The learner never sees them; a hint that
71
+ * contains an answer is refused by {@link checkAiHint}.
72
+ */
73
+ declare function aiHintRequest(input: {
74
+ data: AiActivityInput;
75
+ response: LearnerResponse | null;
76
+ previousHints: readonly string[];
77
+ learnerLocale?: string;
78
+ }): AiHintRequest | null;
79
+ /**
80
+ * Reads what a port returned. Anything but an object with a string `text` is
81
+ * `malformed`; text that is empty once cleaned, or longer than
82
+ * {@link AI_TEXT_MAX_LENGTH}, is refused rather than shown or cut.
83
+ */
84
+ declare function readAiTextResult(raw: unknown): {
85
+ ok: true;
86
+ result: AiTextResult;
87
+ } | {
88
+ ok: false;
89
+ refusal: AiRefusal;
90
+ };
91
+ /**
92
+ * Checks an explanation a port returned for `request`. On top of
93
+ * {@link readAiTextResult}: an explanation that states a verdict other than
94
+ * the SDK's grade is refused (`contradicts-grade`) — it explains an answer
95
+ * the learner did not get.
96
+ */
97
+ declare function checkAiExplanation(raw: unknown, request: AiExplanationRequest): {
98
+ ok: true;
99
+ result: AiTextResult;
100
+ } | {
101
+ ok: false;
102
+ refusal: AiRefusal;
103
+ };
104
+ /**
105
+ * Checks a hint a port returned for `request`. On top of
106
+ * {@link readAiTextResult}: a hint that contains an answer is refused
107
+ * (`reveals-answer`) — see {@link hintRevealsAnswer}.
108
+ */
109
+ declare function checkAiHint(raw: unknown, request: AiHintRequest): {
110
+ ok: true;
111
+ result: AiTextResult;
112
+ } | {
113
+ ok: false;
114
+ refusal: AiRefusal;
115
+ };
116
+ /**
117
+ * Whether a hint gives away an answer, judged against the facts it was asked
118
+ * for. It is a floor, not a proof: it finds an answer written out, not one
119
+ * spelled letter by letter or described.
120
+ *
121
+ * - **Multiple choice:** the text of any correct option, as whole words.
122
+ * - **Fill-in-the-blanks and gap select:** any accepted answer, as whole words.
123
+ * An answer of one short word ("is", "the") counts only where the hint
124
+ * writes it beside a neighbour it has in the passage — "name is", "is
125
+ * Rossi" — so a hint may still use the word on its own.
126
+ *
127
+ * Case, accents and punctuation are ignored on both sides.
128
+ */
129
+ declare function hintRevealsAnswer(facts: AiItemFacts, hint: string): boolean;
130
+
10
131
  /**
11
132
  * The frozen record of what one attempt was served.
12
133
  *
@@ -626,10 +747,12 @@ interface GradeFromRubricOptions {
626
747
  * total a pure function of the judgements, so a grade can be recomputed and
627
748
  * audited years later.
628
749
  *
629
- * Weights are normalised by their sum, so they need not add to 1. Criteria
630
- * marked `notApplicable`, and those carrying no numeric `score` (a purely
631
- * banded judgement), are excluded from both numerator and denominator. When
632
- * nothing scoreable remains the result is `unscorable`, never a zero.
750
+ * Weights are normalised by their sum, so they need not add to 1; each must be
751
+ * zero or more, and their sum a positive, finite number, or the result is
752
+ * `unscorable`. Criteria marked `notApplicable`, and those carrying no numeric
753
+ * `score` (a purely banded judgement), are excluded from both numerator and
754
+ * denominator, weight included. When nothing scoreable remains the result is
755
+ * `unscorable`, never a zero.
633
756
  *
634
757
  * Scores need not be in [0,1]: set `maxScore` on a criterion to declare what
635
758
  * its score is out of, and each is normalised before weighting. A grader
@@ -654,6 +777,19 @@ declare function gradeFromRubric(criteria: readonly CriterionScore[], activityDa
654
777
  * a grade that arrived asynchronously renders through the same path as a
655
778
  * synchronously scored item. The score/passed/feedback fields are mirrored
656
779
  * onto the outcome for uniform reads; `grade` carries the full record.
780
+ *
781
+ * A record whose numbers cannot be a grade is refused, as `evaluate` refuses a
782
+ * non-finite score and {@link gradeFromRubric} one outside [0,1]. `maxScore`
783
+ * must be a positive, finite number and `score` a finite number from 0 to it (a
784
+ * hair above, one part in a billion, is float noise and passes as it is).
785
+ * Anything else — NaN, 85 "out of 1", a score out of 0 — comes back as
786
+ * `{ status: 'deferred', reason: 'grade_rejected', maxScore: 1, rejectedGrade }`
787
+ * with the record kept verbatim. Not `graded`, or its `passed` would be read as
788
+ * a verdict; not `unscorable`, which `composeAssessmentScore` drops from the
789
+ * denominator while letting the attempt go final — so a failing grade on the
790
+ * wrong scale would vanish and the rest would be recorded as a pass. Deferred
791
+ * is what it is: the slot is still owed a real grade, so a composed attempt
792
+ * stays `provisional` and names the slot in `rejectedSlotIds`.
657
793
  */
658
794
  declare function outcomeFromGrade(grade: GradeRecord): ItemOutcome;
659
795
  /**
@@ -1332,4 +1468,4 @@ interface ThemeTokens {
1332
1468
  '--lk-transition-base': string;
1333
1469
  }
1334
1470
 
1335
- export { ActivityData, ActivityDataMap, ActivityMedia, ActivitySchemaError, ActivityType, type ActivityTypeAuthoring, type ActivityTypeDescriptor, type ActivityTypeInterop, type ActivityTypeScoring, 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, 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, assertRedacted, assertRedactedItemGroup, canonicalJson, composeTimelineScore, contentHash, countWords, createDraft, createInteractiveVideoDraft, createItemGroupDraft, defineActivityType, dictationType, diffResponses, entryKeyOf, fillInTheBlanksType, fingerprint, flattenSequence, gapSelectType, getActivityTypeDescriptor, gradeFromRubric, hasGrade, hashSeed, isInteractiveVideoItemType, isItemGroup, multipleChoiceType, outcomeFromGrade, planAttempt, planMediaBudgets, readAloudType, readMediaProgress, redact, redactItemGroup, registerActivityType, registeredActivityTypes, resolvePlaybackPolicy, restoreAttemptState, restoreMediaPlayLedger, scoredItemsFromPlan, seededShuffle, serializeAttemptState, serializeMediaPlayLedger, slotMediaKey, stimulusMediaKey, validateDraft, validateItemGroupDraft, verifyAttemptPlan, writtenResponseType };
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 };