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

Uploaded Python 3

File details

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

File metadata

  • Download URL: quizazz-1.2.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.2.0.tar.gz
Algorithm Hash digest
SHA256 579f1092498cf6c564186beec1989c916c5533838049f60801bd345727576875
MD5 20271b295c4b2ab692eda53efe9a102c
BLAKE2b-256 3c2f0708d4f2d04b2b6309294d3e7a7117d269f3dee2b218239a15e21222f67f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: quizazz-1.2.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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e641c0ae0b5e282179ae59f7f489732fd4d2e6bc24859d50aff9bd47d8c090d9
MD5 c48a9a651b0862f13b93557a84d72b6c
BLAKE2b-256 8dab14a41113f3692ba32a17fb1fa34693363e5f5e5927c5955d94051fd0a672

See more details on using hashes here.

Provenance

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