From f48885bba66eeffe6060e974a691cc484948098b Mon Sep 17 00:00:00 2001 From: Joao Ramos Date: Thu, 7 Dec 2023 18:23:44 +0000 Subject: [PATCH] Updatd UI to display the unique tests for each user in an assignment --- src/dashboards/Student.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dashboards/Student.tsx b/src/dashboards/Student.tsx index d93a0780..ec67cff7 100644 --- a/src/dashboards/Student.tsx +++ b/src/dashboards/Student.tsx @@ -38,7 +38,7 @@ export default function StudentDashboard({user}: Props) { const setAssignment = useExamStore((state) => state.setAssignment); const startAssignment = (assignment: Assignment) => { - const examPromises = assignment.exams.map((e) => getExamById(e.module, e.id)); + const examPromises = assignment.exams.filter((e) => e.assignee === user.id).map((e) => getExamById(e.module, e.id)); Promise.all(examPromises).then((exams) => { if (exams.every((x) => !!x)) { @@ -121,6 +121,7 @@ export default function StudentDashboard({user}: Props) {
{assignment.exams + .filter((e) => e.assignee === user.id) .map((e) => e.module) .sort(sortByModuleName) .map((module) => (