Updatd UI to display the unique tests for each user in an assignment
This commit is contained in:
@@ -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) {
|
||||
<div className="flex justify-between w-full items-center">
|
||||
<div className="grid grid-cols-2 gap-2 place-items-center justify-center w-fit min-w-[104px] -md:mt-2">
|
||||
{assignment.exams
|
||||
.filter((e) => e.assignee === user.id)
|
||||
.map((e) => e.module)
|
||||
.sort(sortByModuleName)
|
||||
.map((module) => (
|
||||
|
||||
Reference in New Issue
Block a user