diff --git a/judgels-client/src/components/SubmissionDetails/Programming/SubmissionDetails.jsx b/judgels-client/src/components/SubmissionDetails/Programming/SubmissionDetails.jsx index 69d161f79..d3849f80b 100644 --- a/judgels-client/src/components/SubmissionDetails/Programming/SubmissionDetails.jsx +++ b/judgels-client/src/components/SubmissionDetails/Programming/SubmissionDetails.jsx @@ -92,15 +92,31 @@ export function SubmissionDetails({ }; const renderScore = score => { + let formattedScore = score; + if (score.startsWith('*')) { - return '✓' + score.substring(1); - } - if (score.startsWith('X')) { - return '✕' + score.substring(1); + formattedScore = '✓' + score.substring(1); + } else if (score.startsWith('X')) { + formattedScore = '✕' + score.substring(1); } return score; }; + const renderSubtaskScore = score => { + if (Number.isInteger(score)) { + return {score}; + } + + const integer = Math.trunc(score); + const decimal = (score - integer).toString().replace('0.', '.'); + return ( + <> + {integer} + {decimal} + + ); + }; + const renderSubtaskResults = () => { if (!hasSubtasks) { return null; @@ -115,7 +131,7 @@ export function SubmissionDetails({ - {subtaskResult.score} + {renderSubtaskScore(subtaskResult.score)}