Updated the Level Exam to work based on Parts

This commit is contained in:
Tiago Ribeiro
2024-06-07 13:25:18 +01:00
parent 8ea97ee944
commit daec246835
15 changed files with 176 additions and 121 deletions

View File

@@ -69,7 +69,7 @@ export const getExamById = async (module: Module, id: string): Promise<Exam | un
};
export const defaultExamUserSolutions = (exam: Exam) => {
if (exam.module === "reading" || exam.module === "listening")
if (exam.module === "reading" || exam.module === "listening" || exam.module === "level")
return exam.parts.flatMap((x) => x.exercises).map((x) => defaultUserSolutions(x, exam));
return exam.exercises.map((x) => defaultUserSolutions(x, exam));