Skip to content

Commit

Permalink
grader: Beautify score output
Browse files Browse the repository at this point in the history
  • Loading branch information
fushar committed Aug 16, 2024
1 parent 7e81e98 commit 1ad8952
Show file tree
Hide file tree
Showing 15 changed files with 311 additions and 293 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ void ac() throws GradingException {
testCaseResult(ACCEPTED, "", 0)),
testGroupResult(
-1,
testCaseResult(ACCEPTED, "20.0", -1),
testCaseResult(ACCEPTED, "20.0", -1),
testCaseResult(ACCEPTED, "20.0", -1),
testCaseResult(ACCEPTED, "20.0", -1),
testCaseResult(ACCEPTED, "20.0", -1))),
testCaseResult(ACCEPTED, "20", -1),
testCaseResult(ACCEPTED, "20", -1),
testCaseResult(ACCEPTED, "20", -1),
testCaseResult(ACCEPTED, "20", -1),
testCaseResult(ACCEPTED, "20", -1))),
ImmutableList.of(
subtaskResult(-1, ACCEPTED, 100)));
}
Expand All @@ -79,11 +79,11 @@ void ac_but_wa_at_sample_that_is_not_included() throws GradingException {
testCaseResult(WRONG_ANSWER, "", 0)),
testGroupResult(
-1,
testCaseResult(ACCEPTED, "20.0", -1),
testCaseResult(ACCEPTED, "20.0", -1),
testCaseResult(ACCEPTED, "20.0", -1),
testCaseResult(ACCEPTED, "20.0", -1),
testCaseResult(ACCEPTED, "20.0", -1))),
testCaseResult(ACCEPTED, "20", -1),
testCaseResult(ACCEPTED, "20", -1),
testCaseResult(ACCEPTED, "20", -1),
testCaseResult(ACCEPTED, "20", -1),
testCaseResult(ACCEPTED, "20", -1))),
ImmutableList.of(
subtaskResult(-1, ACCEPTED, 100)));
}
Expand All @@ -103,11 +103,11 @@ void wa_80() throws GradingException {
testCaseResult(ACCEPTED, "", 0)),
testGroupResult(
-1,
testCaseResult(WRONG_ANSWER, "0.0", -1),
testCaseResult(ACCEPTED, "20.0", -1),
testCaseResult(ACCEPTED, "20.0", -1),
testCaseResult(ACCEPTED, "20.0", -1),
testCaseResult(ACCEPTED, "20.0", -1))),
testCaseResult(WRONG_ANSWER, "0", -1),
testCaseResult(ACCEPTED, "20", -1),
testCaseResult(ACCEPTED, "20", -1),
testCaseResult(ACCEPTED, "20", -1),
testCaseResult(ACCEPTED, "20", -1))),
ImmutableList.of(
subtaskResult(-1, WRONG_ANSWER, 80)));
}
Expand All @@ -127,11 +127,11 @@ void wa_token_mismatch() throws GradingException {
testCaseResult(WRONG_ANSWER, "", 0)),
testGroupResult(
-1,
testCaseResult(WRONG_ANSWER, "0.0", -1),
testCaseResult(WRONG_ANSWER, "0.0", -1),
testCaseResult(WRONG_ANSWER, "0.0", -1),
testCaseResult(WRONG_ANSWER, "0.0", -1),
testCaseResult(WRONG_ANSWER, "0.0", -1))),
testCaseResult(WRONG_ANSWER, "0", -1),
testCaseResult(WRONG_ANSWER, "0", -1),
testCaseResult(WRONG_ANSWER, "0", -1),
testCaseResult(WRONG_ANSWER, "0", -1),
testCaseResult(WRONG_ANSWER, "0", -1))),
ImmutableList.of(
subtaskResult(-1, WRONG_ANSWER, 0)));
}
Expand All @@ -151,11 +151,11 @@ void ok_90_with_custom_scorer() throws GradingException {
testCaseResult(ACCEPTED, "", 0)),
testGroupResult(
-1,
testCaseResult(OK, "10.0", -1),
testCaseResult(ACCEPTED, "20.0", -1),
testCaseResult(ACCEPTED, "20.0", -1),
testCaseResult(ACCEPTED, "20.0", -1),
testCaseResult(ACCEPTED, "20.0", -1))),
testCaseResult(OK, "10", -1),
testCaseResult(ACCEPTED, "20", -1),
testCaseResult(ACCEPTED, "20", -1),
testCaseResult(ACCEPTED, "20", -1),
testCaseResult(ACCEPTED, "20", -1))),
ImmutableList.of(
subtaskResult(-1, OK, 90)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@ void ac() throws GradingException {
ImmutableList.of(
testGroupResult(
0,
testCaseResult(ACCEPTED, "*", 0, 1, 2),
testCaseResult(ACCEPTED, "*", 0, 1, 2),
testCaseResult(ACCEPTED, "*", 0, 2)),
testCaseResult(ACCEPTED, "", 0, 1, 2),
testCaseResult(ACCEPTED, "", 0, 1, 2),
testCaseResult(ACCEPTED, "", 0, 2)),
testGroupResult(
1,
testCaseResult(ACCEPTED, "*", 1, 2),
testCaseResult(ACCEPTED, "*", 1, 2)),
testCaseResult(ACCEPTED, "", 1, 2),
testCaseResult(ACCEPTED, "", 1, 2)),
testGroupResult(
2,
testCaseResult(ACCEPTED, "*", 2),
testCaseResult(ACCEPTED, "*", 2),
testCaseResult(ACCEPTED, "*", 2))),
testCaseResult(ACCEPTED, "", 2),
testCaseResult(ACCEPTED, "", 2),
testCaseResult(ACCEPTED, "", 2))),
ImmutableList.of(
subtaskResult(1, ACCEPTED, 30),
subtaskResult(2, ACCEPTED, 70)));
Expand All @@ -79,18 +79,18 @@ void wa_30() throws GradingException {
ImmutableList.of(
testGroupResult(
0,
testCaseResult(ACCEPTED, "*", 0, 1, 2),
testCaseResult(ACCEPTED, "*", 0, 1, 2),
testCaseResult(ACCEPTED, "*", 0, 2)),
testCaseResult(ACCEPTED, "", 0, 1, 2),
testCaseResult(ACCEPTED, "", 0, 1, 2),
testCaseResult(ACCEPTED, "", 0, 2)),
testGroupResult(
1,
testCaseResult(ACCEPTED, "*", 1, 2),
testCaseResult(ACCEPTED, "*", 1, 2)),
testCaseResult(ACCEPTED, "", 1, 2),
testCaseResult(ACCEPTED, "", 1, 2)),
testGroupResult(
2,
testCaseResult(ACCEPTED, "*", 2),
testCaseResult(ACCEPTED, "*", 2),
testCaseResult(WRONG_ANSWER, "X", 2))),
testCaseResult(ACCEPTED, "", 2),
testCaseResult(ACCEPTED, "", 2),
testCaseResult(WRONG_ANSWER, "", 2))),
ImmutableList.of(
subtaskResult(1, ACCEPTED, 30),
subtaskResult(2, WRONG_ANSWER, 0)));
Expand All @@ -106,13 +106,13 @@ void wa_30_at_sample() throws GradingException {
ImmutableList.of(
testGroupResult(
0,
testCaseResult(ACCEPTED, "*", 0, 1, 2),
testCaseResult(ACCEPTED, "*", 0, 1, 2),
testCaseResult(WRONG_ANSWER, "X", 0, 2)),
testCaseResult(ACCEPTED, "", 0, 1, 2),
testCaseResult(ACCEPTED, "", 0, 1, 2),
testCaseResult(WRONG_ANSWER, "", 0, 2)),
testGroupResult(
1,
testCaseResult(ACCEPTED, "*", 1, 2),
testCaseResult(ACCEPTED, "*", 1, 2)),
testCaseResult(ACCEPTED, "", 1, 2),
testCaseResult(ACCEPTED, "", 1, 2)),
testGroupResult(
2,
testCaseResult(SKIPPED, "?", Optional.empty(), 2),
Expand All @@ -133,18 +133,18 @@ void tle_30() throws GradingException {
ImmutableList.of(
testGroupResult(
0,
testCaseResult(ACCEPTED, "*", 0, 1, 2),
testCaseResult(ACCEPTED, "*", 0, 1, 2),
testCaseResult(ACCEPTED, "*", 0, 2)),
testCaseResult(ACCEPTED, "", 0, 1, 2),
testCaseResult(ACCEPTED, "", 0, 1, 2),
testCaseResult(ACCEPTED, "", 0, 2)),
testGroupResult(
1,
testCaseResult(ACCEPTED, "*", 1, 2),
testCaseResult(ACCEPTED, "*", 1, 2)),
testCaseResult(ACCEPTED, "", 1, 2),
testCaseResult(ACCEPTED, "", 1, 2)),
testGroupResult(
2,
testCaseResult(ACCEPTED, "*", 2),
testCaseResult(ACCEPTED, "*", 2),
testCaseResult(TIME_LIMIT_EXCEEDED, "X", Optional.of(TIMED_OUT), 2))),
testCaseResult(ACCEPTED, "", 2),
testCaseResult(ACCEPTED, "", 2),
testCaseResult(TIME_LIMIT_EXCEEDED, "", Optional.of(TIMED_OUT), 2))),
ImmutableList.of(
subtaskResult(1, ACCEPTED, 30),
subtaskResult(2, TIME_LIMIT_EXCEEDED, 0)));
Expand All @@ -160,12 +160,12 @@ void wa_0() throws GradingException {
ImmutableList.of(
testGroupResult(
0,
testCaseResult(ACCEPTED, "*", 0, 1, 2),
testCaseResult(ACCEPTED, "*", 0, 1, 2),
testCaseResult(ACCEPTED, "*", 0, 2)),
testCaseResult(ACCEPTED, "", 0, 1, 2),
testCaseResult(ACCEPTED, "", 0, 1, 2),
testCaseResult(ACCEPTED, "", 0, 2)),
testGroupResult(
1,
testCaseResult(WRONG_ANSWER, "X", 1, 2),
testCaseResult(WRONG_ANSWER, "", 1, 2),
testCaseResult(SKIPPED, "?", Optional.empty(), 1, 2)),
testGroupResult(
2,
Expand All @@ -187,18 +187,18 @@ void ac_with_custom_scorer() throws GradingException {
ImmutableList.of(
testGroupResult(
0,
testCaseResult(ACCEPTED, "*", 0, 1, 2),
testCaseResult(ACCEPTED, "*", 0, 1, 2),
testCaseResult(ACCEPTED, "*", 0, 2)),
testCaseResult(ACCEPTED, "", 0, 1, 2),
testCaseResult(ACCEPTED, "", 0, 1, 2),
testCaseResult(ACCEPTED, "", 0, 2)),
testGroupResult(
1,
testCaseResult(ACCEPTED, "*", 1, 2),
testCaseResult(ACCEPTED, "*", 1, 2)),
testCaseResult(ACCEPTED, "", 1, 2),
testCaseResult(ACCEPTED, "", 1, 2)),
testGroupResult(
2,
testCaseResult(ACCEPTED, "*", 2),
testCaseResult(ACCEPTED, "*", 2),
testCaseResult(ACCEPTED, "*", 2))),
testCaseResult(ACCEPTED, "", 2),
testCaseResult(ACCEPTED, "", 2),
testCaseResult(ACCEPTED, "", 2))),
ImmutableList.of(
subtaskResult(1, ACCEPTED, 30),
subtaskResult(2, ACCEPTED, 70)));
Expand All @@ -215,18 +215,18 @@ void ok_minimum_score_with_custom_scorer() throws GradingException {
ImmutableList.of(
testGroupResult(
0,
testCaseResult(ACCEPTED, "*", 0, 1, 2),
testCaseResult(ACCEPTED, "*", 0, 1, 2),
testCaseResult(ACCEPTED, "*", 0, 2)),
testCaseResult(ACCEPTED, "", 0, 1, 2),
testCaseResult(ACCEPTED, "", 0, 1, 2),
testCaseResult(ACCEPTED, "", 0, 2)),
testGroupResult(
1,
testCaseResult(ACCEPTED, "*", 1, 2),
testCaseResult(ACCEPTED, "*", 1, 2)),
testCaseResult(ACCEPTED, "", 1, 2),
testCaseResult(ACCEPTED, "", 1, 2)),
testGroupResult(
2,
testCaseResult(ACCEPTED, "*", 2),
testCaseResult(ACCEPTED, "*", 2),
testCaseResult(OK, "10.0", 2))),
testCaseResult(ACCEPTED, "", 2),
testCaseResult(ACCEPTED, "", 2),
testCaseResult(OK, "10", 2))),
ImmutableList.of(
subtaskResult(1, ACCEPTED, 30),
subtaskResult(2, OK, 10)));
Expand All @@ -242,18 +242,18 @@ void wa_30_with_custom_scorer() throws GradingException {
ImmutableList.of(
testGroupResult(
0,
testCaseResult(ACCEPTED, "*", 0, 1, 2),
testCaseResult(ACCEPTED, "*", 0, 1, 2),
testCaseResult(ACCEPTED, "*", 0, 2)),
testCaseResult(ACCEPTED, "", 0, 1, 2),
testCaseResult(ACCEPTED, "", 0, 1, 2),
testCaseResult(ACCEPTED, "", 0, 2)),
testGroupResult(
1,
testCaseResult(ACCEPTED, "*", 1, 2),
testCaseResult(ACCEPTED, "*", 1, 2)),
testCaseResult(ACCEPTED, "", 1, 2),
testCaseResult(ACCEPTED, "", 1, 2)),
testGroupResult(
2,
testCaseResult(ACCEPTED, "*", 2),
testCaseResult(ACCEPTED, "*", 2),
testCaseResult(WRONG_ANSWER, "X", 2))),
testCaseResult(ACCEPTED, "", 2),
testCaseResult(ACCEPTED, "", 2),
testCaseResult(WRONG_ANSWER, "", 2))),
ImmutableList.of(
subtaskResult(1, ACCEPTED, 30),
subtaskResult(2, WRONG_ANSWER, 0)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ void ac() throws GradingException {
testCaseResult(ACCEPTED, "", 0)),
testGroupResult(
-1,
testCaseResult(ACCEPTED, "20.0", -1),
testCaseResult(ACCEPTED, "20.0", -1),
testCaseResult(ACCEPTED, "20.0", -1),
testCaseResult(ACCEPTED, "20.0", -1),
testCaseResult(ACCEPTED, "20.0", -1))),
testCaseResult(ACCEPTED, "20", -1),
testCaseResult(ACCEPTED, "20", -1),
testCaseResult(ACCEPTED, "20", -1),
testCaseResult(ACCEPTED, "20", -1),
testCaseResult(ACCEPTED, "20", -1))),
ImmutableList.of(
subtaskResult(-1, ACCEPTED, 100)));
}
Expand All @@ -78,11 +78,11 @@ void wa_80() throws GradingException {
testCaseResult(ACCEPTED, "", 0)),
testGroupResult(
-1,
testCaseResult(ACCEPTED, "20.0", -1),
testCaseResult(ACCEPTED, "20.0", -1),
testCaseResult(WRONG_ANSWER, "0.0", -1),
testCaseResult(ACCEPTED, "20.0", -1),
testCaseResult(ACCEPTED, "20.0", -1))),
testCaseResult(ACCEPTED, "20", -1),
testCaseResult(ACCEPTED, "20", -1),
testCaseResult(WRONG_ANSWER, "0", -1),
testCaseResult(ACCEPTED, "20", -1),
testCaseResult(ACCEPTED, "20", -1))),
ImmutableList.of(
subtaskResult(-1, WRONG_ANSWER, 80)));
}
Expand All @@ -104,11 +104,11 @@ void ok_90_with_custom_scorer() throws GradingException {
testCaseResult(ACCEPTED, "", 0)),
testGroupResult(
-1,
testCaseResult(OK, "10.0", -1),
testCaseResult(ACCEPTED, "20.0", -1),
testCaseResult(ACCEPTED, "20.0", -1),
testCaseResult(ACCEPTED, "20.0", -1),
testCaseResult(ACCEPTED, "20.0", -1))),
testCaseResult(OK, "10", -1),
testCaseResult(ACCEPTED, "20", -1),
testCaseResult(ACCEPTED, "20", -1),
testCaseResult(ACCEPTED, "20", -1),
testCaseResult(ACCEPTED, "20", -1))),
ImmutableList.of(
subtaskResult(-1, OK, 90)));
}
Expand Down
Loading

0 comments on commit 1ad8952

Please sign in to comment.