Skip to main content

Used to turn CANVAS QTI quizzes into plaintext files. Useful if you want more control over your quizzes or if you want to edit them and reupload them using text2qti.

Project description

QTI2TEXT

qti2txt converts quizzes exported from Canvas in QTI-format (version 1.2) into plaintext files. This is useful if you want ownership over your quizzes, if you are moving them to a different LMS, plan to use them for a paper exam, or edit them and reupload them using text2qti.

This project processes QTI (Question and Test Interoperability) quiz data. It strips namespaces from XML files, parses the data, and generates quiz questions in a .txt format that is mostly compatible with text2qti.

Installation

Install Python 3.13 or greater. You can download it from python.org.

qti2txt can be installed as follows:

pip install qti2txt

or

python3 -m pip install qti2txt

or using uv:

uv add qti2txt

Usage

To use qti2txt, you'll need a .zip file in QTI format. You can obtain one by exporting it from CANVAS as follows:

  1. Select your course in CANVAS.
  2. Click Settings
  3. Select Export Course Content
  4. Select Quiz
  5. Select the quizzes you want to export.
  6. Click Create Export

Canvas will now export a .zip file containing the XML data (you may need to refresh your browser). Now that you have your .zip file.

In the terminal:

qti2txt -f YOUR_QTI_FILEPATH_HERE.zip 

Other command-line options include:

  • -o or --output: specifies the output directory for the quiz files
  • -kxml or --keeptmpxml: keeps the temporary xml files created in the process of creating the quiz. The default is to try to delete these files.
  • -v or verbose: verbose logging

Some basic recipes.

Quizzes and csv file are saved to a folder titled output:

qti2txt -f YOUR_QTI_FILE_HERE.zip -o output

Quizzes, a csv file, and temporary .xml files are saved to a folder titled output, verbose logging is on:

qti2txt -f YOUR_QTI_FILE_HERE.zip -o output -v -kxml

Features

  • Strips namespaces from XML files.

  • Generates quiz questions in a text format.

  • Parses QTI quiz data for a limited number of question types:

    • ✅ Multiple-Choice
    • ✅ True/False (as a Multiple-Choice question)
    • ✅ Fill-in-the-blank (processed as a short-answer question)
    • ✅ Fill-in-multiple-blanks (note: not used in text2qti)
    • ✅ Multi-Answer questions
    • 🟡 Matching. Complete w/o distractors
    • 🚧 Multiple dropdowns
    • 🟡 Numerical Answer. Partial functionality: Exact Answer, Range, Exact Answer with margin of error.
    • ❌ Formula question
    • ✅ Essay
    • ✅ File upload_question
    • ✅ Text only question
    • ✅ Incorporate LaTeX
    • 🟡 Feedback on Question. Presently, there is only General feedback on the question. There is no question-specific feedback or feedback if Correct or feedback if Incorrect.

Requirements

  • Python 3.x
  • defusedxml for XML parsing.
  • html2text

Resources

  1. Get Marked - API for converting docx, QTI, and Moodle XML quiz file into simplified JSON
  2. text2qti

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qti2txt-0.0.1.tar.gz (27.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qti2txt-0.0.1-py3-none-any.whl (30.2 kB view details)

Uploaded Python 3

File details

Details for the file qti2txt-0.0.1.tar.gz.

File metadata

  • Download URL: qti2txt-0.0.1.tar.gz
  • Upload date:
  • Size: 27.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.9

File hashes

Hashes for qti2txt-0.0.1.tar.gz
Algorithm Hash digest
SHA256 bc85930b78b51485f6f2d5e4412f4f961ee5781c053caf438c13225e2b7772a3
MD5 3335384d067e2d13c9fa8547757e1b3d
BLAKE2b-256 3b92419c2aac7ef110bcd55ad747288879da1acc2ffd66ead535983adba24ee0

See more details on using hashes here.

File details

Details for the file qti2txt-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: qti2txt-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 30.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.9

File hashes

Hashes for qti2txt-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6a7dd0d6e766f19db2069a4b3415eed99dfe4db0451a1bd9ad160bd376d447c9
MD5 154e7e2d954202028b22af1ff3e5dfe8
BLAKE2b-256 29e003c4ee883b18aa7363a09a6ebfb96d0f79a95dc271b87e9bc81752b7947e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page