From e779a82e56fbb7a02c32389c817d854e4342a08e 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..67ac24017 100644 --- a/judgels-client/src/components/SubmissionDetails/Programming/SubmissionDetails.jsx +++ b/judgels-client/src/components/SubmissionDetails/Programming/SubmissionDetails.jsx @@ -136,7 +136,7 @@ export function SubmissionDetails({ {renderExecutionTime(testCaseResult)} {renderExecutionMemory(testCaseResult)} - {testCaseResult.score} + {renderScore(testCaseResult.score)} ); }) @@ -200,7 +200,7 @@ export function SubmissionDetails({ {renderExecutionTime(result)} {renderExecutionMemory(result)} - {result.score} + {renderScore(result.score)} ))} @@ -257,7 +257,7 @@ export function SubmissionDetails({ {renderExecutionTime(result)} {renderExecutionMemory(result)} - {result.score} + {renderScore(result.score)} )); })} @@ -381,6 +381,16 @@ export function SubmissionDetails({ ); }; + const renderScore = score => { + if (score.startsWith('*')) { + return '✓' + score.substring(1); + } + if (score.startsWith('X')) { + return '✕' + score.substring(1); + } + return score; + } + return (
{renderGeneralInfo()}