Commit 5e1751c3 by Usman Khalid

Increases precision of percentages shown in 'Total' bar on the progress page.

The percentages shown currently can be confusing. For example, if the true weight
of a category is 0.76925% and the student scores 100% in it, they will see '0.8%
out of a possible 1.0%'. Increasing the precision to 2 decimal places changes it
to '0.77% of a possible 0.77%'.

LMS-2205
parent f74a0f4f
...@@ -183,7 +183,7 @@ class WeightedSubsectionsGrader(CourseGrader): ...@@ -183,7 +183,7 @@ class WeightedSubsectionsGrader(CourseGrader):
subgrade_result = subgrader.grade(grade_sheet, generate_random_scores) subgrade_result = subgrader.grade(grade_sheet, generate_random_scores)
weighted_percent = subgrade_result['percent'] * weight weighted_percent = subgrade_result['percent'] * weight
section_detail = u"{0} = {1:.1%} of a possible {2:.0%}".format(category, weighted_percent, weight) section_detail = u"{0} = {1:.2%} of a possible {2:.2%}".format(category, weighted_percent, weight)
total_percent += weighted_percent total_percent += weighted_percent
section_breakdown += subgrade_result['section_breakdown'] section_breakdown += subgrade_result['section_breakdown']
......
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