Updated the Listening format to work
This commit is contained in:
@@ -45,8 +45,8 @@ export default function ExamList() {
|
||||
router.push("/exercises");
|
||||
};
|
||||
|
||||
const getTotalExercises = (exam: Exam, module: Module) => {
|
||||
if (exam.module === "reading") {
|
||||
const getTotalExercises = (exam: Exam) => {
|
||||
if (exam.module === "reading" || exam.module === "listening") {
|
||||
return exam.parts.flatMap((x) => x.exercises).length;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ export default function ExamList() {
|
||||
header: "Module",
|
||||
cell: (info) => <span className={CLASSES[info.getValue()]}>{capitalize(info.getValue())}</span>,
|
||||
}),
|
||||
columnHelper.accessor((x) => getTotalExercises(x, x.module), {
|
||||
columnHelper.accessor((x) => getTotalExercises(x), {
|
||||
header: "Exercises",
|
||||
cell: (info) => info.getValue(),
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user