-
Notifications
You must be signed in to change notification settings - Fork 0
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
Automatically deactivate team if their absent count exceeds threshold #16
Conversation
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.
Added some comments by the files. Also, as I mentioned to you before, please add:
- Type of change: {Bug fix, New feature, Breaking change, Documentation update}
- How the code change was tested: {Plain text description of testing steps would be fine}
The testing is especially important for this change, since it will automatically deactivate the team. Please post the screenshots of your testing as well, like the admin page before judge presses absent, the judge client view of pressing absent on that team, and then the reloaded admin page after judge presses absent that shows the team as deactivated.
app.json
Outdated
@@ -23,6 +23,7 @@ | |||
"EMAIL_PASSWORD": "_unused_", | |||
"IGNORE_CONFIG_FILE": "true", | |||
"TRACKS": [] | |||
"THRESHOLD_ABSENT": 2 |
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 know you were using 2 as a tester, but can you change this default to 4?
gavel/controllers/judge.py
Outdated
target_state = action == 'Disable' | ||
def tx(): | ||
Item.by_id(item_id).active = False | ||
db.session.commit() #to here |
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.
Please get rid of the #to here
fluff comment. Same thing with #from here
on line 89.
gavel/controllers/judge.py
Outdated
@@ -86,6 +86,13 @@ def tx(): | |||
elif request.form['action'] == 'Absent': | |||
annotator.next.absent.append(annotator) | |||
annotator.ignore.append(annotator.next) | |||
if count >= settings.THRESHOLD_ABSENT: #from here |
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.
Did you test this out? count
doesn't seem to be defined anywhere, and it should give you an error the moment you run this. You should be looking at the length of the absent list: len(annotator.next.absent)
.
gavel/controllers/judge.py
Outdated
@@ -86,6 +86,13 @@ def tx(): | |||
elif request.form['action'] == 'Absent': | |||
annotator.next.absent.append(annotator) | |||
annotator.ignore.append(annotator.next) | |||
if count >= settings.THRESHOLD_ABSENT: #from here | |||
item_id = request.form['item_id'] | |||
target_state = action == 'Disable' |
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.
What are these 2 lines here for?
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! Will merge after you get to the testing
gavel/templates/admin.html
Outdated
@@ -31,7 +31,8 @@ <h2>Projects</h2> | |||
<th class="sort-default" data-sort-method="number" data-sort-order="desc">Mu</th> | |||
<th data-sort-method="number">Sigma Squared</th> | |||
<th data-sort-method="number">Votes</th> | |||
<th data-sort-method="number">Seen</th> | |||
<th data-sort-method="number">Seen</th> | |||
<th data-sort-method="number" data-sort-order="desc">Absent</th> |
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.
Can you remove the changes from this file? The changes here are important enough that I'm going to commit directly to master. Thanks!
app.json
Outdated
"THRESHOLD_ABSENT": 1=4 | ||
======= | ||
"THRESHOLD_ABSENT": 2 | ||
>>>>>>> 193c8c15a75bd580d301c9d875600de2ed0f5891 |
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.
Merge conflict markers!
Solved: issue #10
New feature:
An absent button for the judges to use when a team is not present during the judging process. If the number of times a team is marked “absent” by the judges crosses a specified threshold then the team would be deactivated.
Tested the feature by:
-Adding a new sample project and a judge from admin view
-Marking the sample project “absent” from the judge client view
-Going back and making sure that the absent count was increased by 1 and the team was actually deactivated (Note: for testing purposes, if a team was marked as absent ONCE then it would be deactivated)
Screenshot from the admin view when the new project named "Testing Absent Count" is added:
The judge client view of the project:
Team, "Testing Absent Count", deactivated after a judge marked it "absent"