Updated the score to be reflective of the ungraded questions
This commit is contained in:
@@ -159,7 +159,7 @@ export default function AssignmentView({user, users, entity, assignment}: Props)
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
stats.forEach((x) => {
|
stats.filter(x => !x.isPractice).forEach((x) => {
|
||||||
scores[x.module!] = {
|
scores[x.module!] = {
|
||||||
total: scores[x.module!].total + x.score.total,
|
total: scores[x.module!].total + x.score.total,
|
||||||
correct: scores[x.module!].correct + x.score.correct,
|
correct: scores[x.module!].correct + x.score.correct,
|
||||||
|
|||||||
@@ -19,15 +19,16 @@ import { uniqBy } from "lodash";
|
|||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { getSessionByAssignment, getSessionsByUser } from "@/utils/sessions.be";
|
import { getSessionByAssignment, getSessionsByUser } from "@/utils/sessions.be";
|
||||||
import { Session } from "@/hooks/useSessions";
|
import { Session } from "@/hooks/useSessions";
|
||||||
import moment from "moment";
|
|
||||||
import { activeAssignmentFilter } from "@/utils/assignments";
|
import { activeAssignmentFilter } from "@/utils/assignments";
|
||||||
|
import { checkAccess } from "@/utils/permissions";
|
||||||
|
|
||||||
export const getServerSideProps = withIronSessionSsr(async ({ req, res, query }) => {
|
export const getServerSideProps = withIronSessionSsr(async ({ req, res, query }) => {
|
||||||
const user = await requestUser(req, res)
|
const user = await requestUser(req, res)
|
||||||
const loginDestination = Buffer.from(req.url || "/").toString("base64")
|
const loginDestination = Buffer.from(req.url || "/").toString("base64")
|
||||||
if (!user) return redirect(`/login?destination=${loginDestination}`)
|
if (!user) return redirect(`/login?destination=${loginDestination}`)
|
||||||
|
|
||||||
if (shouldRedirectHome(user)) return redirect("/")
|
if (shouldRedirectHome(user) || checkAccess(user, ["corporate", "mastercorporate"]))
|
||||||
|
return redirect("/")
|
||||||
|
|
||||||
const { assignment: assignmentID, destination } = query as { assignment?: string, destination?: string }
|
const { assignment: assignmentID, destination } = query as { assignment?: string, destination?: string }
|
||||||
const destinationURL = !!destination ? Buffer.from(destination, 'base64').toString() : undefined
|
const destinationURL = !!destination ? Buffer.from(destination, 'base64').toString() : undefined
|
||||||
|
|||||||
Reference in New Issue
Block a user