Updated the counter of exercises

This commit is contained in:
Tiago Ribeiro
2023-10-15 22:54:40 +01:00
parent 18e12db7c5
commit f51dc450b9
7 changed files with 24 additions and 7 deletions

View File

@@ -18,6 +18,7 @@ import Button from "@/components/Low/Button";
import BlankQuestionsModal from "@/components/BlankQuestionsModal";
import useExamStore from "@/stores/examStore";
import {defaultUserSolutions} from "@/utils/exams";
import {countExercises} from "@/utils/moduleUtils";
interface Props {
exam: ReadingExam;
@@ -209,7 +210,7 @@ export default function Reading({exam, showSolutions = false, onFinish}: Props)
) || 0) + (exerciseIndex === -1 ? 0 : 1)
}
module="reading"
totalExercises={exam.parts.flatMap((x) => x.exercises).length}
totalExercises={countExercises(exam.parts.flatMap((x) => x.exercises))}
disableTimer={showSolutions}
label={exerciseIndex === -1 ? undefined : convertCamelCaseToReadable(exam.parts[partIndex].exercises[exerciseIndex].type)}
/>