Updated the Finish screen to also show the practice score

This commit is contained in:
Tiago Ribeiro
2024-11-25 10:32:15 +00:00
parent e5087d4d58
commit 55a03b283f
2 changed files with 22 additions and 8 deletions

View File

@@ -380,7 +380,7 @@ export default function ExamPage({ page, user, destination = "/", hideSidebar =
setQuestionIndex(0);
};
const aggregateScoresByModule = (): {
const aggregateScoresByModule = (isPractice?: boolean): {
module: Module;
total: number;
missing: number;
@@ -416,7 +416,7 @@ export default function ExamPage({ page, user, destination = "/", hideSidebar =
},
};
userSolutions.filter(x => !x.isPractice).forEach((x) => {
userSolutions.filter(x => isPractice ? x.isPractice : !x.isPractice).forEach((x) => {
const examModule =
x.module || (x.type === "writing" ? "writing" : x.type === "speaking" || x.type === "interactiveSpeaking" ? "speaking" : undefined);
@@ -483,6 +483,7 @@ export default function ExamPage({ page, user, destination = "/", hideSidebar =
setExam(exams[0]);
}}
scores={aggregateScoresByModule()}
practiceScores={aggregateScoresByModule(true)}
/>
);
}