Commit 8e364e6d by Victor Shnayder

ensure float when computing module score

parent c9fd7b22
...@@ -179,7 +179,7 @@ def progress_summary(student, course, grader, student_module_cache): ...@@ -179,7 +179,7 @@ def progress_summary(student, course, grader, student_module_cache):
def get_score(user, problem, student_module_cache): def get_score(user, problem, student_module_cache):
""" """
Return the score for a user on a problem Return the score for a user on a problem, as a tuple (correct, total).
user: a Student object user: a Student object
problem: an XModule problem: an XModule
...@@ -219,7 +219,7 @@ def get_score(user, problem, student_module_cache): ...@@ -219,7 +219,7 @@ def get_score(user, problem, student_module_cache):
if total == 0: if total == 0:
log.exception("Cannot reweight a problem with zero weight. Problem: " + str(instance_module)) log.exception("Cannot reweight a problem with zero weight. Problem: " + str(instance_module))
return (correct, total) return (correct, total)
correct = correct * weight / total correct = float(correct) * weight / total
total = weight total = weight
return (correct, total) return (correct, total)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment