Updated the score to be reflective of the ungraded questions

This commit is contained in:
Tiago Ribeiro
2024-11-19 16:21:08 +00:00
parent bb24fe3c6d
commit e6d77af53f
2 changed files with 38 additions and 37 deletions

View File

@@ -19,15 +19,16 @@ import { uniqBy } from "lodash";
import { useRouter } from "next/router";
import { getSessionByAssignment, getSessionsByUser } from "@/utils/sessions.be";
import { Session } from "@/hooks/useSessions";
import moment from "moment";
import { activeAssignmentFilter } from "@/utils/assignments";
import { checkAccess } from "@/utils/permissions";
export const getServerSideProps = withIronSessionSsr(async ({ req, res, query }) => {
const user = await requestUser(req, res)
const loginDestination = Buffer.from(req.url || "/").toString("base64")
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 destinationURL = !!destination ? Buffer.from(destination, 'base64').toString() : undefined