Skip to main content

Generate quizzes from Python code.

Project description

quizlib

Generate quizzes from Python code.

Features

  • Supported Question Types: Essay (ES), Multiple Choice (MC), True/False (TF), Cloze (CZ).
  • Renderers: Moodle XML, Markdown
  • Python-centric: Define quiz structure and content using native Python classes.

Installation

Install using uv:

uv add quizlib

For development run

uv pip install -e .

Usage

from quizlib import Quiz, Essay, MultipleChoice, TrueFalse, Cloze
from quizlib.renderers import MoodleXMLRenderer

# Initialize quiz
quiz = Quiz(category="Example", info="Sample quiz")

# Add questions
quiz.add(Essay(name="q1", defgrade=5, text="Explain the concept of recursion."))

quiz.add(MultipleChoice(
    name="q2",
    text="Which of these is a Python keyword?",
    answers=[(1, "yield"), (0, "function"), (0, "define")],
))

# Render to Moodle XML
renderer = MoodleXMLRenderer()
xml_output = renderer.render(quiz)
print(xml_output)

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

quizlib-0.1.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

quizlib-0.1.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file quizlib-0.1.0.tar.gz.

File metadata

  • Download URL: quizlib-0.1.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for quizlib-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4f03562845d21e0adf3dfdf84d01f1a3741ef2f0ef55b16f5d8fe6c5e8db9126
MD5 b9c389c5fe4ac914557a438f717a8df2
BLAKE2b-256 74d3693f2803c8631308fcd8a011424e4cc21a1075639bb1432969fcd4a4eccc

See more details on using hashes here.

File details

Details for the file quizlib-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: quizlib-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for quizlib-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3744e998cbb7677f4032bc41f5733fd7ac002ea88ac158362e01dc7fe8408f65
MD5 138b19b61871b11d75614a529deb71c4
BLAKE2b-256 46c611fcad6fcd8b1fad5f1a974d50c33f38738f8ee6db47e7cce73ff01af158

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