Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Challenges and leaderboards #3127

Merged
merged 40 commits into from
Jan 26, 2025

Conversation

krrish-sehgal
Copy link
Contributor

@krrish-sehgal krrish-sehgal commented Dec 18, 2024

fixes #3126

Used the points model in user.py to award points to users when they complete challenges.
Teams will earn team_points when they complete challenges.

For the navigation structure:
Under the Users section in the sidenav, Introduced a new page for challenges. Points earned from these challenges are also added showcased on the existing leaderboard.

Under the new Teams section in the sidenav:
a new page for challenges for teams.
a Team Leaderboard with views: global rankings

Separating badges for challenges in necessary because if in future we want to add weekly challenges , we wont need to assign badges for every completion of challenge.
https://github.com/user-attachments/assets/033dcdf8-2e8f-4818-9122-27f9571567ac

@krrish-sehgal krrish-sehgal marked this pull request as draft December 18, 2024 18:54
@krrish-sehgal krrish-sehgal marked this pull request as ready for review December 18, 2024 19:26
@krrish-sehgal
Copy link
Contributor Author

@DonnieBLT Sir i have made the required functionality , but the challenges are limited to 3 , just so i can confirm with you that :

  1. How many challenges should i include ?
  2. whats should be the points threshold?
  3. Should i make differnt signals file for the challenge signals even some are overallaping , but it would separate it from the logic of the activity feed signals?

@DonnieBLT
Copy link
Collaborator

@DonnieBLT Sir i have made the required functionality , but the challenges are limited to 3 , just so i can confirm with you that :

  1. How many challenges should i include ?

  2. whats should be the points threshold?

  3. Should i make differnt signals file for the challenge signals even some are overallaping , but it would separate it from the logic of the activity feed signals?

We can start with three challenges that looks good let's let's make everything one point and then yes if you think it's better to have a separate file then that would be fine for the signals

@krrish-sehgal krrish-sehgal changed the title Challenges leaderboard Challenges and leaderboards Dec 19, 2024
@krrish-sehgal
Copy link
Contributor Author

@DonnieBLT sir, i have made the changes and attached a video, let me know of any other changes.

Thanks.

@DonnieBLT
Copy link
Collaborator

What do you think about modifying the badge code to work with teams instead of adding new models?

@DonnieBLT
Copy link
Collaborator

can you merge these migrations please?

Copy link
Collaborator

@DonnieBLT DonnieBLT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please merge migrations

@krrish-sehgal
Copy link
Contributor Author

Apologies for the delay.
I'll fix it right away.

@krrish-sehgal
Copy link
Contributor Author

krrish-sehgal commented Jan 24, 2025

@DonnieBLT sir , Is it good to merge now?

@DonnieBLT
Copy link
Collaborator

Can you just change the files necessary for the functionality? 93 files changed seems like too much.

@krrish-sehgal
Copy link
Contributor Author

krrish-sehgal commented Jan 24, 2025

@DonnieBLT sir ,The files changed when i ran pre-commit on them , most of the files are same but adjusted by pre-commit, as the test case wasnt passing.
Should i revert them nevertheless?

@DonnieBLT
Copy link
Collaborator

I think the pre commit only does staged files? It would be faster for me to review with smaller changes

@krrish-sehgal krrish-sehgal force-pushed the challenges-leaderboard branch from 5eb90b3 to 689f1dc Compare January 24, 2025 06:47
@krrish-sehgal krrish-sehgal force-pushed the challenges-leaderboard branch from 689f1dc to 196ab0c Compare January 24, 2025 06:50
@krrish-sehgal
Copy link
Contributor Author

krrish-sehgal commented Jan 24, 2025

@DonnieBLT sir , i have reverted the changes , the pre-commit in the test is running on all the files , as it shows error in blt/middleware/iprestrict.py , whereas i havent changes the file in my commit .

In CI , pre-commit runs like pre-commit run --all-files so its checking for all the files .

@krrish-sehgal
Copy link
Contributor Author

krrish-sehgal commented Jan 24, 2025

@DonnieBLT sir ,Since you have approved , should i run pre-commit run --all-files so that it passes the test-case?

@DonnieBLT DonnieBLT merged commit 399de4a into OWASP-BLT:main Jan 26, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Team and user challenges with leaderboard
2 participants