Skip to main content

YAML question bank validator, compiler, and CLI for Quizazz quizzes.

Project description

quizazz

YAML question bank validator, compiler, and CLI for Quizazz quizzes.

Use it as a command-line tool to compile quiz YAML into a browser-ready manifest, or as a Python library to compile assessments directly into dicts — ideal for host frameworks that bundle quizzes at their own build time.

Install

pip install quizazz

Python 3.12+ required.

CLI

# Compile a single quiz directory to a JSON manifest
quizazz generate --input data/my-quiz/ --output app/src/lib/data/

# Batch-compile every quiz under a parent directory
quizazz generate --all --input data/ --output app/src/lib/data/

quizazz --help lists all subcommands. The CLI exits non-zero on validation errors and prints one diagnostic per violation to stderr.

Library API

For host frameworks that want to compile assessments without shelling out:

from pathlib import Path
from quizazz import compile_assessment, validate_assessment, ValidationError

try:
    manifest = compile_assessment("module-4-pre.yaml", base_dir=Path("content"))
    # → dict with schemaVersion, quizName, tree, questions
except ValidationError as exc:
    print(exc.file_path, exc.message, exc.detail)

errors = validate_assessment("bad.yaml", base_dir=Path("content"))
# → [] on success, or one human-readable string per violation

Both functions accept str or Path for their arguments. yaml_path is joined under base_dir and must resolve strictly inside it; traversal attempts (.., absolute paths outside the base, escaping symlinks) raise ValidationError with detail={"base_dir", "resolved"}. Neither function writes to disk, spawns subprocesses, or issues network calls.

validate_assessment never raises — it swallows ValidationError and surfaces one string per underlying violation in the returned list.

YAML schema

Each question requires five or more answers distributed across four categories — correct, partially_correct, incorrect, and ridiculous:

menu_name: "General Knowledge"
questions:
  - question: "What is the capital of France?"
    tags: ["geography"]
    answers:
      correct:
        - text: "Paris"
          explanation: "Paris has been the capital since the 10th century."
      partially_correct:
        - text: "Lyon"
          explanation: "Second-largest city but not the capital."
      incorrect:
        - text: "Berlin"
          explanation: "Berlin is the capital of Germany."
      ridiculous:
        - text: "Atlantis"
          explanation: "A mythical city."
        - text: "The Moon"
          explanation: "Not a city."

Subtopic grouping is optional. See the full repository README for the complete schema, tag filtering, and the SvelteKit quiz UI that consumes the compiled manifests.

Manifest schema version

The compiled manifest includes a top-level schemaVersion field. quizazz 1.x emits "1.0"; consumers should check compatibility before treating the manifest as authoritative. This is the cross-package versioning boundary between quizazz (producer) and @pointmatic/quizazz (future npm consumer).

License

Apache-2.0. See the repository LICENSE.

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

quizazz-1.0.0.tar.gz (23.1 kB view details)

Uploaded Source

Built Distribution

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

quizazz-1.0.0-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: quizazz-1.0.0.tar.gz
  • Upload date:
  • Size: 23.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for quizazz-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8fb706c607f10e49406ce5ddcb8c6fd3c76b412347e41e66a6364d7b3c2967d5
MD5 6bc64a79dbee77453881e4933a06e8c3
BLAKE2b-256 a757572aa426e7a8709ecd7a96bf690edcb015d5d92ff2978d462bcddcf05994

See more details on using hashes here.

Provenance

The following attestation bundles were made for quizazz-1.0.0.tar.gz:

Publisher: publish-pypi.yml on pointmatic/quizazz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: quizazz-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for quizazz-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7b42eb5f128a9929b0e91ae6fc40348c5de89f2e0c6ef0ca55b32eb5c078245
MD5 092963f70c5f9bc2dbcaa7b006fdc50d
BLAKE2b-256 4657edd3bb22b490bf8304a0fd69d8bc4fd6b94726d3ae32cdf0c90cf6bc2e8b

See more details on using hashes here.

Provenance

The following attestation bundles were made for quizazz-1.0.0-py3-none-any.whl:

Publisher: publish-pypi.yml on pointmatic/quizazz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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