Skip to main content

Convert simple JSON quizzes to QTI format for LMS import

Project description

json2qti

PyPI version Lint Test

Instantly convert simple JSON files into QTI import packages for your LMS.

json2qti is a lightweight, zero-dependency tool designed to bridge the gap between AI-generated content and Learning Management Systems (Canvas, Blackboard, Moodle, Brightspace, etc.).

🚀 Why json2qti?

  • LLM Optimized: The input JSON format is designed to be extremely token-efficient, making it perfect for generating quizzes with ChatGPT, Claude, or other LLMs.
  • Zero Dependencies: Runs entirely on the Python standard library. No complex environment setup required.
  • Universal Compatibility: Generates standard QTI v1.2 packages compatible with major LMS platforms.

📄 JSON Format

The input format is minimal by design.

  1. Quiz Title: The top-level key.
  2. Questions: Keys inside the object.
  3. Answers: A list of strings. The first answer is always the correct one. (Don't worry, json2qti shuffles them in the output file).
{
  "Basic Math Quiz": {
    "What is 1+1?": ["2", "3", "4", "5"],
    "What is 1+2?": ["3", "4", "5", "6"]
  }
}

Code Formatting

You can include code snippets using markdown-style syntax:

  • Inline Code: Wrap text in single backticks (`).
  • Block Code: Wrap text in triple backticks (```).
{
  "Python Quiz": {
    "What does `print('hello')` output?": [
      "`hello` to stdout",
      "`hello` to stderr",
      "Nothing"
    ],
    "What does this function do?\n```\ndef add(a, b):\n    return a + b\n```": [
      "Returns the sum of two numbers",
      "Returns the product of two numbers",
      "Prints the numbers"
    ]
  }
}

💻 Usage

Quick Run (Recommended)

You can run it directly using pipx without installing anything globally:

pipx run json2qti quiz.json

Manual Execution

Since the tool is a single file, you can also just download json2qti.py and run it:

python3 json2qti.py quiz.json
# Creates quiz.zip ready for LMS import

🛠️ Development

This project includes a test suite to ensure reliability. Tests are located in the tests/ directory.

make test

📦 Dependencies

Just Python 3.

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

json2qti-1.2.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

json2qti-1.2.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file json2qti-1.2.0.tar.gz.

File metadata

  • Download URL: json2qti-1.2.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for json2qti-1.2.0.tar.gz
Algorithm Hash digest
SHA256 3b512034ad55678d5e5a57a04c84c0ace3ace3cdd74f93ecee56c54b0c192bb9
MD5 d00ebcc2315de3c4e90c96b555d3da34
BLAKE2b-256 8fef0251c99532035b3e006c42e51ac5c378212736892e8535cfd0e9665f780e

See more details on using hashes here.

File details

Details for the file json2qti-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: json2qti-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for json2qti-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 baa0e2c51c60d17e160f7aa88fa8e22d1398731ca5e53b3282a3106604bc5e7f
MD5 fbaadd038318132523e3cf3e5fb10cd3
BLAKE2b-256 a1645a346388b4a48b3cf992f20df97ed6a632ae297aaf5707221e894db58f57

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