Overview
The@timeback/qti package provides a TypeScript client for the QTI (Question and Test Interoperability) API, enabling:
- Assessment Items: Query and manage question items
- Assessment Tests: Query tests with nested structure
- Stimuli: Query shared content for questions
- Lessons: Submit and retrieve lesson feedback
- Validation: Validate QTI XML content
Installation
Quick Start
Assessment Items
List & Get Items
| Method | Returns | Description |
|---|---|---|
list() | { items, total, page, pages } | List with pagination metadata |
get() | AssessmentItem | Get item by ID |
stream() | AsyncIterable<Item> | Memory-efficient streaming |
.toArray() | Item[] | Collect streamed items |
Create, Update & Delete
Assessment Tests
Stimuli
Stimuli are shared content blocks referenced by multiple items:Lessons
Submit and retrieve lesson feedback:Validation
Validate QTI XML content:| Schema | Description |
|---|---|
item | QTI 3.0 assessment item |
test | QTI 3.0 assessment test |
stimulus | QTI 3.0 stimulus |
{ valid: boolean, errors?: string[] }
Item Types
QTI supports various interaction types:| Type | Description |
|---|---|
choiceInteraction | Multiple choice (single or multiple select) |
textEntryInteraction | Text input |
extendedTextInteraction | Long text/essay |
inlineChoiceInteraction | Dropdown select |
orderInteraction | Ordering/ranking |
matchInteraction | Matching pairs |
gapMatchInteraction | Fill in the blank |
hotspotInteraction | Image hotspots |