- ✅ Create Quiz
- ✅ Edit Quiz Settings
- ✅ Delete Quiz
- ✅ Manage Questions (CRUD)
- ✅ View All Quizzes
- ✅ View Quiz Details & Statistics
- ✅ Reorder Questions
- ✅ View Quiz Details (read-only)
- ✅ Start Quiz
- ✅ Take Quiz
- ✅ Save Answers
- ✅ Submit Quiz
- ✅ View Results
- ✅ View Attempt History
- ✅ View Best Score
- ❌ Create Quiz
- ❌ Edit Quiz
- ❌ Delete Quiz
- ❌ Manage Questions
-
Public Routes (All Auth Users):
- View quiz list
- View quiz details
- Quiz taking flow
-
Admin/Instructor Only:
- Quiz CRUD operations
- Question management
-
QuizController:
- Constructor middleware checks user role
- Allows public access to
show()and quiz taking routes - Restricts management routes to admin/instructor
-
QuizQuestionController:
- Full protection - only admin/instructor can access
- All question management operations protected
-
Quiz Show Page:
- Admin/Instructor: Edit, Manage Questions, Delete buttons
- Student: Start Quiz button, Attempt History
-
Quiz Index Page:
- Admin/Instructor: Full CRUD actions
- Student: View + Start Quiz button
-
Conditional Rendering:
- All management buttons hidden from students
- Student-specific UI (attempts, best score) for students only
- Header: Role-based buttons
- Sidebar Actions: Separate cards for Admin vs Student
- Student Card includes:
- Start Quiz button
- Progress tracking
- Attempt history
- Best score display
- Availability checks
- Actions column: Role-based buttons
- Admin: Edit, Manage, Delete
- Student: Start Quiz (if available)
- Student can see quiz details
- Cannot see edit/delete buttons
- Sees "Start Quiz" if available
- Sees attempt history if attempted
- Sees best score if completed
- Click "Start Quiz" button
- Quiz taking interface (separate views)
- Auto-save answers
- Submit quiz
- View results (if enabled)
- Cannot access quiz management routes
- Cannot edit questions
- Cannot change quiz settings
- Cannot delete quiz
- ✅ Route-level protection
- ✅ Controller-level authorization
- ✅ View-level conditional rendering
- ✅ 403 error for unauthorized access
- ✅ Attempt limit enforcement
- ✅ Quiz availability checks
- GET
/quizzes- List all quizzes - GET
/quizzes/{quiz}- View quiz details - GET
/quizzes/{quiz}/start- Start quiz attempt - All quiz taking routes
- POST
/lessons/{lesson}/quizzes- Create quiz - PUT
/quizzes/{quiz}- Update quiz - DELETE
/quizzes/{quiz}- Delete quiz - All
/quizzes/{quiz}/questions/*routes
- Blue/Primary buttons for management
- Full CRUD operations visible
- Statistics and analytics
- Question management tools
- Green/Success buttons for taking quiz
- Attempt tracking
- Progress visualization
- Best score display
- Clean, focused interface
- Admin can create quiz
- Admin can edit quiz
- Admin can delete quiz
- Admin can manage questions
- Student cannot access management routes
- Student can view quiz
- Student can start quiz
- Student can see attempt history
- 403 error for unauthorized access