Book a call
Choose how to read this case

Client workBuilt for an external organization under a paid engagement.

Architecture, system rules, decisions & documented evidence.

← All workProduct case file / 008
EducationAI-assistedNo student loginSaved project

MINI EXAM / منصة الامتحانات المصغّرة

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.

System snapshotEXAM / AR

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.

Role: Product & full-stackDomain: Education2026

Have a similar product or workflow in mind?

Tell me what you need and we can define deliverables, timing and cost. A finished brief is optional.

Discuss your project →
Mini Exam — exam builder and question flow
Exam builder — generate, review, publishLIVE / 2026

01 / The challenge

Teachers lose an evening to work a spreadsheet could not do.

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

One loop, eight steps, no dead ends.

This is the shipped flow, read from the route handlers and services rather than from a description.

01

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.

02

Generate

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.

03

Review

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.

04

Publish & attempt

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

→

WhatsApp

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

The interesting decisions are all about trust.

01↗

Grading never touches the client

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.

02↗

AI is opt-in and per-teacher

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.

03↗

The teacher approves every question

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.

04↗

No accounts for students

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.

05↗

Questions do not repeat

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.

06↗

Four types, one grader

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

Three people, three surfaces.

Teacher — build

Dashboard, exam builder, question review, settings (including the Groq key and model test).

Student — attempt

One code, one exam, no account. Answers are submitted for grading, never a score.

Teacher — results

Per-exam results: statistics, a student table, and the per-question breakdown, then delivery to WhatsApp.

05 / Evidence

Read from the code, not the pitch.

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

Next.js, Firestore, and a strict grader.

Next.js (App Router)TypeScriptReactFirebaseFirebase AdminFirestoreZodGroq APITailwind CSSWhatsApp delivery

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

A grade the student cannot write.

Next: an analytics view for a whole term, and question-bank import in bulk — the two places a teacher still leaves the app.

Switch Reading Lens · 02

Want the practical business breakdown—what this project does, how it runs, and its core advantages?

Have a similar product or workflow in mind?

Tell me what you need and we can define deliverables, timing and cost. A finished brief is optional.

Discuss your project →

NEXT CASE ↳ FROM THE FILES

Ahmed Kamar