Try QTI 3 in React: render, score, and resume a question
Run a complete QTI 3 question preview with the published qti3 React adapter. Check scores, save an attempt, and restore it after a reload.
Use the qti3 React starter to render a multiple-choice question, score a response, and save and restore an attempt in your browser. Try it without an account, or copy the app into your React project.
The starter uses published packages from qti3, Longsight’s open-source TypeScript implementation for QTI 3 assessment items. The React adapter wraps the native Web Component player. The core parses item XML and processes responses with zero third-party runtime dependencies.
Run the starter
With Node.js 22.12 or later and pnpm 12.21.0 installed, clone the repository and enter the starter directory:
git clone --depth 1 https://github.com/QFlowLearn/qti3.git
cd qti3/examples/react-starter
Install and start the app:
pnpm install
pnpm dev
Open the local URL that Vite prints. The starter uses published qti3 packages pinned to exact versions, so you do not need to build qti3. It loads a synthetic, MIT-licensed civics question.

Score a response
The question asks which evidence supports a claim that a library tutoring program improved attendance. Choose the answer about attendance records increasing from 42 to 68 students, then select Score response. Expect Score: 1.
Choose the answer about repainting the study room and score again. Expect Score: 0. The player processes the item’s scoring rules. The React app triggers scoring and displays the result.
Open Inspect attempt JSON to see the selected response and the SCORE outcome. The React integration guide explains the component, event callbacks, and load options. The starter source contains the complete app.
Save and restore the attempt
Choose the attendance-records answer and score it. Select Save attempt, then reload the page. Select Restore saved attempt. The selected answer and scored outcome return.
The player serializes attempt state as versioned JSON. Your app decides where to store it and when to restore it. The starter stores the JSON in the browser and checks it before restoration. Reset response clears the current response without deleting the saved copy.
To restore an attempt, use the same browser profile and origin: the scheme, hostname, and port in the URL. Clearing site data deletes the saved attempt. For graded delivery, keep the authoritative assessment record on the server.
See how QFlowLearn uses the player
QFlowLearn’s public authoring application embeds the native player in a Preact preview. QFlowLearn prepares item XML, supplies language settings and preview controls, and listens for player lifecycle and scoring events.
The QFlowLearn integration walkthrough follows that implementation at a pinned public source revision. It shows which work QFlowLearn performs and which work qti3 performs. The React starter demonstrates the same player API with its own interface and browser storage.
Use qti3 in your application
The starter includes an answer key for local preview scoring. For graded delivery, keep the approved item XML and scoring on the server. Send candidate-safe XML to the browser. The Node scoring guide explains how to score responses on the server with a runnable example.
If you have older assessment content, follow the QTI 2 migration guide to convert an item and check its diagnostics and scores. The migrator reports an error when it cannot preserve the item’s scoring rules.
Try the starter with a synthetic item that represents the content you need to support. If it fails to render, score, or import, submit a compatibility report. Include the source system, package versions, reproduction steps, expected result, and diagnostics with private data removed. Use synthetic XML or a public, licensed sample, and keep private assessment content out of the report.