Add highest_score field to HackProjectScoreCategory model#81
Merged
stefdworschak merged 2 commits intoCode-Institute-Community:masterfrom Oct 18, 2020
Merged
Conversation
stefdworschak
requested changes
Oct 18, 2020
Member
stefdworschak
left a comment
There was a problem hiding this comment.
@Sarosim some minor changes, but I would also add an assertion to test this is working.
hackathon/models.py
Outdated
| category = models.CharField(default="", max_length=255) | ||
| # Score Categories can have different score range (e.g. 1-10, 1-15) | ||
| # this field sets the upper end of the scale | ||
| highest_score = models.IntegerField(default=10) |
Member
There was a problem hiding this comment.
I'd say change it to max_score which is probably more fitting. Highest score sounds more like something related to a highscore to me.
Contributor
Author
There was a problem hiding this comment.
Thanks Stefan, obviously min_score and max_score are the most meaningful names, corrected, tested with assertions, all tests passing.
Contributor
Author
|
Added |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
S08 - Judging submissions
Score Categories can have different score ranges (e.g. 1-10, 1-15)
Adding this field sets the upper end of the scale, so the admin can define for each scoring category the scale by providing the highest possible score for that given category.
I'm just realising that this field was indeed on the original schema (with name score), but wasn't implemented in the models. In this respect it can be treated as a fix.
This might affect other user stories so I'm submitting this PR without any other changes to S08, so others can pull it and start working with this fix.
Tests:
Added the field to the test case but no assertion is added for it. I run the tests and all pass.
Know bugs/errors:
None
In my version, the field is named
highest_score, but I can rename it, if you guys deem necessary.