-
Notifications
You must be signed in to change notification settings - Fork 10
fix: fix the problem score when added in graded sub-section #272
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -992,6 +992,16 @@ def get_progress(self): | |||||||||||
| else: | ||||||||||||
| raw_earned = raw_possible = 0 | ||||||||||||
|
|
||||||||||||
| if not self.attempts: | ||||||||||||
| # Nothing has ever been submitted for this user/block, so there's no | ||||||||||||
| # real grade history to protect. Reflect the problem's current | ||||||||||||
| # definition instead of a stale persisted score (e.g. left over from | ||||||||||||
| # before an author edited the problem after it was first previewed). | ||||||||||||
| if "lcp" in self.__dict__: | ||||||||||||
| raw_possible = self.lcp.get_max_score() | ||||||||||||
| else: | ||||||||||||
| raw_possible = self.max_score() | ||||||||||||
|
Comment on lines
+1000
to
+1003
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
is this conditional important or can we simplify it? When I look at the definition of
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This condition is only added to avoid creating |
||||||||||||
|
|
||||||||||||
| if raw_possible > 0: | ||||||||||||
| if self.weight is not None: | ||||||||||||
| # Progress objects expect total > 0 | ||||||||||||
|
|
||||||||||||
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.
Why can't the code go in this
else:block? Is it becauseself.scoremight be Truthy even when there are no attempts?Uh oh!
There was an error while loading. Please reload this page.
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.
Theoretically it should be zero, but when instructors manually add score for student(s) that could make it truthy and it does not increase the student attempt count.