diff --git a/src/exams/Finish.tsx b/src/exams/Finish.tsx index 398ff06c..3fd06f87 100644 --- a/src/exams/Finish.tsx +++ b/src/exams/Finish.tsx @@ -41,6 +41,7 @@ interface Props { user: User; modules: Module[]; scores: Score[]; + practiceScores: Score[] information: { timeSpent?: number; inactivity?: number; @@ -52,9 +53,10 @@ interface Props { destination?: string } -export default function Finish({ user, scores, modules, information, solutions, isLoading, assignment, onViewResults, destination }: Props) { +export default function Finish({ user, practiceScores, scores, modules, information, solutions, isLoading, assignment, onViewResults, destination }: Props) { const [selectedModule, setSelectedModule] = useState(modules[0]); const [selectedScore, setSelectedScore] = useState(scores.find((x) => x.module === modules[0])!); + const [selectedPracticeScore, setSelectedPracticeScore] = useState(practiceScores.find((x) => x.module === modules[0])); const [isExtraInformationOpen, setIsExtraInformationOpen] = useState(false); const aiUsage = Math.round(ai_usage(solutions) * 100); @@ -231,7 +233,7 @@ export default function Finish({ user, scores, modules, information, solutions, {!isLoading && !(assignment && !assignment.released) && (
{moduleResultText(selectedModule, bandScore)} -
+
-
+
{selectedScore.correct.toString().padStart(2, "0")} - Correct + Correct (Graded)
-
+
{(selectedScore.total - selectedScore.correct).toString().padStart(2, "0")} - Wrong + Wrong (Graded)
+ {selectedPracticeScore && ( +
+
+
+ + {selectedPracticeScore.correct} / {selectedScore.total} + + Practice Questions +
+
+ )}
) : (
diff --git a/src/pages/(exam)/ExamPage.tsx b/src/pages/(exam)/ExamPage.tsx index c01fd682..09bc241c 100644 --- a/src/pages/(exam)/ExamPage.tsx +++ b/src/pages/(exam)/ExamPage.tsx @@ -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)} /> ); }