@intellectif/lk-react 14.0.0 → 15.0.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 +49 -0
- package/README.md +5 -2
- package/dist/{WrittenResponse-pB1ik8hg.d.cts → WrittenResponse-BPbhERgk.d.cts} +1 -1
- package/dist/{WrittenResponse-C0P34En1.d.ts → WrittenResponse-ZAxLR_AU.d.ts} +1 -1
- package/dist/{chunk-YEYKJFEC.cjs → chunk-26GQO5I2.cjs} +12 -12
- package/dist/{chunk-YEYKJFEC.cjs.map → chunk-26GQO5I2.cjs.map} +1 -1
- package/dist/chunk-2HAEQDHQ.js +2330 -0
- package/dist/chunk-2HAEQDHQ.js.map +1 -0
- package/dist/{chunk-47HHC4GD.js → chunk-33BQNWAQ.js} +5 -5
- package/dist/{chunk-47HHC4GD.js.map → chunk-33BQNWAQ.js.map} +1 -1
- package/dist/{chunk-SE6WWDVW.cjs → chunk-4H3JTX74.cjs} +13 -13
- package/dist/{chunk-SE6WWDVW.cjs.map → chunk-4H3JTX74.cjs.map} +1 -1
- package/dist/{chunk-TDJEKXEP.js → chunk-52GXJNQ3.js} +84 -2
- package/dist/chunk-52GXJNQ3.js.map +1 -0
- package/dist/{chunk-USBANZ7K.cjs → chunk-53YOZOGN.cjs} +5 -5
- package/dist/{chunk-USBANZ7K.cjs.map → chunk-53YOZOGN.cjs.map} +1 -1
- package/dist/{chunk-LLXCX5KK.js → chunk-AF72QUBI.js} +5 -5
- package/dist/{chunk-LLXCX5KK.js.map → chunk-AF72QUBI.js.map} +1 -1
- package/dist/{chunk-XUEIUEPI.js → chunk-CE6OGJE6.js} +5 -5
- package/dist/{chunk-XUEIUEPI.js.map → chunk-CE6OGJE6.js.map} +1 -1
- package/dist/{chunk-RRH7ZPXC.cjs → chunk-DP3DM7FR.cjs} +6 -6
- package/dist/{chunk-RRH7ZPXC.cjs.map → chunk-DP3DM7FR.cjs.map} +1 -1
- package/dist/{chunk-J2CDPIRC.cjs → chunk-DQ3VVU5T.cjs} +27 -25
- package/dist/chunk-DQ3VVU5T.cjs.map +1 -0
- package/dist/{chunk-U3APKQ7P.cjs → chunk-EKBEKDWO.cjs} +13 -13
- package/dist/{chunk-U3APKQ7P.cjs.map → chunk-EKBEKDWO.cjs.map} +1 -1
- package/dist/{chunk-RXS455MR.js → chunk-EVBYEWHO.js} +3 -2
- package/dist/chunk-EVBYEWHO.js.map +1 -0
- package/dist/{chunk-B2XQLU2E.cjs → chunk-FKGUKFC7.cjs} +24 -6
- package/dist/chunk-FKGUKFC7.cjs.map +1 -0
- package/dist/{chunk-YMBBM5K7.js → chunk-H6I2JDNW.js} +10 -10
- package/dist/{chunk-YMBBM5K7.js.map → chunk-H6I2JDNW.js.map} +1 -1
- package/dist/{chunk-XIBOFTOL.js → chunk-HA3VRF6E.js} +22 -4
- package/dist/chunk-HA3VRF6E.js.map +1 -0
- package/dist/{chunk-I33FOKZ7.js → chunk-I2QGW4GD.js} +14 -12
- package/dist/chunk-I2QGW4GD.js.map +1 -0
- package/dist/{chunk-72UGRIMM.js → chunk-IE5ZNCWN.js} +5 -5
- package/dist/{chunk-72UGRIMM.js.map → chunk-IE5ZNCWN.js.map} +1 -1
- package/dist/{chunk-NDQD3ZRY.cjs → chunk-L7NE7PR4.cjs} +13 -13
- package/dist/{chunk-NDQD3ZRY.cjs.map → chunk-L7NE7PR4.cjs.map} +1 -1
- package/dist/{chunk-D57QZILZ.js → chunk-QEB6O6GU.js} +62 -37
- package/dist/chunk-QEB6O6GU.js.map +1 -0
- package/dist/{chunk-62AKSD5Y.js → chunk-QM4AV6EG.js} +39 -11
- package/dist/chunk-QM4AV6EG.js.map +1 -0
- package/dist/{chunk-LGCUOLP6.js → chunk-RT5FTHUU.js} +5 -5
- package/dist/{chunk-LGCUOLP6.js.map → chunk-RT5FTHUU.js.map} +1 -1
- package/dist/chunk-SRD4KVAP.cjs +2332 -0
- package/dist/chunk-SRD4KVAP.cjs.map +1 -0
- package/dist/{chunk-BVRUUYYR.cjs → chunk-UAYWLYFW.cjs} +18 -18
- package/dist/{chunk-BVRUUYYR.cjs.map → chunk-UAYWLYFW.cjs.map} +1 -1
- package/dist/{chunk-D4DQFTA7.cjs → chunk-UCKA22ZJ.cjs} +3 -2
- package/dist/chunk-UCKA22ZJ.cjs.map +1 -0
- package/dist/{chunk-F4TBCRGI.cjs → chunk-WKOV25NP.cjs} +42 -13
- package/dist/chunk-WKOV25NP.cjs.map +1 -0
- package/dist/{chunk-WTS34S5E.cjs → chunk-XMJE34FY.cjs} +13 -13
- package/dist/{chunk-WTS34S5E.cjs.map → chunk-XMJE34FY.cjs.map} +1 -1
- package/dist/{chunk-SWY6PWXK.js → chunk-YWQH35VO.js} +4 -4
- package/dist/{chunk-SWY6PWXK.js.map → chunk-YWQH35VO.js.map} +1 -1
- package/dist/{chunk-LB3FEV7Z.cjs → chunk-Z6TVOAO5.cjs} +84 -2
- package/dist/chunk-Z6TVOAO5.cjs.map +1 -0
- package/dist/{chunk-36FTYJWJ.cjs → chunk-ZH5WT2IE.cjs} +80 -55
- package/dist/chunk-ZH5WT2IE.cjs.map +1 -0
- package/dist/{chunk-BO6P723E.js → chunk-ZJMTHPHY.js} +3 -3
- package/dist/{chunk-BO6P723E.js.map → chunk-ZJMTHPHY.js.map} +1 -1
- package/dist/components/ActivityPreview.cjs +12 -12
- package/dist/components/ActivityPreview.d.cts +2 -2
- package/dist/components/ActivityPreview.d.ts +2 -2
- package/dist/components/ActivityPreview.js +11 -11
- package/dist/components/ActivitySequence.cjs +13 -13
- package/dist/components/ActivitySequence.d.cts +14 -7
- package/dist/components/ActivitySequence.d.ts +14 -7
- package/dist/components/ActivitySequence.js +12 -12
- package/dist/components/Dictation.cjs +5 -5
- package/dist/components/Dictation.d.cts +1 -1
- package/dist/components/Dictation.d.ts +1 -1
- package/dist/components/Dictation.js +4 -4
- package/dist/components/FillInTheBlanks.cjs +5 -5
- package/dist/components/FillInTheBlanks.d.cts +1 -1
- package/dist/components/FillInTheBlanks.d.ts +1 -1
- package/dist/components/FillInTheBlanks.js +4 -4
- package/dist/components/GapSelect.cjs +5 -5
- package/dist/components/GapSelect.d.cts +1 -1
- package/dist/components/GapSelect.d.ts +1 -1
- package/dist/components/GapSelect.js +4 -4
- package/dist/components/InteractiveVideo.cjs +26 -0
- package/dist/components/InteractiveVideo.cjs.map +1 -0
- package/dist/components/InteractiveVideo.d.cts +77 -0
- package/dist/components/InteractiveVideo.d.ts +77 -0
- package/dist/components/InteractiveVideo.js +17 -0
- package/dist/components/InteractiveVideo.js.map +1 -0
- package/dist/components/MultipleChoice.cjs +5 -5
- package/dist/components/MultipleChoice.d.cts +1 -1
- package/dist/components/MultipleChoice.d.ts +1 -1
- package/dist/components/MultipleChoice.js +4 -4
- package/dist/components/PronunciationFeedback.cjs +4 -4
- package/dist/components/PronunciationFeedback.d.cts +5 -2
- package/dist/components/PronunciationFeedback.d.ts +5 -2
- package/dist/components/PronunciationFeedback.js +3 -3
- package/dist/components/ReadAloud.cjs +6 -6
- package/dist/components/ReadAloud.d.cts +2 -2
- package/dist/components/ReadAloud.d.ts +2 -2
- package/dist/components/ReadAloud.js +5 -5
- package/dist/components/StimulusPanel.cjs +4 -4
- package/dist/components/StimulusPanel.d.cts +1 -1
- package/dist/components/StimulusPanel.d.ts +1 -1
- package/dist/components/StimulusPanel.js +3 -3
- package/dist/components/WrittenResponse.cjs +5 -5
- package/dist/components/WrittenResponse.d.cts +3 -3
- package/dist/components/WrittenResponse.d.ts +3 -3
- package/dist/components/WrittenResponse.js +4 -4
- package/dist/i18n/LkIntlProvider.cjs +7 -7
- package/dist/i18n/LkIntlProvider.d.cts +2 -2
- package/dist/i18n/LkIntlProvider.d.ts +2 -2
- package/dist/i18n/LkIntlProvider.js +1 -1
- package/dist/index.cjs +44 -39
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +15 -14
- package/dist/index.js.map +1 -1
- package/dist/{strings--ADnHcaA.d.cts → strings-5588Q4Te.d.cts} +118 -1
- package/dist/{strings-CtdSf2St.d.ts → strings-D0IWcsUm.d.ts} +118 -1
- package/dist/theme/ThemeProvider.cjs +6 -6
- package/dist/theme/ThemeProvider.js +1 -1
- package/dist/theme/defaults.css +2 -0
- package/dist/theme/skin.css +1365 -1
- package/package.json +13 -3
- package/dist/chunk-36FTYJWJ.cjs.map +0 -1
- package/dist/chunk-62AKSD5Y.js.map +0 -1
- package/dist/chunk-B2XQLU2E.cjs.map +0 -1
- package/dist/chunk-D4DQFTA7.cjs.map +0 -1
- package/dist/chunk-D57QZILZ.js.map +0 -1
- package/dist/chunk-F4TBCRGI.cjs.map +0 -1
- package/dist/chunk-I33FOKZ7.js.map +0 -1
- package/dist/chunk-J2CDPIRC.cjs.map +0 -1
- package/dist/chunk-LB3FEV7Z.cjs.map +0 -1
- package/dist/chunk-RXS455MR.js.map +0 -1
- package/dist/chunk-TDJEKXEP.js.map +0 -1
- package/dist/chunk-XIBOFTOL.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/ActivitySequence/ActivitySequence.tsx"],"names":[],"mappings":";;;;;;;;;;;;;AAoYA,SAAS,WAAW,IAAA,EAAgD;AAClE,EAAA,OAAO,KAAK,MAAA,CAAO,KAAA,CAAM,GAAG,CAAA,CAAE,CAAC,KAAK,IAAA,CAAK,MAAA;AAC3C;AAmBA,IAAI,iBAAA,GAAoB,CAAA;AA+BxB,SAAS,YAAA,CAAa;AAAA,EACpB,SAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA;AACF,CAAA,EAKsB;AACpB,EAAA,MAAM,GAAA,GAAM,OAAuB,IAAI,CAAA;AACvC,EAAA,MAAM,eAAe,OAAA,EAAS,YAAA;AAE9B,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,CAAC,MAAA,EAAQ;AACX,MAAA;AAAA,IACF;AACA,IAAA,IAAI,i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,CAAC,CAAA;AAAA,UAC3B,QAAA,EAAU,UAAU,KAAA,GAAQ,CAAA;AAAA,UAE3B,QAAA,EAAA,CAAA,CAAE;AAAA;AAAA;AACL,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ","file":"chunk-I2QGW4GD.js","sourcesContent":["'use client';\n\nimport {\n type ActivityMedia,\n type ActivityResult,\n flattenSequence,\n type InteractionEvent,\n type ItemOutcome,\n isItemGroup,\n type LearnerResponse,\n type RecordingRef,\n resolvePlaybackPolicy,\n type SequenceEntry,\n type SequenceSlot,\n type SequenceSlotGroup,\n type SpeechAssessment,\n slotMediaKey,\n stimulusMediaKey,\n type ThemeTokens,\n} from '@intellectif/lk-core';\nimport { type ComponentType, useEffect, useMemo, useRef, useState } from 'react';\nimport { useLkStrings } from '../../i18n/LkIntlProvider.js';\nimport type { LkStringsOverride } from '../../i18n/strings.js';\nimport { randomSessionId } from '../_internal.js';\nimport { Dictation } from '../Dictation/index.js';\nimport { FillInTheBlanks } from '../FillInTheBlanks/index.js';\nimport { GapSelect } from '../GapSelect/index.js';\nimport { MultipleChoice } from '../MultipleChoice/index.js';\nimport { ReadAloud } from '../ReadAloud/index.js';\nimport type { RecordingBinding } from '../ReadAloud/ReadAloud.js';\nimport { StimulusPanel } from '../StimulusPanel/index.js';\nimport { stopCaptureGroup } from '../shared/capture-registry.js';\nimport {\n mintTake,\n type SequenceSlotChannel,\n SequenceSlotContext,\n type TakeState,\n takeOf,\n} from '../shared/sequence-slot.js';\nimport type {\n ActivityProps,\n HtmlSanitizer,\n MediaBudgetBinding,\n RenderableActivity,\n RenderMode,\n SequenceMediaBudget,\n SequenceRecordingBinding,\n SequenceRecordingSlot,\n} from '../types.js';\nimport { WrittenResponse, type WrittenResponseSubmission } from '../WrittenResponse/index.js';\n\n/**\n * What one finished slot in a sequence produced. Two kinds, because two kinds\n * of activity exist: those the SDK scores at submit time, and those a grader\n * scores later. Collapsing them would mean inventing a score for ungraded\n * work — the exact defect the deferred outcome exists to prevent.\n *\n * **A read-aloud hand-in adds no arm here, deliberately.** The obvious home for\n * a handed-in take is `submitted`, and it is the wrong one: that arm's payload\n * is typed `WrittenResponseSubmission`, this union is published from both the\n * barrel and the `components/ActivitySequence` subpath, and a consumer narrows\n * on `kind === 'submitted'` and reads `.text`. Widening the payload to a union\n * would break every one of those reads — a breaking change to a published\n * discriminated union, bought for a type that `responded` already describes: a\n * read-aloud hand-in IS a raw `LearnerResponse` with no grade, which is exactly\n * what `responded` carries.\n *\n * What a read-aloud does add is `unsubmitted`, for the one thing no existing\n * arm can say honestly: a take that never reached storage. Any response would\n * be a lie about it — a `recording` of `null` is the blank a learner chooses,\n * and grades as 0.\n */\nexport type SequenceItemOutcome =\n | {\n kind: 'scored';\n /** Presented position. */\n index: number;\n /** Slot identity from `flattenSequence` — stable under shuffling; the `slotId` to score with. */\n slotId: string;\n activityId: string;\n result: ActivityResult;\n /**\n * The answer this score grades, for a slot whose grade arrives after its\n * answer was handed in and whose learner may hand in another: a\n * `practice` read-aloud, whose `response.recording` names the take the\n * score belongs to. Absent for every other slot, whose score and answer\n * arrive together.\n */\n response?: LearnerResponse;\n }\n | {\n kind: 'submitted';\n index: number;\n slotId: string;\n activityId: string;\n /** Ungraded submission; the grade arrives asynchronously. */\n submission: WrittenResponseSubmission;\n }\n | {\n kind: 'restored';\n index: number;\n slotId: string;\n activityId: string;\n /**\n * The answer as restored, when one was. A slot can be submitted with no\n * stored response (a blank the learner committed), so this is optional —\n * inventing one would be worse than admitting it is absent.\n */\n response?: LearnerResponse;\n }\n | {\n kind: 'responded';\n index: number;\n slotId: string;\n activityId: string;\n /**\n * The raw answer, with no grade of any kind. This is what an `exam` slot\n * produces: the client is forbidden to score, so a response is all there\n * is until the server grades it.\n *\n * A read-aloud `recording` of `null` here is always a blank the learner\n * chose to hand in, never a take that failed to upload — that is\n * `unsubmitted`.\n */\n response: LearnerResponse;\n }\n | {\n /**\n * A question the learner tried to answer and could not hand in, and then\n * left: a `practice` read-aloud whose take never reached your storage. It\n * carries no response, because there is none.\n *\n * Deliberately not `responded` with a `recording` of `null`: that is the\n * blank a learner chooses, and a grader marks it 0 with every word\n * omitted — which would turn a storage outage into a zero. Grade nothing\n * for this slot; the learner can still return to it, and a take stored\n * then reaches you through `onSubmit`.\n */\n kind: 'unsubmitted';\n index: number;\n slotId: string;\n activityId: string;\n };\n\n/**\n * A component that can render one activity inside a sequence. Register one per\n * activity `type` to put a consumer-defined type on screen — the React half of\n * the activity-type registry, matching `registerActivityType` in lk-core.\n */\nexport type ActivityRenderer = ComponentType<ActivityProps>;\n\nexport interface ActivitySequenceProps {\n /**\n * The ordered set of entries to present, one question at a time: loose\n * activities, and item groups — a shared passage, recording or image with\n * the questions that refer to it. A group's stimulus stays on screen\n * alongside each of its questions.\n *\n * Accepts `redact()` projections. For data straight off a server, pass it\n * through `asRenderableSequence()` — see that helper for why a cast is\n * unavoidable there — and set `renderMode=\"exam\"`.\n */\n activities: readonly SequenceEntry<RenderableActivity>[];\n /**\n * Renderers for activity types beyond the built-ins, keyed by `data.type`.\n * A key matching a built-in overrides it, so a consumer can replace the\n * bundled renderer without forking the sequencer.\n *\n * A registered renderer is an `ActivityRenderer`, which is\n * `ComponentType<ActivityProps>` — so it receives the shared prop contract\n * and nothing beyond it. `shuffleSeed`, `recordingBinding`, `assessment` and\n * `workletUrl` are all outside that contract and none of them reaches an\n * override: a replacement for `read-aloud` has to be given its own binding by\n * whoever wrote it.\n */\n renderers?: Readonly<Record<string, ActivityRenderer>>;\n /**\n * Called whenever an individual activity is scored at submit time — the\n * incremental persist hook.\n *\n * `slotId` is the identity to store the result against, NOT `index`.\n * `index` is where the question was PRESENTED, which is not stable: it moves\n * under shuffling, and it already differs from the slot identity whenever a\n * group is present (the second entry of a sequence is presented at index 1\n * but is slot `\"1.0\"` if it is a group's first question). `composeAssessmentScore`\n * scores by `slotId`, so persisting `index` cannot be reconciled with it.\n */\n onActivityComplete?: (result: ActivityResult, index: number, slotId: string) => void;\n /**\n * Called on every submit with the learner's raw response and the identity of\n * the slot that produced it — before any grading, in every render mode.\n *\n * **This is the only response channel an `exam` sequence has.** In `exam`\n * mode the components never grade, so `onActivityComplete` cannot fire and\n * `onComplete` never will; without this prop nothing a learner submitted\n * would reach the consumer at all. Persist `response` against `slotId`.\n */\n onSubmit?: (\n response: LearnerResponse,\n slot: { slotId: string; index: number; activityId: string },\n ) => void;\n /**\n * Called once every activity has been completed, with the scored results.\n *\n * Fires only when EVERY item produced a score. A set containing a\n * deferred-graded activity (a written response) can never satisfy that, so\n * use `onFinished` for mixed sets — it is the general completion signal and\n * reports both kinds of outcome. It also carries `slotId` per item, which\n * this callback's bare array cannot.\n *\n * It fires straight after `onFinished`, with the same results, or never: a\n * set `onFinished` reported with an ungraded slot is not reported here later,\n * when a re-recorded take is graded.\n */\n onComplete?: (results: ActivityResult[]) => void;\n /**\n * Called once every activity has been completed, whether it was scored at\n * submit time or submitted for later grading. Use this for any set that\n * mixes graded and deferred-graded activities.\n *\n * **Once per set**, and that matters for a `practice` read-aloud, whose grade\n * arrives after the submit that completed the slot. When the last slot is\n * filled while a read-aloud's take is still being stored or assessed, this\n * waits for it and reports the set then — with the grade in place, or with\n * the slot's raw `responded` outcome when the take came back with no grade.\n * A take that never settles is a question still being answered, so the set\n * is not reported while it runs.\n *\n * **A failure the learner can still retry is in flight too.** While a take\n * that failed to upload, or whose assessment failed, is offered \"Try again\"\n * on the question the learner is looking at, the set is not reported: the\n * retry may yet store and grade it. It completes once the learner moves to\n * another question — as the last take the slot stored, or as `unsubmitted`\n * when it never stored one, which is never a blank.\n *\n * **A score and a response always describe the same take.** A read-aloud\n * recorded again replaces the earlier take's grade with the new take's\n * `responded`, and a result that arrives for a take the learner has since\n * replaced, or for a paper no longer on screen, is not recorded at all.\n *\n * `onComplete` fires in the same report or not at all, so the two never\n * describe one set differently. What arrives after the set was reported is\n * not reported here again, because a consumer who persists on this callback\n * must not write one attempt twice: a later take reaches you through\n * `onSubmit`, and its grade through `onActivityComplete`, the per-item persist\n * hook keyed by `slotId` — which only ever grades the answer `onSubmit` last\n * reported for that slot.\n */\n onFinished?: (items: SequenceItemOutcome[]) => void;\n /** Forwarded to each activity. */\n onInteraction?: (event: InteractionEvent) => void;\n /** Forwarded to each activity. `exam` and `review` disable local scoring. */\n renderMode?: RenderMode;\n /**\n * Binds every budgeted recording in this sequence to a play ledger the\n * consumer persists.\n *\n * The SDK refuses a play; it does not remember one. `plays` seeds the counts\n * at mount (pass `restoreMediaPlayLedger(plan, stored).entries`), and\n * `onPlayConsumed` is how a play becomes durable — see\n * {@link SequenceMediaBudget}.\n */\n mediaBudget?: SequenceMediaBudget;\n /**\n * Where every read-aloud take in this sequence is stored, and how a\n * judgement comes back. Required by any `read-aloud` slot outside `review`:\n * the component refuses to render a recorder whose take is stored nowhere.\n *\n * Named `recordingBinding` rather than `recording` because both\n * `ReadAloudData.recording` (the bounds an item declares) and\n * `ReadAloudLearnerResponse.recording` (the take a learner handed in) already\n * exist — the plain name would read as one of those. Same name at both\n * levels, different types, as `mediaBudget` has.\n */\n recordingBinding?: SequenceRecordingBinding;\n /**\n * Speech assessments keyed by `slotId`, forwarded to the matching read-aloud\n * slot so `review` can show the per-word marks behind a stored grade.\n *\n * Read LIVE, like `outcomes` and unlike `responses`: an assessment is fetched\n * beside the attempt it explains and lands after the first paint, and a\n * mount-only read would show the grade with no marks under it for ever.\n */\n assessments?: Readonly<Record<string, SpeechAssessment>>;\n /**\n * The URL of a self-hosted copy of `CAPTURE_PROCESSOR_SOURCE`, forwarded to\n * every read-aloud slot's recorder, for a Content-Security-Policy whose\n * `script-src` does not allow `blob:`. See `ReadAloudProps.workletUrl`. Like\n * `recordingBinding`, it does not reach a `renderers` override.\n */\n workletUrl?: string;\n /** Overrides the SDK's chrome text for this sequence. See {@link LkIntlProvider}. */\n strings?: LkStringsOverride;\n /**\n * `entries` shuffles the top-level entries; a group moves as one block, and\n * the order INSIDE a group follows the group's own `shuffle` setting.\n * Default `none`: authored order.\n */\n shuffle?: 'none' | 'entries';\n /**\n * Seed for every shuffle in this sequence (`shuffle: 'entries'` and any\n * group with `shuffle: 'within-group'`). Supply the attempt id, so the\n * server's `flattenSequence(entries, { seed })` derives the same order this\n * pager shows.\n *\n * **Required whenever this sequence shuffles** — `shuffle: 'entries'`, or any\n * group with `shuffle: 'within-group'` — in `exam` or `review` mode; omitting\n * it then throws. An order nobody can reproduce cannot be reconciled with a\n * recorded attempt, and failing at render is the only way that mistake\n * surfaces before a learner sits the paper. A sequence that does not shuffle\n * needs no seed in any mode.\n *\n * The guard covers an activity's own `data.shuffle` too, a group's items\n * included: `<MultipleChoice>` would otherwise fall back to a per-mount seed,\n * in every mode.\n *\n * In `practice` mode it stays optional: a random per-mount seed is used,\n * stable within the mount and deliberately not reproducible. That fallback is\n * also not SSR-safe (server and client would invent different orders and\n * hydration would mismatch), so supply a seed for any server-rendered\n * sequence regardless of mode.\n */\n shuffleSeed?: string;\n /**\n * Where to open. Defaults to the first question; pass a stored\n * `AttemptState.index` to reopen an interrupted attempt where it was left.\n * Read at mount only, like any `default*` prop.\n */\n defaultIndex?: number;\n /**\n * Fires whenever the learner moves. Persist it and the next resume reopens\n * on the right question — without it, the pager's position is the one piece\n * of an attempt a consumer cannot recover.\n */\n onIndexChange?: (index: number) => void;\n /**\n * Answers to restore, keyed by `slotId`, seeded into each slot as its\n * `defaultValue`. This is the other half of resume: `AttemptState.responses`\n * goes straight in.\n *\n * Read at mount only. To restore a different attempt, remount with a `key`.\n */\n responses?: Readonly<Record<string, LearnerResponse>>;\n /**\n * Slots the learner had already submitted, from `AttemptState.submittedSlotIds`.\n * Each is mounted already submitted, so a resumed paper does not reopen a\n * locked question as answerable — without this a learner can change and\n * re-submit work they had already committed.\n *\n * Read at mount only, alongside `responses`.\n */\n submittedSlotIds?: readonly string[];\n /**\n * Server-computed outcomes keyed by `slotId`, forwarded to each slot. In\n * `review` mode this is what marks correctness — the client never scores, so\n * without it a review render has nothing to show.\n */\n outcomes?: Readonly<Record<string, ItemOutcome>>;\n /** Renders author-supplied rich text; forwarded to the stimulus panel and every activity. */\n sanitizeHtml?: HtmlSanitizer;\n theme?: Partial<ThemeTokens>;\n /**\n * BCP 47 tag stamped as `lang` on this component's root. This is the\n * INTERFACE language — the SDK's own chrome renders inside that element — so\n * it should carry the same value you give `<LkIntlProvider locale>`. Passing\n * a different one re-declares the language of every SDK string in this\n * subtree without changing the words.\n *\n * It is NOT `data.locale`, which labels xAPI statements — and, on a\n * dictation, places the dictation's own words: `<Dictation>` puts it, and\n * the direction it names, on its title, hints, marks and solution. Other\n * authored content in another language belongs on `stimulus.locale`, which\n * `<StimulusPanel>` puts on the passage alone.\n */\n locale?: string;\n disabled?: boolean;\n}\n\n/** One stimulus panel to keep mounted: the group, and the presented span of its questions. */\ninterface StimulusMount {\n /** Authored entry position — unique per group in the sequence even if two groups share an id. */\n entryKey: string;\n group: SequenceSlotGroup;\n first: number;\n last: number;\n}\n\n/** The authored-entry prefix of a slot id: `\"3\"` for `\"3\"` and for `\"3.1\"`. */\nfunction entryKeyOf(slot: SequenceSlot<RenderableActivity>): string {\n return slot.slotId.split('.')[0] ?? slot.slotId;\n}\n\n/** The latest take a slot has been told about, and how far it has got. */\ninterface SlotTake {\n /** A number from `mintTake`: unique on the page, larger for a later take. */\n take: number;\n state: TakeState;\n /** The answer the take was handed in as, once it was stored. */\n response?: LearnerResponse;\n}\n\n/**\n * Names the capture groups of one pager, so a slot's microphone belongs to that\n * pager alone. Per mount, for the reason the playback groups are: slot ids are\n * short and repeat (\"0\", \"1.0\"), so two pagers on one page — a review beside a\n * live attempt — would share a group, and hiding one's first question would\n * stop the other's recorder. The name never reaches the DOM, so a server and\n * the client that hydrates it may mint different ones.\n */\nlet captureScopeCount = 0;\n\n/**\n * A pane that is kept MOUNTED but shown only when it is the current one, and\n * that stops any media it contains on the way out.\n *\n * `hidden` alone is not enough. It resolves to `display: none`, and CSS does\n * not touch playback: an `<audio>` or `<video>` inside a hidden subtree keeps\n * playing to the end. (The HTML spec pauses a media element when it is\n * REMOVED from the document — a different thing, and the thing this pager\n * deliberately does not do, because unmounting is what used to destroy the\n * learner's answers.) So a recording started for one question would carry on\n * underneath the next, which for a listening paper means the passage plays\n * while the learner is somewhere else entirely.\n *\n * Pausing preserves `currentTime`: coming back to a group resumes where the\n * learner left off. Nothing auto-plays on the way in — starting audio the\n * learner did not ask for is its own defect.\n *\n * `embed` media (a provider iframe) cannot be paused this way: controlling a\n * third-party player needs its own JS API, which the SDK has no reliable\n * access to because the author supplies the embed URL. Use `audio`/`video`\n * media for anything that must stop when the learner navigates.\n *\n * A microphone is the other way round: it is not an element in this subtree, so\n * no query can find it. A slot pane hands its content a `channel` through\n * `SequenceSlotContext` — never a prop, so nothing on a public component's\n * signature can name it — whose `captureGroup` the pane's recorders join, and\n * hiding the pane stops them: a learner who navigates away mid-take must not\n * leave the microphone live under the next question.\n */\nfunction SequencePane({\n className,\n hidden,\n channel,\n children,\n}: {\n className: string;\n hidden: boolean;\n channel?: SequenceSlotChannel;\n children: React.ReactNode;\n}): React.JSX.Element {\n const ref = useRef<HTMLDivElement>(null);\n const captureGroup = channel?.captureGroup;\n\n useEffect(() => {\n if (!hidden) {\n return;\n }\n if (captureGroup !== undefined) {\n stopCaptureGroup(captureGroup);\n }\n const node = ref.current;\n if (node === null) {\n return;\n }\n for (const media of node.querySelectorAll('audio, video')) {\n const element = media as HTMLMediaElement;\n if (!element.paused) {\n element.pause();\n }\n }\n }, [hidden, captureGroup]);\n\n return (\n <div className={className} hidden={hidden} ref={ref}>\n {channel === undefined ? (\n children\n ) : (\n <SequenceSlotContext.Provider value={channel}>{children}</SequenceSlotContext.Provider>\n )}\n </div>\n );\n}\n\n/**\n * Presents a set of activities as an in-place pager: one question visible at a\n * time, navigated with Prev/Next (no page scrolling). Linear free navigation —\n * the learner may move back and forth; activities keep their own submit and\n * scoring. On navigation, focus moves to the question region and the position\n * is announced via an aria-live region.\n *\n * Item groups are flattened into consecutive questions; the group's stimulus\n * is mounted ONCE, beside the question region rather than inside it, and shown\n * alongside every question in the group — so a passage stays put, and a\n * recording keeps its position, as the learner moves between its questions.\n */\n/**\n * Whether an activity shuffles its own options, and therefore needs a seed of\n * its own. Read structurally: `shuffle` is a per-type content field, not part\n * of the sequence entry contract.\n */\nfunction shufflesItsOwnOptions(entry: unknown): boolean {\n const item = entry as { shuffle?: unknown; shuffleChoices?: unknown } | null;\n // Two content fields, one question: does this item deal an order of its own?\n // `shuffle` is MultipleChoice's; `shuffleChoices` is Gap Select's. A type\n // added without being named here shuffles unseeded in an exam — and one named\n // here but not in the seed guard's message sends its author looking for a\n // shuffle they never wrote.\n return item?.shuffle === true || item?.shuffleChoices === true;\n}\n\nexport function ActivitySequence({\n activities,\n renderers,\n onActivityComplete,\n onComplete,\n onFinished,\n onSubmit,\n onInteraction,\n renderMode = 'practice',\n shuffle,\n shuffleSeed,\n defaultIndex,\n onIndexChange,\n responses,\n submittedSlotIds,\n outcomes,\n sanitizeHtml,\n theme,\n locale,\n disabled,\n mediaBudget,\n recordingBinding,\n assessments,\n workletUrl,\n strings,\n}: ActivitySequenceProps): React.JSX.Element {\n const sessionIdRef = useRef<string | null>(null);\n const s = useLkStrings(strings);\n const mediaPlays = mediaBudget?.plays;\n const [captureScope] = useState(() => {\n captureScopeCount += 1;\n return `lk-seq-capture-${captureScopeCount}`;\n });\n\n // The presented order comes from lk-core, never computed here: the server\n // that records an attempt calls the same function with the same seed.\n const shuffleEntries = shuffle === 'entries';\n // Every shuffle this sequence can produce, not just the ones it performs\n // itself. An ACTIVITY's own `data.shuffle` is the third source: MultipleChoice\n // falls back to a per-mount seed when none reaches it, so an unseeded item\n // shuffle used to render happily under `exam` and hand the learner a\n // different option order on every mount — exactly the unreproducible\n // arrangement this guard exists to refuse, arriving through the one door it\n // did not watch.\n const needsSeed =\n shuffleEntries ||\n activities.some((entry) =>\n isItemGroup(entry)\n ? entry.shuffle === 'within-group' || entry.items.some(shufflesItsOwnOptions)\n : shufflesItsOwnOptions(entry),\n );\n\n // An unreproducible order is a practice-only affordance. Under `exam` or\n // `review` the server has to be able to rebuild exactly what the learner\n // saw, so a missing seed is an error rather than something to paper over —\n // the same reason `flattenSequence` refuses to invent one.\n if (needsSeed && shuffleSeed === undefined && renderMode !== 'practice') {\n // Every door `needsSeed` watches, named: a reader whose only shuffle is an\n // item's own field must find that field here. And no single function\n // rebuilds all of these orders — `flattenSequence` deals entries and group\n // items, while an item deals its own options from the same seed — so the\n // message promises the seed, not a function.\n throw new Error(\n `ActivitySequence: renderMode \"${renderMode}\" requires a \\`shuffleSeed\\` when anything ` +\n 'in the sequence shuffles: shuffle=\"entries\", a group with shuffle: \"within-group\", or ' +\n \"an activity's own `data.shuffle` (multiple choice) or `data.shuffleChoices` (gap \" +\n 'select), including an activity inside a group. Pass the attempt id, so the server can ' +\n 'rebuild every order the learner saw from that one seed.',\n );\n }\n\n // Lazily created only when shuffling in practice without a caller seed (same\n // contract as MultipleChoice.shuffleSeed): a per-mount session seed, stable\n // across re-renders, never reproducible.\n const seed = needsSeed\n ? // biome-ignore lint/suspicious/noAssignInExpressions: sanctioned lazy ref initialization\n (shuffleSeed ?? (sessionIdRef.current ??= randomSessionId()))\n : undefined;\n const slots = useMemo(\n () => flattenSequence(activities, { shuffleEntries, ...(seed !== undefined ? { seed } : {}) }),\n [activities, shuffleEntries, seed],\n );\n\n // Clamped rather than trusted: a stored position from a paper that has since\n // lost its last question would open the pager on a slot that is not there,\n // which renders as an empty shell with no way forward.\n const [index, setIndex] = useState(() => {\n // NaN passes through Math.min/Math.max unchanged, so it survived every\n // clamp and indexed the slots with NaN — the pager then rendered the empty\n // shell this clamp exists to prevent. `NaN` is a `number`, so the prop type\n // gives no protection, and `Number(row.last_index)` on a NULL column\n // produces exactly that.\n const requested = Math.trunc(defaultIndex ?? 0);\n if (!Number.isFinite(requested)) {\n return 0;\n }\n return Math.min(Math.max(0, requested), Math.max(0, slots.length - 1));\n });\n // Outcomes live in a ref, not state: nothing renders from them, and a ref is\n // written SYNCHRONOUSLY. Reading them from a `useState` closure meant two\n // slots completing in the same tick both saw the pre-update array — the\n // second overwrote the first, so one answer vanished and completion never\n // fired. Every slot is mounted at once here, so same-tick completions are\n // reachable (a custom renderer that completes from a mount effect).\n const outcomesRef = useRef<(SequenceItemOutcome | null)[] | null>(null);\n // The slot each position of `outcomesRef` belongs to, assigned wherever that\n // array is created so the two can never describe different papers. A ref,\n // not the `slots` a closure saw: an outcome that settles late arrives through\n // a closure from the render that started it, and only a ref can tell it what\n // is at its position NOW — see `record`.\n const outcomeSlotsRef = useRef<readonly SequenceSlot<RenderableActivity>[] | null>(null);\n // The latest take each `practice` read-aloud slot has been told about, keyed\n // by position — see `record`. A ref for the reason the outcomes are one: a\n // submit, the grade after it and the report all read it inside one tick.\n const takesRef = useRef<Map<number, SlotTake>>(new Map());\n // Which set the outcomes describe: bumped on every set change, and captured\n // by every callback a render hands a slot. A result that arrives through a\n // callback from an earlier set is refused, whatever slot and activity ids the\n // new set reuses — ids a host chooses, and a loading blip or a paper that\n // shares an item repeats them exactly.\n const setGenerationRef = useRef(0);\n // The question on screen, as of the last commit: leaving a question is what\n // completes a failure on it that was being offered a retry, and a report made\n // on a position the screen does not show yet would describe a question the\n // learner is still looking at. Written by the effect below `go`.\n const indexRef = useRef(index);\n // Whether this set has been reported. One flag for both whole-set callbacks,\n // because they are one report: a set can be filled again after it reported —\n // a practice read-aloud recorded again replaces its own outcome — and a\n // consumer who persists on either callback must not be handed one attempt\n // twice, nor be told by `onComplete` later what `onFinished` reported\n // differently.\n const reportedRef = useRef(false);\n // The channel each slot pane hands its content, one per slot per set, so it\n // keeps one identity for as long as its set is on screen.\n const channelsRef = useRef<Map<string, SequenceSlotChannel>>(new Map());\n // What a channel calls, as of the latest render — assigned below `updateTake`.\n const latestRef = useRef<{\n updateTake: (generation: number, at: number, take: number, state: TakeState) => void;\n reportIfFinished: () => void;\n } | null>(null);\n // Cleared as this pager unmounts. A slot's own teardown tells the pager its\n // take is over, and a pager on its way out must not report a set on the\n // strength of that.\n const aliveRef = useRef(true);\n useEffect(() => {\n aliveRef.current = true;\n return () => {\n aliveRef.current = false;\n };\n }, []);\n if (outcomesRef.current === null) {\n // Slots the learner had already submitted are seeded as `restored`. They\n // will not submit again — they mount locked — so leaving them null meant\n // `onFinished` waited forever on outcomes that could never arrive, and a\n // resumed attempt could never signal completion however many of the\n // remaining questions the learner answered. Seeding fires no callback: the\n // attempt was already this far along before this mount existed.\n const submittedAtMount = new Set(submittedSlotIds ?? []);\n outcomesRef.current = slots.map((slot) =>\n submittedAtMount.has(slot.slotId)\n ? {\n kind: 'restored' as const,\n index: slot.index,\n slotId: slot.slotId,\n activityId: slot.activity.id,\n ...(responses !== undefined && Object.hasOwn(responses, slot.slotId)\n ? { response: responses[slot.slotId] as LearnerResponse }\n : {}),\n }\n : null,\n );\n outcomeSlotsRef.current = slots;\n }\n const regionRef = useRef<HTMLDivElement>(null);\n const mountedRef = useRef(false);\n\n // Reset pager position and outcomes when the presented SET changes (B8):\n // without this, results from the previous set leak into the new one and can\n // fire completion with a mixed old/new array. Keyed on the set's CONTENT\n // identity (ordered slot and activity ids), not the array reference — a\n // parent that re-creates a structurally identical array on every render\n // (inline literals, .map() in render) must not wipe in-progress answers.\n // JSON.stringify (not join) so ids containing the separator cannot collide.\n const setKey = JSON.stringify(slots.map((slot) => [slot.slotId, slot.activity.id]));\n const [prevSetKey, setPrevSetKey] = useState(setKey);\n // The set this component mounted with. `responses` seeds slots BY slotId,\n // and slot ids are short and repeat across papers (\"0\", \"1.0\"), so applying\n // them after the set changed would drop one paper's answers under another\n // paper's questions — a review modal stepping to the next attempt did\n // exactly that. Seeding stops at the first set change; to show a different\n // attempt, remount with a `key`, which is what \"read at mount only\" means.\n // `mediaBudget.resumeKey` participates so an invigilator can hand a play\n // back — re-seeding the budgets in place — without remounting the pager and\n // costing the learner their focus, their scroll position and an unsaved\n // answer.\n const seedKey = `${setKey}::${mediaBudget?.resumeKey ?? ''}`;\n const mountSetKeyRef = useRef(setKey);\n const mountSeedKeyRef = useRef(seedKey);\n const seedsApply = mountSetKeyRef.current === setKey;\n const mediaSeedsApply = mountSeedKeyRef.current === seedKey || seedsApply;\n if (mountSeedKeyRef.current !== seedKey) {\n mountSeedKeyRef.current = seedKey;\n }\n const submitted = useMemo(() => new Set(submittedSlotIds ?? []), [submittedSlotIds]);\n if (prevSetKey !== setKey) {\n setPrevSetKey(setKey);\n setIndex(0);\n // At once, not in the effect: a new set has no question the learner was on,\n // and the effect does not run at all when the position was already 0.\n indexRef.current = 0;\n outcomesRef.current = slots.map(() => null);\n outcomeSlotsRef.current = slots;\n takesRef.current = new Map();\n setGenerationRef.current += 1;\n channelsRef.current = new Map();\n reportedRef.current = false;\n }\n const setGeneration = setGenerationRef.current;\n\n // After a navigation (not the initial mount) move focus to the question\n // region so screen-reader / keyboard users land on the new question.\n // biome-ignore lint/correctness/useExhaustiveDependencies: index is the intended trigger\n useEffect(() => {\n if (mountedRef.current) {\n regionRef.current?.focus();\n } else {\n mountedRef.current = true;\n }\n }, [index]);\n\n // Report where the pager actually IS, from an effect rather than from the\n // navigation handler. Two positions the learner never chose are still\n // positions a consumer has to persist: a `defaultIndex` that was clamped\n // (stored 99, showing 2) and the reset a set change performs. Reporting only\n // clicks left storage disagreeing with the screen, and the next autosave\n // then wrote a position the plan does not have.\n const reportedIndexRef = useRef<number | null>(null);\n useEffect(() => {\n if (reportedIndexRef.current === index) {\n return;\n }\n const first = reportedIndexRef.current === null;\n reportedIndexRef.current = index;\n // On mount, stay silent unless the requested position was corrected.\n if (first && index === Math.trunc(defaultIndex ?? 0)) {\n return;\n }\n onIndexChange?.(index);\n }, [index, defaultIndex, onIndexChange]);\n\n // The learner has moved, and the screen shows where to. Leaving a question\n // can complete a failure on it that was being offered a retry — see\n // `reportIfFinished` — so the set may be reportable now.\n useEffect(() => {\n if (indexRef.current === index) {\n return;\n }\n indexRef.current = index;\n latestRef.current?.reportIfFinished();\n }, [index]);\n\n // One panel per group, spanning the presented positions of its questions.\n const stimulusMounts = useMemo<StimulusMount[]>(() => {\n const mounts = new Map<string, StimulusMount>();\n for (const slot of slots) {\n if (slot.group === undefined) {\n continue;\n }\n const entryKey = entryKeyOf(slot);\n const existing = mounts.get(entryKey);\n if (existing === undefined) {\n mounts.set(entryKey, { entryKey, group: slot.group, first: slot.index, last: slot.index });\n } else {\n existing.last = slot.index;\n }\n }\n return [...mounts.values()];\n }, [slots]);\n\n const total = slots.length;\n const current = slots[index];\n\n const go = (next: number): void => {\n setIndex(next);\n };\n\n /**\n * Fires the whole-set callbacks — once, together — when every slot is done\n * and no take is still on its way.\n *\n * **A take on its way holds the report.** A practice read-aloud records its\n * `responded` outcome the moment its take is stored, and its grade can land\n * after the last slot was filled; reporting then handed `onFinished` the raw\n * outcome, and the grade a moment later could never reach it. So a slot\n * whose latest take is being stored or judged is not done. The take states\n * come from the component itself, through the slot's channel, and every way a\n * take can end reports an end — a grade, a take with no grade, a failure\n * nobody can retry, an unmount — so a take that settles never holds a set.\n *\n * **So does a failure the learner can still retry, on the question in front\n * of them.** Reporting there reported a set whose answer \"Try again\" was about\n * to change: the retry stored and graded the take, and `onComplete` then\n * described a different set from the `onFinished` before it. Once the learner\n * moves to another question the failure no longer holds the report: the slot\n * completes as whatever it last stored, or as `unsubmitted` when that is\n * nothing — never as a `recording` of `null`, which is the blank a learner\n * chooses and a grader marks 0. `unsubmitted` is a `practice` outcome only:\n * an exam question with no stored take is unanswered, and the learner has a\n * blank to hand in if that is their answer.\n */\n const reportIfFinished = (): void => {\n const held = outcomesRef.current;\n const presented = outcomeSlotsRef.current;\n if (held === null || presented === null || reportedRef.current) {\n return;\n }\n const items: SequenceItemOutcome[] = [];\n for (const [at, outcome] of held.entries()) {\n const take = takesRef.current.get(at);\n if (take?.state === 'in-flight' || (take?.state === 'retryable' && at === indexRef.current)) {\n return;\n }\n const slot = presented[at];\n if (outcome !== null) {\n items.push(outcome);\n } else if (take?.state === 'retryable' && renderMode === 'practice' && slot !== undefined) {\n items.push({\n kind: 'unsubmitted',\n index: at,\n slotId: slot.slotId,\n activityId: slot.activity.id,\n });\n } else {\n return;\n }\n }\n reportedRef.current = true;\n onFinished?.(items);\n\n // `onComplete` predates deferred grading and promises ActivityResult[].\n // Fire it only when every slot really was scored, rather than inventing a\n // result for work nobody has graded — and only here, beside `onFinished`.\n const scored: ActivityResult[] = [];\n for (const item of items) {\n if (item.kind !== 'scored') {\n return;\n }\n scored.push(item.result);\n }\n onComplete?.(scored);\n };\n\n /**\n * Records a finished slot and reports the set when it is done — the one place\n * a slot's outcome is decided.\n *\n * **An outcome must come from the set on screen.** A grade can settle after\n * the paper changed — an assessment held across a swap of `activities`, or a\n * consumer's own renderer grading asynchronously — and it arrives through a\n * callback from the render that started it. Accepted, it landed in whatever\n * slot of the NEW paper had its index, and could report that paper fully\n * scored though nobody had answered it. Ids cannot tell the papers apart: a\n * new paper can reuse both the slot id and the activity id, and a loading\n * blip reuses every id there is. `generation` can: it is the set the callback\n * was handed out for, and it is refused unless that set is still current.\n *\n * **A slot that already holds an outcome is FINAL**: the first outcome wins,\n * so a renderer that reports twice keeps what it reported first. There is one\n * exception.\n *\n * **The exception is a `practice` read-aloud, and it is decided by `take`.**\n * That slot records `responded` when a take is stored, because a take that\n * comes back unscorable produces no grade at all and the slot would otherwise\n * stay `null` for ever. Each take has a number (`mintTake`), unique on the page\n * and larger for a later take, carried by everything the component reports\n * about it. The invariant:\n *\n * **The score and the response a slot holds always describe the same take.**\n *\n * - A `responded` for a newer take replaces whatever the slot holds, a grade\n * included: `onSubmit` has already told the host about that take, so a\n * grade kept for the older one would sit beside a response it does not\n * grade.\n * - A `scored` lands only for the slot's latest take, once, and replaces that\n * take's `responded`. A grade for any other take — one the learner has\n * since replaced, even one still in flight when they did — is dropped\n * rather than filed against a take it did not grade.\n * - A `restored` slot is never replaced: it was submitted before this mount,\n * and a resumed attempt must not be re-reported as if it had just been sat.\n *\n * A grade therefore lands once per take, and `onActivityComplete` — the\n * per-item hook, keyed by `slotId` — only ever grades the answer `onSubmit`\n * last reported for that slot. The whole-set callbacks stay once per set\n * whatever is replaced — see `reportedRef`.\n */\n const record = (outcome: SequenceItemOutcome, generation: number, take?: number): void => {\n const held = outcomesRef.current;\n if (held === null || generation !== setGenerationRef.current) {\n return;\n }\n const at = outcome.index;\n const holding = held[at];\n let accepted = outcome;\n if (take === undefined) {\n if (holding != null) {\n return;\n }\n } else {\n if (holding?.kind === 'restored') {\n return;\n }\n const latest = takesRef.current.get(at);\n if (outcome.kind === 'responded') {\n // Older than the latest take, or a second answer for the same one.\n if (\n latest !== undefined &&\n (take < latest.take || (take === latest.take && latest.response !== undefined))\n ) {\n return;\n }\n takesRef.current.set(at, {\n take,\n // A take this pager hears of first through its answer — a consumer's\n // renderer has no channel — has nothing on its way.\n state: latest?.take === take ? latest.state : 'settled',\n response: outcome.response,\n });\n } else if (outcome.kind === 'scored') {\n // Only the latest take's grade, only once it was stored, and only once.\n if (latest?.take !== take || latest.response === undefined || holding?.kind === 'scored') {\n return;\n }\n accepted = { ...outcome, response: latest.response };\n } else {\n return;\n }\n }\n const next = held.slice();\n next[at] = accepted;\n // Commit before firing anything: a second record() in the same tick must\n // see this one.\n outcomesRef.current = next;\n\n if (accepted.kind === 'scored') {\n onActivityComplete?.(accepted.result, accepted.index, accepted.slotId);\n }\n reportIfFinished();\n };\n\n /**\n * What a slot's channel reports: the state of one of its takes. A take older\n * than the slot's latest has been replaced, and a report from a set that is\n * no longer current, or reaching a pager that is unmounting, describes\n * nothing on screen.\n */\n const updateTake = (generation: number, at: number, take: number, state: TakeState): void => {\n if (!aliveRef.current || generation !== setGenerationRef.current) {\n return;\n }\n const latest = takesRef.current.get(at);\n if (latest !== undefined && take < latest.take) {\n return;\n }\n // A newer take starts with no answer of its own: the response the slot\n // holds belongs to the take before it until this one is stored.\n takesRef.current.set(at, latest?.take === take ? { ...latest, state } : { take, state });\n reportIfFinished();\n };\n // Channels keep one identity for a whole set, so they call through this ref\n // and always reach the latest render's props.\n latestRef.current = { updateTake, reportIfFinished };\n\n /** The channel a slot's pane hands its content: its capture group and its takes. */\n const channelFor = (slot: SequenceSlot<RenderableActivity>): SequenceSlotChannel => {\n const key = `${slot.index}::${slot.slotId}`;\n let channel = channelsRef.current.get(key);\n if (channel === undefined) {\n const generation = setGeneration;\n const at = slot.index;\n channel = {\n captureGroup: `${captureScope}::${slot.slotId}`,\n takeState: (take, state) => {\n latestRef.current?.updateTake(generation, at, take, state);\n },\n };\n channelsRef.current.set(key, channel);\n }\n return channel;\n };\n\n if (!current) {\n return <div className=\"lk-seq\" />;\n }\n\n // Every budgeted recording this paper presents, and the key it is budgeted\n // under. Derived from the resolved policy, so the pager, the plan and the\n // schema cannot disagree about what is budgeted.\n const budgetedMedia = slots.flatMap((slot) => {\n const found: { key: string; url: string }[] = [];\n const own = (slot.activity as { media?: ActivityMedia }).media;\n if (own !== undefined && resolvePlaybackPolicy(own).maxPlays !== null) {\n found.push({ key: slotMediaKey(slot.slotId), url: own.url });\n }\n const stimulus = slot.group?.stimulus.media;\n if (stimulus !== undefined && resolvePlaybackPolicy(stimulus).maxPlays !== null) {\n found.push({ key: stimulusMediaKey(slot.slotId), url: stimulus.url });\n }\n return found;\n });\n\n const budgetEnforced = mediaBudget?.enforced ?? renderMode !== 'review';\n\n if (budgetedMedia.length > 0 && renderMode === 'exam' && budgetEnforced) {\n if (mediaBudget?.onPlayConsumed === undefined) {\n throw new Error(\n 'ActivitySequence: renderMode \"exam\" with media that declares `maxPlays` requires ' +\n '`mediaBudget.onPlayConsumed`. The SDK persists nothing, so without it the count lives ' +\n 'only in this mount: a refresh silently restores the full budget, and a paper that ' +\n 'grants unlimited plays while showing \"2 plays remaining\" is indistinguishable — to the ' +\n 'learner and to an appeal — from one that works. Budgeted media: ' +\n `${[...new Set(budgetedMedia.map((m) => m.key))].join(', ')}.`,\n );\n }\n const resuming =\n (responses !== undefined && Object.keys(responses).length > 0) ||\n (submittedSlotIds !== undefined && submittedSlotIds.length > 0);\n if (resuming && mediaBudget.plays === undefined) {\n throw new Error(\n 'ActivitySequence: this is a resumed attempt (`responses`/`submittedSlotIds` were ' +\n 'supplied) but `mediaBudget.plays` is absent. A resume that omits the ledger hands the ' +\n 'learner a fresh budget at exactly the moment it matters. Pass ' +\n '`restoreMediaPlayLedger(plan, stored).entries`, or `{}` to state explicitly that ' +\n 'nothing was spent.',\n );\n }\n }\n\n // One recording must not carry two budgets, in any mode — six questions each\n // holding the same clip at maxPlays 2 is twelve plays of one recording.\n const keysByUrl = new Map<string, Set<string>>();\n for (const { key, url } of budgetedMedia) {\n const keys = keysByUrl.get(url) ?? new Set<string>();\n keys.add(key);\n keysByUrl.set(url, keys);\n }\n for (const [url, keys] of keysByUrl) {\n if (keys.size > 1) {\n throw new Error(\n `ActivitySequence: media ${JSON.stringify(url)} is budgeted under ${keys.size} separate ` +\n `keys (${[...keys].join(', ')}), so one recording grants ${keys.size} × maxPlays. Put ` +\n \"the questions that share a recording in an item group — a group's stimulus is one \" +\n 'recording with one budget.',\n );\n }\n }\n\n /** The per-media binding handed to a component or to the stimulus panel. */\n const bindingFor = (\n key: string,\n slot: { slotId: string; index: number; activity: { id: string } },\n ): MediaBudgetBinding | undefined => {\n if (mediaBudget === undefined) {\n return undefined;\n }\n const entry =\n mediaSeedsApply && mediaPlays !== undefined && Object.hasOwn(mediaPlays, key)\n ? mediaPlays[key]\n : undefined;\n return {\n key,\n slotId: slot.slotId,\n index: slot.index,\n activityId: slot.activity.id,\n ...(entry !== undefined ? { entry } : {}),\n ...(mediaBudget.enforced !== undefined ? { enforced: mediaBudget.enforced } : {}),\n ...(mediaBudget.onPlayConsumed !== undefined\n ? { onPlayConsumed: mediaBudget.onPlayConsumed }\n : {}),\n ...(mediaBudget.onPlayRefunded !== undefined\n ? { onPlayRefunded: mediaBudget.onPlayRefunded }\n : {}),\n ...(mediaBudget.onPosition !== undefined ? { onPosition: mediaBudget.onPosition } : {}),\n ...(mediaBudget.strings !== undefined ? { strings: mediaBudget.strings } : {}),\n };\n };\n\n /**\n * The per-slot recording binding handed to a read-aloud, modelled on\n * `bindingFor`: the sequence-level methods are called with the slot they\n * belong to, and `assess` / `playbackUrl` are copied only when the consumer\n * supplied them — a binding carrying `assess: undefined` is a binding the\n * component would try to call.\n *\n * It watches nothing. The pager used to watch the promises it handed out to\n * decide when a set was finished, and a promise knows nothing of the take\n * that asked for it: a late failure from a paper no longer on screen landed\n * in a new paper that reused the slot's ids, as a blank. What a take came to\n * is reported by the component, numbered by take, through the slot's channel\n * — see `record` and `reportIfFinished`.\n *\n * A consumer's own renderer is handed no binding.\n */\n const recordingBindingFor = (slot: {\n slotId: string;\n index: number;\n activity: { id: string };\n }): RecordingBinding | undefined => {\n if (recordingBinding === undefined) {\n return undefined;\n }\n const at: SequenceRecordingSlot = {\n slotId: slot.slotId,\n index: slot.index,\n activityId: slot.activity.id,\n };\n const { assess, playbackUrl } = recordingBinding;\n // Called on the binding, so a consumer's binding written as a class keeps\n // its `this`.\n return {\n upload: (take) => recordingBinding.upload(take, at),\n ...(assess !== undefined\n ? { assess: (ref: RecordingRef) => assess.call(recordingBinding, ref, at) }\n : {}),\n ...(playbackUrl !== undefined\n ? { playbackUrl: (ref: RecordingRef) => playbackUrl.call(recordingBinding, ref, at) }\n : {}),\n };\n };\n\n const forwarded = {\n ...(onInteraction ? { onInteraction } : {}),\n renderMode,\n ...(sanitizeHtml ? { sanitizeHtml } : {}),\n ...(strings !== undefined ? { strings } : {}),\n ...(theme ? { theme } : {}),\n ...(locale ? { locale } : {}),\n ...(disabled ? { disabled } : {}),\n };\n\n const renderSlot = (slot: SequenceSlot<RenderableActivity>): React.JSX.Element => {\n const activity = slot.activity;\n const { slotId, index: slotIndex } = slot;\n const activityId = activity.id;\n const restored =\n seedsApply && responses !== undefined && Object.hasOwn(responses, slotId)\n ? responses[slotId]\n : undefined;\n const slotOutcome =\n outcomes !== undefined && Object.hasOwn(outcomes, slotId) ? outcomes[slotId] : undefined;\n const slotBinding = bindingFor(slotMediaKey(slotId), slot);\n // Whether this slot's answers are numbered by take — see `record`.\n const takesAnswers = renderMode === 'practice' && activity.type === 'read-aloud';\n const childProps = {\n // `defaultValue`, not `value`: the learner must be able to keep editing\n // a restored answer. A controlled `value` would freeze it unless the\n // consumer also threaded state back, which is not what resume means.\n ...(restored !== undefined ? { defaultValue: restored } : {}),\n ...(seedsApply && submitted.has(slotId) ? { defaultSubmitted: true } : {}),\n ...(slotOutcome !== undefined ? { outcome: slotOutcome } : {}),\n onComplete: (result: ActivityResult) =>\n record(\n { kind: 'scored', index: slotIndex, slotId, activityId, result },\n setGeneration,\n // The take the grade is for: stamped by `<ReadAloud>`, and for a\n // consumer's renderer, which cannot stamp one, the slot's latest.\n takesAnswers ? (takeOf(result) ?? takesRef.current.get(slotIndex)?.take) : undefined,\n ),\n onSubmit: (response: LearnerResponse) => {\n // A submit through a callback handed out for an earlier set is a\n // consumer renderer's late one, for a question no longer on screen: the\n // host would file it against whatever slot reuses these ids now.\n if (setGeneration !== setGenerationRef.current) {\n return;\n }\n onSubmit?.(response, { slotId, index: slotIndex, activityId });\n // Written responses are excluded in every mode because they report\n // something richer through `onSubmitted` a moment later, and the first\n // outcome wins.\n if (activity.type === 'written-response') {\n return;\n }\n // Outside `practice` the components do not grade, so a raw response is\n // the ONLY outcome this slot will ever produce — record it, or the set\n // could never complete and `onFinished` would be dead in exam mode.\n if (renderMode !== 'practice') {\n record(\n { kind: 'responded', index: slotIndex, slotId, activityId, response },\n setGeneration,\n );\n return;\n }\n // A `practice` read-aloud is the one type that can submit and then\n // produce no score: an unscorable take, an assessor that failed, or a\n // binding that stores without judging all end the attempt with nothing\n // to grade, and `onComplete` fires only on a grade. Recorded for its\n // take, so the grade that may still arrive for that take replaces it —\n // and a take recorded again replaces the one before, grade and all.\n if (takesAnswers) {\n record(\n { kind: 'responded', index: slotIndex, slotId, activityId, response },\n setGeneration,\n takeOf(response) ?? mintTake(),\n );\n }\n },\n ...forwarded,\n ...(slotBinding !== undefined ? { mediaBudget: slotBinding } : {}),\n };\n\n const CustomRenderer = renderers?.[activity.type];\n if (CustomRenderer) {\n return <CustomRenderer data={activity} {...childProps} />;\n }\n if (activity.type === 'multiple-choice') {\n return (\n <MultipleChoice\n data={activity}\n // The sequence seed reaches the OPTION shuffle too. Without it a\n // resumed or reviewed item invented a fresh per-mount order, so the\n // learner saw their answers against a different arrangement than the\n // one they sat — the exact reproducibility the attempt id is for.\n {...(shuffleSeed !== undefined ? { shuffleSeed } : {})}\n {...childProps}\n />\n );\n }\n if (activity.type === 'fill-in-the-blanks') {\n return <FillInTheBlanks data={activity} {...childProps} />;\n }\n if (activity.type === 'gap-select') {\n return (\n <GapSelect\n data={activity}\n // The sequence seed reaches the per-gap choice shuffle too, for the\n // same reason it reaches MultipleChoice's options: a resumed or\n // reviewed item that dealt a fresh order would show the learner\n // their answers against an arrangement they never sat.\n {...(shuffleSeed !== undefined ? { shuffleSeed } : {})}\n {...childProps}\n />\n );\n }\n if (activity.type === 'dictation') {\n // Nothing to seed: a dictation shuffles nothing. Outside `practice` its\n // raw response is recorded through `onSubmit` above, like MC/FIB/GS.\n return <Dictation data={activity} {...childProps} />;\n }\n if (activity.type === 'read-aloud') {\n const slotRecordingBinding = recordingBindingFor(slot);\n const slotAssessment =\n assessments !== undefined && Object.hasOwn(assessments, slotId)\n ? assessments[slotId]\n : undefined;\n return (\n <ReadAloud\n data={activity}\n // The whole bag, nothing subtracted — unlike the written-response\n // branch below, which drops `onComplete` because it never grades. A\n // read-aloud needs it in `practice`, where a returned grade is a\n // score like any other, and simply never calls it in `exam`.\n {...childProps}\n // No capture group here: the slot's pane hands it down through\n // `SequenceSlotContext`, so it is no prop of the public component.\n {...(slotRecordingBinding !== undefined\n ? { recordingBinding: slotRecordingBinding }\n : {})}\n {...(slotAssessment !== undefined ? { assessment: slotAssessment } : {})}\n {...(workletUrl !== undefined ? { workletUrl } : {})}\n />\n );\n }\n if (activity.type === 'written-response') {\n // Derived from the SAME bag the other two get, minus the one prop this\n // component genuinely does not have. Listing the props by hand is what\n // made this the branch left behind three separate times —\n // `defaultSubmitted`, the redacted-in-`practice` guard and the media\n // budget were each added to `childProps` and each silently missed here.\n // Subtracting from the shared bag cannot forget a prop that is added to\n // it; listing them can.\n const { onComplete: _neverGrades, ...writtenResponseProps } = childProps;\n return (\n <WrittenResponse\n data={activity}\n {...writtenResponseProps}\n onSubmitted={(submission) =>\n record(\n { kind: 'submitted', index: slotIndex, slotId, activityId, submission },\n setGeneration,\n )\n }\n />\n );\n }\n return (\n <div className=\"lk-seq-unsupported\" role=\"note\">\n {s.unsupportedActivity}\n </div>\n );\n };\n\n const currentEntryKey = entryKeyOf(current);\n\n return (\n <div className=\"lk-seq\" lang={locale}>\n <div className=\"lk-seq-progress\" aria-live=\"polite\" role=\"status\">\n {s.questionProgress(index + 1, total)}\n </div>\n\n {/*\n Each group's stimulus is mounted ONCE and only hidden while the current\n question is outside its group. That — not re-rendering it per slot — is\n what makes the passage the same DOM node throughout, and what lets a\n recording keep its position between questions of one group.\n\n It sits BESIDE the question region, not inside it. Inside, every\n navigation dropped focus onto a container whose first content was the\n whole passage: the region promised \"Question 3 of 5\" and then began\n with the passage, keyboard users tabbed through the stimulus (audio\n controls included) before reaching the question, and the passage was a\n landmark nested inside another landmark. As a sibling it stays a\n landmark the learner can jump back to, while focus lands on the\n question that was actually navigated to.\n */}\n {stimulusMounts.map(({ entryKey, group, first, last }) => {\n // `setKey` leads for the same reason it does on a slot pane: entry keys\n // are short and repeat across papers, so a set change to a DIFFERENT\n // paper that happens to reuse an entry key would not remount this\n // panel — and a mount-only budget seed would leak into the next paper.\n const firstSlot = slots[first];\n const stimulusBinding =\n firstSlot === undefined\n ? undefined\n : bindingFor(stimulusMediaKey(firstSlot.slotId), firstSlot);\n return (\n <SequencePane\n className=\"lk-seq-stimulus\"\n hidden={entryKey !== currentEntryKey}\n key={`${setKey}::group-${entryKey}`}\n >\n <StimulusPanel\n stimulus={group.stimulus}\n range={{ first: first + 1, last: last + 1 }}\n renderMode={renderMode}\n {...(sanitizeHtml ? { sanitizeHtml } : {})}\n {...(locale ? { locale } : {})}\n {...(onInteraction ? { onInteraction } : {})}\n {...(disabled ? { disabled } : {})}\n {...(strings !== undefined ? { strings } : {})}\n {...(stimulusBinding !== undefined ? { mediaBudget: stimulusBinding } : {})}\n />\n </SequencePane>\n );\n })}\n\n <section\n className=\"lk-seq-question\"\n ref={regionRef}\n tabIndex={-1}\n aria-label={s.questionProgress(index + 1, total)}\n >\n {/*\n Every slot stays MOUNTED; only the current one is visible. Rendering\n just the current activity unmounted the others, so navigating back to\n an answered question showed it blank and re-answerable — the learner\n silently lost their answer and a second submit fired completion\n again. `hidden` removes the inactive slots from the accessibility\n tree and from tab order, so only the current question is reachable.\n */}\n {slots.map((slot) => {\n // The slot id (authored position) plus the activity id: the same\n // activity may legitimately fill two slots, and each must keep its\n // own answer state; and a different activity in the same slot must\n // remount rather than inherit the previous one's state.\n //\n // `setKey` leads, so a set change remounts every child. Without it a\n // pure REORDER changed `setKey` — clearing the outcomes — while each\n // child kept its key and therefore its `completed` state. Those\n // slots could not be answered again and no outcome would ever refill\n // them, so the sequence could never finish. A reset has to reset\n // both halves or neither. A parent re-creating a structurally\n // identical array leaves `setKey` untouched, so answers still\n // survive that.\n const slotKey = `${setKey}::slot-${slot.slotId}-${slot.activity.id}`;\n return (\n <SequencePane\n className=\"lk-seq-slot\"\n hidden={slot.index !== index}\n // A channel for every slot, not just the ones that record: its\n // capture group is empty until something joins it, and a pane\n // that asked whether its activity records would have to know the\n // type of a renderer the consumer supplied.\n channel={channelFor(slot)}\n key={slotKey}\n >\n {renderSlot(slot)}\n </SequencePane>\n );\n })}\n </section>\n\n <div className=\"lk-seq-nav\">\n <button\n type=\"button\"\n className=\"lk-seq-prev\"\n onClick={() => go(index - 1)}\n disabled={index === 0}\n >\n {s.previous}\n </button>\n <button\n type=\"button\"\n className=\"lk-seq-next\"\n onClick={() => go(index + 1)}\n disabled={index === total - 1}\n >\n {s.next}\n </button>\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { FeedbackRegion } from './chunk-RCMYEWBE.js';
|
|
3
|
-
import { ActivityErrorBoundary, isDevelopment, ANONYMOUS_ACTOR, objectIdFor } from './chunk-
|
|
4
|
-
import { ActivityMedia } from './chunk-
|
|
3
|
+
import { ActivityErrorBoundary, isDevelopment, ANONYMOUS_ACTOR, objectIdFor } from './chunk-ZJMTHPHY.js';
|
|
4
|
+
import { ActivityMedia } from './chunk-HA3VRF6E.js';
|
|
5
5
|
import { useActivityState } from './chunk-6N43WDVG.js';
|
|
6
|
-
import { useLkStrings } from './chunk-
|
|
6
|
+
import { useLkStrings } from './chunk-52GXJNQ3.js';
|
|
7
7
|
import { assertRedacted, validateActivity, ActivitySchemaError, score, xAPIBuilder, xapiDefinitionFor } from '@intellectif/lk-core';
|
|
8
8
|
import { useMemo, useState, useRef, useEffect } from 'react';
|
|
9
9
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -360,5 +360,5 @@ function FillInTheBlanks2(props) {
|
|
|
360
360
|
}
|
|
361
361
|
|
|
362
362
|
export { FillInTheBlanks2 as FillInTheBlanks };
|
|
363
|
-
//# sourceMappingURL=chunk-
|
|
364
|
-
//# sourceMappingURL=chunk-
|
|
363
|
+
//# sourceMappingURL=chunk-IE5ZNCWN.js.map
|
|
364
|
+
//# sourceMappingURL=chunk-IE5ZNCWN.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/FillInTheBlanks/FillInTheBlanks.tsx","../src/components/FillInTheBlanks/index.tsx"],"names":["result","FillInTheBlanks","jsx"],"mappings":";;;;;;;;;AAsCA,IAAM,WAAA,GAAc,0BAAA;AAIpB,SAAS,aAAa,OAAA,EAA4B;AAChD,EAAA,MAAM,WAAsB,EAAC;AAC7B,EAAA,MAAM,EAAA,GAAK,IAAI,MAAA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"chunk-72UGRIMM.js","sourcesContent":["'use client';\n\nimport {\n ActivitySchemaError,\n assertRedacted,\n type FillInTheBlanksData,\n type FillInTheBlanksLearnerResponse,\n type LearnerResponse,\n type ScoringDetail,\n type ScoringResult,\n score,\n validateActivity,\n xAPIBuilder,\n xapiDefinitionFor,\n} from '@intellectif/lk-core';\nimport { type CSSProperties, useEffect, useMemo, useRef, useState } from 'react';\nimport { useActivityState } from '../../hooks/useActivityState.js';\nimport { useLkStrings } from '../../i18n/LkIntlProvider.js';\nimport { ANONYMOUS_ACTOR, isDevelopment, objectIdFor } from '../_internal.js';\nimport { ActivityMedia } from '../shared/ActivityMedia.js';\nimport { FeedbackRegion } from '../shared/FeedbackRegion.js';\nimport type { ActivityProps } from '../types.js';\n\nexport interface FillInTheBlanksProps extends ActivityProps<FillInTheBlanksData> {\n /**\n * After submission, replace each incorrectly-answered blank with its first\n * accepted answer, styled distinctly (Req 5.7). Component-specific prop: it\n * is presentation, not activity data, and is outside the fixed Req-3.1 set.\n *\n * Ignored in `exam` mode — revealing the key is precisely what an exam must\n * not do, and on a `redact()` projection there is no key to reveal. In\n * `review` mode it applies only to blanks the supplied `outcome` marks\n * incorrect, and only when the caller passed data that still carries the key\n * (e.g. `redact(data, { reveal: 'after-submit' })`).\n */\n showCorrectAnswers?: boolean;\n}\n\nconst PLACEHOLDER = /\\{\\{\\s*([^{}]+?)\\s*\\}\\}/g;\n\ntype Segment = { kind: 'text'; value: string } | { kind: 'blank'; id: string; ordinal: number };\n\nfunction parsePassage(passage: string): Segment[] {\n const segments: Segment[] = [];\n const re = new RegExp(PLACEHOLDER);\n let last = 0;\n let ordinal = 0;\n let match = re.exec(passage);\n while (match !== null) {\n if (match.index > last) {\n segments.push({ kind: 'text', value: passage.slice(last, match.index) });\n }\n ordinal += 1;\n segments.push({ kind: 'blank', id: match[1] as string, ordinal });\n last = match.index + match[0].length;\n match = re.exec(passage);\n }\n if (last < passage.length) {\n segments.push({ kind: 'text', value: passage.slice(last) });\n }\n return segments;\n}\n\n/** Shared empty map: keeps the \"no response supplied\" path allocation-free. */\nconst NO_ANSWERS: Record<string, string> = {};\n\n/**\n * Reads the answer map out of a `LearnerResponse`. A response of another\n * activity type is treated as \"no answers\" rather than throwing: a controlled\n * host that has not yet swapped its state on an activity change would\n * otherwise crash the attempt.\n */\nfunction answersOf(response: LearnerResponse | undefined): Record<string, string> {\n return response !== undefined && response.type === 'fill-in-the-blanks'\n ? response.answers\n : NO_ANSWERS;\n}\n\n/**\n * Per-item correctness keyed by blank id. Prefers the unambiguous `outcome`\n * field (always written by the built-in scorers since lk-core 0.3.0) and\n * falls back to the deprecated `correct` boolean so a 0.2-era\n * consumer-constructed `ItemOutcome` still marks correctly in `review`.\n */\nfunction correctnessByItem(details: readonly ScoringDetail[]): Map<string, boolean> {\n const map = new Map<string, boolean>();\n for (const detail of details) {\n map.set(\n detail.itemId,\n detail.outcome !== undefined ? detail.outcome === 'correct' : detail.correct,\n );\n }\n return map;\n}\n\nexport function FillInTheBlanks({\n data,\n onComplete,\n onSubmit,\n onChange,\n onInteraction,\n value,\n defaultValue,\n defaultSubmitted,\n renderMode = 'practice',\n outcome,\n sanitizeHtml,\n mediaBudget,\n mediaStrings,\n strings,\n theme,\n locale,\n disabled,\n showCorrectAnswers,\n}: FillInTheBlanksProps) {\n const isExam = renderMode === 'exam';\n const isReview = renderMode === 'review';\n\n // Dev-only boundary validation (Req 2.3); throws in render so the wrapping\n // ActivityErrorBoundary catches it. Re-runs only when data changes.\n const s = useLkStrings(strings);\n\n const devError = useMemo(() => {\n if (!isDevelopment()) {\n return null;\n }\n if (data.redacted === true) {\n // A redact() projection cannot satisfy the full content schema — the\n // answer key is gone by design. Validate it against the STRICT redacted\n // schema instead, which additionally proves the payload is learner-safe.\n try {\n assertRedacted(data);\n return null;\n } catch (error) {\n return error instanceof Error ? error : new Error(String(error));\n }\n }\n const result = validateActivity('fill-in-the-blanks', data);\n return result.success ? null : new ActivitySchemaError('fill-in-the-blanks', result.errors);\n }, [data]);\n\n const { state, start, complete, getTimeSpent, reset } = useActivityState(\n defaultSubmitted === true ? 'completed' : 'idle',\n );\n // Controlled when `value` is supplied: the answers rendered are ALWAYS the\n // caller's, and internal state is never read. Uncontrolled otherwise,\n // seeded from `defaultValue`.\n const isControlled = value !== undefined;\n const [internalAnswers, setInternalAnswers] = useState<Record<string, string>>(() =>\n answersOf(defaultValue),\n );\n const [revealed, setRevealed] = useState<Set<string>>(() => new Set());\n const [result, setResult] = useState<ScoringResult | null>(null);\n const [summary, setSummary] = useState<string | null>(null);\n const [feedbackHidden, setFeedbackHidden] = useState(false);\n\n const answers = isControlled ? answersOf(value) : internalAnswers;\n\n // `defaultValue` is read only by the reset effect, and it is commonly an\n // inline object literal — putting it in that effect's deps would re-seed\n // (and wipe) the learner's typing on every render. Mirror it into a ref in\n // its own effect, which commits before the reset effect below.\n const defaultValueRef = useRef(defaultValue);\n useEffect(() => {\n defaultValueRef.current = defaultValue;\n }, [defaultValue]);\n\n // Mirror `defaultSubmitted` so the reset below returns to the SEEDED state.\n // Resetting unconditionally to idle unlocked an item the learner had already\n // committed — which made `defaultSubmitted` a no-op here, since this effect\n // runs right after the first paint.\n const defaultSubmittedRef = useRef(defaultSubmitted);\n useEffect(() => {\n defaultSubmittedRef.current = defaultSubmitted;\n }, [defaultSubmitted]);\n\n // Identity guard so the MOUNT run is a no-op. Without it this effect fires\n // after the first paint and undoes every seed it was just given; with it,\n // only a real `data` change resets. A parent that rebuilds structurally\n // identical entries in render (`activities={raw.map(redact)}`) must not\n // unlock or revert a restored answer — the pager already remounts a slot\n // whose activity actually changed, via its key.\n const lastDataRef = useRef(data);\n // `data` is an intentional reset trigger (Req 3.7); it is already in the\n // dependency list. The identity guard below skips the mount run.\n useEffect(() => {\n if (lastDataRef.current === data) {\n return;\n }\n lastDataRef.current = data;\n setInternalAnswers(answersOf(defaultValueRef.current));\n setRevealed(new Set());\n setResult(null);\n setSummary(null);\n setFeedbackHidden(false);\n reset(defaultSubmittedRef.current === true ? 'completed' : 'idle');\n }, [data, reset]);\n\n /*\n * RICH TEXT — deliberate, documented limitation (see `sanitizeHtml`).\n *\n * Every other activity can render its `*Html` field through the caller's\n * sanitiser, because the rich text is a LEAF: the sanitised string is\n * handed to one `dangerouslySetInnerHTML` node and nothing is inserted into\n * it. A fill-in-the-blanks passage is not a leaf — it is the CONTAINER of\n * the React-controlled `<input>`s, one per `{{id}}` placeholder.\n *\n * Placing those inputs inside sanitised HTML means slicing the sanitised\n * string at the placeholders and injecting each slice as its own HTML\n * fragment, which is unsafe and broken on both counts:\n * 1. Broken: the slices are unbalanced. `<p>A {{x}} B</p>` yields `<p>A `\n * and ` B</p>`; the fragment parser auto-closes both, so the input\n * lands OUTSIDE the paragraph and the authored block structure is\n * destroyed.\n * 2. Unsafe: the sanitiser's guarantee covers the document it returned,\n * not arbitrary substrings of it. A placeholder inside an attribute\n * (`<img alt=\"{{x}}\">`) splits mid-attribute, and re-parsing the\n * halves in a fresh context is exactly the mutation (mXSS) class of\n * transformation that voids a sanitiser's output guarantee. An exam\n * runner must never depend on that.\n *\n * The safe alternative — parse the sanitised string once into a detached\n * DOM, split only TEXT nodes at placeholders, and portal the inputs into\n * anchors — needs a DOM at render time (no SSR) and a large imperative\n * subsystem. Until that lands, the plain-text `passage` is rendered (always\n * escaped by React), which is correct, answerable, and safe in every mode.\n * `data.passageHtml` is carried and redacted by lk-core regardless, so no\n * authored content is lost — only this component declines to render it.\n */\n useEffect(() => {\n if (isDevelopment() && sanitizeHtml !== undefined && data.passageHtml !== undefined) {\n console.warn(\n '[lk-react] FillInTheBlanks ignores `passageHtml`: the passage hosts the answer inputs, ' +\n 'so rich HTML cannot be split at {{placeholders}} without voiding the sanitiser. ' +\n 'Rendering the plain `passage` instead.',\n );\n }\n }, [sanitizeHtml, data.passageHtml]);\n\n const segments = useMemo(() => parsePassage(data.passage), [data.passage]);\n const blankById = useMemo(() => new Map(data.blanks.map((b) => [b.id, b])), [data.blanks]);\n\n if (devError) {\n throw devError;\n }\n // Practice grades locally, which a redacted projection cannot support: the\n // submit handler below calls `score()`, which throws RedactedScoringError —\n // from an event handler, where no error boundary can catch it, AFTER the\n // learner has typed their answers. Fail loudly at render instead, in\n // production too. This mirrors the identical guard in MultipleChoice;\n // without it the two built-ins disagreed about the same accident, and\n // wiring an exam item into the self-grading mode is precisely what\n // `renderMode` exists to prevent.\n if (data.redacted === true && renderMode === 'practice') {\n throw new Error(\n `Fill-in-the-Blanks \"${data.id}\" received redacted activity data in renderMode \"practice\", ` +\n 'which grades locally and has no answer key to grade against. ' +\n 'Render redacted data with renderMode=\"exam\" (server grades) or \"review\" (pass `outcome`).',\n );\n }\n\n const submitted = state === 'completed';\n const inactive = disabled === true || submitted || isReview;\n\n /**\n * Whether the component may show answer-key-derived information (per-blank\n * correctness, authored feedback, correct answers). NEVER in `exam`; in\n * `practice` only after the component scored locally; in `review` only once\n * the caller supplies a SCORED outcome — an item that is still awaiting a\n * grade must not have its key revealed just because it is being read back.\n */\n const revealing = isReview ? outcome?.status === 'scored' : !isExam && submitted;\n\n const fireInteraction = (\n type: 'blank-filled' | 'hint-requested' | 'submitted',\n payload: Record<string, unknown>,\n ): void => {\n onInteraction?.({ type, activityId: data.id, timestamp: Date.now(), payload });\n };\n\n const handleChange = (blankId: string, text: string): void => {\n if (inactive) {\n return;\n }\n if (state === 'idle') {\n start();\n }\n const next = { ...answers, [blankId]: text };\n if (!isControlled) {\n setInternalAnswers(next);\n }\n onChange?.({ type: 'fill-in-the-blanks', answers: next });\n fireInteraction('blank-filled', { blankId, value: text });\n };\n\n const toggleHint = (blankId: string): void => {\n if (inactive) {\n return;\n }\n if (state === 'idle') {\n start();\n }\n setRevealed((prev) => {\n const next = new Set(prev);\n if (next.has(blankId)) {\n next.delete(blankId);\n return next;\n }\n next.add(blankId);\n return next;\n });\n // Only a reveal is a \"hint requested\"; hiding is not a new request.\n if (!revealed.has(blankId)) {\n fireInteraction('hint-requested', { blankId });\n }\n };\n\n const handleSubmit = (event: React.FormEvent): void => {\n event.preventDefault();\n if (inactive) {\n return;\n }\n const response: FillInTheBlanksLearnerResponse = { type: 'fill-in-the-blanks', answers };\n // Fires in every submitting mode and always BEFORE onComplete, so an exam\n // runner can persist the raw response regardless of local grading.\n onSubmit?.(response);\n\n if (isExam) {\n // EXAM: the client neither grades nor reveals. No score()/evaluate(), no\n // read of any answer-key field, no onComplete — and no xAPI statement,\n // because its `correctResponsesPattern` IS the answer key. The server\n // owns the grade; it emits the statement.\n complete();\n setSummary(s.answerSubmitted);\n fireInteraction('submitted', { answers });\n return;\n }\n\n // PRACTICE: unchanged v1 behaviour. `data` carries the key here — exam\n // mode is the only path that may be handed a redact() projection.\n const scoringResult = score('fill-in-the-blanks', data as FillInTheBlanksData, response);\n complete();\n const timeSpent = getTimeSpent();\n const xapiStatement = xAPIBuilder.buildAnsweredStatement({\n actor: ANONYMOUS_ACTOR,\n object: {\n id: objectIdFor(data.id),\n name: { [data.locale ?? 'en-US']: data.title },\n ...xapiDefinitionFor(data),\n },\n scoringResult,\n timeSpentMs: timeSpent,\n response: JSON.stringify(answers),\n });\n setResult(scoringResult);\n onComplete?.({\n score: scoringResult.score,\n maxScore: scoringResult.maxScore,\n passed: scoringResult.passed,\n timeSpent,\n xapiStatement,\n });\n // Core selects the authored overall feedback on `passed` (B3 fix).\n const overall = scoringResult.feedback;\n setSummary(\n `${s.answerSubmitted} ${s.scoreAnnouncement(\n Math.round(scoringResult.score * 100),\n scoringResult.passed,\n )}${overall ? ` ${overall}` : ''}`,\n );\n fireInteraction('submitted', { answers, score: scoringResult.score });\n };\n\n const correctByBlank = useMemo(() => {\n if (isExam) {\n // Nothing is ever marked client-side in an exam.\n return new Map<string, boolean>();\n }\n if (isReview) {\n // Correctness comes ONLY from the server-computed outcome; the component\n // never scores in review, so an absent/ungraded outcome marks nothing.\n return outcome?.status === 'scored'\n ? correctnessByItem(outcome.details)\n : new Map<string, boolean>();\n }\n return correctnessByItem(result?.details ?? []);\n }, [isExam, isReview, outcome, result]);\n\n /** Review has no local score: its summary is read off `outcome`, or nothing. */\n const reviewSummary = useMemo(() => {\n if (!isReview || outcome === undefined) {\n return null;\n }\n if (outcome.status === 'scored') {\n return `${s.scoreAnnouncement(Math.round(outcome.score * 100), outcome.passed)}${\n outcome.feedback ? ` ${outcome.feedback}` : ''\n }`;\n }\n if (outcome.status === 'deferred') {\n return s.notGradedYet;\n }\n // `graded` used to fall into the arm below and announce \"No grade\n // available.\" over a grade that had come back. Normalised by maxScore so a\n // grader payload of 8.5 / 10 does not read as 850% — same guard as\n // `<WrittenResponse>`.\n if (outcome.status === 'graded') {\n const percent =\n outcome.maxScore > 0\n ? Math.round((outcome.score / outcome.maxScore) * 100)\n : Math.round(outcome.score * 100);\n return `${s.scoreAnnouncement(percent, outcome.passed)}${\n outcome.feedback ? ` ${outcome.feedback}` : ''\n }`;\n }\n return s.noGradeAvailable;\n }, [isReview, outcome, s]);\n\n return (\n <form\n className=\"lk-fib\"\n aria-label={data.title}\n lang={locale}\n data-render-mode={renderMode}\n style={theme as CSSProperties | undefined}\n onSubmit={handleSubmit}\n >\n {data.media ? (\n <ActivityMedia\n media={data.media}\n renderMode={renderMode}\n {...(mediaBudget !== undefined ? { mediaBudget } : {})}\n {...(mediaStrings !== undefined ? { mediaStrings } : {})}\n {...(strings !== undefined ? { strings } : {})}\n {...(onInteraction !== undefined ? { onInteraction } : {})}\n {...(locale !== undefined ? { locale } : {})}\n />\n ) : null}\n <fieldset disabled={inactive}>\n <p className=\"lk-fib-passage\">\n {segments.map((seg, i) => {\n if (seg.kind === 'text') {\n // biome-ignore lint/suspicious/noArrayIndexKey: passage segments are positional and static\n return <span key={`t${i}`}>{seg.value}</span>;\n }\n const blank = blankById.get(seg.id);\n if (!blank) {\n return null;\n }\n // `Renderable` only widens `scoringStrategy` at the type level, so\n // the answer-key fields still LOOK required here while a redact()\n // projection omits them at runtime. Read them defensively, and\n // never at all in exam mode.\n const acceptedAnswers: string[] | undefined = isExam\n ? undefined\n : blank.acceptedAnswers;\n const blankFeedback = isExam ? undefined : blank.feedback;\n const correctness = correctByBlank.get(seg.id);\n const hintId = `${data.id}-hint-${seg.id}`;\n const correctAnswer = acceptedAnswers?.[0];\n if (revealing && showCorrectAnswers && correctness === false && correctAnswer) {\n return (\n <span key={seg.id} className=\"lk-fib-answer\" data-correct=\"false\">\n {correctAnswer}\n </span>\n );\n }\n return (\n <span key={seg.id} className=\"lk-fib-blank\">\n <input\n type=\"text\"\n aria-label={s.blankLabel(seg.ordinal)}\n aria-describedby={blank.hint ? hintId : undefined}\n value={answers[seg.id] ?? ''}\n disabled={inactive}\n aria-disabled={inactive || undefined}\n data-correct={\n revealing && correctness !== undefined ? String(correctness) : undefined\n }\n onChange={(e) => handleChange(seg.id, e.target.value)}\n />\n {/*\n Hints stay available in exam mode by design: lk-core's field\n policy classifies `blanks.hint` as `public`, so it survives\n redact() and is not part of the answer key.\n */}\n {blank.hint ? (\n <>\n {/*\n Default affordance is an icon; the accessible NAME stays\n text via aria-label (screen readers + tests rely on it).\n The glyph is restylable/replaceable via .lk-fib-hint-btn.\n */}\n <button\n type=\"button\"\n className=\"lk-fib-hint-btn\"\n aria-controls={hintId}\n aria-expanded={revealed.has(seg.id)}\n aria-label={revealed.has(seg.id) ? s.hideHint : s.showHint}\n disabled={inactive}\n onClick={() => toggleHint(seg.id)}\n >\n <svg\n className=\"lk-fib-hint-icon\"\n viewBox=\"0 0 24 24\"\n width=\"16\"\n height=\"16\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <path\n fill=\"currentColor\"\n d=\"M9 21h6v-1H9v1Zm3-19a7 7 0 0 0-4 12.74V17h8v-2.26A7 7 0 0 0 12 2Z\"\n />\n </svg>\n </button>\n {/*\n Not role=\"tooltip\": a real ARIA tooltip is a named\n hover/focus popup with strict WCAG 1.4.13 constraints.\n This is an accessible click-to-toggle disclosure that is\n the input's aria-describedby target and is announced via\n aria-live; the skin gives it a tooltip-like *visual*\n without the tooltip *semantics*. (Refines Task 15.3.)\n */}\n <span id={hintId} aria-live=\"polite\">\n {revealed.has(seg.id) ? blank.hint : ''}\n </span>\n </>\n ) : null}\n {revealing && !feedbackHidden && blankFeedback ? (\n <span\n className=\"lk-fib-blank-feedback\"\n role=\"note\"\n data-correct={correctness !== undefined ? String(correctness) : undefined}\n >\n {blankFeedback}\n </span>\n ) : null}\n </span>\n );\n })}\n </p>\n {/* Review is read-only: there is nothing to submit. */}\n {isReview ? null : (\n <button type=\"submit\" disabled={inactive}>\n {isExam ? s.submitAnswers : s.checkAnswers}\n </button>\n )}\n </fieldset>\n {revealing && data.blanks.some((b) => b.feedback) ? (\n <button\n type=\"button\"\n className=\"lk-fib-feedback-toggle\"\n aria-expanded={!feedbackHidden}\n onClick={() => setFeedbackHidden((h) => !h)}\n >\n {feedbackHidden ? s.showFeedback : s.hideFeedback}\n </button>\n ) : null}\n <FeedbackRegion id={`${data.id}-feedback`}>\n {isReview ? reviewSummary : summary}\n </FeedbackRegion>\n </form>\n );\n}\n","'use client';\n\nimport { useLkStrings } from '../../i18n/LkIntlProvider.js';\nimport { ActivityErrorBoundary } from '../ActivityErrorBoundary.js';\nimport {\n FillInTheBlanks as FillInTheBlanksCore,\n type FillInTheBlanksProps,\n} from './FillInTheBlanks.js';\n\nexport type { FillInTheBlanksProps } from './FillInTheBlanks.js';\n\n/**\n * Public Fill-in-the-Blanks activity: the core wrapped in\n * `ActivityErrorBoundary` so a render failure (incl. the dev schema-validation\n * throw) degrades to an accessible fallback instead of crashing the host.\n */\nexport function FillInTheBlanks(props: FillInTheBlanksProps) {\n // Read here rather than in the boundary: a class component cannot call a\n // hook, and the fallback it renders is learner-facing text like any other.\n const strings = useLkStrings(props.strings);\n return (\n <ActivityErrorBoundary activityTitle={props.data?.title} strings={strings}>\n <FillInTheBlanksCore {...props} />\n </ActivityErrorBoundary>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/FillInTheBlanks/FillInTheBlanks.tsx","../src/components/FillInTheB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EAAA,uBACEC,GAAAA,CAAC,qBAAA,EAAA,EAAsB,aAAA,EAAe,KAAA,CAAM,IAAA,EAAM,KAAA,EAAO,OAAA,EACvD,QAAA,kBAAAA,GAAAA,CAAC,eAAA,EAAA,EAAqB,GAAG,OAAO,CAAA,EAClC,CAAA;AAEJ","file":"chunk-IE5ZNCWN.js","sourcesContent":["'use client';\n\nimport {\n ActivitySchemaError,\n assertRedacted,\n type FillInTheBlanksData,\n type FillInTheBlanksLearnerResponse,\n type LearnerResponse,\n type ScoringDetail,\n type ScoringResult,\n score,\n validateActivity,\n xAPIBuilder,\n xapiDefinitionFor,\n} from '@intellectif/lk-core';\nimport { type CSSProperties, useEffect, useMemo, useRef, useState } from 'react';\nimport { useActivityState } from '../../hooks/useActivityState.js';\nimport { useLkStrings } from '../../i18n/LkIntlProvider.js';\nimport { ANONYMOUS_ACTOR, isDevelopment, objectIdFor } from '../_internal.js';\nimport { ActivityMedia } from '../shared/ActivityMedia.js';\nimport { FeedbackRegion } from '../shared/FeedbackRegion.js';\nimport type { ActivityProps } from '../types.js';\n\nexport interface FillInTheBlanksProps extends ActivityProps<FillInTheBlanksData> {\n /**\n * After submission, replace each incorrectly-answered blank with its first\n * accepted answer, styled distinctly (Req 5.7). Component-specific prop: it\n * is presentation, not activity data, and is outside the fixed Req-3.1 set.\n *\n * Ignored in `exam` mode — revealing the key is precisely what an exam must\n * not do, and on a `redact()` projection there is no key to reveal. In\n * `review` mode it applies only to blanks the supplied `outcome` marks\n * incorrect, and only when the caller passed data that still carries the key\n * (e.g. `redact(data, { reveal: 'after-submit' })`).\n */\n showCorrectAnswers?: boolean;\n}\n\nconst PLACEHOLDER = /\\{\\{\\s*([^{}]+?)\\s*\\}\\}/g;\n\ntype Segment = { kind: 'text'; value: string } | { kind: 'blank'; id: string; ordinal: number };\n\nfunction parsePassage(passage: string): Segment[] {\n const segments: Segment[] = [];\n const re = new RegExp(PLACEHOLDER);\n let last = 0;\n let ordinal = 0;\n let match = re.exec(passage);\n while (match !== null) {\n if (match.index > last) {\n segments.push({ kind: 'text', value: passage.slice(last, match.index) });\n }\n ordinal += 1;\n segments.push({ kind: 'blank', id: match[1] as string, ordinal });\n last = match.index + match[0].length;\n match = re.exec(passage);\n }\n if (last < passage.length) {\n segments.push({ kind: 'text', value: passage.slice(last) });\n }\n return segments;\n}\n\n/** Shared empty map: keeps the \"no response supplied\" path allocation-free. */\nconst NO_ANSWERS: Record<string, string> = {};\n\n/**\n * Reads the answer map out of a `LearnerResponse`. A response of another\n * activity type is treated as \"no answers\" rather than throwing: a controlled\n * host that has not yet swapped its state on an activity change would\n * otherwise crash the attempt.\n */\nfunction answersOf(response: LearnerResponse | undefined): Record<string, string> {\n return response !== undefined && response.type === 'fill-in-the-blanks'\n ? response.answers\n : NO_ANSWERS;\n}\n\n/**\n * Per-item correctness keyed by blank id. Prefers the unambiguous `outcome`\n * field (always written by the built-in scorers since lk-core 0.3.0) and\n * falls back to the deprecated `correct` boolean so a 0.2-era\n * consumer-constructed `ItemOutcome` still marks correctly in `review`.\n */\nfunction correctnessByItem(details: readonly ScoringDetail[]): Map<string, boolean> {\n const map = new Map<string, boolean>();\n for (const detail of details) {\n map.set(\n detail.itemId,\n detail.outcome !== undefined ? detail.outcome === 'correct' : detail.correct,\n );\n }\n return map;\n}\n\nexport function FillInTheBlanks({\n data,\n onComplete,\n onSubmit,\n onChange,\n onInteraction,\n value,\n defaultValue,\n defaultSubmitted,\n renderMode = 'practice',\n outcome,\n sanitizeHtml,\n mediaBudget,\n mediaStrings,\n strings,\n theme,\n locale,\n disabled,\n showCorrectAnswers,\n}: FillInTheBlanksProps) {\n const isExam = renderMode === 'exam';\n const isReview = renderMode === 'review';\n\n // Dev-only boundary validation (Req 2.3); throws in render so the wrapping\n // ActivityErrorBoundary catches it. Re-runs only when data changes.\n const s = useLkStrings(strings);\n\n const devError = useMemo(() => {\n if (!isDevelopment()) {\n return null;\n }\n if (data.redacted === true) {\n // A redact() projection cannot satisfy the full content schema — the\n // answer key is gone by design. Validate it against the STRICT redacted\n // schema instead, which additionally proves the payload is learner-safe.\n try {\n assertRedacted(data);\n return null;\n } catch (error) {\n return error instanceof Error ? error : new Error(String(error));\n }\n }\n const result = validateActivity('fill-in-the-blanks', data);\n return result.success ? null : new ActivitySchemaError('fill-in-the-blanks', result.errors);\n }, [data]);\n\n const { state, start, complete, getTimeSpent, reset } = useActivityState(\n defaultSubmitted === true ? 'completed' : 'idle',\n );\n // Controlled when `value` is supplied: the answers rendered are ALWAYS the\n // caller's, and internal state is never read. Uncontrolled otherwise,\n // seeded from `defaultValue`.\n const isControlled = value !== undefined;\n const [internalAnswers, setInternalAnswers] = useState<Record<string, string>>(() =>\n answersOf(defaultValue),\n );\n const [revealed, setRevealed] = useState<Set<string>>(() => new Set());\n const [result, setResult] = useState<ScoringResult | null>(null);\n const [summary, setSummary] = useState<string | null>(null);\n const [feedbackHidden, setFeedbackHidden] = useState(false);\n\n const answers = isControlled ? answersOf(value) : internalAnswers;\n\n // `defaultValue` is read only by the reset effect, and it is commonly an\n // inline object literal — putting it in that effect's deps would re-seed\n // (and wipe) the learner's typing on every render. Mirror it into a ref in\n // its own effect, which commits before the reset effect below.\n const defaultValueRef = useRef(defaultValue);\n useEffect(() => {\n defaultValueRef.current = defaultValue;\n }, [defaultValue]);\n\n // Mirror `defaultSubmitted` so the reset below returns to the SEEDED state.\n // Resetting unconditionally to idle unlocked an item the learner had already\n // committed — which made `defaultSubmitted` a no-op here, since this effect\n // runs right after the first paint.\n const defaultSubmittedRef = useRef(defaultSubmitted);\n useEffect(() => {\n defaultSubmittedRef.current = defaultSubmitted;\n }, [defaultSubmitted]);\n\n // Identity guard so the MOUNT run is a no-op. Without it this effect fires\n // after the first paint and undoes every seed it was just given; with it,\n // only a real `data` change resets. A parent that rebuilds structurally\n // identical entries in render (`activities={raw.map(redact)}`) must not\n // unlock or revert a restored answer — the pager already remounts a slot\n // whose activity actually changed, via its key.\n const lastDataRef = useRef(data);\n // `data` is an intentional reset trigger (Req 3.7); it is already in the\n // dependency list. The identity guard below skips the mount run.\n useEffect(() => {\n if (lastDataRef.current === data) {\n return;\n }\n lastDataRef.current = data;\n setInternalAnswers(answersOf(defaultValueRef.current));\n setRevealed(new Set());\n setResult(null);\n setSummary(null);\n setFeedbackHidden(false);\n reset(defaultSubmittedRef.current === true ? 'completed' : 'idle');\n }, [data, reset]);\n\n /*\n * RICH TEXT — deliberate, documented limitation (see `sanitizeHtml`).\n *\n * Every other activity can render its `*Html` field through the caller's\n * sanitiser, because the rich text is a LEAF: the sanitised string is\n * handed to one `dangerouslySetInnerHTML` node and nothing is inserted into\n * it. A fill-in-the-blanks passage is not a leaf — it is the CONTAINER of\n * the React-controlled `<input>`s, one per `{{id}}` placeholder.\n *\n * Placing those inputs inside sanitised HTML means slicing the sanitised\n * string at the placeholders and injecting each slice as its own HTML\n * fragment, which is unsafe and broken on both counts:\n * 1. Broken: the slices are unbalanced. `<p>A {{x}} B</p>` yields `<p>A `\n * and ` B</p>`; the fragment parser auto-closes both, so the input\n * lands OUTSIDE the paragraph and the authored block structure is\n * destroyed.\n * 2. Unsafe: the sanitiser's guarantee covers the document it returned,\n * not arbitrary substrings of it. A placeholder inside an attribute\n * (`<img alt=\"{{x}}\">`) splits mid-attribute, and re-parsing the\n * halves in a fresh context is exactly the mutation (mXSS) class of\n * transformation that voids a sanitiser's output guarantee. An exam\n * runner must never depend on that.\n *\n * The safe alternative — parse the sanitised string once into a detached\n * DOM, split only TEXT nodes at placeholders, and portal the inputs into\n * anchors — needs a DOM at render time (no SSR) and a large imperative\n * subsystem. Until that lands, the plain-text `passage` is rendered (always\n * escaped by React), which is correct, answerable, and safe in every mode.\n * `data.passageHtml` is carried and redacted by lk-core regardless, so no\n * authored content is lost — only this component declines to render it.\n */\n useEffect(() => {\n if (isDevelopment() && sanitizeHtml !== undefined && data.passageHtml !== undefined) {\n console.warn(\n '[lk-react] FillInTheBlanks ignores `passageHtml`: the passage hosts the answer inputs, ' +\n 'so rich HTML cannot be split at {{placeholders}} without voiding the sanitiser. ' +\n 'Rendering the plain `passage` instead.',\n );\n }\n }, [sanitizeHtml, data.passageHtml]);\n\n const segments = useMemo(() => parsePassage(data.passage), [data.passage]);\n const blankById = useMemo(() => new Map(data.blanks.map((b) => [b.id, b])), [data.blanks]);\n\n if (devError) {\n throw devError;\n }\n // Practice grades locally, which a redacted projection cannot support: the\n // submit handler below calls `score()`, which throws RedactedScoringError —\n // from an event handler, where no error boundary can catch it, AFTER the\n // learner has typed their answers. Fail loudly at render instead, in\n // production too. This mirrors the identical guard in MultipleChoice;\n // without it the two built-ins disagreed about the same accident, and\n // wiring an exam item into the self-grading mode is precisely what\n // `renderMode` exists to prevent.\n if (data.redacted === true && renderMode === 'practice') {\n throw new Error(\n `Fill-in-the-Blanks \"${data.id}\" received redacted activity data in renderMode \"practice\", ` +\n 'which grades locally and has no answer key to grade against. ' +\n 'Render redacted data with renderMode=\"exam\" (server grades) or \"review\" (pass `outcome`).',\n );\n }\n\n const submitted = state === 'completed';\n const inactive = disabled === true || submitted || isReview;\n\n /**\n * Whether the component may show answer-key-derived information (per-blank\n * correctness, authored feedback, correct answers). NEVER in `exam`; in\n * `practice` only after the component scored locally; in `review` only once\n * the caller supplies a SCORED outcome — an item that is still awaiting a\n * grade must not have its key revealed just because it is being read back.\n */\n const revealing = isReview ? outcome?.status === 'scored' : !isExam && submitted;\n\n const fireInteraction = (\n type: 'blank-filled' | 'hint-requested' | 'submitted',\n payload: Record<string, unknown>,\n ): void => {\n onInteraction?.({ type, activityId: data.id, timestamp: Date.now(), payload });\n };\n\n const handleChange = (blankId: string, text: string): void => {\n if (inactive) {\n return;\n }\n if (state === 'idle') {\n start();\n }\n const next = { ...answers, [blankId]: text };\n if (!isControlled) {\n setInternalAnswers(next);\n }\n onChange?.({ type: 'fill-in-the-blanks', answers: next });\n fireInteraction('blank-filled', { blankId, value: text });\n };\n\n const toggleHint = (blankId: string): void => {\n if (inactive) {\n return;\n }\n if (state === 'idle') {\n start();\n }\n setRevealed((prev) => {\n const next = new Set(prev);\n if (next.has(blankId)) {\n next.delete(blankId);\n return next;\n }\n next.add(blankId);\n return next;\n });\n // Only a reveal is a \"hint requested\"; hiding is not a new request.\n if (!revealed.has(blankId)) {\n fireInteraction('hint-requested', { blankId });\n }\n };\n\n const handleSubmit = (event: React.FormEvent): void => {\n event.preventDefault();\n if (inactive) {\n return;\n }\n const response: FillInTheBlanksLearnerResponse = { type: 'fill-in-the-blanks', answers };\n // Fires in every submitting mode and always BEFORE onComplete, so an exam\n // runner can persist the raw response regardless of local grading.\n onSubmit?.(response);\n\n if (isExam) {\n // EXAM: the client neither grades nor reveals. No score()/evaluate(), no\n // read of any answer-key field, no onComplete — and no xAPI statement,\n // because its `correctResponsesPattern` IS the answer key. The server\n // owns the grade; it emits the statement.\n complete();\n setSummary(s.answerSubmitted);\n fireInteraction('submitted', { answers });\n return;\n }\n\n // PRACTICE: unchanged v1 behaviour. `data` carries the key here — exam\n // mode is the only path that may be handed a redact() projection.\n const scoringResult = score('fill-in-the-blanks', data as FillInTheBlanksData, response);\n complete();\n const timeSpent = getTimeSpent();\n const xapiStatement = xAPIBuilder.buildAnsweredStatement({\n actor: ANONYMOUS_ACTOR,\n object: {\n id: objectIdFor(data.id),\n name: { [data.locale ?? 'en-US']: data.title },\n ...xapiDefinitionFor(data),\n },\n scoringResult,\n timeSpentMs: timeSpent,\n response: JSON.stringify(answers),\n });\n setResult(scoringResult);\n onComplete?.({\n score: scoringResult.score,\n maxScore: scoringResult.maxScore,\n passed: scoringResult.passed,\n timeSpent,\n xapiStatement,\n });\n // Core selects the authored overall feedback on `passed` (B3 fix).\n const overall = scoringResult.feedback;\n setSummary(\n `${s.answerSubmitted} ${s.scoreAnnouncement(\n Math.round(scoringResult.score * 100),\n scoringResult.passed,\n )}${overall ? ` ${overall}` : ''}`,\n );\n fireInteraction('submitted', { answers, score: scoringResult.score });\n };\n\n const correctByBlank = useMemo(() => {\n if (isExam) {\n // Nothing is ever marked client-side in an exam.\n return new Map<string, boolean>();\n }\n if (isReview) {\n // Correctness comes ONLY from the server-computed outcome; the component\n // never scores in review, so an absent/ungraded outcome marks nothing.\n return outcome?.status === 'scored'\n ? correctnessByItem(outcome.details)\n : new Map<string, boolean>();\n }\n return correctnessByItem(result?.details ?? []);\n }, [isExam, isReview, outcome, result]);\n\n /** Review has no local score: its summary is read off `outcome`, or nothing. */\n const reviewSummary = useMemo(() => {\n if (!isReview || outcome === undefined) {\n return null;\n }\n if (outcome.status === 'scored') {\n return `${s.scoreAnnouncement(Math.round(outcome.score * 100), outcome.passed)}${\n outcome.feedback ? ` ${outcome.feedback}` : ''\n }`;\n }\n if (outcome.status === 'deferred') {\n return s.notGradedYet;\n }\n // `graded` used to fall into the arm below and announce \"No grade\n // available.\" over a grade that had come back. Normalised by maxScore so a\n // grader payload of 8.5 / 10 does not read as 850% — same guard as\n // `<WrittenResponse>`.\n if (outcome.status === 'graded') {\n const percent =\n outcome.maxScore > 0\n ? Math.round((outcome.score / outcome.maxScore) * 100)\n : Math.round(outcome.score * 100);\n return `${s.scoreAnnouncement(percent, outcome.passed)}${\n outcome.feedback ? ` ${outcome.feedback}` : ''\n }`;\n }\n return s.noGradeAvailable;\n }, [isReview, outcome, s]);\n\n return (\n <form\n className=\"lk-fib\"\n aria-label={data.title}\n lang={locale}\n data-render-mode={renderMode}\n style={theme as CSSProperties | undefined}\n onSubmit={handleSubmit}\n >\n {data.media ? (\n <ActivityMedia\n media={data.media}\n renderMode={renderMode}\n {...(mediaBudget !== undefined ? { mediaBudget } : {})}\n {...(mediaStrings !== undefined ? { mediaStrings } : {})}\n {...(strings !== undefined ? { strings } : {})}\n {...(onInteraction !== undefined ? { onInteraction } : {})}\n {...(locale !== undefined ? { locale } : {})}\n />\n ) : null}\n <fieldset disabled={inactive}>\n <p className=\"lk-fib-passage\">\n {segments.map((seg, i) => {\n if (seg.kind === 'text') {\n // biome-ignore lint/suspicious/noArrayIndexKey: passage segments are positional and static\n return <span key={`t${i}`}>{seg.value}</span>;\n }\n const blank = blankById.get(seg.id);\n if (!blank) {\n return null;\n }\n // `Renderable` only widens `scoringStrategy` at the type level, so\n // the answer-key fields still LOOK required here while a redact()\n // projection omits them at runtime. Read them defensively, and\n // never at all in exam mode.\n const acceptedAnswers: string[] | undefined = isExam\n ? undefined\n : blank.acceptedAnswers;\n const blankFeedback = isExam ? undefined : blank.feedback;\n const correctness = correctByBlank.get(seg.id);\n const hintId = `${data.id}-hint-${seg.id}`;\n const correctAnswer = acceptedAnswers?.[0];\n if (revealing && showCorrectAnswers && correctness === false && correctAnswer) {\n return (\n <span key={seg.id} className=\"lk-fib-answer\" data-correct=\"false\">\n {correctAnswer}\n </span>\n );\n }\n return (\n <span key={seg.id} className=\"lk-fib-blank\">\n <input\n type=\"text\"\n aria-label={s.blankLabel(seg.ordinal)}\n aria-describedby={blank.hint ? hintId : undefined}\n value={answers[seg.id] ?? ''}\n disabled={inactive}\n aria-disabled={inactive || undefined}\n data-correct={\n revealing && correctness !== undefined ? String(correctness) : undefined\n }\n onChange={(e) => handleChange(seg.id, e.target.value)}\n />\n {/*\n Hints stay available in exam mode by design: lk-core's field\n policy classifies `blanks.hint` as `public`, so it survives\n redact() and is not part of the answer key.\n */}\n {blank.hint ? (\n <>\n {/*\n Default affordance is an icon; the accessible NAME stays\n text via aria-label (screen readers + tests rely on it).\n The glyph is restylable/replaceable via .lk-fib-hint-btn.\n */}\n <button\n type=\"button\"\n className=\"lk-fib-hint-btn\"\n aria-controls={hintId}\n aria-expanded={revealed.has(seg.id)}\n aria-label={revealed.has(seg.id) ? s.hideHint : s.showHint}\n disabled={inactive}\n onClick={() => toggleHint(seg.id)}\n >\n <svg\n className=\"lk-fib-hint-icon\"\n viewBox=\"0 0 24 24\"\n width=\"16\"\n height=\"16\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <path\n fill=\"currentColor\"\n d=\"M9 21h6v-1H9v1Zm3-19a7 7 0 0 0-4 12.74V17h8v-2.26A7 7 0 0 0 12 2Z\"\n />\n </svg>\n </button>\n {/*\n Not role=\"tooltip\": a real ARIA tooltip is a named\n hover/focus popup with strict WCAG 1.4.13 constraints.\n This is an accessible click-to-toggle disclosure that is\n the input's aria-describedby target and is announced via\n aria-live; the skin gives it a tooltip-like *visual*\n without the tooltip *semantics*. (Refines Task 15.3.)\n */}\n <span id={hintId} aria-live=\"polite\">\n {revealed.has(seg.id) ? blank.hint : ''}\n </span>\n </>\n ) : null}\n {revealing && !feedbackHidden && blankFeedback ? (\n <span\n className=\"lk-fib-blank-feedback\"\n role=\"note\"\n data-correct={correctness !== undefined ? String(correctness) : undefined}\n >\n {blankFeedback}\n </span>\n ) : null}\n </span>\n );\n })}\n </p>\n {/* Review is read-only: there is nothing to submit. */}\n {isReview ? null : (\n <button type=\"submit\" disabled={inactive}>\n {isExam ? s.submitAnswers : s.checkAnswers}\n </button>\n )}\n </fieldset>\n {revealing && data.blanks.some((b) => b.feedback) ? (\n <button\n type=\"button\"\n className=\"lk-fib-feedback-toggle\"\n aria-expanded={!feedbackHidden}\n onClick={() => setFeedbackHidden((h) => !h)}\n >\n {feedbackHidden ? s.showFeedback : s.hideFeedback}\n </button>\n ) : null}\n <FeedbackRegion id={`${data.id}-feedback`}>\n {isReview ? reviewSummary : summary}\n </FeedbackRegion>\n </form>\n );\n}\n","'use client';\n\nimport { useLkStrings } from '../../i18n/LkIntlProvider.js';\nimport { ActivityErrorBoundary } from '../ActivityErrorBoundary.js';\nimport {\n FillInTheBlanks as FillInTheBlanksCore,\n type FillInTheBlanksProps,\n} from './FillInTheBlanks.js';\n\nexport type { FillInTheBlanksProps } from './FillInTheBlanks.js';\n\n/**\n * Public Fill-in-the-Blanks activity: the core wrapped in\n * `ActivityErrorBoundary` so a render failure (incl. the dev schema-validation\n * throw) degrades to an accessible fallback instead of crashing the host.\n */\nexport function FillInTheBlanks(props: FillInTheBlanksProps) {\n // Read here rather than in the boundary: a class component cannot call a\n // hook, and the fallback it renders is learner-facing text like any other.\n const strings = useLkStrings(props.strings);\n return (\n <ActivityErrorBoundary activityTitle={props.data?.title} strings={strings}>\n <FillInTheBlanksCore {...props} />\n </ActivityErrorBoundary>\n );\n}\n"]}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var chunkBRPEB43C_cjs = require('./chunk-BRPEB43C.cjs');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
5
|
+
var chunk53YOZOGN_cjs = require('./chunk-53YOZOGN.cjs');
|
|
6
|
+
var chunkFKGUKFC7_cjs = require('./chunk-FKGUKFC7.cjs');
|
|
7
7
|
var chunkXOR4MPEN_cjs = require('./chunk-XOR4MPEN.cjs');
|
|
8
|
-
var
|
|
8
|
+
var chunkZ6TVOAO5_cjs = require('./chunk-Z6TVOAO5.cjs');
|
|
9
9
|
var lkCore = require('@intellectif/lk-core');
|
|
10
10
|
var react = require('react');
|
|
11
11
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -61,9 +61,9 @@ function MultipleChoice({
|
|
|
61
61
|
shuffleSeed,
|
|
62
62
|
strings
|
|
63
63
|
}) {
|
|
64
|
-
const s =
|
|
64
|
+
const s = chunkZ6TVOAO5_cjs.useLkStrings(strings);
|
|
65
65
|
const devError = react.useMemo(() => {
|
|
66
|
-
if (!
|
|
66
|
+
if (!chunk53YOZOGN_cjs.isDevelopment()) {
|
|
67
67
|
return null;
|
|
68
68
|
}
|
|
69
69
|
if (data.redacted === true) {
|
|
@@ -102,7 +102,7 @@ function MultipleChoice({
|
|
|
102
102
|
if (!data.shuffle) {
|
|
103
103
|
return [...data.options];
|
|
104
104
|
}
|
|
105
|
-
const seedSource = shuffleSeed ?? (sessionIdRef.current ??=
|
|
105
|
+
const seedSource = shuffleSeed ?? (sessionIdRef.current ??= chunk53YOZOGN_cjs.randomSessionId());
|
|
106
106
|
return lkCore.seededShuffle(data.options, `${seedSource}:${data.id}`);
|
|
107
107
|
}, [data, shuffleSeed]);
|
|
108
108
|
const reviewDetails = react.useMemo(() => {
|
|
@@ -176,9 +176,9 @@ function MultipleChoice({
|
|
|
176
176
|
complete();
|
|
177
177
|
const timeSpent = getTimeSpent();
|
|
178
178
|
const xapiStatement = lkCore.xAPIBuilder.buildAnsweredStatement({
|
|
179
|
-
actor:
|
|
179
|
+
actor: chunk53YOZOGN_cjs.ANONYMOUS_ACTOR,
|
|
180
180
|
object: {
|
|
181
|
-
id:
|
|
181
|
+
id: chunk53YOZOGN_cjs.objectIdFor(data.id),
|
|
182
182
|
name: { [data.locale ?? "en-US"]: data.title },
|
|
183
183
|
// Activity-type IRI, interaction type and correct-responses pattern
|
|
184
184
|
// come from the REGISTERED descriptor, so a consumer-registered type
|
|
@@ -262,7 +262,7 @@ function MultipleChoice({
|
|
|
262
262
|
});
|
|
263
263
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lk-mc", lang: locale, style: theme, children: [
|
|
264
264
|
data.media ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
265
|
-
|
|
265
|
+
chunkFKGUKFC7_cjs.ActivityMedia,
|
|
266
266
|
{
|
|
267
267
|
media: data.media,
|
|
268
268
|
renderMode,
|
|
@@ -288,10 +288,10 @@ function MultipleChoice({
|
|
|
288
288
|
] });
|
|
289
289
|
}
|
|
290
290
|
function MultipleChoice2(props) {
|
|
291
|
-
const strings =
|
|
292
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
291
|
+
const strings = chunkZ6TVOAO5_cjs.useLkStrings(props.strings);
|
|
292
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunk53YOZOGN_cjs.ActivityErrorBoundary, { activityTitle: props.data?.title, strings, children: /* @__PURE__ */ jsxRuntime.jsx(MultipleChoice, { ...props }) });
|
|
293
293
|
}
|
|
294
294
|
|
|
295
295
|
exports.MultipleChoice = MultipleChoice2;
|
|
296
|
-
//# sourceMappingURL=chunk-
|
|
297
|
-
//# sourceMappingURL=chunk-
|
|
296
|
+
//# sourceMappingURL=chunk-L7NE7PR4.cjs.map
|
|
297
|
+
//# sourceMappingURL=chunk-L7NE7PR4.cjs.map
|