Skip to content

Commit

Permalink
Round task score to the nearest integer and subtask to 2 decimal places
Browse files Browse the repository at this point in the history
  • Loading branch information
lw authored and giomasce committed Oct 14, 2012
1 parent ca20e99 commit 22d061d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cms/grading/ScoreType.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ class ScoreTypeGroup(ScoreTypeAlone):
</span>
{% if st["public"] or show_private %}
<span class="score">
{{ '%g' % st["score"] }} / {{ st["max_score"] }}
{{ '%g' % round(st["score"], 2) }} / {{ st["max_score"] }}
</span>
{% else %}
<span class="score">
Expand Down Expand Up @@ -381,8 +381,8 @@ def class_score_testcase(word):

tc_start = tc_end

score = sum(st["score"] for st in subtasks)
public_score = sum(st["score"] for st in subtasks if st["public"])
score = int(round(sum(st["score"] for st in subtasks)))
public_score = int(round(sum(st["score"] for st in subtasks if st["public"])))

details = \
Template(self.TEMPLATE).generate(subtasks=subtasks,
Expand Down

0 comments on commit 22d061d

Please sign in to comment.