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"]
  }
}
Advanced: 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.3.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.3.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: json2qti-1.3.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.3.0.tar.gz
Algorithm Hash digest
SHA256 4fc0f9928fbc87847ddaab0c948597eb6d90a43bb47ac50cb5f09bf18d12f111
MD5 f3bf3dfa6e94f6a8b6508c194a243fbc
BLAKE2b-256 05094ecc51e03d942db61222a2e79a955a357f98eea413ea637c2ea5b2c4e1c5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: json2qti-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 5.9 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 05b27cf8111d84bcf9c52c1a042453e96409aaaa12d9750750cebe534bd4697b
MD5 d7ba293583292bd8f9a209b0cb7c1269
BLAKE2b-256 e927759238e5035e69f9224137c4b308a5927b3abe095e74a4fcf4e4c807e90f

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