-
Notifications
You must be signed in to change notification settings - Fork 41
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
#M01. Judging Automation #112
#M01. Judging Automation #112
Conversation
Check if all the project have been scored by all the judges in all categories
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.
@natalijabujevic0708 thanks for adding this! I just have some minor comments.
Could you just also add another view which will show a list of all of the projects ranked by their score which the judges will be redirected to if your logic evaluates that all projects have been scored by all judges? Thanks
hackathon/views.py
Outdated
@@ -10,6 +10,7 @@ | |||
|
|||
# Create your views 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.
Could you please remove this comment and reduce it to only 2 blank lines.
hackathon/views.py
Outdated
) | ||
team_score.save() | ||
|
||
|
||
# Number of judges in the Hackathon |
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 don't think you need all the inline comments. Instead I would extract the logic into a separate function to be called here and add the overall logic to the docstring.
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.
@stefdworschak done!
…ci-hackathon-app into judging_automation
Extract the logic into a separate function check_projects_scores to check if all the projects were scored by all the judges in all categories
@stefdworschak no problem, I am going to create the function to calculate the scores and the new view which will show a list of all of the projects ranked by their score in my next PR :) |
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
Description
After a judge submits his/her score, check if all projects have been scored by all judges in all categories.
How to check if all the projects were scored by all the judges in all categories:
Pull request type
#M01. Judging Automation
Testing
I created 2 Hackathons:
Hackathon 1:
Hackathon 2:
-teams: Team 4 with Project Team 4
The judges scored the teams in Hackathon 1:
Team 1 with Project 1 was scored by both judges in all categories
Team 2 with Project Team 2 was scored by just one judge in one category
Team 3 with Project Team 3 was not yet scored
The output was
Number of judges: 2
Number of categories: 2
List of projects: [2, 3, 4] #the id's of the projects
Number of objects: 4
Project : 2 Number of objects: 4
A team has been scored by all the judges
Project : 3 Number of objects: 1
Not all teams have been scored by all judges
Since the second project wasn't scored by all the judges, the loop broke and redirected to the list of Hackathons.
Second test: All the projects were scored by all the judges:
Output was:
Number of judges: 2
Number of categories: 2
List of projects: [2, 3, 4]
Number of objects: 4
Project : 2 Number of objects: 4
A team has been scored by all the judges
Project : 3 Number of objects: 4
A team has been scored by all the judges
Project : 4 Number of objects: 4
A team has been scored by all the judges
All teams have been scored by all judges
Additional Information
This is just the beginning of judging automation, the next step is (after all the projects are scored) to declare a function that will calculate the overall scores and declare a winner, as well as trigger the winning team's profile to allow them to update their shipping address.
Does this introduce a breaking change