Added Student ID to the Master Statistical
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import React, {useEffect, useMemo, useState} from "react";
|
||||
import {CorporateUser, User} from "@/interfaces/user";
|
||||
import {CorporateUser, StudentUser, User} from "@/interfaces/user";
|
||||
import {BsFileExcel, BsBank, BsPersonFill} from "react-icons/bs";
|
||||
import IconCard from "../IconCard";
|
||||
|
||||
@@ -163,6 +163,13 @@ const MasterStatistical = (props: Props) => {
|
||||
return <span>{info.getValue()}</span>;
|
||||
},
|
||||
}),
|
||||
columnHelper.accessor("user", {
|
||||
header: "Student ID",
|
||||
id: "studentID",
|
||||
cell: (info) => {
|
||||
return <span>{(info.getValue() as StudentUser).studentID || "N/A"}</span>;
|
||||
},
|
||||
}),
|
||||
...(displaySelection
|
||||
? [
|
||||
columnHelper.accessor("corporate", {
|
||||
@@ -347,7 +354,7 @@ const MasterStatistical = (props: Props) => {
|
||||
</div>
|
||||
{renderSearch()}
|
||||
<div className="flex flex-col gap-3 justify-end">
|
||||
<Button className="max-w-[200px] h-[70px]" variant="outline" isLoading={downloading} onClick={triggerDownload}>
|
||||
<Button className="w-[200px] h-[70px]" variant="outline" isLoading={downloading} onClick={triggerDownload}>
|
||||
Download
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -11,7 +11,7 @@ import {checkAccess} from "@/utils/permissions";
|
||||
import {getAssignmentsForCorporates} from "@/utils/assignments.be";
|
||||
import {search} from "@/utils/search";
|
||||
import {getGradingSystem} from "@/utils/grading.be";
|
||||
import {User} from "@/interfaces/user";
|
||||
import {StudentUser, User} from "@/interfaces/user";
|
||||
import {calculateBandScore, getGradingLabel} from "@/utils/score";
|
||||
import {Module} from "@/interfaces";
|
||||
|
||||
@@ -19,6 +19,7 @@ export default withIronSessionApiRoute(handler, sessionOptions);
|
||||
|
||||
interface TableData {
|
||||
user: string;
|
||||
studentID: string;
|
||||
email: string;
|
||||
correct: number;
|
||||
corporate: string;
|
||||
@@ -109,10 +110,10 @@ async function post(req: NextApiRequest, res: NextApiResponse) {
|
||||
const total = userStats.reduce((n, e) => n + e.score.total, 0);
|
||||
const {label: level, score} = getGradingSystemHelper(a.exams, a.assigner, userData!, correct, total);
|
||||
|
||||
console.log("Level", level);
|
||||
const commonData = {
|
||||
user: userData?.name || "",
|
||||
email: userData?.email || "",
|
||||
studentID: (userData as StudentUser).studentID || "",
|
||||
userId: assignee,
|
||||
corporateId: a.corporateId,
|
||||
corporate: corporateUser?.name || "",
|
||||
@@ -164,6 +165,10 @@ async function post(req: NextApiRequest, res: NextApiResponse) {
|
||||
label: "Email",
|
||||
value: (entry: TableData) => entry.email,
|
||||
},
|
||||
{
|
||||
label: "Student ID",
|
||||
value: (entry: TableData) => entry.studentID,
|
||||
},
|
||||
...(displaySelection
|
||||
? [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user