Updated the Listening format to work

This commit is contained in:
Tiago Ribeiro
2023-09-29 13:56:11 +01:00
parent 2a68d37de8
commit 782976c14f
6 changed files with 57 additions and 23 deletions

View File

@@ -137,7 +137,7 @@ export default function Page() {
};
const updateExamWithUserSolutions = (exam: Exam): Exam => {
if (exam.module === "reading") {
if (exam.module === "reading" || exam.module === "listening") {
const parts = exam.parts.map((p) =>
Object.assign(p, {
exercises: p.exercises.map((x) => Object.assign(x, {userSolutions: userSolutions.find((y) => x.id === y.exercise)?.solutions})),