Skip to content

feat: implement BALANCED badge dynamically on user profiles - #492

Merged
jagdish-15 merged 3 commits into
codepvg:mainfrom
Yashaswini-K-P:feature/balanced-badge
Aug 8, 2026
Merged

jagdish-15 merged 3 commits into
codepvg:mainfrom
Yashaswini-K-P:feature/balanced-badge

Conversation

@Yashaswini-K-P

Copy link
Copy Markdown
Contributor

Description

Implemented a new dynamic BALANCED badge on user profile pages to reward students who maintain an even distribution of problem solving across difficulties (at least 5 solved in Easy, Medium, and Hard, with the gap between highest and lowest counts being within 5% of the highest count).

Linked Issue

Fixes #336

Changes Made

  • Added the BALANCED badge definition to the ALL_BADGES array in frontend/js/user/badges.js.
  • Implemented evaluation logic in loadBadges() to verify minimum counts and ensure the spread between difficulties satisfies the 5% threshold condition.
  • Added a distinct teal/cyan theme CSS style class (.badge-balanced) in frontend/user.html.

Type of Change

  • Bug fix
  • New feature
  • UI/Visual update
  • Documentation update
  • Refactor

Testing

  • Tested locally
  • Tested on mobile viewport (if applicable)
  • No console errors introduced

Checklist

  • My code follows the project's coding style
  • I have formatted my code locally by running npx prettier --write . before submitting
  • I am submitting my PR from a dedicated feature/* branch, not the main branch
  • I have performed a self-review of my code
  • My changes generate no new warnings or errors
  • I have updated documentation if required
  • I have linked the relevant issue

Screenshots / Screen Recording

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Thank you for submitting a pull request.

Please ensure your changes comply with the project's contribution guidelines and that all workflow checks pass successfully.

Formatting and Branching

  • Please confirm you have formatted your code locally using npx prettier --write . before requesting a review.
  • Ensure this PR is made from a feature/* branch and not main.

Note: This project is currently maintained by a solo maintainer, so reviews and responses may sometimes take a little time. Thanks for your patience.

@jagdish-15

Copy link
Copy Markdown
Collaborator

/format

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

All done! 💅 I've run Prettier and pushed the formatting fixes to this PR.

Just a heads up: Since this commit was pushed by a bot, GitHub won't automatically re-run your CI checks. To trigger them, you can either:

  • Push an empty commit (git commit --allow-empty -m "Trigger builds" and push)
  • Close and immediately reopen this Pull Request.

@jagdish-15 jagdish-15 added type:feature New feature or request level:beginner Indicates the difficulty gssoc:approved quality:clean labels Aug 8, 2026
@jagdish-15
jagdish-15 merged commit abc39d1 into codepvg:main Aug 8, 2026
1 check passed
@Yashaswini-K-P
Yashaswini-K-P deleted the feature/balanced-badge branch August 15, 2026 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved level:beginner Indicates the difficulty quality:clean type:feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "BALANCED" Gamification Badge to User Profile

2 participants