From 071decf25b847627bbf434dc42f9797a5a7d964a Mon Sep 17 00:00:00 2001 From: Ashar Fuadi Date: Thu, 9 May 2024 15:05:37 +0700 Subject: [PATCH] fix(client): correctly show multiple test group results on problem without subtasks (#621) --- .../Programming/SubmissionDetails.jsx | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/judgels-client/src/components/SubmissionDetails/Programming/SubmissionDetails.jsx b/judgels-client/src/components/SubmissionDetails/Programming/SubmissionDetails.jsx index 67df574b1..dc95242e8 100644 --- a/judgels-client/src/components/SubmissionDetails/Programming/SubmissionDetails.jsx +++ b/judgels-client/src/components/SubmissionDetails/Programming/SubmissionDetails.jsx @@ -123,9 +123,6 @@ export function SubmissionDetails({ {latestGrading.details.testDataResults.map(testGroupResult => testGroupResult.testCaseResults.map((testCaseResult, testCaseIdx) => { - if (testCaseResult.subtaskIds.indexOf(subtaskResult.id) < 0) { - return null; - } const testCaseId = `${testGroupResult.id}_${testCaseIdx + 1}`; return ( @@ -244,17 +241,22 @@ export function SubmissionDetails({ - {details.testDataResults[1].testCaseResults.map((result, idx) => ( - - {idx + 1} - - - - {renderExecutionTime(result)} - {renderExecutionMemory(result)} - {result.score} - - ))} + {details.testDataResults.map((testGroupResult, testGroupIdx) => { + if (testGroupIdx === 0) { + return null; + } + return testGroupResult.testCaseResults.map((result, idx) => ( + + {`${testGroupIdx === 1 ? '' : testGroupIdx + '_'}${idx + 1}`} + + + + {renderExecutionTime(result)} + {renderExecutionMemory(result)} + {result.score} + + )); + })}