Generate a deep, mixed-format question bank from source material and grade it — deterministic where it can, LLM where it must. Bring your own chat model.
Project description
quizforge
Generate a deep, mixed-format question bank from any source material, then grade it — deterministic where it can, LLM where it must. Bring your own chat model.
quizforge is the engine behind a training/readiness feature: it drafts far more questions than any single test shows (multiple choice, fill-in-the-blank, match-the-following, short answer, and free-response scenarios), samples a fresh shuffled test on each attempt — so two learners rarely see the same one — and grades every format. MC/fill/match are graded instantly with no model call; open-ended answers are scored 0–1 with coaching feedback by an LLM you provide.
- Model-agnostic — pass any LangChain-style chat model (
with_structured_output). No SDK is bundled. - Deep bank, anti-sharing sampling — unseen-first, difficulty-spread draws per a configurable blueprint.
- Cheap grading — only open-ended answers cost a model call; everything else is local and free.
- Plain dicts in, plain dicts out — YAML/JSON-friendly, easy to store and template.
Install
pip install quizforge
Bring a chat model from whichever provider you use, e.g.:
pip install langchain-openai # or langchain-anthropic, etc.
Quickstart
Generate a bank
from quizforge import generate_bank
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(model="gpt-4.1", temperature=0.4)
material = open("citrix_lesson.md").read()
new_questions = generate_bank(
material, llm,
targets={"mc": 40, "fill_blank": 20, "match": 12, "short": 16, "freetext": 12},
existing=[], # pass your current bank to top it up
coverage="At least half should be applied incident-response scenarios.",
)
# -> list of dicts with id/type/difficulty + per-format fields. Store as you like.
generate_bank only produces the shortfall to reach targets, validates each
question, and never duplicates an existing prompt — safe to re-run to grow a bank.
Sample a test
from quizforge import sample_test, DEFAULT_BLUEPRINT
test = sample_test(bank, blueprint=DEFAULT_BLUEPRINT, seen_ids=already_seen)
# DEFAULT_BLUEPRINT draws mc8 / fill4 / match2 / short4 / freetext2 = 20, shuffled.
Grade
from quizforge import grade_fill_blank, grade_match, grade_open_answer
grade_fill_blank(q, "ICA") # {"score": 1.0, "correct": True, ...}
grade_match(q, {"0": "RDP", "1": "ICA"}) # per-pair partial credit
grade_open_answer(q, learner_text, llm) # QuizGrade(score, verdict, feedback, ...) or None
grade_open_answer returns None if the model was unavailable — exclude that
question from the attempt's max score rather than penalizing the learner.
Question shapes
Each question is a dict with id, type, difficulty, prompt, plus:
mc—choices: [str],answer_idx: int,explanation: strfill_blank—accepted_answers: [str],explanation: strmatch—pairs: [{left, right}],explanation: strshort/freetext—model_answer: str,rubric: [str]
License
MIT
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
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
File details
Details for the file quizforge-0.2.0.tar.gz.
File metadata
- Download URL: quizforge-0.2.0.tar.gz
- Upload date:
- Size: 24.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ce6a3203b0539efa935261f6ecdd2cc3c34d51f87a1cda0fc9adaad58cdbb92
|
|
| MD5 |
dd337280f883dc1c096aeb07a0519002
|
|
| BLAKE2b-256 |
97f211936dfe38b4430c890f896324499b5d3a37383fefaefc99daea83178362
|
Provenance
The following attestation bundles were made for quizforge-0.2.0.tar.gz:
Publisher:
publish.yml on vinayvobbili/quizforge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
quizforge-0.2.0.tar.gz -
Subject digest:
0ce6a3203b0539efa935261f6ecdd2cc3c34d51f87a1cda0fc9adaad58cdbb92 - Sigstore transparency entry: 1999181690
- Sigstore integration time:
-
Permalink:
vinayvobbili/quizforge@17961b0b40b1e7631cb1795d5462e3ef8c38287c -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/vinayvobbili
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@17961b0b40b1e7631cb1795d5462e3ef8c38287c -
Trigger Event:
push
-
Statement type:
File details
Details for the file quizforge-0.2.0-py3-none-any.whl.
File metadata
- Download URL: quizforge-0.2.0-py3-none-any.whl
- Upload date:
- Size: 22.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
abcbbf4ab52df2659d20c2e8919b15098cddc5a80610fe604f67e1919fd9fa8c
|
|
| MD5 |
090fe29e6c3d7d137fc035ae972a02ca
|
|
| BLAKE2b-256 |
9063b477d83424371087dc0088c78a87bc2b0447ed045cbb6790ff19a0a8d421
|
Provenance
The following attestation bundles were made for quizforge-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on vinayvobbili/quizforge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
quizforge-0.2.0-py3-none-any.whl -
Subject digest:
abcbbf4ab52df2659d20c2e8919b15098cddc5a80610fe604f67e1919fd9fa8c - Sigstore transparency entry: 1999181949
- Sigstore integration time:
-
Permalink:
vinayvobbili/quizforge@17961b0b40b1e7631cb1795d5462e3ef8c38287c -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/vinayvobbili
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@17961b0b40b1e7631cb1795d5462e3ef8c38287c -
Trigger Event:
push
-
Statement type: