Skip to content

AI Study Coach

Paste a lecture or upload a PDF: Gemini writes the quiz, code validates every question, and spaced repetition decides when each one comes back.

n8nGeminiGoogle SheetsGoogle DriveGmailGoogle Docs

The problem

Between lectures, students either re-read everything passively or don't review at all until the night before the exam.

Teachers can't see which topics the class actually struggles with until exam scores come back, when it's too late to close the gaps.

Pipeline

How it works

  1. Drivelecture dropped
  2. Geminiwrites content
  3. Codechecks questions
  4. Docs + Sheetsstudy pack
  5. 7:00 Gmaildaily quiz
  6. Formgraded instantly

On the website the same pipeline is triggered by your lecture instead of a Drive upload, and the quiz is shown here instead of emailed.

Live demo

Run the end-to-end pipeline

Submit lecture notes or a PDF, take the validated quiz, grade it, and skip days forward to watch spaced-repetition cards climb to Box 4.

1. Provide a lecture

Paste 200–30,000 characters of lecture notes or drop a PDF (max 5 MB).

0 / 30,000 chars

Or upload a lecture PDF (max 5 MB)

Drag and drop a PDF here, or browse filesapplication/pdf · max 5 MB

Demo sessions run in a sandbox spreadsheet and are separate from real students. Time is simulated with the skip buttons.

Teacher view

Live class analytics

Live from the Google Sheet behind this demo

Cached 60s

Engineering details

Under the hood

Question checker (code, not AI)

Every Gemini output passes through a deterministic code validator: 4 distinct options, one answer A–D, no repeated questions, and no “all of the above”.

Quiz order

Each student's daily queue is sorted deterministically: wrong answers first, then lower Leitner boxes, then oldest due review date.

Safe links

Every quiz gets a 32-hex secret token stored in the Quizzes tab. Once submitted, the quiz is locked and cannot be retaken.

Reliability

A shared error workflow logs every failure with a direct link to the failed n8n run in the Errors tab and emails the teacher.

Data model

All state lives in one Google Sheet with seven tabs so teachers can audit everything directly:

TabWhat it holds
StudentsStudent roster, email addresses, and active enrollment flags.
LecturesDrive file IDs, lecture titles, processing status, and generated Google Doc links.
QuestionsValidated multiple-choice items (prompt, options A–D, answer key, explanation, topic).
CardsPer-student Leitner state: current box (1–4), next review date, and last outcome.
QuizzesDaily quiz instances, secret access tokens, selected question IDs, scores, and completion timestamps.
SettingsCourse config such as teacher email, daily send hour, and quiz size.
ErrorsFailure log with timestamp, workflow name, error message, and direct n8n execution link.

n8n architecture

Workflows

Error handler

Shared error workflow attached to every AI Study Coach flow. Logs each failure with a direct link to the failed run in the Errors tab and emails the teacher.

Teacher side

Watches Google Drive for a new lecture PDF, runs Gemini and the code validator, writes the study pack to Docs + Sheets, and sends the Friday report.

Student side

Runs at 7:00 daily to pick 5 prioritized cards per student, emails a single-use tokenized quiz form via Gmail, grades answers, and updates boxes.

Portal Live (this demo)

Live webhook workflow serving /webhook/mozakra/live/{start,grade,next,state,overview} behind Next.js server routes with httpOnly sessions and x-api-key auth.