Skip to content

Commit

Permalink
Fix score calculation with instructor answers.
Browse files Browse the repository at this point in the history
Instructor answers don't get judged, so they wouldn't have a round
associated with them, need to default to 0.
  • Loading branch information
ionparticle committed Sep 2, 2014
1 parent db0627e commit 47dfd51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion acj/judgement.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def _calculate_scores(course_id, question_id):
score = Scores.query.filter_by(answer=answer, course_criterion=course_criterion).first()
if not score:
score = Scores(answer=answer, course_criterion=course_criterion)
score.rounds = rounds[answer.id]
score.rounds = rounds.get(answer.id, 0)
score.score = wins.get_score(answer, course_criterion)
score.wins = wins.get_total_wins(answer, course_criterion)
db.session.add(score)
Expand Down

0 comments on commit 47dfd51

Please sign in to comment.