Skip to content

QTI export

Already writing quizzes in your docs? You can reuse them in a Learning Management System (LMS) instead of rebuilding them by hand. The export-qti command turns every quiz on your site into QTI (Question & Test Interoperability), the standard interchange format that Canvas, Moodle, Blackboard, D2L Brightspace and most other platforms can import.

Like the terminal runner, the exporter reads a quiz manifest, never your MDX. The manifest is a single quiz-manifest.json file describing every quiz on your site (question, answers, which are correct, page path), and the plugin writes it by default. See the CLI guide for what the manifest is and where it lives, and Configuration for the option.

Point export-qti at your site’s manifest — its URL or a local build directory — and choose an output directory:

Terminal window
# QTI 2.1 (the default)
npx starlight-quiz export-qti https://ewels.github.io/starlight-quiz/quiz-manifest.json --out ./qti
output
Wrote 28 file(s) to ./qti/

That writes one XML assessment item per quiz, plus an imsmanifest.xml index, into the output directory:

./qti/
imsmanifest.xml ← the package index
demo-single.xml ← one item per quiz, named by its id
demo-multiple.xml
blank-single.xml

Single-choice, multiple-choice and fill-in-the-blank questions are all supported.

The output directory is an unzipped IMS Content Package. To import it:

  1. Zip the output directory so imsmanifest.xml sits at the root of the archive.
  2. In your LMS, import it as a QTI / IMS content package (for example Canvas: Settings → Import Course Content → QTI .zip file).
Flag Description
<source> A manifest URL or file, a directory containing one, or a page URL (scraped).
--out Output directory (default qti).
--version 2.1 (default) or 1.2.
--filename Manifest filename to look for (default quiz-manifest.json).