@pie-qti/assessment-player 0.1.1

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 (74) hide show
  1. package/.turbo/turbo-build.log +1 -0
  2. package/BACKEND-INTEGRATION.md +620 -0
  3. package/CHANGELOG.md +11 -0
  4. package/EXTENSIBILITY.md +551 -0
  5. package/README.md +1137 -0
  6. package/dist/core/AssessmentPlayer.d.ts +151 -0
  7. package/dist/core/AssessmentPlayer.d.ts.map +1 -0
  8. package/dist/core/AssessmentPlayer.js +595 -0
  9. package/dist/core/ItemSessionController.d.ts +119 -0
  10. package/dist/core/ItemSessionController.d.ts.map +1 -0
  11. package/dist/core/ItemSessionController.js +227 -0
  12. package/dist/core/NavigationManager.d.ts +59 -0
  13. package/dist/core/NavigationManager.d.ts.map +1 -0
  14. package/dist/core/NavigationManager.js +104 -0
  15. package/dist/core/StatePersistenceManager.d.ts +126 -0
  16. package/dist/core/StatePersistenceManager.d.ts.map +1 -0
  17. package/dist/core/StatePersistenceManager.js +267 -0
  18. package/dist/core/TimeManager.d.ts +123 -0
  19. package/dist/core/TimeManager.d.ts.map +1 -0
  20. package/dist/core/TimeManager.js +217 -0
  21. package/dist/core/index.d.ts +10 -0
  22. package/dist/core/index.d.ts.map +1 -0
  23. package/dist/core/index.js +5 -0
  24. package/dist/index.d.ts +6 -0
  25. package/dist/index.d.ts.map +1 -0
  26. package/dist/index.js +7 -0
  27. package/dist/integration/ReferenceBackendAdapter.d.ts +128 -0
  28. package/dist/integration/ReferenceBackendAdapter.d.ts.map +1 -0
  29. package/dist/integration/ReferenceBackendAdapter.js +735 -0
  30. package/dist/integration/api-contract.d.ts +319 -0
  31. package/dist/integration/api-contract.d.ts.map +1 -0
  32. package/dist/integration/api-contract.js +19 -0
  33. package/dist/integration/index.d.ts +47 -0
  34. package/dist/integration/index.d.ts.map +1 -0
  35. package/dist/integration/index.js +46 -0
  36. package/dist/types/index.d.ts +51 -0
  37. package/dist/types/index.d.ts.map +1 -0
  38. package/dist/types/index.js +7 -0
  39. package/dist/utils/PerformanceMonitor.d.ts +115 -0
  40. package/dist/utils/PerformanceMonitor.d.ts.map +1 -0
  41. package/dist/utils/PerformanceMonitor.js +171 -0
  42. package/package.json +82 -0
  43. package/src/ambient.d.ts +55 -0
  44. package/src/components/AccessibilityAnnouncer.svelte +102 -0
  45. package/src/components/AssessmentHeader.svelte +76 -0
  46. package/src/components/AssessmentShell.svelte +485 -0
  47. package/src/components/AssessmentTimer.svelte +228 -0
  48. package/src/components/ItemRenderer.svelte +147 -0
  49. package/src/components/ItemSessionInfo.svelte +241 -0
  50. package/src/components/NavigationBar.svelte +142 -0
  51. package/src/components/RubricDisplay.svelte +185 -0
  52. package/src/components/SectionMenu.svelte +206 -0
  53. package/src/components/SplitPaneResizer.svelte +288 -0
  54. package/src/components/TestFeedback.svelte +147 -0
  55. package/src/components/index.ts +19 -0
  56. package/src/core/AssessmentPlayer.ts +720 -0
  57. package/src/core/ItemSessionController.ts +287 -0
  58. package/src/core/NavigationManager.ts +126 -0
  59. package/src/core/StatePersistenceManager.ts +344 -0
  60. package/src/core/TimeManager.ts +289 -0
  61. package/src/core/index.ts +15 -0
  62. package/src/index.ts +13 -0
  63. package/src/integration/ReferenceBackendAdapter.ts +861 -0
  64. package/src/integration/api-contract.ts +377 -0
  65. package/src/integration/index.ts +70 -0
  66. package/src/svelte-shims.d.ts +7 -0
  67. package/src/types/index.ts +56 -0
  68. package/src/utils/PerformanceMonitor.ts +222 -0
  69. package/svelte.config.js +8 -0
  70. package/tests/ReferenceBackendAdapter.spec.ts +309 -0
  71. package/tests/setup.ts +103 -0
  72. package/tests/smoke.test.ts +7 -0
  73. package/tsconfig.json +20 -0
  74. package/tsconfig.svelte.json +10 -0
