From 0fedae2f7045491420972a00e4a060900b384a36 Mon Sep 17 00:00:00 2001 From: amjed-ali-k Date: Thu, 26 Oct 2023 01:06:40 +0530 Subject: [PATCH] feat: final working model --- .../exam/new/_components/NewExamForm.tsx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/app/dashboard/tools/exam-seating/exam/new/_components/NewExamForm.tsx b/src/app/dashboard/tools/exam-seating/exam/new/_components/NewExamForm.tsx index 7aea760..aa52d1e 100644 --- a/src/app/dashboard/tools/exam-seating/exam/new/_components/NewExamForm.tsx +++ b/src/app/dashboard/tools/exam-seating/exam/new/_components/NewExamForm.tsx @@ -195,21 +195,22 @@ function GenerateSection({ subjectCode: number; examType: number; }[] = []; - + // console.log(remainingStudents); subjectCodes.map((subCode) => { if (indexes[subCode] === undefined) indexes[subCode] = 0; const count = hall[parseInt(subCode)]; - console.log( - `${count} students assigned from ${subCode} in Hall ${ogHall?.name}` - ); + // console.log( + // `${count} students assigned from ${subCode} in Hall ${ogHall?.name}, Index start from ${indexes[subCode]}` + // ); const toAdd = remainingStudents[parseInt(subCode)]?.slice( indexes[subCode], - indexes[subCode] - 1 + count + indexes[subCode] + count ); + // console.log(indexes); indexes[subCode] += count; + console.log(indexes); if (!toAdd) return; students.push(...toAdd); - indexes[subCode] ? (indexes[subCode] += count) : 0; }); if (!ogHall?.structure) return; @@ -226,7 +227,7 @@ function GenerateSection({ }; }) ); - console.log(seats); + // console.log(seats); return seats; }, [finalBatches, finalHalls]);