Removed redirection from the official-exam to records
This commit is contained in:
@@ -86,7 +86,6 @@ export default function AssignmentCard({ user, assignment, session, startAssignm
|
|||||||
)}
|
)}
|
||||||
{assignment.results.map((r) => r.user).includes(user.id) && (
|
{assignment.results.map((r) => r.user).includes(user.id) && (
|
||||||
<Button
|
<Button
|
||||||
onClick={() => router.push("/record")}
|
|
||||||
color="green"
|
color="green"
|
||||||
className="-md:hidden h-full w-full max-w-[50%] !rounded-xl"
|
className="-md:hidden h-full w-full max-w-[50%] !rounded-xl"
|
||||||
variant="outline">
|
variant="outline">
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ 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 moment from "moment";
|
||||||
|
import { activeAssignmentFilter } from "@/utils/assignments";
|
||||||
|
|
||||||
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)
|
||||||
@@ -69,7 +70,7 @@ export default function Page({ user, assignment, exams = [], destinationURL = "/
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (assignment && exams.length > 0 && !state.assignment && !session) {
|
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.setUserSolutions([]);
|
||||||
state.setShowSolutions(false);
|
state.setShowSolutions(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user