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
- Ajay Wagh
- Pravin Game
- Vipin Ramakrishnan
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