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
Release history Release notifications | RSS feed
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.1.tar.gz
(6.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
quizlib-0.1.1-py3-none-any.whl
(11.1 kB
view details)
File details
Details for the file quizlib-0.1.1.tar.gz.
File metadata
- Download URL: quizlib-0.1.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14347d9eb64e43fac893af9404b63eb26504aee2ef9b459d797bf043e8dfef28
|
|
| MD5 |
d62195cc798ecf204d297f59a709b3e3
|
|
| BLAKE2b-256 |
d3d916a9e3ac0931dc33653b06d997982c46a9c9db1ca9254cc5cc9ae2aeb1e4
|
File details
Details for the file quizlib-0.1.1-py3-none-any.whl.
File metadata
- Download URL: quizlib-0.1.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1a5e846b1d372a6e7a200d7149b834415015342aaff8ca0b9c4f92bed368597
|
|
| MD5 |
b8c0736f825cbec6223335c18d4b7248
|
|
| BLAKE2b-256 |
11f167a180a89097d8fd1b26cf43253d410348a079a166b8ab9ff48141d63bb8
|