From 5c4812dcf4b475cb8ed874c4ba6feea0bd1e2e31 Mon Sep 17 00:00:00 2001 From: Tom <20648924+moT01@users.noreply.github.com> Date: Thu, 6 Nov 2025 03:27:04 -0600 Subject: [PATCH] fix(client): exam prerequisites list (#63582) --- client/src/templates/Challenges/exam-download/show.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/client/src/templates/Challenges/exam-download/show.tsx b/client/src/templates/Challenges/exam-download/show.tsx index 61052800cab..f220fad4542 100644 --- a/client/src/templates/Challenges/exam-download/show.tsx +++ b/client/src/templates/Challenges/exam-download/show.tsx @@ -66,7 +66,7 @@ interface ShowExamDownloadProps { function ShowExamDownload({ data: { challengeNode: { - challenge: { id, title, translationPending } + challenge: { id, superBlock: examSuperBlock, title, translationPending } }, allChallengeNode: { nodes } }, @@ -168,8 +168,10 @@ function ShowExamDownload({ const unmetPrerequisites = exam?.prerequisites?.filter( prereq => !completedChallenges.some(challenge => challenge.id === prereq) ); - const challenges = nodes.filter(({ challenge }) => - unmetPrerequisites?.includes(challenge.id) + const challenges = nodes.filter( + ({ challenge }) => + unmetPrerequisites?.includes(challenge.id) && + challenge.superBlock === examSuperBlock ); const missingPrerequisites = challenges.map(({ challenge }) => { return { @@ -274,6 +276,7 @@ export const query = graphql` challengeNode(id: { eq: $id }) { challenge { id + superBlock title translationPending } @@ -286,6 +289,7 @@ export const query = graphql` fields { slug } + superBlock } } }