qti2txt


Nameqti2txt JSON
Version 0.0.1 PyPI version JSON
download
home_pageNone
SummaryUsed 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.
upload_time2025-08-20 00:25:04
maintainerNone
docs_urlNone
authordavidagler
requires_python>=3.13
licenseNone
keywords qti canvas quiz conversion lms education
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # QTI2TEXT

qti2txt converts quizzes exported from [Canvas](https://www.instructure.com/canvas) in [QTI-format](https://en.wikipedia.org/wiki/QTI) (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](https://github.com/gpoore/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](https://www.python.org/).

qti2txt can be installed as follows:

```bash
pip install qti2txt
```

or

```bash
python3 -m pip install qti2txt
```

or using `uv`:

```bash
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.
1. Click `Settings`
1. Select `Export Course Content`
1. Select `Quiz`
1. Select the quizzes you want to export.
1. 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:

```bash
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`:

```bash
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:

```bash
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](https://digitaliser.getmarked.ai/docs/) - API for converting docx, QTI, and Moodle XML quiz file into simplified JSON
1. [text2qti](https://github.com/gpoore/text2qti)
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "qti2txt",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.13",
    "maintainer_email": null,
    "keywords": "qti, canvas, quiz, conversion, lms, education",
    "author": "davidagler",
    "author_email": "davidagler <davidagler@users.noreply.github.com>",
    "download_url": "https://files.pythonhosted.org/packages/3b/92/419c2aac7ef110bcd55ad747288879da1acc2ffd66ead535983adba24ee0/qti2txt-0.0.1.tar.gz",
    "platform": null,
    "description": "# QTI2TEXT\r\n\r\nqti2txt converts quizzes exported from [Canvas](https://www.instructure.com/canvas) in [QTI-format](https://en.wikipedia.org/wiki/QTI) (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](https://github.com/gpoore/text2qti).\r\n\r\nThis 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.\r\n\r\n## Installation\r\n\r\nInstall **Python 3.13** or greater. You can download it from [python.org](https://www.python.org/).\r\n\r\nqti2txt can be installed as follows:\r\n\r\n```bash\r\npip install qti2txt\r\n```\r\n\r\nor\r\n\r\n```bash\r\npython3 -m pip install qti2txt\r\n```\r\n\r\nor using `uv`:\r\n\r\n```bash\r\nuv add qti2txt\r\n```\r\n\r\n## Usage\r\n\r\nTo use qti2txt, you'll need a `.zip` file in QTI format. You can obtain one by exporting it from CANVAS as follows:\r\n\r\n1. Select your course in CANVAS.\r\n1. Click `Settings`\r\n1. Select `Export Course Content`\r\n1. Select `Quiz`\r\n1. Select the quizzes you want to export.\r\n1. Click `Create Export`\r\n\r\nCanvas will now export a `.zip` file containing the XML data (you may need to refresh your browser). Now that you have your `.zip` file.\r\n\r\nIn the terminal:\r\n\r\n```bash\r\nqti2txt -f YOUR_QTI_FILEPATH_HERE.zip \r\n```\r\n\r\nOther command-line options include:\r\n\r\n- `-o` or `--output`: specifies the output directory for the quiz files\r\n- `-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.\r\n- `-v` or `verbose`: verbose logging\r\n\r\nSome basic recipes.\r\n\r\nQuizzes and csv file are saved to a folder titled `output`:\r\n\r\n```bash\r\nqti2txt -f YOUR_QTI_FILE_HERE.zip -o output\r\n\r\n```\r\n\r\nQuizzes, a csv file, and temporary .xml files are saved to a folder titled `output`, verbose logging is on:\r\n\r\n```bash\r\nqti2txt -f YOUR_QTI_FILE_HERE.zip -o output -v -kxml\r\n\r\n```\r\n\r\n## Features\r\n\r\n- Strips namespaces from XML files.\r\n- Generates quiz questions in a text format.\r\n- Parses QTI quiz data for a limited number of question types:\r\n\r\n  - \u2705 Multiple-Choice\r\n  - \u2705 True/False (as a Multiple-Choice question)\r\n  - \u2705 Fill-in-the-blank (processed as a short-answer question)\r\n  - \u2705 Fill-in-multiple-blanks (note: not used in text2qti)\r\n  - \u2705 Multi-Answer questions\r\n  - \ud83d\udfe1 Matching. Complete w/o distractors\r\n  - \ud83d\udea7 Multiple dropdowns\r\n  - \ud83d\udfe1 Numerical Answer. Partial functionality: Exact Answer, Range, Exact Answer with margin of error.\r\n  - \u274c Formula question\r\n  - \u2705 Essay\r\n  - \u2705 File upload_question\r\n  - \u2705 Text only question\r\n  - \u2705 Incorporate LaTeX\r\n  - \ud83d\udfe1 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.\r\n\r\n## Requirements\r\n\r\n- Python 3.x\r\n- `defusedxml` for XML parsing.\r\n- `html2text`\r\n\r\n## Resources\r\n\r\n1. [Get Marked](https://digitaliser.getmarked.ai/docs/) - API for converting docx, QTI, and Moodle XML quiz file into simplified JSON\r\n1. [text2qti](https://github.com/gpoore/text2qti)",
    "bugtrack_url": null,
    "license": null,
    "summary": "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.",
    "version": "0.0.1",
    "project_urls": {
        "Changelog": "https://github.com/davidagler/qti2txt/blob/main/CHANGELOG.md",
        "Homepage": "https://github.com/davidagler/qti2txt",
        "Repository": "https://github.com/davidagler/qti2txt"
    },
    "split_keywords": [
        "qti",
        " canvas",
        " quiz",
        " conversion",
        " lms",
        " education"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "29e003c4ee883b18aa7363a09a6ebfb96d0f79a95dc271b87e9bc81752b7947e",
                "md5": "154e7e2d954202028b22af1ff3e5dfe8",
                "sha256": "6a7dd0d6e766f19db2069a4b3415eed99dfe4db0451a1bd9ad160bd376d447c9"
            },
            "downloads": -1,
            "filename": "qti2txt-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "154e7e2d954202028b22af1ff3e5dfe8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.13",
            "size": 30189,
            "upload_time": "2025-08-20T00:25:03",
            "upload_time_iso_8601": "2025-08-20T00:25:03.133678Z",
            "url": "https://files.pythonhosted.org/packages/29/e0/03c4ee883b18aa7363a09a6ebfb96d0f79a95dc271b87e9bc81752b7947e/qti2txt-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3b92419c2aac7ef110bcd55ad747288879da1acc2ffd66ead535983adba24ee0",
                "md5": "3335384d067e2d13c9fa8547757e1b3d",
                "sha256": "bc85930b78b51485f6f2d5e4412f4f961ee5781c053caf438c13225e2b7772a3"
            },
            "downloads": -1,
            "filename": "qti2txt-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "3335384d067e2d13c9fa8547757e1b3d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.13",
            "size": 27616,
            "upload_time": "2025-08-20T00:25:04",
            "upload_time_iso_8601": "2025-08-20T00:25:04.358284Z",
            "url": "https://files.pythonhosted.org/packages/3b/92/419c2aac7ef110bcd55ad747288879da1acc2ffd66ead535983adba24ee0/qti2txt-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-20 00:25:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "davidagler",
    "github_project": "qti2txt",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "qti2txt"
}
        
Elapsed time: 0.44975s