printProperty(report, "Login", account.getLogin());
report.append("\n\n");
printDelimiter(report);
for (Task task : contest.getTasks()) {
AccumulatedGrade testResults = graderManager.getResult(contest.getId(), account
.getLogin(), task);
report.append(String.format("Task %-10s %#3s out of 100\n",
task.getName() + ":",
testResults.getTotal()));
}
report.append("-------------------------------\n");
BigDecimal totalScore = calculateTotalScore(account);
report.append(String.format("Total score: %#3s out of %#3s\n", totalScore, contest
.getTasks().size() * 100));
printDelimiter(report);
report.append("\n\n\nLegend:\n"
+ "TL - Time Limit Exceeded\n"
+ "RE - Run-time Error (including limit violation)\n"
+ "WA - Wrong Answer\n"
+ "PC - Partial Credit\n"
+ "OK - Correct\n");
for (Task task : contest.getTasks()) {
AccumulatedGrade testResults = graderManager.getResult(contest.getId(), account
.getLogin(), task);
report.append("\n\n\n");
printDelimiter(report);
printName(report, person);
printProperty(report, "Task", task.getName());
report.append("\n");
if (task.getType() != Task.PROBLEM_TYPE_OUTPUT
&& "-".equals(testResults.getTestCases().get(0))) {
report.append("No valid submission.\n");
printDelimiter(report);
continue;
}
report.append("Test group | Score | Max Score | Individual test results\n");
report.append("-----------+-------+-----------+-------------------------\n");
List<TestGroup> testGroups = task.getTestGroups();
for (int index = 0; index < testGroups.size(); index++) {
report.append(String.format("%#6s |", index + 1));
TestGroup group = testGroups.get(index);
List<String> testCases = testResults.getTestCases();
report.append(String.format(" %#3s |", getNumericValue(testResults
.getTestGroups().get(index))));
report.append(String.format(" %#3s |", group.getPoints()));
for (int testIndex : group.getTestCases()) {
report.append(" ");
report.append(toTwoLetterCode(testCases.get(testIndex - 1), group.getPoints()));
report.append(" ");
}
report.append("\n");
}
report.append("-----------+-------+-----------+-------------------------\n");
report.append(String.format(" TOTAL | %#3s | 100 |\n", testResults
.getTotal()));
printDelimiter(report);
}
report.append("\n\n");