Merged
Conversation
Closed
Member
Author
|
@ArthurCRodrigues ready for review :D |
Member
|
@matheusmra reviewing |
ArthurCRodrigues
approved these changes
Mar 27, 2026
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.
Fixed a critical logic error in how penalty points were calculated and applied to the final grade. The previous implementation incorrectly subtracted points even when penalty-marked tests passed, or used an inverted logic that led to inconsistent grading.
Technical Changes
autograder/models/result_tree.pyModified
RootResultNode.calculate_score()to correctly handle the PENALTY category.Old Logic: The calculation was not properly reflecting the "deduction" nature of the penalty, often leading to inconsistent final scores when penalty tests were present.
New Logic: The impact of penalties is now calculated as the inverse of the penalty group's score.
A penalty score of 100% (no violations) results in 0 deduction points.
A penalty score of 0% (full violation) results in the full penalty weight being subtracted from the final grade.
Formula implemented: penalty_points = ((100.0 - penalty_score) / 100.0) * self.penalty.weight
Fixed: NameError in FocusStep caused by a missing import, which was previously interrupting the pipeline. Also corrected the test impact logic in FocusService to properly account for category weights (bonus/penalty).