+
Skip to content

Fix decaying points (Fixes #232) #233

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

Merged
merged 7 commits into from
Feb 28, 2022
Merged

Fix decaying points (Fixes #232) #233

merged 7 commits into from
Feb 28, 2022

Conversation

0xAda
Copy link
Contributor

@0xAda 0xAda commented Feb 8, 2022

Relevant fields for frontend:
decay_constant for controlling how fast the points decay
min_points for controlling the minimum amount of points
And challenge.points_type being set to decay to use this plugin

Copy link
Member

@RACTFBot RACTFBot left a comment

Choose a reason for hiding this comment

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

✔️ Auto-approved due to hotfix/ branch.

@codecov
Copy link

codecov bot commented Feb 8, 2022

Codecov Report

Merging #233 (962017b) into master (e57e390) will increase coverage by 0.09%.
The diff coverage is 98.46%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #233      +/-   ##
==========================================
+ Coverage   96.55%   96.65%   +0.09%     
==========================================
  Files         108      108              
  Lines        4970     5026      +56     
  Branches      264      267       +3     
==========================================
+ Hits         4799     4858      +59     
+ Misses        139      137       -2     
+ Partials       32       31       -1     
Impacted Files Coverage Δ
src/plugins/points/base.py 97.50% <50.00%> (-2.50%) ⬇️
src/challenge/models.py 100.00% <100.00%> (ø)
src/challenge/serializers.py 90.70% <100.00%> (+1.96%) ⬆️
src/challenge/signals.py 100.00% <100.00%> (ø)
src/challenge/tests/test_views.py 100.00% <100.00%> (ø)
src/challenge/views.py 84.41% <100.00%> (+0.24%) ⬆️
src/plugins/points/decay.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e57e390...962017b. Read the comment docs.

@NicholasG04
Copy link
Member

I may be being stupid here but this doesn't appear to broadcast the websocket message to me? Please send event_type 7, challenge_id and score

Comment on lines +15 to +16
decay_constant = challenge.flag_metadata.get("decay_constant", 0.99)
min_points = challenge.flag_metadata.get("min_points", 100)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we move this into settings?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

unsure, min_points makes sense to have per challenge imo, because the max points is stored per challenge, decay constant feels like something most people wont need to touch, but if we're giving them control over min and max, it feels a bit odd not giving them control over decay constant

Copy link
Collaborator

Choose a reason for hiding this comment

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

No, I mean, Django settings. As in

Suggested change
decay_constant = challenge.flag_metadata.get("decay_constant", 0.99)
min_points = challenge.flag_metadata.get("min_points", 100)
decay_constant = challenge.flag_metadata.get("decay_constant", settings.DEFAULT_CHALLENGE_DECAY)
min_points = challenge.flag_metadata.get("min_points", settings.DEFAULT_CHALLENGE_MINIMUM_POINTS)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ohhh, ok, that makes sense, i'd either put it there or config, the defaults should definitely be configurable

Copy link
Collaborator

@jchristgit jchristgit left a comment

Choose a reason for hiding this comment

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

Rock solid, apart from maybe moving the values to settings.

@jchristgit jchristgit self-requested a review February 11, 2022 22:03
@thebeanogamer thebeanogamer force-pushed the hotfix/fix-dynamic-scoring branch from 3fe4993 to bcc7b27 Compare February 13, 2022 16:29
@thebeanogamer thebeanogamer marked this pull request as draft February 13, 2022 16:48
@0xAda 0xAda force-pushed the hotfix/fix-dynamic-scoring branch from bcc7b27 to 6d4f27f Compare February 17, 2022 22:37
@jchristgit jchristgit linked an issue Feb 26, 2022 that may be closed by this pull request
@0xAda 0xAda marked this pull request as ready for review February 26, 2022 21:01
@jchristgit
Copy link
Collaborator

@david-cooke will reach out to @thebeanogamer about testing this, then it's good to go

@NicholasG04
Copy link
Member

Am out today, will hopefully find time to test this with shell after some succour from Daniel with running all changes.

@0xAda 0xAda merged commit aef1c79 into master Feb 28, 2022
@0xAda 0xAda deleted the hotfix/fix-dynamic-scoring branch February 28, 2022 00:47
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.

Dynamic Scoring
5 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载