grip_hook.quiz¶
grip_hook.quiz ¶
The quiz itself: generate questions, ask them, grade, decide.
QuizOutcome
dataclass
¶
Result of one quiz run.
Source code in src/grip_hook/quiz.py
truncation_note ¶
What part of a truncated diff the model sees, or None when it sees all of it.
Source code in src/grip_hook/quiz.py
render_intro ¶
Show what is about to be quizzed, and how much of it the model sees.
Source code in src/grip_hook/quiz.py
read_answer ¶
One answer: the line typed, or every line of a paste, line breaks kept.
A paste arrives faster than anyone types, so the lines already waiting after the first belong to the same answer. An empty line ends it unless more of the paste is waiting right behind it: then it separates two paragraphs. So a paste that ends with an empty line ends the answer there, and a paste that stops mid-line (its last line waiting for Enter) runs on to the next empty line.
Source code in src/grip_hook/quiz.py
ask_questions ¶
Present each question and collect one line of answer for it.
Source code in src/grip_hook/quiz.py
render_result ¶
Print the score table and verdict.
Source code in src/grip_hook/quiz.py
usage_line ¶
took 9.8 s · 3,140 tokens for report, or None when nothing was measured.
Source code in src/grip_hook/quiz.py
run_quiz ¶
run_quiz(*, diff: Diff, cfg: Config, provider: Provider, term: Terminal, stage: Stage) -> QuizOutcome
Run the full quiz and return the outcome. Does not exit or raise on failure.