@@ -0,0 +1,206 @@
1
+ <script lang="ts">
2
+ import type { I18nProvider } from '@pie-qti/i18n';
3
+
4
+ interface Section {
5
+ id: string;
6
+ title?: string;
7
+ index: number;
8
+ }
9
+
10
+ interface Props {
11
+ sections: Section[];
12
+ currentSectionIndex?: number;
13
+ i18n?: I18nProvider;
14
+ onSectionSelect?: (sectionIndex: number) => void;
15
+ disabled?: boolean;
16
+ }
17
+
18
+ const { sections, currentSectionIndex, i18n, onSectionSelect, disabled = false }: Props = $props();
19
+
20
+ let isOpen = $state(false);
21
+
22
+ function toggleMenu() {
23
+ isOpen = !isOpen;
24
+ }
25
+
26
+ function selectSection(sectionIndex: number) {
27
+ if (disabled) return;
28
+ if (onSectionSelect) {
29
+ onSectionSelect(sectionIndex);
30
+ }
31
+ isOpen = false;
32
+ }
33
+ </script>
34
+
35
+ {#if sections.length > 1}
36
+ <div class="section-menu">
37
+ <button class="btn btn-outline btn-sm" onclick={() => toggleMenu?.()} disabled={disabled}>
38
+ <svg
39
+ xmlns="http://www.w3.org/2000/svg"
40
+ class="h-5 w-5"
41
+ fill="none"
42
+ viewBox="0 0 24 24"
43
+ stroke="currentColor"
44
+ >
45
+ <path
46
+ stroke-linecap="round"
47
+ stroke-linejoin="round"
48
+ stroke-width="2"
49
+ d="M4 6h16M4 12h16M4 18h16"
50
+ />
51
+ </svg>
52
+ {i18n?.t('assessment.sections.title') ?? 'Sections'}
53
+ </button>
54
+
55
+ {#if isOpen}
56
+ <div class="section-dropdown">
57
+ <div class="section-dropdown-content">
58
+ <div class="section-list">
59
+ {#each sections as section}
60
+ <button
61
+ class="section-item"
62
+ class:active={currentSectionIndex === section.index}
63
+ onclick={() => selectSection(section.index)}
64
+ disabled={disabled}
65
+ >
66
+ <div class="section-icon">
67
+ {#if currentSectionIndex === section.index}
68
+ <svg
69
+ xmlns="http://www.w3.org/2000/svg"
70
+ class="h-5 w-5"
71
+ viewBox="0 0 20 20"
72
+ fill="currentColor"
73
+ >
74
+ <path
75
+ fill-rule="evenodd"
76
+ d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z"
77
+ clip-rule="evenodd"
78
+ />
79
+ </svg>
80
+ {:else}
81
+ <svg
82
+ xmlns="http://www.w3.org/2000/svg"
83
+ class="h-5 w-5"
84
+ fill="none"
85
+ viewBox="0 0 24 24"
86
+ stroke="currentColor"
87
+ >
88
+ <path
89
+ stroke-linecap="round"
90
+ stroke-linejoin="round"
91
+ stroke-width="2"
92
+ d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
93
+ />
94
+ </svg>
95
+ {/if}
96
+ </div>
97
+ <div class="section-info">
98
+ <div class="section-title">
99
+ {section.title || (i18n?.t('assessment.sectionDefault', { number: section.index + 1 }) ?? `Section ${section.index + 1}`)}
100
+ </div>
101
+ </div>
102
+ </button>
103
+ {/each}
104
+ </div>
105
+ </div>
106
+ <button class="section-backdrop" onclick={() => toggleMenu?.()} aria-label={i18n?.t('assessment.closeMenu') ?? 'Close menu'}></button>
107
+ </div>
108
+ {/if}
109
+ </div>
110
+ {/if}
111
+
112
+ <style>
113
+ .section-menu {
114
+ position: relative;
115
+ }
116
+
117
+ .section-dropdown {
118
+ position: fixed;
119
+ inset: 0;
120
+ z-index: 50;
121
+ }
122
+
123
+ .section-backdrop {
124
+ position: absolute;
125
+ inset: 0;
126
+ background: transparent;
127
+ border: none;
128
+ cursor: default;
129
+ }
130
+
131
+ .section-dropdown-content {
132
+ position: absolute;
133
+ top: 4rem;
134
+ right: 1rem;
135
+ width: 20rem;
136
+ max-height: 24rem;
137
+ overflow-y: auto;
138
+ background: var(--color-base-100);
139
+ border: 1px solid var(--color-base-300);
140
+ border-radius: 0.5rem;
141
+ box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
142
+ z-index: 51;
143
+ }
144
+
145
+ .section-list {
146
+ padding: 0.5rem;
147
+ }
148
+
149
+ .section-item {
150
+ display: flex;
151
+ align-items: center;
152
+ gap: 0.75rem;
153
+ width: 100%;
154
+ padding: 0.75rem;
155
+ border: none;
156
+ background: transparent;
157
+ border-radius: 0.375rem;
158
+ cursor: pointer;
159
+ transition: background-color 0.2s;
160
+ text-align: left;
161
+ }
162
+
163
+ .section-item:hover:not(:disabled) {
164
+ background: var(--color-base-200);
165
+ }
166
+
167
+ .section-item.active {
168
+ background: color-mix(in oklab, var(--color-primary) 12%, transparent);
169
+ color: var(--color-primary);
170
+ }
171
+
172
+ .section-item:disabled {
173
+ opacity: 0.5;
174
+ cursor: not-allowed;
175
+ }
176
+
177
+ .section-icon {
178
+ flex-shrink: 0;
179
+ color: color-mix(in oklab, var(--color-base-content) 60%, transparent);
180
+ }
181
+
182
+ .section-item.active .section-icon {
183
+ color: var(--color-primary);
184
+ }
185
+
186
+ .section-info {
187
+ flex: 1;
188
+ min-width: 0;
189
+ }
190
+
191
+ .section-title {
192
+ font-weight: 500;
193
+ overflow: hidden;
194
+ text-overflow: ellipsis;
195
+ white-space: nowrap;
196
+ }
197
+
198
+ @media (max-width: 640px) {
199
+ .section-dropdown-content {
200
+ right: 0;
201
+ left: 0;
202
+ width: auto;
203
+ margin: 0 1rem;
204
+ }
205
+ }
206
+ </style>
@@ -0,0 +1,288 @@
1
+ <script lang="ts">
2
+ import { onMount } from 'svelte';
3
+ import type { I18nProvider } from '@pie-qti/i18n';
4
+ import RubricDisplay from './RubricDisplay.svelte';
5
+
6
+ interface Props {
7
+ /** Left pane content (passage/stimulus) */
8
+ leftContent: any[];
9
+ /** Right pane content slot */
10
+ children: any;
11
+ /** Math typesetting function */
12
+ typeset?: (root: HTMLElement) => void | Promise<void>;
13
+ i18n?: I18nProvider;
14
+ /** Storage key for persisting split position */
15
+ storageKey?: string;
16
+ /** Minimum left pane percentage */
17
+ minLeftPct?: number;
18
+ /** Maximum left pane percentage */
19
+ maxLeftPct?: number;
20
+ /** Initial split percentage */
21
+ initialSplitPct?: number;
22
+ /** Callback when right pane element is ready (for scroll management) */
23
+ onRightPaneReady?: (element: HTMLDivElement) => void;
24
+ }
25
+
26
+ const {
27
+ leftContent,
28
+ children,
29
+ typeset,
30
+ i18n,
31
+ storageKey = 'qti22-split-pane.splitLeftPct',
32
+ minLeftPct = 25,
33
+ maxLeftPct = 75,
34
+ initialSplitPct = 50,
35
+ onRightPaneReady
36
+ }: Props = $props();
37
+
38
+ let splitContainerEl = $state<HTMLDivElement | null>(null);
39
+ let rightPaneEl = $state<HTMLDivElement | null>(null);
40
+ let splitLeftPct = $state<number>(50);
41
+ let isResizing = $state(false);
42
+ let hasInitializedFromProps = $state(false);
43
+
44
+ function clampPct(pct: number) {
45
+ return Math.min(maxLeftPct, Math.max(minLeftPct, pct));
46
+ }
47
+
48
+ function saveSplitPct(pct: number) {
49
+ try {
50
+ if (typeof window === 'undefined') return;
51
+ window.localStorage.setItem(storageKey, String(pct));
52
+ } catch {
53
+ // ignore
54
+ }
55
+ }
56
+
57
+ function loadSplitPct() {
58
+ try {
59
+ if (typeof window === 'undefined') return null;
60
+ const raw = window.localStorage.getItem(storageKey);
61
+ if (!raw) return null;
62
+ const n = Number(raw);
63
+ if (!Number.isFinite(n)) return null;
64
+ return clampPct(n);
65
+ } catch {
66
+ return null;
67
+ }
68
+ }
69
+
70
+ function updateSplitFromClientX(clientX: number) {
71
+ if (!splitContainerEl) return;
72
+ const rect = splitContainerEl.getBoundingClientRect();
73
+ if (rect.width <= 0) return;
74
+ const x = clientX - rect.left;
75
+ const pct = (x / rect.width) * 100;
76
+ splitLeftPct = clampPct(pct);
77
+ }
78
+
79
+ function onSplitterPointerDown(e: PointerEvent) {
80
+ if (!splitContainerEl) return;
81
+ isResizing = true;
82
+ (e.currentTarget as HTMLElement | null)?.setPointerCapture?.(e.pointerId);
83
+ updateSplitFromClientX(e.clientX);
84
+
85
+ const move = (ev: PointerEvent) => updateSplitFromClientX(ev.clientX);
86
+ const up = () => {
87
+ isResizing = false;
88
+ window.removeEventListener('pointermove', move);
89
+ window.removeEventListener('pointerup', up);
90
+ window.removeEventListener('pointercancel', up);
91
+ saveSplitPct(splitLeftPct);
92
+ };
93
+
94
+ window.addEventListener('pointermove', move);
95
+ window.addEventListener('pointerup', up, { once: true });
96
+ window.addEventListener('pointercancel', up, { once: true });
97
+ }
98
+
99
+ function onSplitterKeyDown(e: KeyboardEvent) {
100
+ // Keyboard accessible resizing
101
+ if (e.key === 'ArrowLeft') {
102
+ e.preventDefault();
103
+ splitLeftPct = clampPct(splitLeftPct - 2);
104
+ saveSplitPct(splitLeftPct);
105
+ } else if (e.key === 'ArrowRight') {
106
+ e.preventDefault();
107
+ splitLeftPct = clampPct(splitLeftPct + 2);
108
+ saveSplitPct(splitLeftPct);
109
+ } else if (e.key === 'Home') {
110
+ e.preventDefault();
111
+ splitLeftPct = minLeftPct;
112
+ saveSplitPct(splitLeftPct);
113
+ } else if (e.key === 'End') {
114
+ e.preventDefault();
115
+ splitLeftPct = maxLeftPct;
116
+ saveSplitPct(splitLeftPct);
117
+ }
118
+ }
119
+
120
+ function splitterInteractions(node: HTMLElement) {
121
+ const pointerDown = (e: PointerEvent) => onSplitterPointerDown(e);
122
+ const keyDown = (e: KeyboardEvent) => onSplitterKeyDown(e);
123
+
124
+ node.addEventListener('pointerdown', pointerDown);
125
+ node.addEventListener('keydown', keyDown);
126
+
127
+ return {
128
+ destroy() {
129
+ node.removeEventListener('pointerdown', pointerDown);
130
+ node.removeEventListener('keydown', keyDown);
131
+ }
132
+ };
133
+ }
134
+
135
+ // Load saved position on mount
136
+ onMount(() => {
137
+ const loaded = loadSplitPct();
138
+ if (loaded !== null) splitLeftPct = loaded;
139
+ });
140
+
141
+ // Initialize from prop (once). If there's a saved value, onMount() will override.
142
+ $effect(() => {
143
+ if (hasInitializedFromProps) return;
144
+ splitLeftPct = clampPct(initialSplitPct);
145
+ hasInitializedFromProps = true;
146
+ });
147
+
148
+ // Notify parent when right pane is ready
149
+ $effect(() => {
150
+ if (rightPaneEl && onRightPaneReady) {
151
+ onRightPaneReady(rightPaneEl);
152
+ }
153
+ });
154
+ </script>
155
+
156
+ <div
157
+ class:resizing={isResizing}
158
+ class="split-layout"
159
+ bind:this={splitContainerEl}
160
+ style={`--split-left: ${splitLeftPct}%;`}
161
+ >
162
+ <!-- Left pane (passage/stimulus) -->
163
+ <div class="pane pane-left">
164
+ <RubricDisplay blocks={leftContent} {typeset} />
165
+ </div>
166
+
167
+ <!-- Resizer -->
168
+ <!-- svelte-ignore a11y_no_noninteractive_tabindex -->
169
+ <div
170
+ class="splitter"
171
+ role="separator"
172
+ aria-orientation="vertical"
173
+ aria-label={i18n?.t('accessibility.resizer', 'Resize passage and question panels')}
174
+ aria-valuemin={minLeftPct}
175
+ aria-valuemax={maxLeftPct}
176
+ aria-valuenow={Math.round(splitLeftPct)}
177
+ tabindex="0"
178
+ use:splitterInteractions
179
+ >
180
+ <div class="splitter-grip" aria-hidden="true"></div>
181
+ </div>
182
+
183
+ <!-- Right pane (question) -->
184
+ <div class="pane pane-right" bind:this={rightPaneEl}>
185
+ {@render children()}
186
+ </div>
187
+ </div>
188
+
189
+ <style>
190
+ .split-layout {
191
+ display: grid;
192
+ --splitter-size: 16px;
193
+ grid-template-columns: minmax(320px, var(--split-left)) var(--splitter-size) minmax(320px, 1fr);
194
+ gap: 0;
195
+ height: 100%;
196
+ padding: 2rem;
197
+ max-width: 1400px;
198
+ margin: 0 auto;
199
+ }
200
+
201
+ .pane {
202
+ min-height: 0;
203
+ overflow: auto;
204
+ padding: 0 1rem;
205
+ }
206
+
207
+ .splitter {
208
+ width: var(--splitter-size);
209
+ cursor: col-resize;
210
+ display: flex;
211
+ align-items: center;
212
+ justify-content: center;
213
+ align-self: stretch;
214
+ height: 100%;
215
+ background: var(--color-base-200);
216
+ border-left: 1px solid var(--color-base-300);
217
+ border-right: 1px solid var(--color-base-300);
218
+ user-select: none;
219
+ touch-action: none;
220
+ position: relative;
221
+ }
222
+
223
+ .splitter:hover {
224
+ background: var(--color-base-300);
225
+ border-left-color: var(--color-base-300);
226
+ border-right-color: var(--color-base-300);
227
+ }
228
+
229
+ .splitter:focus-visible {
230
+ outline: 2px solid var(--color-primary);
231
+ outline-offset: 2px;
232
+ }
233
+
234
+ /* High-contrast center rail */
235
+ .splitter::before {
236
+ content: '';
237
+ position: absolute;
238
+ top: 0;
239
+ bottom: 0;
240
+ left: 50%;
241
+ width: 2px;
242
+ transform: translateX(-50%);
243
+ background: color-mix(in oklab, var(--color-base-content) 55%, transparent);
244
+ }
245
+
246
+ .splitter-grip {
247
+ width: 6px;
248
+ height: 72px;
249
+ border-radius: 999px;
250
+ background: linear-gradient(
251
+ to bottom,
252
+ color-mix(in oklab, var(--color-base-content) 15%, transparent),
253
+ color-mix(in oklab, var(--color-base-content) 55%, transparent),
254
+ color-mix(in oklab, var(--color-base-content) 15%, transparent)
255
+ );
256
+ }
257
+
258
+ .split-layout.resizing .splitter {
259
+ background: color-mix(in oklab, var(--color-primary) 14%, transparent);
260
+ border-left-color: color-mix(in oklab, var(--color-primary) 60%, transparent);
261
+ border-right-color: color-mix(in oklab, var(--color-primary) 60%, transparent);
262
+ }
263
+
264
+ /* Avoid accidental text selection during resize */
265
+ .split-layout.resizing {
266
+ user-select: none;
267
+ }
268
+
269
+ /* Avoid extra bottom spacing in panes */
270
+ .pane :global(.rubric-container) {
271
+ margin-bottom: 0;
272
+ }
273
+
274
+ @media (max-width: 768px) {
275
+ .split-layout {
276
+ grid-template-columns: 1fr;
277
+ padding: 1rem;
278
+ }
279
+
280
+ .splitter {
281
+ display: none;
282
+ }
283
+
284
+ .pane-left {
285
+ max-height: 40vh;
286
+ }
287
+ }
288
+ </style>
@@ -0,0 +1,147 @@
1
+ <script lang="ts">
2
+ /**
3
+ * TestFeedback Component
4
+ *
5
+ * Displays assessment-level feedback based on outcome conditions.
6
+ * Shows feedback when QTI outcome conditions are met.
7
+ */
8
+ import type { I18nProvider } from '@pie-qti/i18n';
9
+
10
+ interface FeedbackItem {
11
+ identifier: string;
12
+ content: string;
13
+ access: string;
14
+ }
15
+
16
+ interface Props {
17
+ /** Array of visible feedback items to display */
18
+ feedback?: FeedbackItem[];
19
+ /** Callback when feedback is dismissed (if dismissable) */
20
+ onDismiss?: (identifier: string) => void;
21
+ /** Allow dismissing individual feedback items */
22
+ dismissable?: boolean;
23
+ /** CSS class for custom styling */
24
+ class?: string;
25
+ i18n?: I18nProvider;
26
+ }
27
+
28
+ let {
29
+ feedback = [],
30
+ onDismiss,
31
+ dismissable = false,
32
+ class: className = '',
33
+ i18n
34
+ }: Props = $props();
35
+
36
+ // Track dismissed items
37
+ let dismissedItems = $state<Set<string>>(new Set());
38
+
39
+ // Filter out dismissed items
40
+ const visibleFeedback = $derived(
41
+ feedback.filter((fb) => !dismissedItems.has(fb.identifier))
42
+ );
43
+
44
+ function handleDismiss(identifier: string) {
45
+ dismissedItems.add(identifier);
46
+ onDismiss?.(identifier);
47
+ }
48
+ </script>
49
+
50
+ {#if visibleFeedback.length > 0}
51
+ <div class="test-feedback {className}" role="region" aria-label={i18n?.t('feedback.testFeedback') ?? 'Test feedback'}>
52
+ {#each visibleFeedback as item (item.identifier)}
53
+ <div class="feedback-item" data-identifier={item.identifier}>
54
+ <div class="feedback-content">
55
+ {@html item.content}
56
+ </div>
57
+ {#if dismissable}
58
+ <button
59
+ class="feedback-dismiss"
60
+ onclick={() => handleDismiss(item.identifier)}
61
+ aria-label={i18n?.t('feedback.closeFeedback', 'Dismiss feedback')}
62
+ >
63
+ ×
64
+ </button>
65
+ {/if}
66
+ </div>
67
+ {/each}
68
+ </div>
69
+ {/if}
70
+
71
+ <style>
72
+ .test-feedback {
73
+ display: flex;
74
+ flex-direction: column;
75
+ gap: 1rem;
76
+ margin: 1rem 0;
77
+ }
78
+
79
+ .feedback-item {
80
+ position: relative;
81
+ padding: 1rem;
82
+ border-radius: 0.5rem;
83
+ background-color: var(--feedback-bg, #f0f9ff);
84
+ border: 1px solid var(--feedback-border, #0ea5e9);
85
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
86
+ }
87
+
88
+ .feedback-content {
89
+ color: var(--feedback-text, #0c4a6e);
90
+ line-height: 1.6;
91
+ }
92
+
93
+ .feedback-content :global(p) {
94
+ margin: 0 0 0.5rem 0;
95
+ }
96
+
97
+ .feedback-content :global(p:last-child) {
98
+ margin-bottom: 0;
99
+ }
100
+
101
+ .feedback-content :global(strong) {
102
+ font-weight: 600;
103
+ }
104
+
105
+ .feedback-content :global(em) {
106
+ font-style: italic;
107
+ }
108
+
109
+ .feedback-content :global(ul),
110
+ .feedback-content :global(ol) {
111
+ margin: 0.5rem 0;
112
+ padding-left: 1.5rem;
113
+ }
114
+
115
+ .feedback-content :global(li) {
116
+ margin: 0.25rem 0;
117
+ }
118
+
119
+ .feedback-dismiss {
120
+ position: absolute;
121
+ top: 0.5rem;
122
+ right: 0.5rem;
123
+ width: 2rem;
124
+ height: 2rem;
125
+ display: flex;
126
+ align-items: center;
127
+ justify-content: center;
128
+ border: none;
129
+ background: transparent;
130
+ color: var(--feedback-dismiss-color, #64748b);
131
+ font-size: 1.5rem;
132
+ line-height: 1;
133
+ cursor: pointer;
134
+ border-radius: 0.25rem;
135
+ transition: all 0.2s;
136
+ }
137
+
138
+ .feedback-dismiss:hover {
139
+ background-color: var(--feedback-dismiss-hover-bg, rgba(0, 0, 0, 0.05));
140
+ color: var(--feedback-dismiss-hover-color, #1e293b);
141
+ }
142
+
143
+ .feedback-dismiss:focus {
144
+ outline: 2px solid var(--feedback-dismiss-focus, #0ea5e9);
145
+ outline-offset: 2px;
146
+ }
147
+ </style>
@@ -0,0 +1,19 @@
1
+ /**
2
+ * QTI 2.2 Assessment Player Components
3
+ *
4
+ * Reusable Svelte components for rendering assessments (multi-item tests).
5
+ *
6
+ * Import from '@pie-qti/assessment-player/components' in your Svelte app.
7
+ */
8
+
9
+ export { default as AssessmentHeader } from './AssessmentHeader.svelte';
10
+ export { default as AssessmentShell } from './AssessmentShell.svelte';
11
+ export { default as AssessmentTimer } from './AssessmentTimer.svelte';
12
+ export { default as ItemRenderer } from './ItemRenderer.svelte';
13
+ export { default as ItemSessionInfo } from './ItemSessionInfo.svelte';
14
+ export { default as NavigationBar } from './NavigationBar.svelte';
15
+ export { default as RubricDisplay } from './RubricDisplay.svelte';
16
+ export { default as SectionMenu } from './SectionMenu.svelte';
17
+ export { default as SplitPaneResizer } from './SplitPaneResizer.svelte';
18
+
19
+