|
1 | | -# QTI 3.x Renderer - Proof of Concept |
| 1 | +# QTI 3.x Renderer |
2 | 2 |
|
3 | | -A framework-agnostic QTI 3.x renderer with a React demo application. |
| 3 | +[**Live Sandbox Demo**](https://agencyenterprise.github.io/qti-3-player/) |
| 4 | + |
| 5 | +A framework-agnostic QTI 3.x renderer with support for multiple frontend frameworks. |
4 | 6 |
|
5 | 7 | ## Structure |
6 | 8 |
|
7 | 9 | ``` |
8 | 10 | qti-3-player/ |
9 | 11 | ├── packages/ |
10 | | -│ └── qti-renderer/ # Core renderer library (TypeScript, framework-agnostic) |
11 | | -└── apps/ |
12 | | - └── react-demo/ # React sample application |
| 12 | +│ ├── qti-renderer/ # Core renderer library (TypeScript, framework-agnostic) |
| 13 | +│ ├── qti-react/ # React wrapper component |
| 14 | +│ ├── qti-vue/ # Vue wrapper component |
| 15 | +│ └── qti-vanilla/ # Vanilla JS wrapper |
| 16 | +├── sandbox/ # Standalone demo application |
| 17 | +└── stories/ # Storybook examples and stories |
13 | 18 | ``` |
14 | 19 |
|
15 | | -## Core Library (`packages/qti-renderer`) |
16 | | - |
17 | | -Framework-agnostic npm package that renders QTI 3.x assessment items to HTML. |
| 20 | +## Packages |
18 | 21 |
|
19 | | -### Supported QTI Elements |
| 22 | +### Core Library (`packages/qti-renderer`) |
20 | 23 |
|
21 | | -- `<assessmentItem>` - Root element |
22 | | -- `<itemBody>` - Question content container |
23 | | -- `<choiceInteraction>` - Multiple choice interaction |
24 | | -- `<prompt>` - Question text |
25 | | -- `<simpleChoice>` - Individual choice options |
| 24 | +Framework-agnostic npm package that renders QTI 3.x assessment items to HTML with full response processing support. |
26 | 25 |
|
27 | | -### API |
| 26 | +**API:** |
28 | 27 |
|
29 | 28 | ```typescript |
30 | 29 | import { QtiRenderer } from '@qti-renderer/core'; |
31 | 30 |
|
32 | 31 | const renderer = new QtiRenderer(qtiXmlString); |
33 | | -renderer.mount(containerElement); |
34 | | -const responses = renderer.getResponses(); // Record<string, string | string[]> |
| 32 | +renderer.render(containerElement); |
35 | 33 | ``` |
36 | 34 |
|
37 | | -### Design Decisions |
| 35 | +**Features:** |
| 36 | + |
| 37 | +- XML validation against QTI 3.0 schema |
| 38 | +- Response processing with conditional logic |
| 39 | +- Outcome variable management (RESPONSE) |
| 40 | +- Feedback display (inline and modal) |
| 41 | +- Response state management |
| 42 | + |
| 43 | +## Supported QTI Elements |
| 44 | + |
| 45 | +See [QTI Support Documentation](docs/qti_support/README.md) for a complete checklist of supported elements and attributes. |
| 46 | + |
| 47 | +## Design Decisions |
38 | 48 |
|
39 | 49 | - Uses `DOMParser` for XML parsing (no external dependencies) |
40 | 50 | - Renders to vanilla DOM elements (framework-agnostic) |
41 | 51 | - Maintains response state internally |
42 | 52 | - Uses semantic HTML (`fieldset`, `legend`, `label`) for accessibility |
43 | 53 | - Registry pattern for extensible element rendering |
| 54 | +- Event-driven response processing |
44 | 55 |
|
45 | | -## React Demo (`apps/react-demo`) |
| 56 | +## Development |
46 | 57 |
|
47 | | -Sample React application demonstrating QTI renderer usage. |
| 58 | +### Running Storybook |
48 | 59 |
|
49 | | -### Usage |
| 60 | +```bash |
| 61 | +npm install |
| 62 | +npm run dev |
| 63 | +``` |
| 64 | + |
| 65 | +This will start Storybook on `http://localhost:6006` with examples for React, Vue, and Vanilla JS. |
50 | 66 |
|
51 | | -```tsx |
52 | | -import { QtiItem } from './QtiItem'; |
| 67 | +### Building |
53 | 68 |
|
54 | | -<QtiItem xml={qtiXmlString} onResponseChange={(responses) => console.log(responses)} /> |
| 69 | +```bash |
| 70 | +npm run build |
55 | 71 | ``` |
56 | 72 |
|
57 | | -### Running |
| 73 | +Builds all packages in the monorepo. |
| 74 | + |
| 75 | +### Sandbox |
| 76 | + |
| 77 | +The sandbox provides a standalone demo application: |
58 | 78 |
|
59 | 79 | ```bash |
| 80 | +cd sandbox |
60 | 81 | npm install |
61 | 82 | npm run dev |
62 | 83 | ``` |
63 | 84 |
|
64 | | -## Limitations |
65 | | - |
66 | | -This is a proof of concept with the following limitations: |
| 85 | +## Current Limitations |
67 | 86 |
|
68 | | -- **No response processing** - Only renders questions, doesn't grade them |
69 | 87 | - **No scoring** - No calculation or evaluation of responses |
70 | | -- **No adaptive behavior** - Static rendering only |
71 | | -- **No feedback** - No correct/incorrect feedback display |
72 | | -- **No test structure** - Only single items, no tests/sections |
73 | | - |
74 | | -## QTI 3.x Support |
75 | | - |
76 | | -Targets QTI 3.x specification structure and syntax. Uses `responseIdentifier` and supports `maxChoices` attribute for single/multiple selection. |
| 88 | +- **No test structure** - Only single assessment items, no tests/sections |
| 89 | +- **Limited interaction types** - Currently supports `choice-interaction` (single and multiple choice) |
| 90 | +- **Partial expression support** - Basic expressions like `match` and `correct` are supported, but not all QTI expressions |
| 91 | +- **No adaptive behavior** - Static rendering only, no adaptive item selection |
0 commit comments