Skip to content

Scaffold & Quiz

ZPD-inspired scaffolding and the Quiz protocol.

Scaffold Computation

compute_scaffold

compute_scaffold(circuit: Circuit, neuron_id: str) -> Scaffold

Compute scaffolding for a neuron based on Brain state.

Returns a Scaffold with: - level: how much support to provide - context: strong neighbor IDs (scaffolding material) - gaps: weak prerequisite IDs (should study first) - hints: auto-generated hints from neighbors

Quiz Protocol

The BaseQuiz protocol and its concrete implementations live in spikuit-cli as of v0.6.3 — core is LLM-free and the grader-bound quiz types belong with the CLI.

BaseQuiz

BaseQuiz()

Bases: ABC

Base class for every Quiz v2 type.

Subclasses implement front, back, grade, and optionally preferred_mode / grade_choices_spec. They are constructed with enough state to render themselves; selection, scheduling, and persistence are the caller's concern.

front abstractmethod

front() -> RenderedContent

Return the initial (question) side.

back abstractmethod

back() -> RenderedContent

Return the answer side — shown after flip or submit.

grade abstractmethod

grade(response: QuizResponse) -> QuizResult

Grade a response. Return QuizResult with needs_tutor_grading set to True if the quiz type cannot grade mechanically.

preferred_mode

preferred_mode() -> RenderMode

Preferred render mode. Override for audio/image quizzes.

grade_choices_spec

grade_choices_spec() -> list

Grade choices shown to the learner. Default: empty (quiz type provides its own grade input widget).

render

render() -> RenderResponse

Return the full render payload for an agent or TUI.

submit async

submit(response: QuizResponse) -> None

Record a response and release anyone waiting on submission.

wait_for_submit async

wait_for_submit() -> QuizResponse

Block until a response is submitted via submit.

Flashcard

Flashcard(neuron: Neuron, scaffold: Scaffold)

Bases: BaseQuiz

Self-graded flashcard over one neuron.

Front shows a scaffold-appropriate preview; back shows full content. Grading is mechanical — the response's self_grade is the result.