@intellectif/lk-core 0.18.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +62 -0
- package/README.md +3 -1
- package/dist/{activity-HH8dxN1v.d.cts → activity-f0bgZSTP.d.cts} +163 -141
- package/dist/{activity-HH8dxN1v.d.ts → activity-f0bgZSTP.d.ts} +163 -141
- package/dist/ai-check.cjs +283 -0
- package/dist/ai-check.cjs.map +1 -0
- package/dist/ai-check.d.cts +106 -0
- package/dist/ai-check.d.ts +106 -0
- package/dist/ai-check.js +283 -0
- package/dist/ai-check.js.map +1 -0
- package/dist/chunk-BIJCO2HM.js +443 -0
- package/dist/chunk-BIJCO2HM.js.map +1 -0
- package/dist/chunk-FVZJ4X3Y.cjs +443 -0
- package/dist/chunk-FVZJ4X3Y.cjs.map +1 -0
- package/dist/{index-DejnxQpK.d.cts → index-7S3-TLjT.d.cts} +1 -1
- package/dist/{index-BrBBUb1i.d.ts → index-BA9f2ydg.d.ts} +1 -1
- package/dist/index.cjs +165 -428
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +149 -5
- package/dist/index.d.ts +149 -5
- package/dist/index.js +167 -430
- package/dist/index.js.map +1 -1
- package/dist/schemas.d.cts +2 -2
- package/dist/schemas.d.ts +2 -2
- package/dist/scoring.d.cts +2 -2
- package/dist/scoring.d.ts +2 -2
- package/dist/xapi.d.cts +1 -1
- package/dist/xapi.d.ts +1 -1
- package/package.json +11 -1
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-
|
|
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-
|
|
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
3
|
import { ScoredItem, RoundingPolicy, CompositionPolicy, AssessmentScore } from './scoring.cjs';
|
|
4
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-
|
|
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-
|
|
5
|
+
import { a5 as SequenceSlot, a4 as SequenceEntry, I as ItemGroup, i as MediaProgress } from './index-7S3-TLjT.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-7S3-TLjT.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,12 @@ 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;
|
|
230
311
|
slots: AttemptPlanSlot[];
|
|
231
312
|
/** Sum of every slot's `points`, frozen. The denominator of the paper. */
|
|
232
313
|
totalPoints: number;
|
|
@@ -257,6 +338,16 @@ interface AttemptPlanDrift {
|
|
|
257
338
|
changedPointsSlotIds: string[];
|
|
258
339
|
/** Slots presented at a different position now than they were then. */
|
|
259
340
|
reorderedSlotIds: string[];
|
|
341
|
+
/**
|
|
342
|
+
* The delivery policy differs: one plan records a policy the other does not,
|
|
343
|
+
* or a setting differs. Not a change to any question, but a change to the
|
|
344
|
+
* conditions it was asked under — hints on in one, off in the other — so it
|
|
345
|
+
* breaks `matches` like any other difference.
|
|
346
|
+
*
|
|
347
|
+
* Present only when it is `true`, so a report between two plans without a
|
|
348
|
+
* policy has exactly the shape it had before policies existed.
|
|
349
|
+
*/
|
|
350
|
+
deliveryChanged?: true;
|
|
260
351
|
}
|
|
261
352
|
|
|
262
353
|
/** Options for {@link planAttempt}. */
|
|
@@ -281,6 +372,20 @@ interface PlanAttemptOptions<TItem> {
|
|
|
281
372
|
* number — a slot worth `NaN` points would poison the whole total.
|
|
282
373
|
*/
|
|
283
374
|
points?: (slot: SequenceSlot<TItem>) => number;
|
|
375
|
+
/**
|
|
376
|
+
* The delivery policy this attempt is sat under — whether hints were
|
|
377
|
+
* offered, whether AI help was, whether feedback and solutions showed.
|
|
378
|
+
* Frozen into the plan with every setting spelled out, so the record of the
|
|
379
|
+
* conditions a grade was earned under does not depend on today's defaults.
|
|
380
|
+
*
|
|
381
|
+
* Recorded only when given: a plan made without one is byte-identical to a
|
|
382
|
+
* plan made before policies existed, `planHash` included.
|
|
383
|
+
*
|
|
384
|
+
* @throws Error when the policy does not pass `validateDeliveryPolicy` —
|
|
385
|
+
* a misspelled restriction is no restriction, and a plan is the
|
|
386
|
+
* record an appeal reads.
|
|
387
|
+
*/
|
|
388
|
+
delivery?: DeliveryPolicy | null;
|
|
284
389
|
}
|
|
285
390
|
/**
|
|
286
391
|
* Freezes what an attempt is being served: the presented order, each slot's
|
|
@@ -676,6 +781,45 @@ declare function contentHash(value: unknown): string;
|
|
|
676
781
|
*/
|
|
677
782
|
declare function countWords(text: string): number;
|
|
678
783
|
|
|
784
|
+
/**
|
|
785
|
+
* The policy that restricts nothing: every setting `true`. It is what an absent
|
|
786
|
+
* policy resolves to, and it is exactly the behaviour the SDK had before
|
|
787
|
+
* delivery policies existed.
|
|
788
|
+
*/
|
|
789
|
+
declare const OPEN_DELIVERY_POLICY: ResolvedDeliveryPolicy;
|
|
790
|
+
/**
|
|
791
|
+
* A policy with every setting spelled out — see {@link DeliveryPolicy}.
|
|
792
|
+
*
|
|
793
|
+
* Tolerant, because it runs where a learner is waiting: nothing here throws.
|
|
794
|
+
* A value it cannot read restricts rather than allows (see above), and a
|
|
795
|
+
* policy that is not an object at all restricts everything. Check a policy
|
|
796
|
+
* before you store it with {@link validateDeliveryPolicy}; `planAttempt` does.
|
|
797
|
+
*/
|
|
798
|
+
declare function resolveDeliveryPolicy(policy: unknown): ResolvedDeliveryPolicy;
|
|
799
|
+
/**
|
|
800
|
+
* The strictest of several policies: a setting is on only where every one of
|
|
801
|
+
* them leaves it on. How a course's policy and an assessment's combine, and
|
|
802
|
+
* how a pager's policy wins over whatever a question it draws was handed.
|
|
803
|
+
*/
|
|
804
|
+
declare function combineDeliveryPolicies(...policies: unknown[]): ResolvedDeliveryPolicy;
|
|
805
|
+
/**
|
|
806
|
+
* Checks a policy before it is stored: each setting `true`, `false`, `null`
|
|
807
|
+
* or absent, and nothing else — no misspelled setting, no string standing in
|
|
808
|
+
* for a boolean.
|
|
809
|
+
*
|
|
810
|
+
* Stricter than {@link resolveDeliveryPolicy} on purpose. A misspelled
|
|
811
|
+
* restriction (`hint: false`) is silently no restriction at all, and a
|
|
812
|
+
* policy is a record of the conditions a paper was sat under: it is worth
|
|
813
|
+
* refusing before it is written down, rather than read charitably after.
|
|
814
|
+
*/
|
|
815
|
+
declare function validateDeliveryPolicy(policy: unknown): {
|
|
816
|
+
success: true;
|
|
817
|
+
data: DeliveryPolicy;
|
|
818
|
+
} | {
|
|
819
|
+
success: false;
|
|
820
|
+
issues: DeliveryPolicyIssue[];
|
|
821
|
+
};
|
|
822
|
+
|
|
679
823
|
/** Thrown when activity data fails schema validation at a component boundary. */
|
|
680
824
|
declare class ActivitySchemaError extends Error {
|
|
681
825
|
readonly activityType: string;
|
|
@@ -1468,4 +1612,4 @@ interface ThemeTokens {
|
|
|
1468
1612
|
'--lk-transition-base': string;
|
|
1469
1613
|
}
|
|
1470
1614
|
|
|
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 };
|
|
1615
|
+
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, 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, 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-
|
|
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-
|
|
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
3
|
import { ScoredItem, RoundingPolicy, CompositionPolicy, AssessmentScore } from './scoring.js';
|
|
4
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-
|
|
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-
|
|
5
|
+
import { a5 as SequenceSlot, a4 as SequenceEntry, I as ItemGroup, i as MediaProgress } from './index-BA9f2ydg.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-BA9f2ydg.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,12 @@ 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;
|
|
230
311
|
slots: AttemptPlanSlot[];
|
|
231
312
|
/** Sum of every slot's `points`, frozen. The denominator of the paper. */
|
|
232
313
|
totalPoints: number;
|
|
@@ -257,6 +338,16 @@ interface AttemptPlanDrift {
|
|
|
257
338
|
changedPointsSlotIds: string[];
|
|
258
339
|
/** Slots presented at a different position now than they were then. */
|
|
259
340
|
reorderedSlotIds: string[];
|
|
341
|
+
/**
|
|
342
|
+
* The delivery policy differs: one plan records a policy the other does not,
|
|
343
|
+
* or a setting differs. Not a change to any question, but a change to the
|
|
344
|
+
* conditions it was asked under — hints on in one, off in the other — so it
|
|
345
|
+
* breaks `matches` like any other difference.
|
|
346
|
+
*
|
|
347
|
+
* Present only when it is `true`, so a report between two plans without a
|
|
348
|
+
* policy has exactly the shape it had before policies existed.
|
|
349
|
+
*/
|
|
350
|
+
deliveryChanged?: true;
|
|
260
351
|
}
|
|
261
352
|
|
|
262
353
|
/** Options for {@link planAttempt}. */
|
|
@@ -281,6 +372,20 @@ interface PlanAttemptOptions<TItem> {
|
|
|
281
372
|
* number — a slot worth `NaN` points would poison the whole total.
|
|
282
373
|
*/
|
|
283
374
|
points?: (slot: SequenceSlot<TItem>) => number;
|
|
375
|
+
/**
|
|
376
|
+
* The delivery policy this attempt is sat under — whether hints were
|
|
377
|
+
* offered, whether AI help was, whether feedback and solutions showed.
|
|
378
|
+
* Frozen into the plan with every setting spelled out, so the record of the
|
|
379
|
+
* conditions a grade was earned under does not depend on today's defaults.
|
|
380
|
+
*
|
|
381
|
+
* Recorded only when given: a plan made without one is byte-identical to a
|
|
382
|
+
* plan made before policies existed, `planHash` included.
|
|
383
|
+
*
|
|
384
|
+
* @throws Error when the policy does not pass `validateDeliveryPolicy` —
|
|
385
|
+
* a misspelled restriction is no restriction, and a plan is the
|
|
386
|
+
* record an appeal reads.
|
|
387
|
+
*/
|
|
388
|
+
delivery?: DeliveryPolicy | null;
|
|
284
389
|
}
|
|
285
390
|
/**
|
|
286
391
|
* Freezes what an attempt is being served: the presented order, each slot's
|
|
@@ -676,6 +781,45 @@ declare function contentHash(value: unknown): string;
|
|
|
676
781
|
*/
|
|
677
782
|
declare function countWords(text: string): number;
|
|
678
783
|
|
|
784
|
+
/**
|
|
785
|
+
* The policy that restricts nothing: every setting `true`. It is what an absent
|
|
786
|
+
* policy resolves to, and it is exactly the behaviour the SDK had before
|
|
787
|
+
* delivery policies existed.
|
|
788
|
+
*/
|
|
789
|
+
declare const OPEN_DELIVERY_POLICY: ResolvedDeliveryPolicy;
|
|
790
|
+
/**
|
|
791
|
+
* A policy with every setting spelled out — see {@link DeliveryPolicy}.
|
|
792
|
+
*
|
|
793
|
+
* Tolerant, because it runs where a learner is waiting: nothing here throws.
|
|
794
|
+
* A value it cannot read restricts rather than allows (see above), and a
|
|
795
|
+
* policy that is not an object at all restricts everything. Check a policy
|
|
796
|
+
* before you store it with {@link validateDeliveryPolicy}; `planAttempt` does.
|
|
797
|
+
*/
|
|
798
|
+
declare function resolveDeliveryPolicy(policy: unknown): ResolvedDeliveryPolicy;
|
|
799
|
+
/**
|
|
800
|
+
* The strictest of several policies: a setting is on only where every one of
|
|
801
|
+
* them leaves it on. How a course's policy and an assessment's combine, and
|
|
802
|
+
* how a pager's policy wins over whatever a question it draws was handed.
|
|
803
|
+
*/
|
|
804
|
+
declare function combineDeliveryPolicies(...policies: unknown[]): ResolvedDeliveryPolicy;
|
|
805
|
+
/**
|
|
806
|
+
* Checks a policy before it is stored: each setting `true`, `false`, `null`
|
|
807
|
+
* or absent, and nothing else — no misspelled setting, no string standing in
|
|
808
|
+
* for a boolean.
|
|
809
|
+
*
|
|
810
|
+
* Stricter than {@link resolveDeliveryPolicy} on purpose. A misspelled
|
|
811
|
+
* restriction (`hint: false`) is silently no restriction at all, and a
|
|
812
|
+
* policy is a record of the conditions a paper was sat under: it is worth
|
|
813
|
+
* refusing before it is written down, rather than read charitably after.
|
|
814
|
+
*/
|
|
815
|
+
declare function validateDeliveryPolicy(policy: unknown): {
|
|
816
|
+
success: true;
|
|
817
|
+
data: DeliveryPolicy;
|
|
818
|
+
} | {
|
|
819
|
+
success: false;
|
|
820
|
+
issues: DeliveryPolicyIssue[];
|
|
821
|
+
};
|
|
822
|
+
|
|
679
823
|
/** Thrown when activity data fails schema validation at a component boundary. */
|
|
680
824
|
declare class ActivitySchemaError extends Error {
|
|
681
825
|
readonly activityType: string;
|
|
@@ -1468,4 +1612,4 @@ interface ThemeTokens {
|
|
|
1468
1612
|
'--lk-transition-base': string;
|
|
1469
1613
|
}
|
|
1470
1614
|
|
|
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 };
|
|
1615
|
+
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, 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, 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 };
|