From 383f1964436efcc5e85005c9c78a5067dfd1bc8e Mon Sep 17 00:00:00 2001 From: Ashar Fuadi Date: Mon, 19 Aug 2024 22:18:21 +0700 Subject: [PATCH] client: beautify score details --- .../Programming/SubmissionDetails.jsx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/judgels-client/src/components/SubmissionDetails/Programming/SubmissionDetails.jsx b/judgels-client/src/components/SubmissionDetails/Programming/SubmissionDetails.jsx index f07020aa0..69d161f79 100644 --- a/judgels-client/src/components/SubmissionDetails/Programming/SubmissionDetails.jsx +++ b/judgels-client/src/components/SubmissionDetails/Programming/SubmissionDetails.jsx @@ -91,6 +91,16 @@ export function SubmissionDetails({ ); }; + const renderScore = score => { + if (score.startsWith('*')) { + return '✓' + score.substring(1); + } + if (score.startsWith('X')) { + return '✕' + score.substring(1); + } + return score; + }; + const renderSubtaskResults = () => { if (!hasSubtasks) { return null; @@ -136,7 +146,7 @@ export function SubmissionDetails({ {renderExecutionTime(testCaseResult)} {renderExecutionMemory(testCaseResult)} - {testCaseResult.score} + {renderScore(testCaseResult.score)} ); }) @@ -200,7 +210,7 @@ export function SubmissionDetails({ {renderExecutionTime(result)} {renderExecutionMemory(result)} - {result.score} + {renderScore(result.score)} ))} @@ -257,7 +267,7 @@ export function SubmissionDetails({ {renderExecutionTime(result)} {renderExecutionMemory(result)} - {result.score} + {renderScore(result.score)} )); })}