@@ -238,10 +238,9 @@ class ScoreTypeGroup(ScoreTypeAlone):
238238 <span class="title">
239239 {% trans index=st["idx"] %}Subtask {{ index }}{% endtrans %}
240240 </span>
241- {% if "score_fraction" in st and "max_score" in st %}
242- {% set score = st["score_fraction"] * st["max_score"] %}
241+ {% if "score" in st and "max_score" in st %}
243242 <span class="score">
244- ({{ score|round(2) |format_decimal }}
243+ ({{ st[" score"] |format_decimal }}
245244 / {{ st["max_score"]|format_decimal }})
246245 </span>
247246 {% else %}
@@ -416,6 +415,8 @@ def compute_score(self, submission_result):
416415 targets = self .retrieve_target_testcases ()
417416 evaluations = {ev .codename : ev for ev in submission_result .evaluations }
418417
418+ score_precision = submission_result .submission .task .score_precision
419+
419420 for st_idx , parameter in enumerate (self .parameters ):
420421 target = targets [st_idx ]
421422
@@ -461,6 +462,7 @@ def compute_score(self, submission_result):
461462 [float (evaluations [tc_idx ].outcome ) for tc_idx in target ],
462463 parameter )
463464 st_score = st_score_fraction * parameter [0 ]
465+ rounded_score = round (st_score , score_precision )
464466
465467 if tc_first_lowest_idx is not None and st_score_fraction < 1.0 :
466468 for tc in testcases :
@@ -478,6 +480,8 @@ def compute_score(self, submission_result):
478480 # with a max score of zero is still properly rendered as
479481 # correct or incorrect.
480482 "score_fraction" : st_score_fraction ,
483+ # But we also want the properly rounded score for display.
484+ "score" : rounded_score ,
481485 "max_score" : parameter [0 ],
482486 "testcases" : testcases })
483487 if all (self .public_testcases [tc_idx ] for tc_idx in target ):
@@ -486,7 +490,7 @@ def compute_score(self, submission_result):
486490 else :
487491 public_subtasks .append ({"idx" : st_idx ,
488492 "testcases" : public_testcases })
489- ranking_details .append ("%g" % round ( st_score , 2 ) )
493+ ranking_details .append ("%g" % rounded_score )
490494
491495 return score , subtasks , public_score , public_subtasks , ranking_details
492496
0 commit comments