- Adapted more of the design to be more responsive;

- Revamped some of the UserSolutions;
- Transformed the homepage chart to use actual dynamic values;
- Created an endpoint for the stats;
This commit is contained in:
Tiago Ribeiro
2023-04-20 00:20:20 +01:00
parent d61592b73e
commit 87f7b717fc
22 changed files with 5468 additions and 829 deletions

View File

@@ -80,7 +80,7 @@ export default function Reading({exam, showSolutions = false, onFinish}: Props)
const nextExercise = (solution?: UserSolution) => {
if (solution) {
setUserSolutions((prev) => [...prev.filter((x) => x.id !== solution.id), solution]);
setUserSolutions((prev) => [...prev.filter((x) => x.exercise !== solution.exercise), solution]);
}
if (exerciseIndex + 1 < exam.exercises.length) {
@@ -89,7 +89,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", exam: exam.id})));
onFinish(
[...userSolutions.filter((x) => x.exercise !== solution.exercise), solution].map((x) => ({...x, module: "reading", exam: exam.id})),
);
} else {
onFinish(userSolutions.map((x) => ({...x, module: "reading", exam: exam.id})));
}