diff --git a/src/app/dashboard/tools/exam-seating/exam/new/_components/PDFgen.tsx b/src/app/dashboard/tools/exam-seating/exam/new/_components/PDFgen.tsx index f92563c..692003b 100644 --- a/src/app/dashboard/tools/exam-seating/exam/new/_components/PDFgen.tsx +++ b/src/app/dashboard/tools/exam-seating/exam/new/_components/PDFgen.tsx @@ -265,7 +265,7 @@ export function GenerateSeatArrangements({ - Normal + Default Reg Number Admn Number Roll Number @@ -418,6 +418,12 @@ const hallschema = z.object({ showBatchName: z.boolean(), }); +const defaultHallValues = { + alignment: "portrait", + nameSelect: "regNo", + title: "", + showBatchName: true, +}; export function GenerateHallsAssignment({ seats, }: { @@ -437,17 +443,18 @@ export function GenerateHallsAssignment({ [seats] ); const [instance, updateInstance] = usePDF({ - document: , + document: ( + + ), }); const form = useForm>({ resolver: zodResolver(hallschema), - defaultValues: { - alignment: "portrait", - nameSelect: "regNo", - title: "", - showBatchName: true, - }, + defaultValues: defaultHallValues, }); function onSubmit(data: z.infer) { @@ -532,7 +539,7 @@ export function GenerateHallsAssignment({ - Normal + Default Reg Number Admn Number Roll Number @@ -764,6 +771,20 @@ function HallArrangementPDF({ ); } +const defaultAtValues = { + alignment: "portrait", + nameSelect: "regNo", + title: "", + showAddSheetCount: true, + showAlphaCode: true, +}; +const atschema = z.object({ + alignment: z.string(), + title: z.string().min(0).optional(), + nameSelect: z.string(), + showAddSheetCount: z.boolean(), + showAlphaCode: z.boolean(), +}); export function GenerateAttendanceSheet({ seats, @@ -771,20 +792,15 @@ export function GenerateAttendanceSheet({ seats: ArrangedResult[]; }) { const [instance, updateInstance] = usePDF({ - document: , + document: , }); - const form = useForm>({ - resolver: zodResolver(hallschema), - defaultValues: { - alignment: "portrait", - nameSelect: "regNo", - title: "", - showBatchName: true, - }, + const form = useForm>({ + resolver: zodResolver(atschema), + defaultValues: defaultAtValues, }); - function onSubmit(data: z.infer) { + function onSubmit(data: z.infer) { updateInstance(); } @@ -864,7 +880,7 @@ export function GenerateAttendanceSheet({ - Normal + Default Reg Number Admn Number Roll Number @@ -882,13 +898,35 @@ export function GenerateAttendanceSheet({ /> (
- Show batch name + Show Additional Sheets - Display batch name on top of each student list + Display a column for Additional sheets count + +
+ + + +
+ )} + /> + ( + +
+ Show Alpha Code + + Display a column for writing alpha code, (Used for + public examinations)
@@ -949,11 +987,18 @@ const atsheetStyle = StyleSheet.create({ tableCol: { borderRightWidth: 1, paddingVertical: 5, - fontSize: 12, + fontSize: 11, flexShrink: 0, borderRightColor: "#000", }, - tableblankCol: {}, + signContainer: { + display: "flex", + flexDirection: "row", + justifyContent: "flex-end", + fontSize: 10, + paddingHorizontal: 30, + paddingTop: 50, + }, }); function AttendanceSheetPDF({ @@ -961,7 +1006,7 @@ function AttendanceSheetPDF({ options, }: { seats: ArrangedResult[]; - options?: z.infer; + options?: z.infer; }) { return ( @@ -978,6 +1023,10 @@ function AttendanceSheetPDF({ {options?.title} )} + + {/* Hall Details */} + {hall.hallName} + Attendance Sheet @@ -990,6 +1039,8 @@ function AttendanceSheetPDF({ width: "30px", textAlign: "center", fontSize: 10, + fontWeight: "bold", + height: "100%", }} > No. @@ -1002,28 +1053,46 @@ function AttendanceSheetPDF({ flexGrow: 1, height: "100%", fontSize: 10, + fontWeight: "bold", }} > Name - - Alpha Code - + {options?.showAlphaCode && ( + + Alpha Code + + )} + {options?.showAddSheetCount && ( + + Ad. Sheet + + )} @@ -1032,10 +1101,11 @@ function AttendanceSheetPDF({ @@ -1064,14 +1134,26 @@ function AttendanceSheetPDF({ > {e[options?.nameSelect as keyof typeof e] || e.name} - - {" "} - + {options?.showAlphaCode && ( + + {" "} + + )} + {options?.showAddSheetCount && ( + + {" "} + + )} @@ -1093,6 +1175,9 @@ function AttendanceSheetPDF({ ); })} + + Sign and designation of Invigilator +