diff --git a/judgels-backends/judgels-grader-engines/src/main/java/judgels/gabriel/aggregators/MinAggregator.java b/judgels-backends/judgels-grader-engines/src/main/java/judgels/gabriel/aggregators/MinAggregator.java index 058db701c..7a1e65ba7 100644 --- a/judgels-backends/judgels-grader-engines/src/main/java/judgels/gabriel/aggregators/MinAggregator.java +++ b/judgels-backends/judgels-grader-engines/src/main/java/judgels/gabriel/aggregators/MinAggregator.java @@ -21,16 +21,17 @@ public AggregationResult aggregate(List testCaseVerdicts, doubl aggregatedVerdict = verdict; } - String points; + String points = ""; if (verdict == Verdict.OK) { double okPoints = 0.0; if (testCaseVerdict.getPercentage().isPresent()) { okPoints = testCaseVerdict.getPercentage().get() * subtaskPoints / 100.0; + points = testCaseVerdict.getPercentage().get() + "%"; } else if (testCaseVerdict.getPoints().isPresent()) { okPoints = testCaseVerdict.getPoints().get(); + points = "" + okPoints; } aggregatedPoints = Math.min(aggregatedPoints, okPoints); - points = "" + okPoints; } else if (verdict == Verdict.ACCEPTED) { points = "*"; } else if (verdict == Verdict.SKIPPED) { diff --git a/judgels-backends/judgels-grader-engines/src/test/java/judgels/gabriel/aggregators/MinAggregatorTests.java b/judgels-backends/judgels-grader-engines/src/test/java/judgels/gabriel/aggregators/MinAggregatorTests.java index 3d63533d6..9d65c333a 100644 --- a/judgels-backends/judgels-grader-engines/src/test/java/judgels/gabriel/aggregators/MinAggregatorTests.java +++ b/judgels-backends/judgels-grader-engines/src/test/java/judgels/gabriel/aggregators/MinAggregatorTests.java @@ -87,7 +87,7 @@ void aggregate_min_ok_percentage() { AggregationResult result = aggregator.aggregate(testCaseVerdicts, 70.0); assertThat(result.getSubtaskVerdict()).isEqualTo(SubtaskVerdict.of(Verdict.OK, 17.5)); - assertThat(result.getTestCasePoints()).containsExactly("*", "17.5", "35.0"); + assertThat(result.getTestCasePoints()).containsExactly("*", "25%", "50%"); } @Test