add changes
This commit is contained in:
@@ -226,22 +226,22 @@
|
||||
**Purpose:** Fetch all active categories
|
||||
|
||||
**Frontend Tasks:**
|
||||
- [ ] Create `CategoryService` with `getCategories()` method
|
||||
- [ ] Store categories in `categoriesState` signal
|
||||
- [ ] Implement caching strategy for categories (1 hour TTL)
|
||||
- [ ] Handle guest vs authenticated user filtering (guestAccessible flag)
|
||||
- [ ] Sort categories by displayOrder or name
|
||||
- [x] Create `CategoryService` with `getCategories()` method
|
||||
- [x] Store categories in `categoriesState` signal
|
||||
- [x] Implement caching strategy for categories (1 hour TTL)
|
||||
- [x] Handle guest vs authenticated user filtering (guestAccessible flag)
|
||||
- [x] Sort categories by displayOrder or name
|
||||
|
||||
**UI Tasks:**
|
||||
- [ ] Build `CategoryListComponent` to display all categories
|
||||
- [ ] Design category card with icon, name, description, question count
|
||||
- [ ] Show "Locked" badge for auth-only categories (guest users)
|
||||
- [ ] Implement grid layout (responsive: 1 col mobile, 2 cols tablet, 3-4 cols desktop)
|
||||
- [ ] Add search/filter bar for categories
|
||||
- [ ] Show loading skeleton while fetching
|
||||
- [ ] Display empty state if no categories available
|
||||
- [ ] Add hover effects and click animation
|
||||
- [ ] Ensure keyboard navigation and ARIA labels
|
||||
- [x] Build `CategoryListComponent` to display all categories
|
||||
- [x] Design category card with icon, name, description, question count
|
||||
- [x] Show "Locked" badge for auth-only categories (guest users)
|
||||
- [x] Implement grid layout (responsive: 1 col mobile, 2 cols tablet, 3-4 cols desktop)
|
||||
- [x] Add search/filter bar for categories
|
||||
- [x] Show loading skeleton while fetching
|
||||
- [x] Display empty state if no categories available
|
||||
- [x] Add hover effects and click animation
|
||||
- [x] Ensure keyboard navigation and ARIA labels
|
||||
|
||||
---
|
||||
|
||||
@@ -249,21 +249,21 @@
|
||||
**Purpose:** Get category details with question preview
|
||||
|
||||
**Frontend Tasks:**
|
||||
- [ ] Add `CategoryService.getCategoryById(id)` method
|
||||
- [ ] Store selected category in `selectedCategoryState` signal
|
||||
- [ ] Fetch category stats (total questions, difficulty breakdown, accuracy)
|
||||
- [ ] Handle 404 if category not found
|
||||
- [ ] Handle 403 for guest users accessing auth-only categories
|
||||
- [x] Add `CategoryService.getCategoryById(id)` method
|
||||
- [x] Store selected category in `selectedCategoryState` signal
|
||||
- [x] Fetch category stats (total questions, difficulty breakdown, accuracy)
|
||||
- [x] Handle 404 if category not found
|
||||
- [x] Handle 403 for guest users accessing auth-only categories
|
||||
|
||||
**UI Tasks:**
|
||||
- [ ] Build `CategoryDetailComponent` showing full category info
|
||||
- [ ] Display category header with icon, name, description
|
||||
- [ ] Show statistics (total questions, difficulty breakdown chart)
|
||||
- [ ] Display question preview (first 5 questions)
|
||||
- [ ] Add "Start Quiz" button with difficulty selector
|
||||
- [ ] Show loading spinner while fetching details
|
||||
- [ ] Display error message if category not accessible
|
||||
- [ ] Implement breadcrumb navigation (Home > Categories > Category Name)
|
||||
- [x] Build `CategoryDetailComponent` showing full category info
|
||||
- [x] Display category header with icon, name, description
|
||||
- [x] Show statistics (total questions, difficulty breakdown chart)
|
||||
- [x] Display question preview (first 5 questions)
|
||||
- [x] Add "Start Quiz" button with difficulty selector
|
||||
- [x] Show loading spinner while fetching details
|
||||
- [x] Display error message if category not accessible
|
||||
- [x] Implement breadcrumb navigation (Home > Categories > Category Name)
|
||||
|
||||
---
|
||||
|
||||
@@ -271,19 +271,19 @@
|
||||
**Purpose:** Create new category
|
||||
|
||||
**Frontend Tasks:**
|
||||
- [ ] Add `CategoryService.createCategory(data)` method (admin only)
|
||||
- [ ] Validate form data (name, slug, description)
|
||||
- [ ] Handle 401/403 authorization errors
|
||||
- [ ] Invalidate category cache after creation
|
||||
- [x] Add `CategoryService.createCategory(data)` method (admin only)
|
||||
- [x] Validate form data (name, slug, description)
|
||||
- [x] Handle 401/403 authorization errors
|
||||
- [x] Invalidate category cache after creation
|
||||
|
||||
**UI Tasks:**
|
||||
- [ ] Build `CategoryFormComponent` (admin) for creating categories
|
||||
- [ ] Design form with name, slug, description, icon, color fields
|
||||
- [ ] Add guest accessible checkbox
|
||||
- [ ] Show slug preview/auto-generation
|
||||
- [ ] Display validation errors inline
|
||||
- [ ] Show success toast after creation
|
||||
- [ ] Redirect to category list after success
|
||||
- [x] Build `CategoryFormComponent` (admin) for creating categories
|
||||
- [x] Design form with name, slug, description, icon, color fields
|
||||
- [x] Add guest accessible checkbox
|
||||
- [x] Show slug preview/auto-generation
|
||||
- [x] Display validation errors inline
|
||||
- [x] Show success toast after creation
|
||||
- [x] Redirect to category list after success
|
||||
|
||||
---
|
||||
|
||||
@@ -291,17 +291,17 @@
|
||||
**Purpose:** Update category
|
||||
|
||||
**Frontend Tasks:**
|
||||
- [ ] Add `CategoryService.updateCategory(id, data)` method (admin only)
|
||||
- [ ] Pre-fill form with existing category data
|
||||
- [ ] Handle 404 if category not found
|
||||
- [ ] Invalidate cache after update
|
||||
- [x] Add `CategoryService.updateCategory(id, data)` method (admin only)
|
||||
- [x] Pre-fill form with existing category data
|
||||
- [x] Handle 404 if category not found
|
||||
- [x] Invalidate cache after update
|
||||
|
||||
**UI Tasks:**
|
||||
- [ ] Reuse `CategoryFormComponent` in edit mode
|
||||
- [ ] Pre-populate form fields with existing data
|
||||
- [ ] Show "Editing: Category Name" header
|
||||
- [ ] Add "Cancel" and "Save Changes" buttons
|
||||
- [ ] Display success toast after update
|
||||
- [x] Reuse `CategoryFormComponent` in edit mode
|
||||
- [x] Pre-populate form fields with existing data
|
||||
- [x] Show "Editing: Category Name" header
|
||||
- [x] Add "Cancel" and "Save Changes" buttons
|
||||
- [x] Display success toast after update
|
||||
|
||||
---
|
||||
|
||||
@@ -309,17 +309,17 @@
|
||||
**Purpose:** Delete category
|
||||
|
||||
**Frontend Tasks:**
|
||||
- [ ] Add `CategoryService.deleteCategory(id)` method (admin only)
|
||||
- [ ] Handle soft delete
|
||||
- [ ] Invalidate cache after deletion
|
||||
- [ ] Handle 404 if category not found
|
||||
- [x] Add `CategoryService.deleteCategory(id)` method (admin only)
|
||||
- [x] Handle soft delete
|
||||
- [x] Invalidate cache after deletion
|
||||
- [x] Handle 404 if category not found
|
||||
|
||||
**UI Tasks:**
|
||||
- [ ] Add delete button in admin category list
|
||||
- [ ] Show confirmation dialog before deletion
|
||||
- [ ] Display warning if category has questions
|
||||
- [ ] Show success toast after deletion
|
||||
- [ ] Remove category from list immediately
|
||||
- [x] Add delete button in admin category list
|
||||
- [x] Show confirmation dialog before deletion
|
||||
- [x] Display warning if category has questions
|
||||
- [x] Show success toast after deletion
|
||||
- [x] Remove category from list immediately
|
||||
|
||||
---
|
||||
|
||||
@@ -329,23 +329,23 @@
|
||||
**Purpose:** Start a new quiz session
|
||||
|
||||
**Frontend Tasks:**
|
||||
- [ ] Create `QuizService` with `startQuiz(categoryId, questionCount, difficulty, quizType)` method
|
||||
- [ ] Store active session in `quizSessionState` signal
|
||||
- [ ] Validate category accessibility (guest vs authenticated)
|
||||
- [ ] Check guest quiz limit before starting
|
||||
- [ ] Handle JWT token or guest token header
|
||||
- [ ] Navigate to quiz page after starting
|
||||
- [x] Create `QuizService` with `startQuiz(categoryId, questionCount, difficulty, quizType)` method
|
||||
- [x] Store active session in `quizSessionState` signal
|
||||
- [x] Validate category accessibility (guest vs authenticated)
|
||||
- [x] Check guest quiz limit before starting
|
||||
- [x] Handle JWT token or guest token header
|
||||
- [x] Navigate to quiz page after starting
|
||||
|
||||
**UI Tasks:**
|
||||
- [ ] Build `QuizSetupComponent` for configuring quiz
|
||||
- [ ] Add category selector dropdown
|
||||
- [ ] Add question count slider (5, 10, 15, 20)
|
||||
- [ ] Add difficulty selector (Easy, Medium, Hard, Mixed)
|
||||
- [ ] Add quiz type selector (Practice, Timed)
|
||||
- [ ] Show estimated time for quiz
|
||||
- [ ] Display "Start Quiz" button with loading state
|
||||
- [ ] Show guest limit warning if applicable
|
||||
- [ ] Implement responsive design
|
||||
- [x] Build `QuizSetupComponent` for configuring quiz
|
||||
- [x] Add category selector dropdown
|
||||
- [x] Add question count slider (5, 10, 15, 20)
|
||||
- [x] Add difficulty selector (Easy, Medium, Hard, Mixed)
|
||||
- [x] Add quiz type selector (Practice, Timed)
|
||||
- [x] Show estimated time for quiz
|
||||
- [x] Display "Start Quiz" button with loading state
|
||||
- [x] Show guest limit warning if applicable
|
||||
- [x] Implement responsive design
|
||||
|
||||
---
|
||||
|
||||
@@ -353,28 +353,28 @@
|
||||
**Purpose:** Submit answer for current question
|
||||
|
||||
**Frontend Tasks:**
|
||||
- [ ] Add `QuizService.submitAnswer(questionId, answer, sessionId)` method
|
||||
- [ ] Update quiz session state with answer result
|
||||
- [ ] Increment current question index
|
||||
- [ ] Calculate and update score in real-time
|
||||
- [ ] Handle validation errors
|
||||
- [ ] Store answer history for review
|
||||
- [x] Add `QuizService.submitAnswer(questionId, answer, sessionId)` method
|
||||
- [x] Update quiz session state with answer result
|
||||
- [x] Increment current question index
|
||||
- [x] Calculate and update score in real-time
|
||||
- [x] Handle validation errors
|
||||
- [x] Store answer history for review
|
||||
|
||||
**UI Tasks:**
|
||||
- [ ] Build `QuizQuestionComponent` displaying current question
|
||||
- [ ] Show question text, type, and options
|
||||
- [ ] Create answer input based on question type:
|
||||
- [x] Build `QuizQuestionComponent` displaying current question
|
||||
- [x] Show question text, type, and options
|
||||
- [x] Create answer input based on question type:
|
||||
- Multiple choice: Radio buttons
|
||||
- True/False: Toggle buttons
|
||||
- Written: Text area
|
||||
- [ ] Show "Submit Answer" button (disabled until answer selected)
|
||||
- [ ] Display loading spinner during submission
|
||||
- [ ] Show immediate feedback (correct/incorrect) with animation
|
||||
- [ ] Display explanation after submission
|
||||
- [ ] Show "Next Question" button after submission
|
||||
- [ ] Update progress bar and score
|
||||
- [ ] Add timer display if timed quiz
|
||||
- [ ] Prevent answer changes after submission
|
||||
- [x] Show "Submit Answer" button (disabled until answer selected)
|
||||
- [x] Display loading spinner during submission
|
||||
- [x] Show immediate feedback (correct/incorrect) with animation
|
||||
- [x] Display explanation after submission
|
||||
- [x] Show "Next Question" button after submission
|
||||
- [x] Update progress bar and score
|
||||
- [x] Add timer display if timed quiz
|
||||
- [x] Prevent answer changes after submission
|
||||
|
||||
---
|
||||
|
||||
@@ -382,25 +382,25 @@
|
||||
**Purpose:** Complete quiz session and get results
|
||||
|
||||
**Frontend Tasks:**
|
||||
- [ ] Add `QuizService.completeQuiz(sessionId)` method
|
||||
- [ ] Store final results in `quizResultsState` signal
|
||||
- [ ] Calculate percentage score
|
||||
- [ ] Fetch detailed answer breakdown
|
||||
- [ ] Clear active session state
|
||||
- [ ] Redirect to results page
|
||||
- [x] Add `QuizService.completeQuiz(sessionId)` method
|
||||
- [x] Store final results in `quizResultsState` signal
|
||||
- [x] Calculate percentage score
|
||||
- [x] Fetch detailed answer breakdown
|
||||
- [x] Clear active session state
|
||||
- [x] Redirect to results page
|
||||
|
||||
**UI Tasks:**
|
||||
- [ ] Build `QuizResultsComponent` showing final score
|
||||
- [ ] Display score with percentage and message (Excellent, Good, Keep Practicing)
|
||||
- [ ] Show time taken and questions answered
|
||||
- [ ] Display pie chart for correct/incorrect breakdown
|
||||
- [ ] List all questions with user answers and correct answers
|
||||
- [ ] Highlight incorrect answers in red
|
||||
- [ ] Add "Review Incorrect Answers" button
|
||||
- [ ] Add "Retake Quiz" button
|
||||
- [ ] Add "Return to Dashboard" button
|
||||
- [ ] Show confetti animation for high scores (>80%)
|
||||
- [ ] Add social share buttons (Twitter, LinkedIn, Facebook)
|
||||
- [x] Build `QuizResultsComponent` showing final score
|
||||
- [x] Display score with percentage and message (Excellent, Good, Keep Practicing)
|
||||
- [x] Show time taken and questions answered
|
||||
- [x] Display pie chart for correct/incorrect breakdown
|
||||
- [x] List all questions with user answers and correct answers
|
||||
- [x] Highlight incorrect answers in red
|
||||
- [x] Add "Review Incorrect Answers" button
|
||||
- [x] Add "Retake Quiz" button
|
||||
- [x] Add "Return to Dashboard" button
|
||||
- [x] Show confetti animation for high scores (>80%)
|
||||
- [x] Add social share buttons (Twitter, LinkedIn, Facebook)
|
||||
|
||||
---
|
||||
|
||||
@@ -408,15 +408,15 @@
|
||||
**Purpose:** Get current quiz session details
|
||||
|
||||
**Frontend Tasks:**
|
||||
- [ ] Add `QuizService.getSession(sessionId)` method
|
||||
- [ ] Restore session state if user refreshes page
|
||||
- [ ] Handle 404 if session not found
|
||||
- [ ] Resume quiz from current question index
|
||||
- [x] Add `QuizService.getSession(sessionId)` method
|
||||
- [x] Restore session state if user refreshes page
|
||||
- [x] Handle 404 if session not found
|
||||
- [x] Resume quiz from current question index
|
||||
|
||||
**UI Tasks:**
|
||||
- [ ] Show "Resume Quiz" prompt if incomplete session exists
|
||||
- [ ] Display current progress in prompt (e.g., "Question 5 of 10")
|
||||
- [ ] Allow user to continue or start new quiz
|
||||
- [x] Show "Resume Quiz" prompt if incomplete session exists
|
||||
- [x] Display current progress in prompt (e.g., "Question 5 of 10")
|
||||
- [x] Allow user to continue or start new quiz
|
||||
|
||||
---
|
||||
|
||||
@@ -424,19 +424,19 @@
|
||||
**Purpose:** Review completed quiz
|
||||
|
||||
**Frontend Tasks:**
|
||||
- [ ] Add `QuizService.reviewQuiz(sessionId)` method
|
||||
- [ ] Fetch all questions and answers for session
|
||||
- [ ] Store review data in signal
|
||||
- [ ] Handle 404 if session not found
|
||||
- [x] Add `QuizService.reviewQuiz(sessionId)` method
|
||||
- [x] Fetch all questions and answers for session
|
||||
- [x] Store review data in signal
|
||||
- [x] Handle 404 if session not found
|
||||
|
||||
**UI Tasks:**
|
||||
- [ ] Build `QuizReviewComponent` for reviewing completed quiz
|
||||
- [ ] Display each question with user answer and correct answer
|
||||
- [ ] Highlight correct answers in green, incorrect in red
|
||||
- [ ] Show explanations for all questions
|
||||
- [ ] Add "Bookmark" button for difficult questions
|
||||
- [ ] Implement pagination or infinite scroll for long quizzes
|
||||
- [ ] Add "Back to Results" button
|
||||
- [x] Build `QuizReviewComponent` for reviewing completed quiz
|
||||
- [x] Display each question with user answer and correct answer
|
||||
- [x] Highlight correct answers in green, incorrect in red
|
||||
- [x] Show explanations for all questions
|
||||
- [x] Add "Bookmark" button for difficult questions
|
||||
- [x] Implement pagination or infinite scroll for long quizzes
|
||||
- [x] Add "Back to Results" button
|
||||
|
||||
---
|
||||
|
||||
@@ -446,27 +446,27 @@
|
||||
**Purpose:** Get user dashboard with statistics
|
||||
|
||||
**Frontend Tasks:**
|
||||
- [ ] Create `UserService` with `getDashboard(userId)` method
|
||||
- [ ] Store dashboard data in `dashboardState` signal
|
||||
- [ ] Fetch on dashboard component load
|
||||
- [ ] Implement caching (5 min TTL)
|
||||
- [ ] Handle 401 if not authenticated
|
||||
- [x] Create `UserService` with `getDashboard(userId)` method
|
||||
- [x] Store dashboard data in `dashboardState` signal
|
||||
- [x] Fetch on dashboard component load
|
||||
- [x] Implement caching (5 min TTL)
|
||||
- [x] Handle 401 if not authenticated
|
||||
|
||||
**UI Tasks:**
|
||||
- [ ] Build `DashboardComponent` as main user landing page
|
||||
- [ ] Display welcome message with username
|
||||
- [ ] Show overall statistics cards:
|
||||
- [x] Build `DashboardComponent` as main user landing page
|
||||
- [x] Display welcome message with username
|
||||
- [x] Show overall statistics cards:
|
||||
- Total quizzes taken
|
||||
- Overall accuracy percentage
|
||||
- Current streak
|
||||
- Total questions answered
|
||||
- [ ] Create category-wise performance chart (bar chart or pie chart)
|
||||
- [ ] Display recent quiz sessions (last 5) with scores
|
||||
- [ ] Show achievements and badges earned
|
||||
- [ ] Add "Start New Quiz" CTA button
|
||||
- [ ] Implement responsive grid layout (stack on mobile)
|
||||
- [ ] Add loading skeletons for data sections
|
||||
- [ ] Show empty state if no quizzes taken yet
|
||||
- [x] Create category-wise performance chart (bar chart or pie chart)
|
||||
- [x] Display recent quiz sessions (last 5) with scores
|
||||
- [x] Show achievements and badges earned
|
||||
- [x] Add "Start New Quiz" CTA button
|
||||
- [x] Implement responsive grid layout (stack on mobile)
|
||||
- [x] Add loading skeletons for data sections
|
||||
- [x] Show empty state if no quizzes taken yet
|
||||
|
||||
---
|
||||
|
||||
@@ -474,24 +474,24 @@
|
||||
**Purpose:** Get quiz history with pagination
|
||||
|
||||
**Frontend Tasks:**
|
||||
- [ ] Add `UserService.getHistory(userId, page, limit, category?, sortBy?)` method
|
||||
- [ ] Store history in `historyState` signal
|
||||
- [ ] Implement pagination state management
|
||||
- [ ] Add filtering by category
|
||||
- [ ] Add sorting by date or score
|
||||
- [ ] Handle query parameters in URL
|
||||
- [x] Add `UserService.getHistory(userId, page, limit, category?, sortBy?)` method
|
||||
- [x] Store history in `historyState` signal
|
||||
- [x] Implement pagination state management
|
||||
- [x] Add filtering by category
|
||||
- [x] Add sorting by date or score
|
||||
- [x] Handle query parameters in URL
|
||||
|
||||
**UI Tasks:**
|
||||
- [ ] Build `QuizHistoryComponent` displaying all past quizzes
|
||||
- [ ] Create history table/list with columns: Date, Category, Score, Time, Actions
|
||||
- [ ] Add filter dropdown for category
|
||||
- [ ] Add sort dropdown (Date, Score)
|
||||
- [ ] Implement pagination controls (Previous, Next, Page numbers)
|
||||
- [ ] Show "View Details" button for each quiz
|
||||
- [ ] Display loading spinner during fetch
|
||||
- [ ] Show empty state if no history
|
||||
- [ ] Make table responsive (collapse to cards on mobile)
|
||||
- [ ] Add export functionality (CSV download)
|
||||
- [x] Build `QuizHistoryComponent` displaying all past quizzes
|
||||
- [x] Create history table/list with columns: Date, Category, Score, Time, Actions
|
||||
- [x] Add filter dropdown for category
|
||||
- [x] Add sort dropdown (Date, Score)
|
||||
- [x] Implement pagination controls (Previous, Next, Page numbers)
|
||||
- [x] Show "View Details" button for each quiz
|
||||
- [x] Display loading spinner during fetch
|
||||
- [x] Show empty state if no history
|
||||
- [x] Make table responsive (collapse to cards on mobile)
|
||||
- [x] Add export functionality (CSV download)
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user