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.1.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.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: json2qti-1.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 e02ad2b7ec0ece3de0bb50bee3dd506169a68de3428fba321834c1a207d38bff
MD5 cb4b768361cbc6ecc29c7e5acae3d5d1
BLAKE2b-256 b85ceb73d92c6b578e118db1cb6c2d958eaa92b956b043921e65dd860daea691

See more details on using hashes here.

File details

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

File metadata

  • Download URL: json2qti-1.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dd7f3b6dfca8a68f2c1588d0768f3cbfa24a069c02cf018b6ea6a46f76ff13eb
MD5 d6db1207685043ec3f25ec666d181a22
BLAKE2b-256 3719e755643a2fb3bebbe5704badf2d973613deac721815403f045710f418c8b

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