@intellectif/lk-react 3.0.0 → 5.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.
Files changed (76) hide show
  1. package/README.md +7 -2
  2. package/dist/{WrittenResponse-BHhP936i.d.ts → WrittenResponse-Dkg7FUt-.d.ts} +1 -1
  3. package/dist/{WrittenResponse-B50EjVR0.d.cts → WrittenResponse-DqQ0NjPK.d.cts} +1 -1
  4. package/dist/chunk-3B4ACY4K.cjs +249 -0
  5. package/dist/chunk-3B4ACY4K.cjs.map +1 -0
  6. package/dist/{chunk-3X7MYAFT.js → chunk-3DNJDP73.js} +11 -9
  7. package/dist/chunk-3DNJDP73.js.map +1 -0
  8. package/dist/chunk-4HZ7LQIH.cjs +40 -0
  9. package/dist/chunk-4HZ7LQIH.cjs.map +1 -0
  10. package/dist/{chunk-ZVFWJTT4.js → chunk-5SYL5CJ2.js} +10 -28
  11. package/dist/chunk-5SYL5CJ2.js.map +1 -0
  12. package/dist/{chunk-UXO6KYSZ.cjs → chunk-67RIIDZX.cjs} +17 -15
  13. package/dist/chunk-67RIIDZX.cjs.map +1 -0
  14. package/dist/{chunk-AEQQ7VPF.js → chunk-67WDTQMG.js} +9 -4
  15. package/dist/chunk-67WDTQMG.js.map +1 -0
  16. package/dist/{chunk-7MW7HGOA.cjs → chunk-6COTYW77.cjs} +15 -10
  17. package/dist/chunk-6COTYW77.cjs.map +1 -0
  18. package/dist/chunk-6F4X2NKL.js +54 -0
  19. package/dist/chunk-6F4X2NKL.js.map +1 -0
  20. package/dist/chunk-GB5URWM4.js +38 -0
  21. package/dist/chunk-GB5URWM4.js.map +1 -0
  22. package/dist/chunk-NBFTCGQ5.js +247 -0
  23. package/dist/chunk-NBFTCGQ5.js.map +1 -0
  24. package/dist/chunk-NEWGUDA5.cjs +49 -0
  25. package/dist/chunk-NEWGUDA5.cjs.map +1 -0
  26. package/dist/{chunk-QHOV2A6M.cjs → chunk-PGEG7UZJ.cjs} +2 -34
  27. package/dist/chunk-PGEG7UZJ.cjs.map +1 -0
  28. package/dist/chunk-UQ3BBEIT.js +47 -0
  29. package/dist/chunk-UQ3BBEIT.js.map +1 -0
  30. package/dist/{chunk-W6BH2YMZ.cjs → chunk-WCVD5LVG.cjs} +16 -34
  31. package/dist/chunk-WCVD5LVG.cjs.map +1 -0
  32. package/dist/components/ActivitySequence.cjs +8 -6
  33. package/dist/components/ActivitySequence.d.cts +87 -9
  34. package/dist/components/ActivitySequence.d.ts +87 -9
  35. package/dist/components/ActivitySequence.js +7 -5
  36. package/dist/components/FillInTheBlanks.cjs +4 -3
  37. package/dist/components/FillInTheBlanks.d.cts +1 -1
  38. package/dist/components/FillInTheBlanks.d.ts +1 -1
  39. package/dist/components/FillInTheBlanks.js +3 -2
  40. package/dist/components/MultipleChoice.cjs +4 -3
  41. package/dist/components/MultipleChoice.d.cts +1 -1
  42. package/dist/components/MultipleChoice.d.ts +1 -1
  43. package/dist/components/MultipleChoice.js +3 -2
  44. package/dist/components/StimulusPanel.cjs +13 -0
  45. package/dist/components/StimulusPanel.cjs.map +1 -0
  46. package/dist/components/StimulusPanel.d.cts +30 -0
  47. package/dist/components/StimulusPanel.d.ts +30 -0
  48. package/dist/components/StimulusPanel.js +4 -0
  49. package/dist/components/StimulusPanel.js.map +1 -0
  50. package/dist/components/WrittenResponse.cjs +4 -3
  51. package/dist/components/WrittenResponse.d.cts +3 -3
  52. package/dist/components/WrittenResponse.d.ts +3 -3
  53. package/dist/components/WrittenResponse.js +3 -2
  54. package/dist/index.cjs +36 -26
  55. package/dist/index.cjs.map +1 -1
  56. package/dist/index.d.cts +3 -2
  57. package/dist/index.d.ts +3 -2
  58. package/dist/index.js +12 -7
  59. package/dist/index.js.map +1 -1
  60. package/dist/theme/skin.css +49 -0
  61. package/dist/{types-CNmjqD6M.d.cts → types-CrURyd9-.d.cts} +51 -3
  62. package/dist/{types-CNmjqD6M.d.ts → types-CrURyd9-.d.ts} +51 -3
  63. package/package.json +15 -4
  64. package/dist/chunk-3X7MYAFT.js.map +0 -1
  65. package/dist/chunk-7MW7HGOA.cjs.map +0 -1
  66. package/dist/chunk-AEQQ7VPF.js.map +0 -1
  67. package/dist/chunk-BGWXN44S.js +0 -152
  68. package/dist/chunk-BGWXN44S.js.map +0 -1
  69. package/dist/chunk-HO3AC3WQ.cjs +0 -154
  70. package/dist/chunk-HO3AC3WQ.cjs.map +0 -1
  71. package/dist/chunk-QHOV2A6M.cjs.map +0 -1
  72. package/dist/chunk-UIGIYYGY.js +0 -85
  73. package/dist/chunk-UIGIYYGY.js.map +0 -1
  74. package/dist/chunk-UXO6KYSZ.cjs.map +0 -1
  75. package/dist/chunk-W6BH2YMZ.cjs.map +0 -1
  76. package/dist/chunk-ZVFWJTT4.js.map +0 -1
package/README.md CHANGED
@@ -64,7 +64,9 @@ export function Demo() {
64
64
 
65
65
  - **`<MultipleChoice>`** — single / multi select, all-or-nothing or partial scoring, deterministic per-session shuffle, per-option `feedback`.
66
66
  - **`<FillInTheBlanks>`** — `{{id}}` placeholders, case/whitespace options, per-blank `hint` (Show/Hide toggle as an icon), per-blank `feedback` shown inline on submit with a learner-controlled **Hide/Show feedback** toggle, optional `showCorrectAnswers`.
67
- - **`<ActivitySequence>`** — in-place "question set" pager (Previous/Next, "Question X of N", no scrolling, focus-managed).
67
+ - **`<WrittenResponse>`** — free-text writing with a live word counter and bounds messaging, graded **asynchronously**: it emits an ungraded submission (never a fake zero) and a SUBMITTED-verb xAPI statement, and renders a returned `GradeRecord` in `review` mode with per-criterion scores and inline corrections.
68
+ - **`<ActivitySequence>`** — in-place "question set" pager (Previous/Next, "Question X of N", no scrolling, focus-managed). Accepts item groups and keeps their stimulus beside every question; `onSubmit` reports every raw answer with its `slotId`, which is the only response channel an `exam` sequence has.
69
+ - **`<StimulusPanel>`** — a shared passage / recording / image (an item group's stimulus) as a landmark region; the sequence uses it, and a custom runner can too.
68
70
  - **Media per question** — optional `image` / `audio` / `video` / `embed` (YouTube/Vimeo iframe) above the question; alt-text required for `image`/`embed` (WCAG).
69
71
  - **Activity-level overall feedback** — `{ correct, incorrect }` shown after submit (h5p "Overall Feedback" parity).
70
72
  - **`useXAPI(config)`** — fire-and-forget LRS delivery with retry/backoff for 5xx/network (1 s / 2 s / 4 s), immediate fail on 4xx, never throws.
@@ -81,7 +83,9 @@ export function Demo() {
81
83
  | `@intellectif/lk-react` | Everything (barrel) |
82
84
  | `@intellectif/lk-react/components/MultipleChoice` | `<MultipleChoice>` (boundary-wrapped) |
83
85
  | `@intellectif/lk-react/components/FillInTheBlanks` | `<FillInTheBlanks>` (boundary-wrapped) |
86
+ | `@intellectif/lk-react/components/WrittenResponse` | `<WrittenResponse>` (boundary-wrapped) |
84
87
  | `@intellectif/lk-react/components/ActivitySequence` | `<ActivitySequence>` question-set pager |
88
+ | `@intellectif/lk-react/components/StimulusPanel` | `<StimulusPanel>` shared-stimulus region |
85
89
  | `@intellectif/lk-react/hooks/useActivityState` | Lifecycle + timing |
86
90
  | `@intellectif/lk-react/hooks/useXAPI` | LRS delivery (retry, never-throws) |
87
91
  | `@intellectif/lk-react/theme/ThemeProvider` | `<ThemeProvider>`, `darkTheme`, `useTheme`, `createTailwindTheme` |
@@ -97,12 +101,13 @@ ESM + CJS + `.d.ts` for every entry. Tree-shakeable.
97
101
  | **Scoring** | Pure & deterministic; `all-or-nothing` and `partial`. |
98
102
  | **Feedback** | Per-item (MC per-option, FIB per-blank) shown inline on submit with Hide/Show toggle, + activity-level overall. |
99
103
  | **Retry** | Pass a new `data` reference or change the React `key` → activity resets (no built-in button — retry *policy* is yours). |
100
- | **Persistence / resume** | Not in the SDK — capture `onInteraction` / `onComplete` and persist as you wish. No `initialResponse` prop in V1 (cannot re-hydrate a partial attempt). |
104
+ | **Persistence / resume** | Storage is yours — capture `onSubmit` / `onChange` / `onInteraction` and persist as you wish. Re-hydration **is** supported: pass `defaultValue` to seed a component, or `value` + `onChange` to control it outright (since 2.1.0). |
101
105
  | **Authoring / content storage / CDN / auth** | Consumer responsibility — typed schemas + `validateActivity` + JSON Schema export are provided for you to build authoring on. |
102
106
  | **SSR / RSC** | Fully supported. |
103
107
 
104
108
  ## Documentation
105
109
 
110
+ - [Upgrading](https://github.com/intellectif/learning-kit/blob/main/docs/upgrading.md) — start here if you are on 2.x.
106
111
  - [Authoring & content storage](https://github.com/intellectif/learning-kit/blob/main/docs/authoring.md)
107
112
  - [Styling](https://github.com/intellectif/learning-kit/blob/main/docs/styling.md) — tokens, the skin, overrides, dark mode, Tailwind.
108
113
  - [Project README](https://github.com/intellectif/learning-kit#readme) — full picture & monorepo layout.
@@ -1,5 +1,5 @@
1
1
  import { XAPIStatement, WrittenResponseData, LearnerResponse, ItemOutcome, InteractionEvent, ThemeTokens } from '@intellectif/lk-core';
2
- import { a as Renderable, R as RenderMode, H as HtmlSanitizer } from './types-CNmjqD6M.js';
2
+ import { a as Renderable, R as RenderMode, H as HtmlSanitizer } from './types-CrURyd9-.js';
3
3
 
4
4
  /**
5
5
  * Payload delivered when the learner submits a written response. Grading is
@@ -1,5 +1,5 @@
1
1
  import { XAPIStatement, WrittenResponseData, LearnerResponse, ItemOutcome, InteractionEvent, ThemeTokens } from '@intellectif/lk-core';
2
- import { a as Renderable, R as RenderMode, H as HtmlSanitizer } from './types-CNmjqD6M.cjs';
2
+ import { a as Renderable, R as RenderMode, H as HtmlSanitizer } from './types-CrURyd9-.cjs';
3
3
 
4
4
  /**
5
5
  * Payload delivered when the learner submits a written response. Grading is
@@ -0,0 +1,249 @@
1
+ 'use strict';
2
+
3
+ var chunkWCVD5LVG_cjs = require('./chunk-WCVD5LVG.cjs');
4
+ var chunk67RIIDZX_cjs = require('./chunk-67RIIDZX.cjs');
5
+ var chunk6COTYW77_cjs = require('./chunk-6COTYW77.cjs');
6
+ var chunkPGEG7UZJ_cjs = require('./chunk-PGEG7UZJ.cjs');
7
+ var chunkNEWGUDA5_cjs = require('./chunk-NEWGUDA5.cjs');
8
+ var lkCore = require('@intellectif/lk-core');
9
+ var react = require('react');
10
+ var jsxRuntime = require('react/jsx-runtime');
11
+
12
+ function entryKeyOf(slot) {
13
+ return slot.slotId.split(".")[0] ?? slot.slotId;
14
+ }
15
+ function SequencePane({
16
+ className,
17
+ hidden,
18
+ children
19
+ }) {
20
+ const ref = react.useRef(null);
21
+ react.useEffect(() => {
22
+ if (!hidden) {
23
+ return;
24
+ }
25
+ const node = ref.current;
26
+ if (node === null) {
27
+ return;
28
+ }
29
+ for (const media of node.querySelectorAll("audio, video")) {
30
+ const element = media;
31
+ if (!element.paused) {
32
+ element.pause();
33
+ }
34
+ }
35
+ }, [hidden]);
36
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className, hidden, ref, children });
37
+ }
38
+ function ActivitySequence({
39
+ activities,
40
+ renderers,
41
+ onActivityComplete,
42
+ onComplete,
43
+ onFinished,
44
+ onSubmit,
45
+ onInteraction,
46
+ renderMode = "practice",
47
+ shuffle,
48
+ shuffleSeed,
49
+ sanitizeHtml,
50
+ theme,
51
+ locale,
52
+ disabled
53
+ }) {
54
+ const sessionIdRef = react.useRef(null);
55
+ const shuffleEntries = shuffle === "entries";
56
+ const needsSeed = shuffleEntries || activities.some((entry) => lkCore.isItemGroup(entry) && entry.shuffle === "within-group");
57
+ if (needsSeed && shuffleSeed === void 0 && renderMode !== "practice") {
58
+ throw new Error(
59
+ `ActivitySequence: renderMode "${renderMode}" requires a \`shuffleSeed\` when shuffling (shuffle="entries", or a group with shuffle: "within-group"). Pass the attempt id, so the server's flattenSequence(entries, { seed }) reproduces the order the learner saw.`
60
+ );
61
+ }
62
+ const seed = needsSeed ? (
63
+ // biome-ignore lint/suspicious/noAssignInExpressions: sanctioned lazy ref initialization
64
+ shuffleSeed ?? (sessionIdRef.current ??= chunkPGEG7UZJ_cjs.randomSessionId())
65
+ ) : void 0;
66
+ const slots = react.useMemo(
67
+ () => lkCore.flattenSequence(activities, { shuffleEntries, ...seed !== void 0 ? { seed } : {} }),
68
+ [activities, shuffleEntries, seed]
69
+ );
70
+ const [index, setIndex] = react.useState(0);
71
+ const outcomesRef = react.useRef(null);
72
+ if (outcomesRef.current === null) {
73
+ outcomesRef.current = slots.map(() => null);
74
+ }
75
+ const regionRef = react.useRef(null);
76
+ const mountedRef = react.useRef(false);
77
+ const setKey = JSON.stringify(slots.map((slot) => [slot.slotId, slot.activity.id]));
78
+ const [prevSetKey, setPrevSetKey] = react.useState(setKey);
79
+ if (prevSetKey !== setKey) {
80
+ setPrevSetKey(setKey);
81
+ setIndex(0);
82
+ outcomesRef.current = slots.map(() => null);
83
+ }
84
+ react.useEffect(() => {
85
+ if (mountedRef.current) {
86
+ regionRef.current?.focus();
87
+ } else {
88
+ mountedRef.current = true;
89
+ }
90
+ }, [index]);
91
+ const stimulusMounts = react.useMemo(() => {
92
+ const mounts = /* @__PURE__ */ new Map();
93
+ for (const slot of slots) {
94
+ if (slot.group === void 0) {
95
+ continue;
96
+ }
97
+ const entryKey = entryKeyOf(slot);
98
+ const existing = mounts.get(entryKey);
99
+ if (existing === void 0) {
100
+ mounts.set(entryKey, { entryKey, group: slot.group, first: slot.index, last: slot.index });
101
+ } else {
102
+ existing.last = slot.index;
103
+ }
104
+ }
105
+ return [...mounts.values()];
106
+ }, [slots]);
107
+ const total = slots.length;
108
+ const current = slots[index];
109
+ const go = (next) => {
110
+ setIndex(next);
111
+ };
112
+ const record = (outcome) => {
113
+ const current2 = outcomesRef.current;
114
+ if (current2 === null || current2[outcome.index] != null) {
115
+ return;
116
+ }
117
+ const next = current2.slice();
118
+ next[outcome.index] = outcome;
119
+ outcomesRef.current = next;
120
+ if (outcome.kind === "scored") {
121
+ onActivityComplete?.(outcome.result, outcome.index, outcome.slotId);
122
+ }
123
+ if (!next.every((item) => item !== null)) {
124
+ return;
125
+ }
126
+ onFinished?.(next);
127
+ const scored = [];
128
+ for (const item of next) {
129
+ if (item.kind !== "scored") {
130
+ return;
131
+ }
132
+ scored.push(item.result);
133
+ }
134
+ onComplete?.(scored);
135
+ };
136
+ if (!current) {
137
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lk-seq" });
138
+ }
139
+ const forwarded = {
140
+ ...onInteraction ? { onInteraction } : {},
141
+ renderMode,
142
+ ...sanitizeHtml ? { sanitizeHtml } : {},
143
+ ...theme ? { theme } : {},
144
+ ...locale ? { locale } : {},
145
+ ...disabled ? { disabled } : {}
146
+ };
147
+ const renderSlot = (slot) => {
148
+ const activity = slot.activity;
149
+ const { slotId, index: slotIndex } = slot;
150
+ const activityId = activity.id;
151
+ const childProps = {
152
+ onComplete: (result) => record({ kind: "scored", index: slotIndex, slotId, activityId, result }),
153
+ onSubmit: (response) => {
154
+ onSubmit?.(response, { slotId, index: slotIndex, activityId });
155
+ if (renderMode !== "practice" && activity.type !== "written-response") {
156
+ record({ kind: "responded", index: slotIndex, slotId, activityId, response });
157
+ }
158
+ },
159
+ ...forwarded
160
+ };
161
+ const CustomRenderer = renderers?.[activity.type];
162
+ if (CustomRenderer) {
163
+ return /* @__PURE__ */ jsxRuntime.jsx(CustomRenderer, { data: activity, ...childProps });
164
+ }
165
+ if (activity.type === "multiple-choice") {
166
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkWCVD5LVG_cjs.MultipleChoice, { data: activity, ...childProps });
167
+ }
168
+ if (activity.type === "fill-in-the-blanks") {
169
+ return /* @__PURE__ */ jsxRuntime.jsx(chunk67RIIDZX_cjs.FillInTheBlanks, { data: activity, ...childProps });
170
+ }
171
+ if (activity.type === "written-response") {
172
+ return /* @__PURE__ */ jsxRuntime.jsx(
173
+ chunk6COTYW77_cjs.WrittenResponse,
174
+ {
175
+ data: activity,
176
+ onSubmitted: (submission) => record({ kind: "submitted", index: slotIndex, slotId, activityId, submission }),
177
+ onSubmit: childProps.onSubmit,
178
+ ...forwarded
179
+ }
180
+ );
181
+ }
182
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lk-seq-unsupported", role: "note", children: "This activity type has no renderer. Supply one through the renderers prop." });
183
+ };
184
+ const currentEntryKey = entryKeyOf(current);
185
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lk-seq", lang: locale, children: [
186
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lk-seq-progress", "aria-live": "polite", role: "status", children: [
187
+ "Question ",
188
+ index + 1,
189
+ " of ",
190
+ total
191
+ ] }),
192
+ stimulusMounts.map(({ entryKey, group, first, last }) => /* @__PURE__ */ jsxRuntime.jsx(
193
+ SequencePane,
194
+ {
195
+ className: "lk-seq-stimulus",
196
+ hidden: entryKey !== currentEntryKey,
197
+ children: /* @__PURE__ */ jsxRuntime.jsx(
198
+ chunkNEWGUDA5_cjs.StimulusPanel,
199
+ {
200
+ stimulus: group.stimulus,
201
+ range: { first: first + 1, last: last + 1 },
202
+ ...sanitizeHtml ? { sanitizeHtml } : {},
203
+ ...locale ? { locale } : {}
204
+ }
205
+ )
206
+ },
207
+ `group-${entryKey}`
208
+ )),
209
+ /* @__PURE__ */ jsxRuntime.jsx(
210
+ "section",
211
+ {
212
+ className: "lk-seq-question",
213
+ ref: regionRef,
214
+ tabIndex: -1,
215
+ "aria-label": `Question ${index + 1} of ${total}`,
216
+ children: slots.map((slot) => {
217
+ const slotKey = `${setKey}::slot-${slot.slotId}-${slot.activity.id}`;
218
+ return /* @__PURE__ */ jsxRuntime.jsx(SequencePane, { className: "lk-seq-slot", hidden: slot.index !== index, children: renderSlot(slot) }, slotKey);
219
+ })
220
+ }
221
+ ),
222
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lk-seq-nav", children: [
223
+ /* @__PURE__ */ jsxRuntime.jsx(
224
+ "button",
225
+ {
226
+ type: "button",
227
+ className: "lk-seq-prev",
228
+ onClick: () => go(index - 1),
229
+ disabled: index === 0,
230
+ children: "Previous"
231
+ }
232
+ ),
233
+ /* @__PURE__ */ jsxRuntime.jsx(
234
+ "button",
235
+ {
236
+ type: "button",
237
+ className: "lk-seq-next",
238
+ onClick: () => go(index + 1),
239
+ disabled: index === total - 1,
240
+ children: "Next"
241
+ }
242
+ )
243
+ ] })
244
+ ] });
245
+ }
246
+
247
+ exports.ActivitySequence = ActivitySequence;
248
+ //# sourceMappingURL=chunk-3B4ACY4K.cjs.map
249
+ //# sourceMappingURL=chunk-3B4ACY4K.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/ActivitySequence/ActivitySequence.tsx"],"names":["useRef","useEffect","jsx","isItemGroup","randomSessionId","useMemo","flattenSequence","useState","current","MultipleChoice","FillInTheBlanks","WrittenResponse","jsxs","StimulusPanel"],"mappings":";;;;;;;;;;;AAuKA,SAAS,WAAW,IAAA,EAAgD;AAClE,EAAA,OAAO,KAAK,MAAA,CAAO,KAAA,CAAM,GAAG,CAAA,CAAE,CAAC,KAAK,IAAA,CAAK,MAAA;AAC3C;AAwBA,SAAS,YAAA,CAAa;AAAA,EACpB,SAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,EAIsB;AACpB,EAAA,MAAM,GAAA,GAAMA,aAAuB,IAAI,CAAA;AAEvC,EAAAC,eAAA,CAAU,MAAM;AACd,IAAA,IAAI,CAAC,MAAA,EAAQ;AACX,MAAA;AAAA,IACF;AACA,IAAA,MAAM,OAAO,GAAA,CAAI,OAAA;AACjB,IAAA,IAAI,SAAS,IAAA,EAAM;AACjB,MAAA;AAAA,IACF;AACA,IAAA,KAAA,MAAW,KAAA,IAAS,IAAA,CAAK,gBAAA,CAAiB,cAAc,CAAA,EAAG;AACzD,MAAA,MAAM,OAAA,GAAU,KAAA;AAChB,MAAA,IAAI,CAAC,QAAQ,MAAA,EAAQ;AACnB,QAAA,OAAA,CAAQ,KAAA,EAAM;AAAA,MAChB;AAAA,IACF;AAAA,EACF,CAAA,EAAG,CAAC,MAAM,CAAC,CAAA;AAEX,EAAA,uBACEC,cAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAsB,MAAA,EAAgB,KACxC,QAAA,EACH,CAAA;AAEJ;AAcO,SAAS,gBAAA,CAAiB;AAAA,EAC/B,U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AA,CAAI,CAAC,IAAA,KAAS;AAcnB,UAAA,MAAM,OAAA,GAAU,GAAG,MAAM,CAAA,OAAA,EAAU,KAAK,MAAM,CAAA,CAAA,EAAI,IAAA,CAAK,QAAA,CAAS,EAAE,CAAA,CAAA;AAClE,UAAA,uBACEA,cAAA,CAAC,YAAA,EAAA,EAAa,SAAA,EAAU,aAAA,EAAc,MAAA,EAAQ,IAAA,CAAK,KAAA,KAAU,KAAA,EAC1D,QAAA,EAAA,UAAA,CAAW,IAAI,CAAA,EAAA,EADuD,OAEzE,CAAA;AAAA,QAEJ,CAAC;AAAA;AAAA,KACH;AAAA,oBAEAU,eAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,YAAA,EACb,QAAA,EAAA;AAAA,sBAAAV,cAAA;AAAA,QAAC,QAAA;AAAA,QAAA;AAAA,UACC,IAAA,EAAK,QAAA;AAAA,UACL,SAAA,EAAU,aAAA;AAAA,UACV,OAAA,EAAS,MAAM,EAAA,CAAG,KAAA,GAAQ,CAAC,CAAA;AAAA,UAC3B,UAAU,KAAA,KAAU,CAAA;AAAA,UACrB,QAAA,EAAA;AAAA;AAAA,OAED;AAAA,sBACAA,cAAA;AAAA,QAAC,QAAA;AAAA,QAAA;AAAA,UACC,IAAA,EAAK,QAAA;AAAA,UACL,SAAA,EAAU,aAAA;AAAA,UACV,OAAA,EAAS,MAAM,EAAA,CAAG,KAAA,GAAQ,CAAC,CAAA;AAAA,UAC3B,QAAA,EAAU,UAAU,KAAA,GAAQ,CAAA;AAAA,UAC7B,QAAA,EAAA;AAAA;AAAA;AAED,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ","file":"chunk-3B4ACY4K.cjs","sourcesContent":["'use client';\n\nimport {\n type ActivityResult,\n flattenSequence,\n type InteractionEvent,\n isItemGroup,\n type LearnerResponse,\n type SequenceEntry,\n type SequenceSlot,\n type SequenceSlotGroup,\n type ThemeTokens,\n} from '@intellectif/lk-core';\nimport { type ComponentType, useEffect, useMemo, useRef, useState } from 'react';\nimport { randomSessionId } from '../_internal.js';\nimport { FillInTheBlanks } from '../FillInTheBlanks/index.js';\nimport { MultipleChoice } from '../MultipleChoice/index.js';\nimport { StimulusPanel } from '../StimulusPanel/index.js';\nimport type { ActivityProps, HtmlSanitizer, RenderableActivity, RenderMode } 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 */\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 | {\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: '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 response: LearnerResponse;\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 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 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 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 * `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 in `exam` and `review` mode** — omitting it throws. An order\n * nobody can reproduce cannot be reconciled with a recorded attempt, and\n * failing at render is the only way that mistake surfaces before a learner\n * sits the paper. In `practice` mode it stays optional: a random per-mount\n * seed is used, which is stable within the mount and deliberately not\n * reproducible. That fallback is also not SSR-safe (server and client would\n * invent different orders and hydration would mismatch), so supply a seed\n * for any server-rendered sequence regardless of mode.\n */\n shuffleSeed?: string;\n /** Renders author-supplied rich text; forwarded to the stimulus panel and every activity. */\n sanitizeHtml?: HtmlSanitizer;\n theme?: Partial<ThemeTokens>;\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/**\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 */\nfunction SequencePane({\n className,\n hidden,\n children,\n}: {\n className: string;\n hidden: boolean;\n children: React.ReactNode;\n}): React.JSX.Element {\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (!hidden) {\n return;\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]);\n\n return (\n <div className={className} hidden={hidden} ref={ref}>\n {children}\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 */\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 sanitizeHtml,\n theme,\n locale,\n disabled,\n}: ActivitySequenceProps): React.JSX.Element {\n const sessionIdRef = useRef<string | null>(null);\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 const needsSeed =\n shuffleEntries ||\n activities.some((entry) => isItemGroup(entry) && entry.shuffle === 'within-group');\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 throw new Error(\n `ActivitySequence: renderMode \"${renderMode}\" requires a \\`shuffleSeed\\` when shuffling ` +\n '(shuffle=\"entries\", or a group with shuffle: \"within-group\"). Pass the attempt id, so ' +\n \"the server's flattenSequence(entries, { seed }) reproduces the order the learner saw.\",\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 const [index, setIndex] = useState(0);\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 if (outcomesRef.current === null) {\n outcomesRef.current = slots.map(() => null);\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 if (prevSetKey !== setKey) {\n setPrevSetKey(setKey);\n setIndex(0);\n outcomesRef.current = slots.map(() => null);\n }\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 // 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 * Records a finished slot and fires completion callbacks when the set is\n * done. A slot that already holds an outcome is FINAL: re-recording it would\n * fire completion a second time for one attempt, so a consumer persisting on\n * `onFinished` would write the same attempt twice.\n */\n const record = (outcome: SequenceItemOutcome): void => {\n const current = outcomesRef.current;\n if (current === null || current[outcome.index] != null) {\n return;\n }\n const next = current.slice();\n next[outcome.index] = outcome;\n // Commit before firing anything: a second record() in the same tick must\n // see this one.\n outcomesRef.current = next;\n\n if (outcome.kind === 'scored') {\n onActivityComplete?.(outcome.result, outcome.index, outcome.slotId);\n }\n\n if (!next.every((item): item is SequenceItemOutcome => item !== null)) {\n return;\n }\n onFinished?.(next);\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.\n const scored: ActivityResult[] = [];\n for (const item of next) {\n if (item.kind !== 'scored') {\n return;\n }\n scored.push(item.result);\n }\n onComplete?.(scored);\n };\n\n if (!current) {\n return <div className=\"lk-seq\" />;\n }\n\n const forwarded = {\n ...(onInteraction ? { onInteraction } : {}),\n renderMode,\n ...(sanitizeHtml ? { sanitizeHtml } : {}),\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 childProps = {\n onComplete: (result: ActivityResult) =>\n record({ kind: 'scored', index: slotIndex, slotId, activityId, result }),\n onSubmit: (response: LearnerResponse) => {\n onSubmit?.(response, { slotId, index: slotIndex, activityId });\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 // Written responses are excluded because they report something richer\n // through `onSubmitted` a moment later, and the first outcome wins.\n if (renderMode !== 'practice' && activity.type !== 'written-response') {\n record({ kind: 'responded', index: slotIndex, slotId, activityId, response });\n }\n },\n ...forwarded,\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 <MultipleChoice data={activity} {...childProps} />;\n }\n if (activity.type === 'fill-in-the-blanks') {\n return <FillInTheBlanks data={activity} {...childProps} />;\n }\n if (activity.type === 'written-response') {\n return (\n <WrittenResponse\n data={activity}\n onSubmitted={(submission) =>\n record({ kind: 'submitted', index: slotIndex, slotId, activityId, submission })\n }\n // Explicit rather than spread: WrittenResponse has no `onComplete`\n // (it never grades), so `childProps` does not fit it — but it must\n // still report the raw response like every other slot.\n onSubmit={childProps.onSubmit}\n {...forwarded}\n />\n );\n }\n return (\n <div className=\"lk-seq-unsupported\" role=\"note\">\n This activity type has no renderer. Supply one through the renderers prop.\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 Question {index + 1} of {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 <SequencePane\n className=\"lk-seq-stimulus\"\n hidden={entryKey !== currentEntryKey}\n key={`group-${entryKey}`}\n >\n <StimulusPanel\n stimulus={group.stimulus}\n range={{ first: first + 1, last: last + 1 }}\n {...(sanitizeHtml ? { sanitizeHtml } : {})}\n {...(locale ? { locale } : {})}\n />\n </SequencePane>\n ))}\n\n <section\n className=\"lk-seq-question\"\n ref={regionRef}\n tabIndex={-1}\n aria-label={`Question ${index + 1} of ${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 className=\"lk-seq-slot\" hidden={slot.index !== index} key={slotKey}>\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 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 Next\n </button>\n </div>\n </div>\n );\n}\n"]}
@@ -1,6 +1,7 @@
1
- import { ActivityErrorBoundary, isDevelopment, ActivityMedia, FeedbackRegion, ANONYMOUS_ACTOR, objectIdFor } from './chunk-UIGIYYGY.js';
1
+ import { ActivityErrorBoundary, isDevelopment, FeedbackRegion, ANONYMOUS_ACTOR, objectIdFor } from './chunk-6F4X2NKL.js';
2
+ import { ActivityMedia } from './chunk-GB5URWM4.js';
2
3
  import { useActivityState } from './chunk-5HVUKXF3.js';
