A modern, robust platform for seamless online exams featuring real-time AI-powered webcam proctoring, secure evaluation workflows, and instant scorecard generation. Built with React, TypeScript, and Supabase.
|
|
- React 18 with TypeScript
- Vite for blazing fast builds
- Tailwind CSS + Shadcn UI components
- React Router for secure, role-based navigation
- jsPDF & jsPDF-AutoTable for scorecard generation
- Framer Motion for fluid micro-animations
- Supabase (PostgreSQL) as a Backend-as-a-Service
- Supabase Storage for hosting photo evidence
- Row-Level Security policies directly protecting exam integrity
- JWT Authentication for Teachers and Students
- TensorFlow.js executing directly inside the browser
- Blazeface for lightweight, privacy-preserving face tracking
- Native Browser MediaDevices & Focus APIs
ai-gradebook-main/
β
βββ π src/
β βββ π components/
β β βββ π exam/ # Proctoring (WebcamMonitor) & exam UI
β β βββ π ui/ # Shadcn UI reusable components
β β βββ ...
β βββ π pages/
β β βββ π student/ # Student dashboard, exam taking, scorecards
β β βββ π¨βπ« teacher/ # Teacher dashboard, evidence review, grading
β β βββ ...
β βββ π hooks/
β β βββ useAntiCheat.tsx # Core tracking and violation logic
β βββ π integrations/
β β βββ supabase/ # Supabase client & generated types
β βββ π¨ index.css # Global Tailwind environment
β
βββ π¦ package.json # Project metadata & dependencies
βββ π README.md # You are here!
Setup Details (Title, Subject, Warning Limits)
β
Drafting Questions (MCQ, MSQ, Subjective)
β
Publish and Schedule for Students
// Frontend: src/components/exam/WebcamMonitor.tsx
// Local Browser Anti-Cheat utilizing TensorFlow
const model = await blazeface.load();
const predictions = await model.estimateFaces(videoRef.current, false);
if (predictions.length > 1) {
onWarning("Multiple people detected!", "multiple_faces");
} else if (predictions.length === 0) {
onWarning("No face detected on camera!", "missing_face");
}If infractions cross the allowed threshold, a snapshot evidence is taken via HTML5 Canvas, sent to Supabase Storage, and the exam is instantly auto-submitted.
Review Auto-Collected Photo Evidence β Grade Subjective Answers β Publish Official Scorecard
// Frontend: Automatically structures the student's evaluated marks into a PDF
const doc = new jsPDF();
doc.text(`Scorecard for ${exam.title}`, 14, 20);
autoTable(doc, {
head: [['Question', 'Marks Awarded', 'Max Marks']],
body: examData.results,
});
doc.save(`${student_name}_scorecard.pdf`);-- Exams Table
CREATE TABLE exams (
id UUID PRIMARY KEY,
teacher_id UUID REFERENCES auth.users,
title TEXT,
subject TEXT,
duration_minutes INTEGER,
warning_limit INTEGER DEFAULT 3
);
-- Submissions Table
CREATE TABLE submissions (
id UUID PRIMARY KEY,
exam_id UUID REFERENCES exams,
student_id UUID REFERENCES auth.users,
status TEXT, -- 'in_progress', 'submitted', 'terminated'
answers JSONB
);
-- Cheating Logs (Evidence)
CREATE TABLE cheating_logs (
id UUID PRIMARY KEY,
submission_id UUID REFERENCES submissions,
event_type TEXT,
evidence_url TEXT, -- Points to Supabase Storage Bucket
description TEXT
);- Node.js 18+
- Supabase account & project
git clone https://github.com/Shubham1392003/ai-gradebook-main.git
cd ai-gradebook-mainnpm installCreate a .env file in the root directory:
VITE_SUPABASE_URL=your_supabase_project_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_keynpm run devVisit http://localhost:8080 (or the port Vite outputs)
This application can easily be deployed onto Vercel, Netlify, or any static hosting provider.
npm run build- Local, browser-based execution ensures total student privacy (video is never streamed to external servers).
- Tracks missing faces, multiple faces, excessive background audio, and physical tab-switching.
- Implements cooldown delays so honest mistakes aren't rapidly double-punished.
- Automatically grades multiple-choice/select questions upon submission.
- Allows teachers to seamlessly override or assign partial points for long-form answers.
- Teacher View: Deep aggregate performance statistics, student-by-student evidence reviews, built with Recharts.
- Student View: Active timers, countdowns, grievance submissions, and seamless result downloading.