A full-stack application that uses Groq AI (LLaMA) to automatically evaluate student exam answers and provide detailed feedback, scores, and grades.
- 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
| Layer | Technology |
|---|---|
| Frontend | React 18 + Vite + React Router |
| Backend | Node.js + Express |
| Database | MongoDB + Mongoose |
| AI | Groq (LLaMA 3.3 70B) |
| Auth | JWT + bcryptjs |
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
- Node.js 18+
- MongoDB (local or Atlas)
- Groq API key (free at console.groq.com)
cd server
npm install
cp .env.example .envEdit .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:5000cd client
npm install
npm run dev # starts on http://localhost:5173POST /api/auth/register— register (name, email, password, role)POST /api/auth/login— login (email, password)GET /api/auth/me— get current user
GET /api/exams— list all published exams (students) / own exams (teachers)GET /api/exams/:id— get exam by IDPOST /api/exams— create exam (teacher only)PUT /api/exams/:id— update exam (teacher only)DELETE /api/exams/:id— delete exam (teacher only)
POST /api/submissions— submit exam (triggers AI evaluation)GET /api/submissions/my— student's own historyGET /api/submissions/:id— get submission detailsGET /api/submissions/exam/:examId— all submissions for an exam (teacher only)
- MCQ — rule-based, instant (no API call)
- Short text / Essay / Code — sends question, model answer, and student answer to Groq
- Groq returns JSON:
{ score, feedback, strengths[], improvements[] } - After all questions, Groq generates an overall performance summary
- Results are saved to MongoDB and shown to the student
| Grade | Percentage |
|---|---|
| A | ≥ 90% |
| B | ≥ 75% |
| C | ≥ 60% |
| D | ≥ 45% |
| F | < 45% |