All Posts

11 September 2026

Quiz Application: Handling AI-Generated and Manually-Written Questions in One System

Full-StackNestJSNext.jsGenAI
Quiz Application: Handling AI-Generated and Manually-Written Questions in One System

Quiz platforms usually pick one lane: either everything is manually authored by a teacher, or everything is AI-generated and generic. Quiz Application was built to support both from the same system, which turned out to be less about the AI integration and more about getting the underlying data model right.

The core pieces

  • Authentication — separate Admin and Student roles, with admins managing content and students only ever seeing what they're permitted to attempt.
  • Quiz Management — full lifecycle control over quizzes: creation, editing, publishing, and organizing.
  • Question Management — questions can be written manually by an admin or generated by AI, but both paths write to the same question schema, so the rest of the app (scoring, review, analytics) never needs to know which path a question came from.
  • Section Management — quizzes are broken into sections, which matters for anything beyond a trivially short quiz — timing, partial scoring, and review all get organized around sections rather than a flat question list.

Why the data model was the hard part

AI-generated questions and manually-authored ones look similar on the surface but come with different failure modes — an AI-generated question might have a subtly wrong "correct" answer or ambiguous phrasing that a human author wouldn't produce. Designing the schema so both paths are reviewable and editable after creation (not locked in once generated) was the actual engineering problem here — the LLM call to generate a question is the easy 10% of this feature.

Split backend, for a reason

Next.js handles the frontend, but the backend runs on NestJS rather than something lighter — the structured, modular, decorator-based architecture NestJS enforces is a good match for a domain with this many entities (users, quizzes, sections, questions, attempts, scores) that all reference each other.

Frontend, backend, and question sources

LayerTechnology
FrontendNext.js
BackendNestJS
Question source: manualWritten by admins
Question source: AI-generatedSame schema, reviewable after creation

AI-generated and manually-authored questions look similar on the surface but need to be equally reviewable — that's a data-model problem, not an AI problem.

Built with TypeScript, JavaScript, and CSS across both apps. Source on GitHub.

FAQ

Common Questions

Yes — manual and AI-generated questions share the same schema and are editable after creation, so nothing ships unreviewed.