Updated the writing exam to work based on exercises instead of just a single one

This commit is contained in:
Tiago Ribeiro
2023-04-17 13:03:48 +01:00
parent 5df816c73c
commit 207328dade
9 changed files with 359 additions and 74 deletions

View File

@@ -99,9 +99,9 @@ export default function Reading({exam, showSolutions = false, onFinish}: Props)
}
if (solution) {
onFinish([...userSolutions.filter((x) => x.id !== solution.id), solution].map((x) => ({...x, module: "reading"})));
onFinish([...userSolutions.filter((x) => x.id !== solution.id), solution].map((x) => ({...x, module: "reading", exam: exam.id})));
} else {
onFinish(userSolutions.map((x) => ({...x, module: "reading"})));
onFinish(userSolutions.map((x) => ({...x, module: "reading", exam: exam.id})));
}
};