round-off weight, min_count and drop_count values while returing grading policy

TNL-884
This commit is contained in:
zubair-arbi
2014-12-01 14:53:59 +05:00
parent dfc4da1574
commit f62e5347e1
3 changed files with 20 additions and 11 deletions

View File

@@ -205,6 +205,9 @@ class CourseGradingModel(object):
@staticmethod
def jsonize_grader(i, grader):
# Warning: converting weight to integer might give unwanted results due
# to the reason how floating point arithmetic works
# e.g, "0.29 * 100 = 28.999999999999996"
return {
"id": i,
"type": grader["type"],