Content in
exam_bank.json · data/
Subject, topic, lesson and a question bank — the teacher's own material is the ground truth, not a generic curriculum.
Client workBuilt for an external organization under a paid engagement.
Architecture, system rules, decisions & documented evidence.
MINI EXAM / منصة الامتحانات المصغّرة
A teacher types a lesson, picks a question mix, and gets a shareable exam — then the results arrive on WhatsApp. Students never log in, and never hold their own score.
16
API route handlers
04
Question types
02
Generation modes
00
Scores trusted from client
Data path
Groq / bank → Server grading → WhatsApp
Structural counts from the repository: route handlers, question types and generation modes.
Tell me what you need and we can define deliverables, timing and cost. A finished brief is optional.

01 / The challenge
A teacher with forty students and a lesson to assess has three jobs in one: write the questions, grade them, and tell every student what they got. Most tools solve the middle one and leave the teacher retyping scores into WhatsApp.
The shortcut everyone reaches for — let the browser grade and send the score — is the one that cannot be taken, because a score posted from the client is a score the student controls.
Mini Exam is built around one closed loop: content in, exam out, results back to the teacher, delivery to the student. The AI sits inside the loop as an optional assistant, never as the authority.
Core decision: the server grades, always. The student's browser never sends a score — the interface says so, and the grading service is written to make it true.
02 / Flow
This is the shipped flow, read from the route handlers and services rather than from a description.
exam_bank.json · data/
Subject, topic, lesson and a question bank — the teacher's own material is the ground truth, not a generic curriculum.
lib/questions/{generator,validator} · lib/groq/generator
Two modes: fast random selection straight from the bank, or Groq generation grounded in the bank — with a validation pipeline before any question enters the exam.
app/api/questions/[id] · …/regenerate · …/reorder
The teacher edits text, choices, the correct answer, marks and explanations; regenerates a single question; reorders; or adds one by hand.
app/api/exams/code/[code] · app/exam/[code]
Publishing mints a code and a link. Students answer without an account — the access surface is a per-exam code, not a user session.
Groq / bank
Optional AI, validated
Server grading
Client never posts score
Result delivered to student
A simplified view of the shipped pipeline; the repository's README documents the same eight-step loop end to end.
03 / Product decisions
lib/services/grading-service.ts carries the rule in its own comment: it is impossible for a student to forge a result because a score is never submitted. The server grades, and the server is the only writer of a score.
Groq is BYOK: every teacher adds their own key in settings, picks a model, and can test the connection before it affects anything. A missing or deleted model self-heals against the live model list.
Generation is never trusted straight into an exam. A validation pipeline runs first, then a review screen exposes the text, choices, answer, marks and explanation for editing or regeneration.
Every signup step is a student who does not sit the exam. Access is a per-exam code and a link — which also keeps the compliance surface small, since the app stores no student identity to protect.
A new exam draws randomly from the bank and excludes questions used in the teacher's previous exams for the same lesson, with a safe fallback when the bank runs dry.
MCQ, true/false, matching and ordering all flow through the same deterministic grader — no AI in scoring, so the same answers always produce the same mark.
04 / Roles
Dashboard, exam builder, question review, settings (including the Groq key and model test).
One code, one exam, no account. Answers are submitted for grading, never a score.
Per-exam results: statistics, a student table, and the per-question breakdown, then delivery to WhatsApp.
05 / Evidence
16
API route handlers shipped
from repo
04
Question types on one grader
from repo
BYOK
Per-teacher Groq key + model test
from repo
00
Client-supplied scores accepted
from repo
Counts come from the app/api tree and the lib/questions + lib/services modules in the repository.
No student numbers, completion rates or WhatsApp delivery rates are claimed: the repository holds no such data.
Firestore rules ship with the project (firestore.rules), but this file does not assert a security review that was not performed here.
06 / Technology stack
The stack is small on purpose: four runtime dependencies beyond the framework, and zod guarding every payload that crosses the API boundary.
HAND-OFF / 008
Next: an analytics view for a whole term, and question-bank import in bulk — the two places a teacher still leaves the app.
Want the practical business breakdown—what this project does, how it runs, and its core advantages?
Tell me what you need and we can define deliverables, timing and cost. A finished brief is optional.
NEXT CASE ↳ FROM THE FILES