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

Open
wants to merge 31 commits into
base: main
Choose a base branch
from

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?

@krrish-sehgal
Copy link
Contributor Author

While there seems to be some overlap between the badge model and the challenge model , if in future we want to add badges for lets say , "Complete all the team challenges" , "Complete all weekly challenges in 3 consecutive weeks", wouldnt there be significant mismatch in the logic?

@DonnieBLT
Copy link
Collaborator

That’s a good point. How about if a user reports 5 ips for the team, they should get the individual badge too right? I think the badge code is setup to be similar to the challenges. Maybe if it’s a team capable badge, it only gets rewarded when all members earn it and it ties into the progress bar. If we use badges we also get the nice graphic.

@krrish-sehgal
Copy link
Contributor Author

krrish-sehgal commented Dec 19, 2024

I believe then the this depends on the use case , if you plan to have badges associated with all the challenges , then combining the challenges and badge model would be good , but if badges have multiple use cases beyond challenges then keeping them separate would be a better option ,

For teams i can modify the badge model to have a field like
"
AWARD_TARGETS = [
("individual", "Individual"),
("team", "Team"),
]
"

and i can modify the UserBadge model to RecipientBadge model , that can link the badges to the users as well as teams depending on the badge .
This way for each team badge , there will always be a challenge associated , and we wont need to have a badge for some small team challenges which arent badge worthy.

@DonnieBLT
Copy link
Collaborator

I think it’s fine if each challenge also has a badge. We also want them to work with team+individual so I could report 5 ips for my team and earn two badges one for the team when all members find 5 ip and individual when I find 5

@krrish-sehgal
Copy link
Contributor Author

krrish-sehgal commented Dec 19, 2024

Sir, treating challenges that way would compromise the point system and leaderboard functionality. Currently, a challenge is marked as complete when team members collectively report 5 IPs, allowing the team to earn points and be ranked on the global leaderboard.

So, I wanted to propose either of the following options:

  1. Eliminate the whole global team leaderboard system and keep the competition within team challenges only.
    or i can do an addition of the within team challenges on this, like
  2. If a team challenge is completed, the team receives the badge, not the individual user.
  3. If a within-team challenge is completed, two badges are awarded to the user: one for completing the individual challenge and another for completing the within-team challenge.

This way, we preserve the focus on team challenges while still recognizing individual efforts within teams.

@DonnieBLT
Copy link
Collaborator

I like the ability to have individual and team challenges

@krrish-sehgal
Copy link
Contributor Author

krrish-sehgal commented Dec 23, 2024

so I could report 5 ips for my team and earn two badges one for the team when all members find 5 ip and individual when I find 5

So , finally we want in team challenges to be like,
if all the user collectively complete the challenge and team entity is awarded a badge
or
i report 5ips and when other team members also report 5 ips , all the user entities of the team gets the badge not the team entity?

@DonnieBLT
Copy link
Collaborator

Yes I think that seems right

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Team and user challenges with leaderboard
2 participants