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.4.0.tar.gz (24.8 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.4.0-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for quizazz-1.4.0.tar.gz
Algorithm Hash digest
SHA256 7d8f2353b5e8b8a7de152efe8cfd4d796664e5791f56b47fe1ba0779a7bf2616
MD5 ab602d2db05fe24e592366d52c0c47dd
BLAKE2b-256 dd7ef070b91f90aca66d53e6ecfb5cdca98765eccad2e5f09fe8d5eca4622c2f

See more details on using hashes here.

Provenance

The following attestation bundles were made for quizazz-1.4.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.4.0-py3-none-any.whl.

File metadata

  • Download URL: quizazz-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 15.0 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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 18eaac453b475a8e989d2db0a37480a33c8ff39273f01196ba1d1402a4c56512
MD5 7f2eac96114e8995aeec088bbea89d44
BLAKE2b-256 fd35c68f4240d2d90d2ed268eda37566e27974eaee0c770ed77b319b7934e98d

See more details on using hashes here.

Provenance

The following attestation bundles were made for quizazz-1.4.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