-
Notifications
You must be signed in to change notification settings - Fork 785
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
[Feature] Prize support for Challenges #3906
base: master
Are you sure you want to change the base?
Conversation
This commit contains all API files and validation for challenge configuration to implement this feature. Changes: - models.py: Added has_prizes attribute in challenge model class to check whether challenge has prizes. Added new ChallengePrize model for prize. - serializers.py Added ChallengePrizeSerializer class to serialize ChallengePrize model. - views.py: Modified create_or_update_github_challenge method to create and update prize objects defined in YAML file. Modified ZIP config validation method to validate prize data in YAML file and to create prize objects. Added get_prizes_by_challenge method to return prizes objects of challenge to an API call. - urls.py Added url to call API for fetching ChallengePrize objects. - challenge_config_utils.py Added Prize validation to ensure appropriate values for prizes in challenge configuration.
This commit contains migration file of model changes.
This commit contains all backend changes. Changes: - challengeCtrl.js Added API Call to get prize data of a challenge. - route-config.js Added frontend page route of Prize section.
This commit contains all frontend changes. Changes: - prize.html This frontend file is for display the challenge prizes. - challenge-page.html Added tab for prize section in challenge page.
d1209c6
to
1549331
Compare
1549331
to
e1756a3
Compare
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## master #3906 +/- ##
==========================================
- Coverage 72.93% 71.12% -1.81%
==========================================
Files 83 20 -63
Lines 5368 3276 -2092
==========================================
- Hits 3915 2330 -1585
+ Misses 1453 946 -507
... and 63 files with indirect coverage changes
... and 63 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
a0f23e0
to
e1756a3
Compare
This pull request is for the addition of the challenge prizes feature [fixes #3893]. This feature will allow hosts to offer rewards to the top-performing participants in a challenge.
To add prizes to a challenge:
has_prizes
attribute in the challenge model will be set to True.has_prizes
attribute will remain False, and the prize tab section will be removed from the challenge details page.Here's Screenshot of hosted challenge with above 'prizes' configuration:
To implement this feature,
ChallengePrize
model and serializer to handle prizes in challenges.has_prizes
attribute to the Challenge model class.create_or_update_github_challenge
method to create and update prize objects from configuration file.get_prizes_by_challenge
method and URL to retrieve prize objects via API call.