Only shows results for an assignments that has been released
This commit is contained in:
@@ -11,6 +11,7 @@ import {useRouter} from "next/router";
|
||||
import {Fragment, useEffect, useState} from "react";
|
||||
import {
|
||||
BsArrowCounterclockwise,
|
||||
BsBan,
|
||||
BsBook,
|
||||
BsClipboard,
|
||||
BsClipboardFill,
|
||||
@@ -27,6 +28,7 @@ import Modal from "@/components/Modal";
|
||||
import {UserSolution} from "@/interfaces/exam";
|
||||
import ai_usage from "@/utils/ai.detection";
|
||||
import useGradingSystem from "@/hooks/useGrading";
|
||||
import {Assignment} from "@/interfaces/results";
|
||||
|
||||
interface Score {
|
||||
module: Module;
|
||||
@@ -45,10 +47,11 @@ interface Props {
|
||||
};
|
||||
solutions: UserSolution[];
|
||||
isLoading: boolean;
|
||||
assignment?: Assignment;
|
||||
onViewResults: (moduleIndex?: number) => void;
|
||||
}
|
||||
|
||||
export default function Finish({user, scores, modules, information, solutions, isLoading, onViewResults}: Props) {
|
||||
export default function Finish({user, scores, modules, information, solutions, isLoading, assignment, onViewResults}: Props) {
|
||||
const [selectedModule, setSelectedModule] = useState(modules[0]);
|
||||
const [selectedScore, setSelectedScore] = useState<Score>(scores.find((x) => x.module === modules[0])!);
|
||||
const [isExtraInformationOpen, setIsExtraInformationOpen] = useState(false);
|
||||
@@ -209,7 +212,18 @@ export default function Finish({user, scores, modules, information, solutions, i
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
{!isLoading && (
|
||||
{assignment && !assignment.released && (
|
||||
<div className="absolute left-1/2 top-1/2 flex h-fit w-fit -translate-x-1/2 -translate-y-1/2 flex-col items-center gap-12">
|
||||
{/* <span className={clsx("loading loading-infinity w-32", moduleColors[selectedModule].progress)} /> */}
|
||||
<BsBan size={64} className={clsx(moduleColors[selectedModule].progress)} />
|
||||
<span className={clsx("text-center text-2xl font-bold", moduleColors[selectedModule].progress)}>
|
||||
This exam has not yet been released by its assigner.
|
||||
<br />
|
||||
You can check it later on your records page when it is released!
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
{!isLoading && false && (
|
||||
<div className="mb-20 mt-32 flex w-full items-center justify-between gap-9">
|
||||
<span className="max-w-3xl">{moduleResultText(selectedModule, bandScore)}</span>
|
||||
<div className="flex gap-9 px-16">
|
||||
|
||||
Reference in New Issue
Block a user