Added Student ID to the Master Statistical
This commit is contained in:
@@ -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