Skip to content

Shubham1392003/ai-gradebook-main

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎯 AI Gradebook & Secure Exam Platform

Craft, Take, and Evaluate Secure Exams with AI-Powered Proctoring

Live Demo Supabase TensorFlow.js

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.


✨ Features at a Glance

🎯 Core Features

  • πŸ“ Secure Exam Creation - Flexible question types (MCQ, MSQ, Theory)
  • πŸ€– AI Proctoring Engine - Real-time face detection using TensorFlow.js
  • πŸ“Έ Automated Evidence Capture - Silent screenshots for cheating violations
  • πŸ“Š Teacher Dashboard - Comprehensive tracking and evaluation system
  • πŸŒ“ Dark Mode - Beautiful dark theme support for modern aesthetics
  • πŸ“± Responsive Design - Works perfectly on all devices

πŸš€ Advanced Features

  • πŸŽ“ Automated Scorecards - Generate official PDFs via jsPDF natively
  • πŸ’Ύ Cloud Storage - Secure evidence logging backed by Supabase
  • βš–οΈ Grievance System - Built-in student appeal workflows
  • 🚫 Browser Lockdown - Tab-switch detection & copy-paste prevention
  • πŸ›‘οΈ Role-Based Access - Distinct Teacher and Student workspaces
  • πŸš€ Serverless Architecture - Highly scalable and easy to maintain

πŸš€ Tech Stack

React TypeScript Tailwind CSS Supabase Node.js TensorFlow.js

Frontend

  • 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

Backend & Database

  • 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

AI & Proctoring Engine

  • TensorFlow.js executing directly inside the browser
  • Blazeface for lightweight, privacy-preserving face tracking
  • Native Browser MediaDevices & Focus APIs

πŸ“‚ Project Structure

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!

�️ How It Works

1️⃣ Exam Creation Workflow (Teacher)

Setup Details (Title, Subject, Warning Limits) 
     ↓
Drafting Questions (MCQ, MSQ, Subjective) 
     ↓
Publish and Schedule for Students

2️⃣ AI Anti-Cheat Workflow (Student)

// 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.

3️⃣ Evaluation & Review Workflow

Review Auto-Collected Photo Evidence β†’ Grade Subjective Answers β†’ Publish Official Scorecard

4️⃣ Automated Scorecards generation (jsPDF)

// 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`);

🎯 API Integration & Database Schema

Supabase Database Architecture

-- 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
);

🚧 Setup & Installation

Prerequisites

  • Node.js 18+
  • Supabase account & project

1. Clone the Repository

git clone https://github.com/Shubham1392003/ai-gradebook-main.git
cd ai-gradebook-main

2. Install Dependencies

npm install

3. Environment Variables

Create a .env file in the root directory:

VITE_SUPABASE_URL=your_supabase_project_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key

4. Run the Application

npm run dev

Visit http://localhost:8080 (or the port Vite outputs)

5. Deployment

This application can easily be deployed onto Vercel, Netlify, or any static hosting provider.

npm run build

πŸ’‘ Key Features Breakdown

πŸ€– AI Proctoring Engine

  • 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.

πŸŽ“ Dynamic Grading System

  • Automatically grades multiple-choice/select questions upon submission.
  • Allows teachers to seamlessly override or assign partial points for long-form answers.

πŸ“Š Comprehensive Dashboards

  • 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.

πŸ‘¨β€πŸ’» Author

Developed & Built by Shubham Madhav Kendre

AI/ML & Full Stack Developer

Portfolio GitHub Instagram


⭐ Star this repo if you found it helpful!

Made with ❀️ and lots of β˜•

About

🎯 AI Gradebook & Secure Exam Platform An AI-powered secure online examination system with real-time webcam proctoring using TensorFlow.js, automated cheating detection, instant PDF scorecards, and Supabase-backed cloud storage. Built with React, TypeScript, and a scalable serverless architecture. Secure. Intelligent. Modern. πŸš€

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors