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.3.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.3.0-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: quizazz-1.3.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.3.0.tar.gz
Algorithm Hash digest
SHA256 5588c7f006688ca6048121840d76e59c17f2857a0de4b610ea8afcef6736ad25
MD5 290b0d9e252a6b0a072dbc6db47507ee
BLAKE2b-256 76072ffa5cc995740665d83bddb623d4abd17e909df74b3e43079c83febbe4b5

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: quizazz-1.3.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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9282eb5220c0fc7dc307d5e560d9b8d12679530e99d3c01eab5ac372ce2972f1
MD5 3a5dc6d804f08b341dc55f50e7327982
BLAKE2b-256 2e22406e15e5f0344e79a1ceb360c568cabd5c69fa5dac1850c6e5c8fd706792

See more details on using hashes here.

Provenance

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