Skip to content

Commit

Permalink
add some error handling to marking code
Browse files Browse the repository at this point in the history
  • Loading branch information
struan committed Jul 19, 2023
1 parent 62ee64b commit 7a61daa
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions crowdsourcer/scoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,28 @@ def get_section_scores(q_maxes):
score["question__number"], score["question__number_part"]
)
q_max = q_maxes[section.title][q]

if score["score"] is None:
print(
"score is None:",
score["authority__name"],
section.title,
q,
score["score"],
q_max,
)
continue
if q_max is None or q_max == 0:
print(
"Max score is None or 0:",
score["authority__name"],
section.title,
q,
score["score"],
q_max,
)
continue

weighted_score = get_weighted_question_score(
score["score"], q_max, score["question__weighting"]
)
Expand Down

0 comments on commit 7a61daa

Please sign in to comment.