-
Notifications
You must be signed in to change notification settings - Fork 4
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
Remove submissions with more than 4 recusals #5403
base: preview
Are you sure you want to change the base?
Remove submissions with more than 4 recusals #5403
Conversation
50e3cf1
to
dc57def
Compare
@@ -7,7 +7,7 @@ class ScoredSubmissionsGrid | |||
|
|||
scope do | |||
TeamSubmission.complete.current | |||
.includes(:team, {submission_scores: :judge_profile}) | |||
.includes(team: :division, submission_scores: :judge_profile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed bullet warning
ed3d453
to
8e4246a
Compare
@@ -128,6 +128,9 @@ def developed_on?(platform_name) | |||
scope :complete, -> { where("published_at IS NOT NULL") } | |||
scope :incomplete, -> { where("published_at IS NULL") } | |||
|
|||
scope :removed_from_judging_pool, -> { where(removed_from_judging_pool: true) } | |||
scope :not_removed_from_judging_pool, -> { where(removed_from_judging_pool: false) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unsure of the scope names. I think removed_from_judging_pool
is pretty straight forward but I'm wondering if the other should be eligble_for_judging
or something more general like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I like where you're headed, eligible_for_judging
or something like that. 👍 And I could even see that scope containing complete
too, as in an eligible submission for judging is a complete submission that hasn't been removed from the judging pool.
@@ -10,6 +10,7 @@ class ScoresController < AdminController | |||
unless request.xhr? | |||
@round = grid_params[:round] | |||
end | |||
@removed_submissions = TeamSubmission.current.complete.removed_from_judging_pool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reading removed_submissions
this seems to be a little vague to me, suggestion: submissions_removed_from_judging_pool
or something more descriptive.
@@ -84,6 +84,10 @@ class ScoredSubmissionsGrid | |||
|
|||
column :judge_recusal_count, header: "Recusals", mandatory: true, order: true | |||
|
|||
column :removed_from_judging_pool, header: "Removed from judging pool", mandatory: true do |submission| | |||
ApplicationController.helpers.humanize_boolean(submission.removed_from_judging_pool) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using removed_from_judging_pool?
would be more explicit that this returns a boolean (by convention); and since we're using a humanize_boolean
helper vs the method w/o the ?
(which will do the same thing, just doesn't follow the ?
convention).
@@ -565,4 +567,8 @@ def pending_approval? | |||
def update_team_score_summaries | |||
team_submission.update_score_summaries | |||
end | |||
|
|||
def update_removed_from_judging_pool | |||
team_submission.reload.update(removed_from_judging_pool: team_submission.judge_recusal_count > 4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if making this more explicit would make it easier to parse:
if recusal count >= 5
remove from judging pool
The basic format being:
- if this, set that
vs.
- set this to result of conditional
Just a random thought. 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, some nice functionality here! 💯
Refs #5335 and #5336
This PR adds functionality to automatically remove a submission from the judging pool on the 5th recusal.
Key Changes:
remove_from_judging_pool
boolean field to team_submissionsremove_from_judging_pool
to true whenjudge_recusal_count exceeds
4 recusals