3
- import { assertRedacted, validateActivity, ActivitySchemaError, score, xAPIBuilder } from '@intellectif/lk-core';
4
+ import { assertRedacted, validateActivity, ActivitySchemaError, score, xAPIBuilder, xapiDefinitionFor } from '@intellectif/lk-core';
4
5
  import { useMemo, useState, useRef, useEffect } from 'react';
5
6
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
6
7
 
@@ -106,6 +107,11 @@ function FillInTheBlanks({
106
107
  if (devError) {
107
108
  throw devError;
108
109
  }
110
+ if (data.redacted === true && renderMode === "practice") {
111
+ throw new Error(
112
+ `Fill-in-the-Blanks "${data.id}" received redacted activity data in renderMode "practice", which grades locally and has no answer key to grade against. Render redacted data with renderMode="exam" (server grades) or "review" (pass \`outcome\`).`
113
+ );
114
+ }
109
115
  const submitted = state === "completed";
110
116
  const inactive = disabled === true || submitted || isReview;
111
117
  const revealing = isReview ? outcome?.status === "scored" : !isExam && submitted;
@@ -167,11 +173,7 @@ function FillInTheBlanks({
167
173
  object: {
168
174
  id: objectIdFor(data.id),
169
175
  name: { [data.locale ?? "en-US"]: data.title },
170
- type: "http://adlnet.gov/expapi/activities/cmi.interaction",
171
- interactionType: "fill-in",
172
- correctResponsesPattern: [
173
- data.blanks.map((blank) => blank.acceptedAnswers[0] ?? "").join("[,]")
174
- ]
176
+ ...xapiDefinitionFor(data)
175
177
  },
176
178
  scoringResult,
177
179
  timeSpentMs: timeSpent,
@@ -317,5 +319,5 @@ function FillInTheBlanks2(props) {
317
319
  }
318
320
 
319
321
  export { FillInTheBlanks2 as FillInTheBlanks };
320
- //# sourceMappingURL=chunk-3X7MYAFT.js.map
321
- //# sourceMappingURL=chunk-3X7MYAFT.js.map
322
+ //# sourceMappingURL=chunk-3DNJDP73.js.map
323
+ //# sourceMappingURL=chunk-3DNJDP73.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/FillInTheBlanks/FillInTheBlanks.tsx","../src/components/FillInTheBlanks/index.tsx"],"names":["result","FillInTheBlanks","jsx"],"mappings":";;;;;;;AAqCA,IAAM,WAAA,GAAc,0BAAA;AAIpB,SAAS,aAAa,OAAA,EAA4B;AAChD,EAAA,MAAM,WAAsB,EAAC;AAC7B,EAAA,MAAM,EAAA,GAAK,IAAI,MAAA,CAAO,WAAW,CAAA;AACjC,EAAA,IAAI,IAAA,GAAO,CAAA;AACX,EAAA,IAAI,OAAA,GAAU,CAAA;AACd,EAAA,IAAI,KAAA,GAAQ,EAAA,CAAG,IAAA,CAAK,OAAO,CAAA;AAC3B,EAAA,OAAO,UAAU,IAAA,EAAM;AACrB,IAAA,IAAI,KAAA,CAAM,QAAQ,IAAA,EAAM;AACtB,MAAA,QAAA,CAAS,IAAA,CAAK,EAAE,IAAA,EAAM,MAAA,EAAQ,KAAA,EAAO,OAAA,CAAQ,KAAA,CAAM,IAAA,EAAM,KAAA,CAAM,KAAK,CAAA,EAAG,CAAA;AAAA,IACzE;AACA,IAAA,OAAA,IAAW,CAAA;AACX,IAAA,QAAA,CAAS,IAAA,CAAK,EAAE,IAAA,EAAM,OAAA,EAAS,IAAI,KAAA,CAAM,CAAC,CAAA,EAAa,OAAA,EAAS,CAAA;AAChE,IAAA,IAAA,GAAO,KAAA,CAAM,KAAA,GAAQ,KAAA,CAAM,CAAC,CAAA,CAAE,MAAA;AAC9B,IAAA,KAAA,GAAQ,EAAA,CAAG,KAAK,OAAO,CAAA;AAAA,EACzB;AACA,EAAA,IAAI,IAAA,GAAO,QAAQ,MAAA,EAAQ;AACzB,IAAA,QAAA,CAAS,IAAA,CAAK,EAAE,IAAA,EAAM,MAAA,EAAQ,OAAO,OAA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Redacted,\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 { 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 renderMode = 'practice',\n outcome,\n sanitizeHtml,\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 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 // 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 // `data` is an intentional reset trigger (Req 3.7), not read in the body.\n // biome-ignore lint/correctness/useExhaustiveDependencies: data is the reset trigger (Req 3.7)\n useEffect(() => {\n setInternalAnswers(answersOf(defaultValueRef.current));\n setRevealed(new Set());\n setResult(null);\n setSummary(null);\n setFeedbackHidden(false);\n reset();\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('Answer submitted.');\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 `Answer submitted. Score ${Math.round(scoringResult.score * 100)}%. ${\n scoringResult.passed ? 'Passed.' : 'Not 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 `Score ${Math.round(outcome.score * 100)}%. ${\n outcome.passed ? 'Passed.' : 'Not passed.'\n }${outcome.feedback ? ` ${outcome.feedback}` : ''}`;\n }\n return outcome.status === 'deferred' ? 'Not graded yet.' : 'No grade available.';\n }, [isReview, outcome]);\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 ? <ActivityMedia media={data.media} /> : 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={`Fill in blank ${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) ? 'Hide hint' : 'Show hint'}\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 ? 'Submit answers' : 'Check answers'}\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 ? 'Show feedback' : 'Hide feedback'}\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 { 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 return (\n <ActivityErrorBoundary activityTitle={props.data?.title}>\n <FillInTheBlanksCore {...props} />\n </ActivityErrorBoundary>\n );\n}\n"]}
@@ -0,0 +1,40 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+
5
+ // src/components/shared/ActivityMedia.tsx
6
+ function ActivityMedia({ media }) {
7
+ const { type, url, alt, captionsUrl } = media;
8
+ if (type === "image") {
9
+ return /* @__PURE__ */ jsxRuntime.jsx("figure", { className: "lk-media", children: /* @__PURE__ */ jsxRuntime.jsx("img", { className: "lk-media-el", src: url, alt: alt ?? "" }) });
10
+ }
11
+ if (type === "audio") {
12
+ return /* @__PURE__ */ jsxRuntime.jsx("figure", { className: "lk-media", children: /* @__PURE__ */ jsxRuntime.jsxs("audio", { className: "lk-media-el", controls: true, "aria-label": alt || void 0, children: [
13
+ /* @__PURE__ */ jsxRuntime.jsx("source", { src: url }),
14
+ captionsUrl ? /* @__PURE__ */ jsxRuntime.jsx("track", { kind: "captions", src: captionsUrl, default: true }) : null
15
+ ] }) });
16
+ }
17
+ if (type === "embed") {
18
+ return /* @__PURE__ */ jsxRuntime.jsx("figure", { className: "lk-media", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lk-media-embed", children: /* @__PURE__ */ jsxRuntime.jsx(
19
+ "iframe",
20
+ {
21
+ className: "lk-media-el",
22
+ src: url,
23
+ title: alt ?? "Embedded media",
24
+ loading: "lazy",
25
+ referrerPolicy: "strict-origin-when-cross-origin",
26
+ sandbox: "allow-scripts allow-same-origin allow-presentation",
27
+ allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
28
+ allowFullScreen: true
29
+ }
30
+ ) }) });
31
+ }
32
+ return /* @__PURE__ */ jsxRuntime.jsx("figure", { className: "lk-media", children: /* @__PURE__ */ jsxRuntime.jsxs("video", { className: "lk-media-el", controls: true, "aria-label": alt || void 0, children: [
33
+ /* @__PURE__ */ jsxRuntime.jsx("source", { src: url }),
34
+ captionsUrl ? /* @__PURE__ */ jsxRuntime.jsx("track", { kind: "captions", src: captionsUrl, default: true }) : null
35
+ ] }) });
36
+ }
37
+
38
+ exports.ActivityMedia = ActivityMedia;
39
+ //# sourceMappingURL=chunk-4HZ7LQIH.c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,SAAA,EAAU,aAAA;AAAA,QACV,GAAA,EAAK,GAAA;AAAA,QACL,OAAO,GAAA,IAAO,gBAAA;AAAA,QACd,OAAA,EAAQ,MAAA;AAAA,QACR,cAAA,EAAe,iCAAA;AAAA,QAMf,OAAA,EAAQ,oDAAA;AAAA,QACR,KAAA,EAAM,qGAAA;AAAA,QACN,eAAA,EAAe;AAAA;AAAA,OAEnB,CAAA,EACF,CAAA;AAAA,EAEJ;AAEA,EAAA,uBACEA,cAAA,CAAC,QAAA,EAAA,EAAO,SAAA,EAAU,UAAA,EAEhB,QAAA,kBAAAC,eAAA,CAAC,OAAA,EAAA,EAAM,SAAA,EAAU,aAAA,EAAc,QAAA,EAAQ,IAAA,EAAC,YAAA,EAAY,GAAA,IAAO,MAAA,EACzD,QAAA,EAAA;AAAA,oBAAAD,cAAA,CAAC,QAAA,EAAA,EAAO,KAAK,GAAA,EAAK,CAAA;AAAA,IACjB,WAAA,kCAAe,OAAA,EAAA,EAAM,IAAA,EAAK,YAAW,GAAA,EAAK,WAAA,EAAa,OAAA,EAAO,IAAA,EAAC,CAAA,GAAK;AAAA,GAAA,EACvE,CAAA,EACF,CAAA;AAEJ","file":"chunk-4HZ7LQIH.cjs","sourcesContent":["import type { ActivityMedia as ActivityMediaData } from '@intellectif/lk-core';\n\n/**\n * Presentational media block shown above a question or passage. URL-only:\n * the SDK does not host media (consumer responsibility). Accessibility:\n * images use `alt` (schema requires it non-empty); audio/video expose an\n * optional label and a captions `<track>` when `captionsUrl` is provided;\n * `embed` renders a responsive sandboxed iframe with `alt` as its required\n * accessible `title` (Req 14.5).\n */\nexport function ActivityMedia({ media }: { media: ActivityMediaData }): React.JSX.Element {\n const { type, url, alt, captionsUrl } = media;\n\n if (type === 'image') {\n return (\n <figure className=\"lk-media\">\n <img className=\"lk-media-el\" src={url} alt={alt ?? ''} />\n </figure>\n );\n }\n\n if (type === 'audio') {\n return (\n <figure className=\"lk-media\">\n {/* biome-ignore lint/a11y/useMediaCaption: captions are optional in the data contract — a <track> is rendered when captionsUrl is provided; absence is the author's documented choice (Req 14.5) */}\n <audio className=\"lk-media-el\" controls aria-label={alt || undefined}>\n <source src={url} />\n {captionsUrl ? <track kind=\"captions\" src={captionsUrl} default /> : null}\n </audio>\n </figure>\n );\n }\n\n if (type === 'embed') {\n return (\n <figure className=\"lk-media\">\n <div className=\"lk-media-embed\">\n <iframe\n className=\"lk-media-el\"\n src={url}\n title={alt ?? 'Embedded media'}\n loading=\"lazy\"\n referrerPolicy=\"strict-origin-when-cross-origin\"\n // The docblock always promised a sandboxed iframe; now it is one.\n // allow-scripts + allow-same-origin are required by provider\n // players (YouTube/Vimeo); top-navigation, forms, downloads and\n // popups stay blocked. Scheme allow-listing in MediaSchema is the\n // primary defense; this is depth.\n sandbox=\"allow-scripts allow-same-origin allow-presentation\"\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\"\n allowFullScreen\n />\n </div>\n </figure>\n );\n }\n\n return (\n <figure className=\"lk-media\">\n {/* biome-ignore lint/a11y/useMediaCaption: captions are optional in the data contract — a <track> is rendered when captionsUrl is provided; absence is the author's documented choice (Req 14.5) */}\n <video className=\"lk-media-el\" controls aria-label={alt || undefined}>\n <source src={url} />\n {captionsUrl ? <track kind=\"captions\" src={captionsUrl} default /> : null}\n </video>\n </figure>\n );\n}\n"]}
@@ -1,27 +1,10 @@
1
- import { ActivityErrorBoundary, isDevelopment, randomSessionId, ActivityMedia, FeedbackRegion, ANONYMOUS_ACTOR, objectIdFor } from './chunk-UIGIYYGY.js';
1
+ import { ActivityErrorBoundary, isDevelopment, randomSessionId, FeedbackRegion, ANONYMOUS_ACTOR, objectIdFor } from './chunk-6F4X2NKL.js';
2
+ import { ActivityMedia } from './chunk-GB5URWM4.js';
2
3
  import { useActivityState } from './chunk-5HVUKXF3.js';
3
- import { validateActivity, ActivitySchemaError, score, xAPIBuilder } from '@intellectif/lk-core';
4
+ import { validateActivity, ActivitySchemaError, seededShuffle, score, xAPIBuilder, xapiDefinitionFor } from '@intellectif/lk-core';
4
5
  import { useMemo, useRef, useState, useEffect } from 'react';
5
6
  import { jsx, jsxs } from 'react/jsx-runtime';
6
7
 
7
- function hashSeed(input) {
8
- let h = 2166136261 >>> 0;
9
- for (let i = 0; i < input.length; i += 1) {
10
- h ^= input.charCodeAt(i);
11
- h = Math.imul(h, 16777619) >>> 0;
12
- }
13
- return h;
14
- }
15
- function seededShuffle(items, seed) {
16
- const out = [...items];
17
- let s = seed >>> 0 || 1;
18
- for (let i = out.length - 1; i > 0; i -= 1) {
19
- s = Math.imul(s, 1664525) + 1013904223 >>> 0;
20
- const j = s % (i + 1);
21
- [out[i], out[j]] = [out[j], out[i]];
22
- }
23
- return out;
24
- }
25
8
  function selectionOf(response) {
26
9
  return response?.type === "multiple-choice" ? response.selectedOptionIds : [];
27
10
  }
@@ -97,7 +80,7 @@ function MultipleChoice({
97
80
  return [...data.options];
98
81
  }
99
82
  const seedSource = shuffleSeed ?? (sessionIdRef.current ??= randomSessionId());
100
- return seededShuffle(data.options, hashSeed(`${seedSource}:${data.id}`));
83
+ return seededShuffle(data.options, `${seedSource}:${data.id}`);
101
84
  }, [data, shuffleSeed]);
