-
Notifications
You must be signed in to change notification settings - Fork 34
fix: assessments buttons #339
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
Conversation
orronai
commented
Oct 15, 2021
- Unfocus after clicking an assessment
- Assessment is now changed after select and not after fully checked solution
- Unfocus after clicking an assessment - Assessment is now changed after select and not after fully checked solution
Codecov Report
@@ Coverage Diff @@
## master #339 +/- ##
==========================================
+ Coverage 83.94% 83.96% +0.02%
==========================================
Files 63 63
Lines 2940 2950 +10
==========================================
+ Hits 2468 2477 +9
- Misses 472 473 +1
Continue to review full report at Codecov.
|
Sourcery Code Quality Report✅ Merging this PR will increase code quality in the affected files by 0.10%.
Here are some functions in these files that still need a tune-up:
Legend and ExplanationThe emojis denote the absolute quality of the code:
The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request. Please see our documentation here for details on how these metrics are calculated. We are actively working on this report - lots more documentation and extra metrics to come! Help us improve this quality report! |
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.
AAA Job, thanks!
def change_assessment(self, assessment_id: Optional[int] = None) -> bool: | ||
assessment = SolutionAssessment.get_or_none( | ||
SolutionAssessment.id == assessment_id, | ||
) | ||
requested_solution = (Solution.id == self.id) | ||
updates_dict = {Solution.assessment.name: assessment} | ||
changes = Solution.update(**updates_dict).where(requested_solution) | ||
return changes.execute() == 1 |
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.
Awesome job! I like both the decoupling and the cleanness of this function