Sql_Adv_Proj

API & Configuration src/api/axios.js - Axios instance with interceptors for auth tokens and error handling Utilities src/utils/constants.js - API endpoints, user roles, exam status, colors src/utils/helpers.js - Utility functions (formatTime, getGrade, validation, etc.) Services src/services/authService.js - Authentication API calls src/services/courseService.js - Course CRUD operations src/services/studentService.js - Student management src/services/examService.js - Exam operations Context Providers src/context/AuthContext.jsx - Authentication state management src/context/ExamContext.jsx - Exam state with timer and persistence Common Components src/components/common/Button.jsx - Button with variants src/components/common/Input.jsx - Input with validation states src/components/common/Card.jsx - Card component src/components/common/Modal.jsx - Modal & ConfirmModal src/components/common/Loader.jsx - Loader & Skeleton src/components/common/Badge.jsx - Badge & StatusBadge src/components/common/EmptyState.jsx - Empty state Layout Components src/components/layout/Navbar.jsx - Navigation with role-based links src/components/layout/Footer.jsx - Footer component src/components/layout/MainLayout.jsx - Layout wrapper Pages src/pages/LandingPage.jsx - Public landing page src/pages/NotFoundPage.jsx - 404 page src/pages/auth/LoginPage.jsx - Login with Student/Instructor tabs src/pages/auth/RegisterPage.jsx - Registration page src/pages/student/StudentDashboard.jsx - Student dashboard src/pages/instructor/InstructorDashboard.jsx - Instructor dashboard src/pages/exams/ExamListPage.jsx - Exam listing src/pages/exams/TakeExamPage.jsx - Exam taking with timer src/pages/exams/ExamResultPage.jsx - Exam results Updated Files src/App.jsx - Updated with new routing structure src/main.jsx - Added AuthProvider and ExamProvider src/App.css - Added custom animations πŸš€ Routes Structure Route Page Protection / Landing Page Public /login Login Page Public /register Register Page Public /student/dashboard Student Dashboard Student only /student/exams Exam List Student only /student/exams/:id/take Take Exam Student only /student/exams/:id/result Exam Result Student only /instructor/dashboard Instructor Dashboard Instructor only 🎯 Features Implemented βœ… Role-based authentication (Student/Instructor) βœ… Protected routes with role checking βœ… Exam taking with countdown timer βœ… Question flagging and navigation βœ… Auto-submit on timer expiry βœ… Exam state persistence (localStorage) βœ… Responsive design with Tailwind CSS βœ… Toast notifications βœ… Custom animations

examService.js - Added 5 new API methods:

generateExam() - Start a new exam submitExamAnswers() - Submit exam answers getExamReview() - Get detailed review with correct answers getStudentExams() - Fetch student’s exam history checkExamStatus() - Check if exam is already taken constants.js - Added new exam endpoints

helpers.js - Added 6 exam helper functions:

formatAnswersForSubmission(), groupQuestionsByChoices() calculateRemainingTime(), getGradeColor(), getGradeBgColor(), getGradeLabel() ExamContext.jsx - Complete rewrite with:

Timer countdown (15 min default) localStorage persistence Auto-submit on timeout Answer tracking & question navigation Flagging system ExamListPage.jsx - Real API integration:

Fetch from /api/v1/exams/student/:id Filter by status (All/Passed/Failed) Grade color coding Responsive grid layout TakeExamPage.jsx - Full exam UI:

Timer display with countdown Question navigation sidebar Answer selection (A/B/C/D) Flag questions for review Submit confirmation modal Auto-submit on timeout ExamResultPage.jsx - Results display:

Fetch review from API Grade visualization with pass/fail colors Statistics (correct/wrong/marks) Expandable detailed question review Correct/incorrect answer highlighting with icons