Recipe
Recipe: Essay grader with rubric
Build a prompt that grades student essays against a custom rubric, returns structured scores, and explains each mark.
Ingredients
- A rubric with 3–5 criteria and point ranges
- One or more student essays (plain text)
- System prompt that enforces JSON output
- Temperature set to 0 for deterministic grading
Steps
- Define the rubric. List each criterion with its max points and a short description of what top marks look like.
- Write the system prompt. Instruct the model to return a JSON object with a
scoresarray and atotalfield. - Attach the essay. Pass the student text as a user message alongside the rubric.
- Parse the JSON. Extract scores, validate against rubric max points, and display per-criterion feedback.
Example prompt
You are an essay grader. Grade the essay below
against this rubric:
- Thesis clarity (0–10)
- Evidence quality (0–10)
- Organization (0–10)
- Grammar & style (0–10)
Return ONLY valid JSON:
{
"scores": [
{ "criterion": "...", "score": N, "max": N, "comment": "..." }
],
"total": N
}Notes
- Use temperature 0 for consistent, repeatable grades.
- Validate the JSON schema before showing results to students.
- For large classes, batch essays and process asynchronously.