102
85
  const reviewDetails = useMemo(() => {
103
86
  if (renderMode !== "review" || outcome === void 0 || outcome.status !== "scored") {
@@ -174,11 +157,10 @@ function MultipleChoice({
174
157
  object: {
175
158
  id: objectIdFor(data.id),
176
159
  name: { [data.locale ?? "en-US"]: data.title },
177
- type: "http://adlnet.gov/expapi/activities/cmi.interaction",
178
- interactionType: "choice",
179
- correctResponsesPattern: [
180
- data.options.filter((option) => option.isCorrect).map((option) => option.id).join("[,]")
181
- ],
160
+ // Activity-type IRI, interaction type and correct-responses pattern
161
+ // come from the REGISTERED descriptor, so a consumer-registered type
162
+ // gets correct interop without touching this component.
163
+ ...xapiDefinitionFor(data),
182
164
  choices: data.options.map((option) => ({
183
165
  id: option.id,
184
166
  description: { [data.locale ?? "en-US"]: option.text }
@@ -253,5 +235,5 @@ function MultipleChoice2(props) {
253
235
  }
254
236
 
255
237
  export { MultipleChoice2 as MultipleChoice };
256
- //# sourceMappingURL=chunk-ZVFWJTT4.js.map
257
- //# sourceMappingURL=chunk-ZVFWJTT4.js.map
238
+ //# sourceMappingURL=chunk-5SYL5CJ2.js.map
239
+ //# sourceMappingURL=chunk-5SYL5CJ2.js.map