Skip to content

Commit

Permalink
Merge pull request #35 from team-inu/development
Browse files Browse the repository at this point in the history
Update excel format and theme
  • Loading branch information
eltfshr committed Jun 23, 2024
2 parents 9741a60 + fb2d307 commit c142b5e
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 10 deletions.
62 changes: 58 additions & 4 deletions app/(main)/course/[id]/setting/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const SettingPage = () => {

type WeeklyPlanSheet = {
assignments: {
lecture: number;
lecture: string;
topics: string;
clo: string;
assessment: string;
Expand All @@ -106,6 +106,7 @@ const SettingPage = () => {
score: number;
description: string;
assessmentType: string;
learningActivity: string;
}[];
};

Expand Down Expand Up @@ -136,7 +137,7 @@ const SettingPage = () => {
poSheetData.course.id,
poSheetData.course.title,
poSheetData.course.curriculum,
poSheetData.course.semester,
poSheetData.course.semester.split('/')[1],
poSheetData.course.academicYear,
poSheetData.course.graduateYear,
poSheetData.course.programYear,
Expand Down Expand Up @@ -170,10 +171,42 @@ const SettingPage = () => {
}),
rows: poSheetData.thresholds.map((e) => [e.name, e.description, e.value]),
});
poSheet.columns = [
{ width: 25 },
{ width: 72 },
{ width: 16 },
{ width: 15 },
{ width: 17 },
{ width: 17 },
{ width: 18 },
];
poSheet.properties.defaultRowHeight = 20;

// student sheet

workbook.addWorksheet('(IN) StudentList');
const studentSheet = workbook.addWorksheet('(IN) StudentList');
studentSheet.addTable({
name: 'student_list',
ref: `A1`,
columns: ['Seq No.', 'Student Code', 'Student Name'].map((e) => {
return { name: e };
}),

rows: Array.from(rawScoreSheetData.scoreByAssignmentByStudent.entries()).map(
([student, scoreByAssignment], index) => {
// return [
// student,
// 'NO_DATA',
// ...Array.from(scoreByAssignment.values()).map((score) => {
// return score;
// }),
// ];
return [index + 1, student, 'NO_DATA'];
},
),
});
studentSheet.columns = [{ width: 10 }, { width: 19 }, { width: 40 }];
studentSheet.properties.defaultRowHeight = 15;

// weekly plan sheet

Expand All @@ -192,6 +225,7 @@ const SettingPage = () => {
'Raw full score',
'Description',
'AssessmentType',
'Learning Activity',
].map((e) => {
return { name: e };
}),
Expand All @@ -206,8 +240,23 @@ const SettingPage = () => {
e.score,
e.description,
e.assessmentType,
e.learningActivity,
]),
});
weeklyPlanSheet.columns = [
{ width: 11 },
{ width: 33 },
{ width: 8 },
{ width: 16 },
{ width: 12 },
{ width: 10 },
{ width: 20 },
{ width: 17 },
{ width: 34 },
{ width: 20 },
{ width: 40 },
];
weeklyPlanSheet.properties.defaultRowHeight = 15;

const assignmentNames: string[] = [];

Expand All @@ -221,11 +270,13 @@ const SettingPage = () => {
// rawScoreSheetData.scoreByAssignmentByStudent.entries();

// raw score sheet
let rawScoreColumns = [{ width: 15 }, { width: 31 }];
const rawScoreSheet = workbook.addWorksheet('(IN) RawScores');
rawScoreSheet.addTable({
name: 'raw_score',
ref: `A1`,
columns: ['ID', 'Name', ...assignmentNames].map((e) => {
rawScoreColumns.push({ width: 7 });
return { name: e };
}),

Expand All @@ -242,6 +293,8 @@ const SettingPage = () => {
},
),
});
rawScoreSheet.columns = rawScoreColumns;
rawScoreSheet.properties.defaultRowHeight = 15;

workbook.addWorksheet('Course Catalogue');
workbook.addWorksheet('Assessment techniques');
Expand Down Expand Up @@ -342,7 +395,7 @@ const SettingPage = () => {
}

return {
lecture: i + 1,
lecture: 'NO_DATA',
topics: e.description,
clo: e.courseLearningOutcomes[0].code,
assessment: assignmentGroup.name,
Expand All @@ -352,6 +405,7 @@ const SettingPage = () => {
score: e.maxScore,
description: 'NO_DATA',
assessmentType: 'NO_DATA',
learningActivity: 'NO_DATA',
};
}),
};
Expand Down
2 changes: 1 addition & 1 deletion components/features/course/enrollment/enrollment-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export function EnrollmentDataTable<TData, TValue>({
<TableCell key={cell.id}>{flexRender(cell.column.columnDef.cell, cell.getContext())}</TableCell>
))}
</TableRow>
<CollapsibleContent asChild className="bg-black">
<CollapsibleContent asChild className="bg-secondary/20">
<tr>
<CollapsibleRowContent studentId={row.getValue('studentId')} />
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const CommentCourse = () => {
<div className="space-y-5 p-5 ">
<div className="text-lg font-semibold">Comments form others course</div>
<div className="h-[500px] overflow-y-auto scrollbar scrollbar-thumb-primary ">
<div className="space-y-6 rounded-md bg-black p-5 py-0">
<div className="space-y-6 rounded-md bg-secondary/20 p-5 py-0">
{courseStreams?.map((e, i) => {
return <CommentCard key={i} comment={e.comment} streamType={e.streamType} courseId={e.targetCourseId} />;
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const CommentHistory = () => {
<div className="space-y-5 p-5 ">
<div className="text-lg font-semibold">History</div>
<div className="h-[500px] overflow-y-auto scrollbar scrollbar-thumb-primary ">
<div className="space-y-6 rounded-md bg-black p-5 py-0">
<div className="space-y-6 rounded-md bg-secondary/20 p-5 py-0">
{historyCourseStreams ? (
historyCourseStreams?.map((e, i) => {
return (
Expand Down
2 changes: 1 addition & 1 deletion components/features/student/student-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ export function StudentDataTable<TData, TValue>({ columns, data }: DataTableProp
<TableCell key={cell.id}>{flexRender(cell.column.columnDef.cell, cell.getContext())}</TableCell>
))}
</TableRow>
<CollapsibleContent asChild className="bg-black">
<CollapsibleContent asChild className="bg-secondary/20">
<tr>
<CollapsibleRowContent studentId={row.getValue('id')} />
</tr>
Expand Down
2 changes: 1 addition & 1 deletion components/features/tabee/plo/plo-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export function ProgramLearningOutcomeDataTable<TData, TValue>({
<TableCell key={cell.id}>{flexRender(cell.column.columnDef.cell, cell.getContext())}</TableCell>
))}
</TableRow>
<CollapsibleContent asChild className="bg-black">
<CollapsibleContent asChild className="bg-secondary/20">
<tr>
<CollapsibleRowContent ploId={row.getValue('id')} />
</tr>
Expand Down
2 changes: 1 addition & 1 deletion components/features/user/user-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export function UserDataTable<TData extends UserColumn, TValue>({ columns, data
<TableCell key={cell.id}>{flexRender(cell.column.columnDef.cell, cell.getContext())}</TableCell>
))}
</TableRow>
<CollapsibleContent asChild className="bg-black">
<CollapsibleContent asChild className="bg-secondary/20">
<tr>
<CollapsibleRowContent userId={row.getValue('id')} />
</tr>
Expand Down
Binary file modified public/template/CPE_course_import_template.xlsx
Binary file not shown.

0 comments on commit c142b5e

Please sign in to comment.