Skip to main content

Convert simple JSON quizzes to QTI format for LMS import

Project description

json2qti

PyPI version Lint Test

Build LMS quizzes from simple json.

Format

The JSON representation is as minimal as possible to allow for token-efficient generation and processing by LLMs. All questions are multiple choice. Questions are keys in an object. Answers are provided as a list of values. The first answer is always the correct choice. Generated quizzes will have answer shuffling enabled.

Here's an example:

{
  "Basic Math Quiz": {
    "What is 1+1?": ["2", "3", "4", "5"],
    "What is 1+2?": ["3", "4", "5", "6"]
  }
}

Usage

The simplest way to perform a quick conversion is using pipx:

pipx run json2qti {quiz.json}

Running locally:

python3 json2qti.py quiz.json # Produces quiz.zip QTI file

Dependencies

This project has no dependencies beyond the Python standard library. The entire package is in a single file json2qti.py.

Development

This project includes a test suite that can be run using make test. This will run the tests in the tests/ directory using pytest.

make test

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.0.0.tar.gz (5.4 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.0.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for json2qti-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0c0206eb97380e11772f7ff2825ef31872f354f84534cea0bc4cbcc0e5eb0752
MD5 67360147311c80af8fbf3a3b9155fc97
BLAKE2b-256 4964b2301545dd3a7db8a13f0a04349a89a3a7989bb2e7c4d9c24b35eeb5d898

See more details on using hashes here.

File details

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

File metadata

  • Download URL: json2qti-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 07cb13ac565343cde76e1a1a9b63ce543c1508c54744ceef7b3cc0cbd3db8450
MD5 4cea3a3379c0e03e8ca0b5a8c0bffd1c
BLAKE2b-256 ab2d5238aaca0eee6388f40cda1df8e5c17afbf68cb44824d4abd18bdba9c558

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