A Self-Critic OCR-Based Framework for Automated Quiz Generation

Instructors must invest a lot of time in creating reliable multiple choice exams by hand, and may not design the questions in the same manner for all course sections. Although contemporary Large Language Models (LLMs) can generate test items within seconds, traditional single-prompt methods often generate facts that fall outside of the syllabus, weak or superfluous distractors, and broken JSON structures that crash web interfaces. To address these real-life problems in the classroom, we propose a Self-Critic OCR-Based Quiz Generation System implemented using Flask, LangChain, and the Gemini API. To avoid using the initial model draft, our pipeline goes through another Self-Critic step where it verifies facts against the source text, improves plausibility of distractors and checks rigorously for JSON schema compliance. Also, we include an Optical Character Recognition (OCR) preprocessing stage to enable teachers and students to create quizzes from lecture notes that are taken by taking a photo of the lecture note or from a scanned textbook page in addition to the raw text. Client-side state is saved using browser local storage and completed assessments can be exported directly to PDF for offline use. The two-stage critique introduces an additional 10-13 seconds in latency over single-pass prompting when tested against real academic study materials, but found to be capable of eliminating malformed JSON responses after retry checks, and dramatically downplaying off-context hallucinations.

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-12-03
DOI
https://doi.org/10.5281/zenodo.24781423
Primary Topic
Artificial Intelligence in Education
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

A Self-Critic OCR-Based Framework for Automated Quiz Generation

Ajay Wagh, Pravin Game, Vipin Ramakrishnan
Zenodo (CERN European Organization for Nuclear Research)
Artificial Intelligence in Education
preprint

A Self-Critic OCR-Based Framework for Automated Quiz Generation

Ajay Wagh, Pravin Game, Vipin Ramakrishnan
preprint en

Abstract

Instructors must invest a lot of time in creating reliable multiple choice exams by hand, and may not design the questions in the same manner for all course sections. Although contemporary Large Language Models (LLMs) can generate test items within seconds, traditional single-prompt methods often generate facts that fall outside of the syllabus, weak or superfluous distractors, and broken JSON structures that crash web interfaces. To address these real-life problems in the classroom, we propose a Self-Critic OCR-Based Quiz Generation System implemented using Flask, LangChain, and the Gemini API. To avoid using the initial model draft, our pipeline goes through another Self-Critic step where it verifies facts against the source text, improves plausibility of distractors and checks rigorously for JSON schema compliance. Also, we include an Optical Character Recognition (OCR) preprocessing stage to enable teachers and students to create quizzes from lecture notes that are taken by taking a photo of the lecture note or from a scanned textbook page in addition to the raw text. Client-side state is saved using browser local storage and completed assessments can be exported directly to PDF for offline use. The two-stage critique introduces an additional 10-13 seconds in latency over single-pass prompting when tested against real academic study materials, but found to be capable of eliminating malformed JSON responses after retry checks, and dramatically downplaying off-context hallucinations.

Zenodo (CERN European Organization for Nuclear Research)
Artificial Intelligence in Education
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon