@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,344 @@
1
+ /**
2
+ * StatePersistenceManager
3
+ *
4
+ * Manages automatic state persistence for assessment sessions.
5
+ * Supports both client-side (localStorage) and server-side persistence.
6
+ *
7
+ * Features:
8
+ * - Auto-save on state changes (debounced)
9
+ * - Manual save triggers
10
+ * - State restoration
11
+ * - Optional backend integration
12
+ * - Fallback to localStorage when backend unavailable
13
+ */
14
+
15
+ export interface PersistableState {
16
+ /** Assessment identifier */
17
+ assessmentId: string;
18
+ /** Current item index */
19
+ currentItemIndex: number;
20
+ /** Visited item indices */
21
+ visitedItems: number[];
22
+ /** Response data per item */
23
+ responses: Record<string, unknown>;
24
+ /** Item session states (attempts, submission status) */
25
+ itemSessionStates: Record<string, {
26
+ attemptCount: number;
27
+ isAnswered: boolean;
28
+ isSubmitted: boolean;
29
+ lastSubmissionTime?: number;
30
+ }>;
31
+ /** Time tracking data */
32
+ timeTracking?: {
33
+ startedAt: number;
34
+ totalElapsed: number;
35
+ itemTimes: Record<string, number>;
36
+ sectionTimes: Record<string, number>;
37
+ };
38
+ /** Last saved timestamp */
39
+ savedAt: number;
40
+ }
41
+
42
+ export interface PersistenceConfig {
43
+ /** Unique session identifier */
44
+ sessionId: string;
45
+ /** Assessment identifier */
46
+ assessmentId: string;
47
+ /** Auto-save enabled (default: true) */
48
+ autoSave?: boolean;
49
+ /** Auto-save debounce delay in ms (default: 2000) */
50
+ autoSaveDelay?: number;
51
+ /** Storage strategy */
52
+ storage?: 'localStorage' | 'sessionStorage' | 'memory';
53
+ /** Optional backend save callback */
54
+ onBackendSave?: (state: PersistableState) => Promise<void>;
55
+ /** Optional save success callback */
56
+ onSaveSuccess?: (state: PersistableState) => void;
57
+ /** Optional save error callback */
58
+ onSaveError?: (error: Error) => void;
59
+ }
60
+
61
+ export class StatePersistenceManager {
62
+ private config: PersistenceConfig;
63
+ private currentState: PersistableState | null = null;
64
+ private autoSaveTimer: ReturnType<typeof setTimeout> | null = null;
65
+ private isSaving = false;
66
+ private memoryStorage: Map<string, string> = new Map();
67
+
68
+ constructor(config: PersistenceConfig) {
69
+ this.config = {
70
+ autoSave: true,
71
+ autoSaveDelay: 2000,
72
+ storage: 'localStorage',
73
+ ...config,
74
+ };
75
+ }
76
+
77
+ /**
78
+ * Update state and trigger auto-save
79
+ */
80
+ updateState(state: Partial<PersistableState>): void {
81
+ // Merge with existing state
82
+ this.currentState = {
83
+ ...this.currentState,
84
+ assessmentId: this.config.assessmentId,
85
+ savedAt: Date.now(),
86
+ ...state,
87
+ } as PersistableState;
88
+
89
+ // Trigger auto-save
90
+ if (this.config.autoSave) {
91
+ this.scheduleAutoSave();
92
+ }
93
+ }
94
+
95
+ /**
96
+ * Schedule auto-save with debouncing
97
+ */
98
+ private scheduleAutoSave(): void {
99
+ // Clear existing timer
100
+ if (this.autoSaveTimer) {
101
+ clearTimeout(this.autoSaveTimer);
102
+ }
103
+
104
+ // Schedule new save
105
+ this.autoSaveTimer = setTimeout(() => {
106
+ this.save().catch((error) => {
107
+ console.error('[StatePersistenceManager] Auto-save failed:', error);
108
+ this.config.onSaveError?.(error);
109
+ });
110
+ }, this.config.autoSaveDelay);
111
+ }
112
+
113
+ /**
114
+ * Manually save current state
115
+ */
116
+ async save(): Promise<void> {
117
+ if (!this.currentState) {
118
+ return;
119
+ }
120
+
121
+ if (this.isSaving) {
122
+ console.warn('[StatePersistenceManager] Save already in progress');
123
+ return;
124
+ }
125
+
126
+ this.isSaving = true;
127
+
128
+ try {
129
+ // Update timestamp
130
+ this.currentState.savedAt = Date.now();
131
+
132
+ // Try backend save first (if configured)
133
+ if (this.config.onBackendSave) {
134
+ try {
135
+ await this.config.onBackendSave(this.currentState);
136
+ } catch (backendError) {
137
+ console.warn('[StatePersistenceManager] Backend save failed, falling back to local:', backendError);
138
+ // Continue to local save as fallback
139
+ }
140
+ }
141
+
142
+ // Save to local storage
143
+ this.saveToStorage(this.currentState);
144
+
145
+ // Success callback
146
+ this.config.onSaveSuccess?.(this.currentState);
147
+ } catch (error) {
148
+ console.error('[StatePersistenceManager] Save failed:', error);
149
+ this.config.onSaveError?.(error as Error);
150
+ throw error;
151
+ } finally {
152
+ this.isSaving = false;
153
+ }
154
+ }
155
+
156
+ /**
157
+ * Save to configured storage
158
+ */
159
+ private saveToStorage(state: PersistableState): void {
160
+ const key = this.getStorageKey();
161
+ const data = JSON.stringify(state);
162
+
163
+ try {
164
+ switch (this.config.storage) {
165
+ case 'localStorage':
166
+ if (typeof localStorage !== 'undefined') {
167
+ localStorage.setItem(key, data);
168
+ } else {
169
+ this.memoryStorage.set(key, data);
170
+ }
171
+ break;
172
+
173
+ case 'sessionStorage':
174
+ if (typeof sessionStorage !== 'undefined') {
175
+ sessionStorage.setItem(key, data);
176
+ } else {
177
+ this.memoryStorage.set(key, data);
178
+ }
179
+ break;
180
+
181
+ case 'memory':
182
+ this.memoryStorage.set(key, data);
183
+ break;
184
+ }
185
+ } catch (error) {
186
+ // Storage quota exceeded or other storage error
187
+ console.error('[StatePersistenceManager] Storage save failed:', error);
188
+ // Fallback to memory storage
189
+ this.memoryStorage.set(key, data);
190
+ }
191
+ }
192
+
193
+ /**
194
+ * Load state from storage
195
+ */
196
+ async load(): Promise<PersistableState | null> {
197
+ const key = this.getStorageKey();
198
+ let data: string | null = null;
199
+
200
+ try {
201
+ switch (this.config.storage) {
202
+ case 'localStorage':
203
+ data = typeof localStorage !== 'undefined'
204
+ ? localStorage.getItem(key)
205
+ : this.memoryStorage.get(key) || null;
206
+ break;
207
+
208
+ case 'sessionStorage':
209
+ data = typeof sessionStorage !== 'undefined'
210
+ ? sessionStorage.getItem(key)
211
+ : this.memoryStorage.get(key) || null;
212
+ break;
213
+
214
+ case 'memory':
215
+ data = this.memoryStorage.get(key) || null;
216
+ break;
217
+ }
218
+
219
+ if (!data) {
220
+ return null;
221
+ }
222
+
223
+ const state = JSON.parse(data) as PersistableState;
224
+ this.currentState = state;
225
+ return state;
226
+ } catch (error) {
227
+ console.error('[StatePersistenceManager] Failed to load state:', error);
228
+ return null;
229
+ }
230
+ }
231
+
232
+ /**
233
+ * Check if saved state exists
234
+ */
235
+ async hasSavedState(): Promise<boolean> {
236
+ const state = await this.load();
237
+ return state !== null;
238
+ }
239
+
240
+ /**
241
+ * Clear saved state
242
+ */
243
+ async clear(): Promise<void> {
244
+ const key = this.getStorageKey();
245
+
246
+ try {
247
+ switch (this.config.storage) {
248
+ case 'localStorage':
249
+ if (typeof localStorage !== 'undefined') {
250
+ localStorage.removeItem(key);
251
+ }
252
+ this.memoryStorage.delete(key);
253
+ break;
254
+
255
+ case 'sessionStorage':
256
+ if (typeof sessionStorage !== 'undefined') {
257
+ sessionStorage.removeItem(key);
258
+ }
259
+ this.memoryStorage.delete(key);
260
+ break;
261
+
262
+ case 'memory':
263
+ this.memoryStorage.delete(key);
264
+ break;
265
+ }
266
+
267
+ this.currentState = null;
268
+ } catch (error) {
269
+ console.error('[StatePersistenceManager] Failed to clear state:', error);
270
+ }
271
+ }
272
+
273
+ /**
274
+ * Get current state without saving
275
+ */
276
+ getCurrentState(): PersistableState | null {
277
+ return this.currentState ? { ...this.currentState } : null;
278
+ }
279
+
280
+ /**
281
+ * Get storage key for this session
282
+ */
283
+ private getStorageKey(): string {
284
+ return `qti-assessment-${this.config.assessmentId}-${this.config.sessionId}`;
285
+ }
286
+
287
+ /**
288
+ * Force immediate save (bypasses debounce)
289
+ */
290
+ async forceSave(): Promise<void> {
291
+ // Clear any pending auto-save
292
+ if (this.autoSaveTimer) {
293
+ clearTimeout(this.autoSaveTimer);
294
+ this.autoSaveTimer = null;
295
+ }
296
+
297
+ await this.save();
298
+ }
299
+
300
+ /**
301
+ * Pause auto-save (useful during navigation transitions)
302
+ */
303
+ pauseAutoSave(): void {
304
+ if (this.autoSaveTimer) {
305
+ clearTimeout(this.autoSaveTimer);
306
+ this.autoSaveTimer = null;
307
+ }
308
+ }
309
+
310
+ /**
311
+ * Resume auto-save
312
+ */
313
+ resumeAutoSave(): void {
314
+ if (this.config.autoSave && this.currentState) {
315
+ this.scheduleAutoSave();
316
+ }
317
+ }
318
+
319
+ /**
320
+ * Get last save timestamp
321
+ */
322
+ getLastSaveTime(): number | null {
323
+ return this.currentState?.savedAt || null;
324
+ }
325
+
326
+ /**
327
+ * Check if state has been modified since last save
328
+ */
329
+ isDirty(): boolean {
330
+ // Simple check - could be enhanced with deep comparison
331
+ return this.autoSaveTimer !== null;
332
+ }
333
+
334
+ /**
335
+ * Cleanup
336
+ */
337
+ destroy(): void {
338
+ if (this.autoSaveTimer) {
339
+ clearTimeout(this.autoSaveTimer);
340
+ this.autoSaveTimer = null;
341
+ }
342
+ this.currentState = null;
343
+ }
344
+ }
@@ -0,0 +1,289 @@
1
+ /**
2
+ * TimeManager
3
+ *
4
+ * Manages time limits and tracking for QTI assessments.
5
+ * Supports test-level, section-level, and item-level time limits.
6
+ *
7
+ * Features:
8
+ * - Countdown timers with warnings
9
+ * - Auto-submission when time expires
10
+ * - Time spent tracking per item
11
+ * - Pause/resume support
12
+ * - Late submission handling
13
+ */
14
+
15
+ import type { TimeLimits } from '../types/index.js';
16
+
17
+ export interface TimeManagerConfig {
18
+ /** Assessment-level time limits */
19
+ assessmentTimeLimits?: TimeLimits;
20
+ /** Warning threshold (seconds before expiry) */
21
+ warningThreshold?: number;
22
+ /** Callback when time warning is triggered */
23
+ onWarning?: (remainingSeconds: number) => void;
24
+ /** Callback when time expires */
25
+ onExpired?: () => void;
26
+ /** Callback for time updates (fires every second) */
27
+ onTick?: (remainingSeconds: number, elapsedSeconds: number) => void;
28
+ }
29
+
30
+ export interface TimeTrackingState {
31
+ /** Total elapsed time (ms) */
32
+ totalElapsed: number;
33
+ /** Time spent per item identifier (ms) */
34
+ itemTimes: Record<string, number>;
35
+ /** Time spent per section identifier (ms) */
36
+ sectionTimes: Record<string, number>;
37
+ /** Session start timestamp */
38
+ startedAt: number;
39
+ /** Current item start time (for tracking) */
40
+ currentItemStartTime?: number;
41
+ /** Current section identifier */
42
+ currentSectionId?: string;
43
+ /** Is timer currently paused */
44
+ isPaused: boolean;
45
+ }
46
+
47
+ export class TimeManager {
48
+ private config: TimeManagerConfig;
49
+ private state: TimeTrackingState;
50
+
51
+ // Timer internals
52
+ private intervalId: ReturnType<typeof setInterval> | null = null;
53
+ private maxTimeSeconds: number | null = null;
54
+ private warningTriggered = false;
55
+
56
+ constructor(config: TimeManagerConfig) {
57
+ this.config = config;
58
+ this.state = {
59
+ totalElapsed: 0,
60
+ itemTimes: {},
61
+ sectionTimes: {},
62
+ startedAt: Date.now(),
63
+ isPaused: false,
64
+ };
65
+
66
+ // Initialize timer if time limit exists
67
+ if (config.assessmentTimeLimits?.maxTime) {
68
+ this.maxTimeSeconds = config.assessmentTimeLimits.maxTime;
69
+ this.startTimer();
70
+ }
71
+ }
72
+
73
+ /**
74
+ * Start or resume the timer
75
+ */
76
+ private startTimer(): void {
77
+ if (this.intervalId) {
78
+ return; // Already running
79
+ }
80
+
81
+ this.state.isPaused = false;
82
+
83
+ this.intervalId = setInterval(() => {
84
+ if (this.state.isPaused) {
85
+ return;
86
+ }
87
+
88
+ this.state.totalElapsed += 1000; // Increment by 1 second
89
+
90
+ const elapsedSeconds = Math.floor(this.state.totalElapsed / 1000);
91
+
92
+ // Track item time if active
93
+ if (this.state.currentItemStartTime) {
94
+ // Item tracking handled by startItem/endItem
95
+ }
96
+
97
+ // Calculate remaining time
98
+ if (this.maxTimeSeconds) {
99
+ const remainingSeconds = this.maxTimeSeconds - elapsedSeconds;
100
+
101
+ // Trigger warning
102
+ const warningThreshold = this.config.warningThreshold || 60;
103
+ if (!this.warningTriggered && remainingSeconds <= warningThreshold && remainingSeconds > 0) {
104
+ this.warningTriggered = true;
105
+ this.config.onWarning?.(remainingSeconds);
106
+ }
107
+
108
+ // Trigger expiration
109
+ if (remainingSeconds <= 0) {
110
+ this.handleExpiration();
111
+ return;
112
+ }
113
+
114
+ // Tick callback
115
+ this.config.onTick?.(remainingSeconds, elapsedSeconds);
116
+ } else {
117
+ // No limit - just count up
118
+ this.config.onTick?.(0, elapsedSeconds);
119
+ }
120
+ }, 1000);
121
+ }
122
+
123
+ /**
124
+ * Handle time expiration
125
+ */
126
+ private handleExpiration(): void {
127
+ this.stopTimer();
128
+ this.config.onExpired?.();
129
+ }
130
+
131
+ /**
132
+ * Stop the timer
133
+ */
134
+ stopTimer(): void {
135
+ if (this.intervalId) {
136
+ clearInterval(this.intervalId);
137
+ this.intervalId = null;
138
+ }
139
+ }
140
+
141
+ /**
142
+ * Pause the timer
143
+ */
144
+ pause(): void {
145
+ this.state.isPaused = true;
146
+ }
147
+
148
+ /**
149
+ * Resume the timer
150
+ */
151
+ resume(): void {
152
+ this.state.isPaused = false;
153
+ }
154
+
155
+ /**
156
+ * Start tracking time for an item
157
+ */
158
+ startItem(_itemIdentifier: string): void {
159
+ // End previous item if any
160
+ if (this.state.currentItemStartTime) {
161
+ this.endCurrentItem();
162
+ }
163
+
164
+ this.state.currentItemStartTime = Date.now();
165
+ }
166
+
167
+ /**
168
+ * End tracking time for current item
169
+ */
170
+ private endCurrentItem(): void {
171
+ if (!this.state.currentItemStartTime) {
172
+ return;
173
+ }
174
+
175
+ const timeSpent = Date.now() - this.state.currentItemStartTime;
176
+ // Note: We need the item identifier, which should be tracked separately
177
+ // For now, we'll handle this in the endItem method
178
+ this.state.currentItemStartTime = undefined;
179
+ }
180
+
181
+ /**
182
+ * End tracking time for an item
183
+ */
184
+ endItem(itemIdentifier: string): void {
185
+ if (!this.state.currentItemStartTime) {
186
+ return;
187
+ }
188
+
189
+ const timeSpent = Date.now() - this.state.currentItemStartTime;
190
+ this.state.itemTimes[itemIdentifier] = (this.state.itemTimes[itemIdentifier] || 0) + timeSpent;
191
+ this.state.currentItemStartTime = undefined;
192
+ }
193
+
194
+ /**
195
+ * Start tracking time for a section
196
+ */
197
+ startSection(sectionIdentifier: string): void {
198
+ this.state.currentSectionId = sectionIdentifier;
199
+ }
200
+
201
+ /**
202
+ * Get remaining time in seconds (null if no limit)
203
+ */
204
+ getRemainingSeconds(): number | null {
205
+ if (!this.maxTimeSeconds) {
206
+ return null;
207
+ }
208
+
209
+ const elapsedSeconds = Math.floor(this.state.totalElapsed / 1000);
210
+ return Math.max(0, this.maxTimeSeconds - elapsedSeconds);
211
+ }
212
+
213
+ /**
214
+ * Get elapsed time in seconds
215
+ */
216
+ getElapsedSeconds(): number {
217
+ return Math.floor(this.state.totalElapsed / 1000);
218
+ }
219
+
220
+ /**
221
+ * Get time spent on a specific item (ms)
222
+ */
223
+ getItemTime(itemIdentifier: string): number {
224
+ return this.state.itemTimes[itemIdentifier] || 0;
225
+ }
226
+
227
+ /**
228
+ * Get current tracking state (for persistence)
229
+ */
230
+ getState(): TimeTrackingState {
231
+ return { ...this.state };
232
+ }
233
+
234
+ /**
235
+ * Restore tracking state (for resume)
236
+ */
237
+ restoreState(state: TimeTrackingState): void {
238
+ this.state = { ...state };
239
+
240
+ // Restart timer if not expired
241
+ if (this.maxTimeSeconds) {
242
+ const elapsedSeconds = Math.floor(this.state.totalElapsed / 1000);
243
+ if (elapsedSeconds < this.maxTimeSeconds) {
244
+ this.startTimer();
245
+ }
246
+ }
247
+ }
248
+
249
+ /**
250
+ * Check if time has expired
251
+ */
252
+ isExpired(): boolean {
253
+ if (!this.maxTimeSeconds) {
254
+ return false;
255
+ }
256
+
257
+ const elapsedSeconds = Math.floor(this.state.totalElapsed / 1000);
258
+ return elapsedSeconds >= this.maxTimeSeconds;
259
+ }
260
+
261
+ /**
262
+ * Check if late submission is allowed
263
+ */
264
+ allowsLateSubmission(): boolean {
265
+ return this.config.assessmentTimeLimits?.allowLateSubmission || false;
266
+ }
267
+
268
+ /**
269
+ * Format time as MM:SS or HH:MM:SS
270
+ */
271
+ static formatTime(seconds: number): string {
272
+ const hours = Math.floor(seconds / 3600);
273
+ const minutes = Math.floor((seconds % 3600) / 60);
274
+ const secs = seconds % 60;
275
+
276
+ if (hours > 0) {
277
+ return `${hours}:${minutes.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`;
278
+ }
279
+
280
+ return `${minutes}:${secs.toString().padStart(2, '0')}`;
281
+ }
282
+
283
+ /**
284
+ * Cleanup - stop all timers
285
+ */
286
+ destroy(): void {
287
+ this.stopTimer();
288
+ }
289
+ }
@@ -0,0 +1,15 @@
1
+ export { AssessmentPlayer } from './AssessmentPlayer.js';
2
+ export type {
3
+ ItemSessionControlSettings,
4
+ ItemSessionState,
5
+ } from './ItemSessionController.js';
6
+ export { ItemSessionController } from './ItemSessionController.js';
7
+ export type { NavigationMode } from './NavigationManager.js';
8
+ export { NavigationManager } from './NavigationManager.js';
9
+ export type {
10
+ PersistableState,
11
+ PersistenceConfig,
12
+ } from './StatePersistenceManager.js';
13
+ export { StatePersistenceManager } from './StatePersistenceManager.js';
14
+ export type { TimeManagerConfig, TimeTrackingState } from './TimeManager.js';
15
+ export { TimeManager } from './TimeManager.js';
package/src/index.ts ADDED
@@ -0,0 +1,13 @@
1
+ // Core classes
2
+
3
+ export type { BackendAssessmentPlayerConfig } from './core/AssessmentPlayer.js';
4
+ export type { NavigationMode } from './core/index.js';
5
+ export { AssessmentPlayer, NavigationManager } from './core/index.js';
6
+ // Backend integration API + reference adapter
7
+ export * from './integration/index.js';
8
+ // Public UI/data types
9
+ export type { AssessmentResults, ItemResult, NavigationState, QTIRole, QuestionRef } from './types/index.js';
10
+
11
+ // Components are exported via package.json "exports" field
12
+ // Users can import them like:
13
+ // import AssessmentShell from '@pie-qti/assessment-player/components/AssessmentShell.svelte';