Skip to main content
Educational & Speaking

Moodle x n8n - AI Exam Grading

40 students graded in 1 minute. ±5 point max deviation from professor grades. PhD research project with a custom Moodle plugin and RAG pipeline.

Workflow Screenshots

Moodle x n8n - AI Exam Grading - Screenshot 1

About This Project

An AI-powered exam grading system built for a PhD research project at the Technical University of Bulgaria (researcher Anastasia Vangelova). 3 n8n workflows (43 nodes), a custom Moodle PHP plugin, and a RAG pipeline that graded 40 students in under 1 minute - validated by the professor: ±5 point maximum deviation on a 100-point scale, 100% match on UML diagram grading, only 1 out of 40 grades needed manual override.

The problem: Manual grading takes 5-10 minutes per student, creates a 3-7 day feedback delay, and grades vary depending on the grader's fatigue. For a class of 40 students, that's 3.5-7 hours of grading per exam.

Architecture:

  • Custom Moodle PHP plugin (local_assesswebhook, 6 files) hooks into assignment submission events and triggers n8n in sub-second latency
  • Course Content Sync workflow (5 nodes, scheduled) keeps materials up to date
  • Document RAG Pipeline (21 nodes, sub-workflow) chunks lecture materials (PDF/DOCX/PPTX) into 1000-char segments with 200-char overlap, embeds them with ada-002, and stores in Supabase pgvector
  • AI Student Assessment workflow (17 nodes, webhook-triggered) retrieves top 50 relevant chunks per grading event, evaluates against a 20-criterion rubric mapped to Bloom's Taxonomy (Remember → Create)

Key capabilities:

  • GPT-4.1-mini for text evaluation, OpenAI Vision for UML diagram analysis
  • Bilingual grading (Bulgarian and English courses)
  • 20-criterion rubric per exam with Bloom's Taxonomy mapping

Validated results (live exam, professor-reviewed):

  • 40 students graded across 2 exams in ~1 minute
  • Maximum ±5 point deviation from human grades on a 100-point scale
  • 100% AI-human match on UML diagram grading (Task 5, worth 30% of exam)
  • Cost: approximately $0.02 per student evaluation

Infrastructure: Single Hetzner Cloud VPS, Docker-based deployment. Built over ~3 months (July-October 2025).

Technologies Used

n8nn8nMoodleMoodleOpenAIOpenAISupabaseSupabaseDockerDocker

Interested in a Similar Solution?

Let's discuss how I can help automate your business processes.