Handle null weighted_possible values safely.

Rather than failing, treat them as unscored blocks.

[TNL-5689](https://openedx.atlassian.net/browse/TNL-5689): Server error when
checking a problem.
This commit is contained in:
J. Cliff Dyer
2016-09-30 10:21:35 -04:00
parent e3db08f194
commit 2ec95262ab

View File

@@ -108,8 +108,7 @@ def get_score(submissions_scores, csm_scores, persisted_block, block):
_get_score_from_persisted_or_latest_block(persisted_block, block, weight)
)
assert weighted_possible is not None
has_valid_denominator = weighted_possible > 0.0
has_valid_denominator = weighted_possible is not None and weighted_possible > 0.0
graded = _get_graded_from_block(persisted_block, block) if has_valid_denominator else False
return ProblemScore(