Skip to content

[Feature Request]: "Most Improved" & Streak Badges for Daily and Weekly Leaderboard #108

@Vachhani-Tapan

Description

@Vachhani-Tapan

Description

To boost user motivation and recognize daily consistency and acceleration, we want to introduce dynamic badge decorations next to user names on the leaderboard. These badges will be calculated automatically during the daily sync run by comparing historical daily files.

Proposed Badges

  1. [HOT_STREAK] — Awarded to students who have solved at least 1 problem every single day for the past 7 days.
  2. [SPEEDRUN] — Awarded to the top 3 students who achieved the highest problem-solving velocity (most problems solved) over the last 7 days.
  3. [UP_LINK] — Awarded to students who jumped up by 5 or more positions in the ranks compared to the previous day.

Implementation Plan

  1. Sync Script Updates (scripts/sync-leaderboard.js):

    • Enhance the script to parse JSON files from the past 7 days.
    • For each user, track daily difference counts over the week to check if they solved >= 1 problem each day.
    • Compute rank movements and problem acceleration compared to historical logs.
    • Save these computed badges (e.g. badges: ["HOT_STREAK", "SPEEDRUN"]) into overall.json, daily.json, weekly.json, and monthly.json.
  2. Frontend UI Rendering:

    • Update renderLeaderboard(data) in leaderboard.html to look for user badges.
    • Style these badges to match the existing privilege tags ([ROOT], [SUDO], [EXEC]) but with distinct thematic colors (e.g., violet for [HOT_STREAK], red/cyan for [SPEEDRUN]).
    • Add tooltips to explain why each badge was awarded when hovering over it.

Metadata

Metadata

Labels

BackendTask mainly involving backendtype:featureNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions