How the AI grader actually works
Apr 10, 2026
How the AI grader actually works
Multiple-choice and numeric questions don't need an AI — they're graded by simple rules. Short-answer and extended-response questions are different: that's where AI grading earns its keep.
The contract
For each free-text answer the grader returns:
- baseMarks — marks awarded against the rubric, before any hint penalty.
- rationale — one or two sentences a student can read.
- criteriaMet — which mark-scheme bullets the answer hit (for 6-markers).
- rewrittenAnswer — a model answer in the student's own register so they can see what "full marks" looks like.
The server then subtracts one mark per hint the student opened — so peeking at help still shows them how to get there, but doesn't pretend they did it unaided.
Why one model, one provider
We use Google Gemini 3.1 via the Vercel ai SDK. The prompt is versioned in the repo so we can A/B against past versions. If the model is briefly unavailable, students see a clear "grading unavailable, your teacher will mark this" message — never a fabricated wrong score.
What the AI never sees
The grading request includes only the answer text and the rubric. No student name, no email, no class. Google does not retain the content for training.