Feature Description
Add a comparison feature to the leaderboard that allows users to select up to 3 peers and compare their LeetCode stats and progress side-by-side using interactive charts and statistics. This will boost engagement by encouraging healthy competition and allowing students to analyze their grinding velocity compared to their peers.
User Flow
- Selection: Add a checkbox next to each student's name on both desktop (
leaderboard-row) and mobile (mobile-card) views.
- Action: Once 2 or 3 users are selected, a floating bar appears at the bottom with a "Compare" button.
- Comparison Screen: Clicking "Compare" opens a modal or dedicated panel displaying:
- Metrics Comparison Table: Side-by-side table comparing score, easy/medium/hard problems solved, and average daily problems.
- Difficulty Breakdown Chart: A comparative bar chart (Easy/Medium/Hard) for each user.
- Progress History Chart: A combined line graph showing cumulative problems solved over time (using the
/api/student/:username history endpoint).
Proposed Changes
frontend/leaderboard.html: Add checkboxes to row elements, a floating action panel, and a comparison overlay/modal that matches the existing dark/matrix style.
frontend/js/compare.js (New File): Handle selection state, fetch history data for compared users from /api/student/:username, and render comparison charts using a lightweight graphing library (like Chart.js via CDN).
Feature Description
Add a comparison feature to the leaderboard that allows users to select up to 3 peers and compare their LeetCode stats and progress side-by-side using interactive charts and statistics. This will boost engagement by encouraging healthy competition and allowing students to analyze their grinding velocity compared to their peers.
User Flow
leaderboard-row) and mobile (mobile-card) views./api/student/:usernamehistory endpoint).Proposed Changes
frontend/leaderboard.html: Add checkboxes to row elements, a floating action panel, and a comparison overlay/modal that matches the existing dark/matrix style.frontend/js/compare.js(New File): Handle selection state, fetch history data for compared users from/api/student/:username, and render comparison charts using a lightweight graphing library (like Chart.js via CDN).