Skip to content

Prinxe05/Exam-evaluator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🎓 ExamAI — AI-Powered Exam Evaluator

A full-stack application that uses Groq AI (LLaMA) to automatically evaluate student exam answers and provide detailed feedback, scores, and grades.

Features

  • 4 answer types: Short text, long essay, MCQ, and code answers
  • AI evaluation: Groq (LLaMA) grades open-ended answers with detailed feedback, strengths, and improvement suggestions
  • Role-based access: Separate teacher and student flows
  • Student dashboard: View available exams and submission history
  • Teacher panel: Create/publish exams with model answers to guide AI grading
  • Timed exams: Countdown timer with auto-submit on expiry
  • Rich results page: Score ring, per-question AI breakdown, grade distribution by type

Tech Stack

Layer Technology
Frontend React 18 + Vite + React Router
Backend Node.js + Express
Database MongoDB + Mongoose
AI Groq (LLaMA 3.3 70B)
Auth JWT + bcryptjs

Project Structure

exam-evaluator/
├── client/          # React frontend
│   ├── src/
│   │   ├── pages/       Login, Register, StudentDashboard, ExamPage, ResultPage, TeacherDashboard, CreateExam
│   │   ├── components/  Navbar, FeedbackCard
│   │   ├── context/     AuthContext
│   │   └── api/         axios instance
│   └── index.html
│
└── server/          # Express backend
    ├── models/      User, Exam, Submission
    ├── routes/      auth, exams, submissions
    ├── middleware/  JWT auth
    ├── services/    evaluator.js (Groq AI)
    └── index.js

Setup & Run

Prerequisites

  • Node.js 18+
  • MongoDB (local or Atlas)
  • Groq API key (free at console.groq.com)

1. Backend

cd server
npm install
cp .env.example .env

Edit .env:

PORT=5000
MONGO_URI=mongodb://localhost:27017/exam-evaluator
JWT_SECRET=your_secret_key_here
GROQ_API_KEY=gsk_your-key-here
CLIENT_URL=http://localhost:5173
npm run dev   # starts on http://localhost:5000

2. Frontend

cd client
npm install
npm run dev   # starts on http://localhost:5173

Open http://localhost:5173

API Endpoints

Auth

  • POST /api/auth/register — register (name, email, password, role)
  • POST /api/auth/login — login (email, password)
  • GET /api/auth/me — get current user

Exams

  • GET /api/exams — list all published exams (students) / own exams (teachers)
  • GET /api/exams/:id — get exam by ID
  • POST /api/exams — create exam (teacher only)
  • PUT /api/exams/:id — update exam (teacher only)
  • DELETE /api/exams/:id — delete exam (teacher only)

Submissions

  • POST /api/submissions — submit exam (triggers AI evaluation)
  • GET /api/submissions/my — student's own history
  • GET /api/submissions/:id — get submission details
  • GET /api/submissions/exam/:examId — all submissions for an exam (teacher only)

How AI Evaluation Works

  1. MCQ — rule-based, instant (no API call)
  2. Short text / Essay / Code — sends question, model answer, and student answer to Groq
  3. Groq returns JSON: { score, feedback, strengths[], improvements[] }
  4. After all questions, Groq generates an overall performance summary
  5. Results are saved to MongoDB and shown to the student

Grading Scale

Grade Percentage
A ≥ 90%
B ≥ 75%
C ≥ 60%
D ≥ 45%
F < 45%

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors