Removed redirection from the official-exam to records
This commit is contained in:
@@ -20,6 +20,7 @@ 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";
|
||||
|
||||
export const getServerSideProps = withIronSessionSsr(async ({ req, res, query }) => {
|
||||
const user = await requestUser(req, res)
|
||||
@@ -69,7 +70,7 @@ export default function Page({ user, assignment, exams = [], destinationURL = "/
|
||||
|
||||
useEffect(() => {
|
||||
if (assignment && exams.length > 0 && !state.assignment && !session) {
|
||||
if ((moment(assignment.startDate).isAfter(moment()) || moment(assignment.endDate).isBefore(moment())) && assignment.start) return
|
||||
if (!activeAssignmentFilter(assignment)) return
|
||||
|
||||
state.setUserSolutions([]);
|
||||
state.setShowSolutions(false);
|
||||
|
||||
Reference in New Issue
Block a user