Solved a bug where the speaking and interactive speaking were not being correctly evaluated
This commit is contained in:
@@ -193,6 +193,7 @@ export default function ExamPage({page}: Props) {
|
||||
module: exam!.module,
|
||||
user: user?.id || "",
|
||||
date: new Date().getTime(),
|
||||
isDisabled: solution.isDisabled,
|
||||
...(assignment ? {assignment: assignment.id} : {}),
|
||||
}));
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
missing: 0,
|
||||
total: 100,
|
||||
},
|
||||
isDisabled: false,
|
||||
},
|
||||
{merge: true},
|
||||
);
|
||||
|
||||
@@ -38,11 +38,13 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
console.log("🌱 - Process complete");
|
||||
|
||||
const correspondingStat = (await getDoc(doc(db, "stats", fields.id))).data() as Stat;
|
||||
|
||||
const solutions = correspondingStat.solutions.map((x) => ({
|
||||
...x,
|
||||
evaluation: backendRequest.data,
|
||||
solution: snapshot.metadata.fullPath,
|
||||
}));
|
||||
|
||||
await setDoc(
|
||||
doc(db, "stats", fields.id),
|
||||
{
|
||||
@@ -52,6 +54,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
total: 100,
|
||||
missing: 0,
|
||||
},
|
||||
isDisabled: false,
|
||||
},
|
||||
{merge: true},
|
||||
);
|
||||
|
||||
@@ -40,6 +40,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
total: 100,
|
||||
missing: 0,
|
||||
},
|
||||
isDisabled: false,
|
||||
},
|
||||
{merge: true},
|
||||
);
|
||||
|
||||
@@ -34,7 +34,7 @@ export const getServerSideProps = withIronSessionSsr(({req, res}) => {
|
||||
redirect: {
|
||||
destination: "/login",
|
||||
permanent: false,
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ export const getServerSideProps = withIronSessionSsr(({req, res}) => {
|
||||
redirect: {
|
||||
destination: "/",
|
||||
permanent: false,
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -165,6 +165,7 @@ export default function History({user}: {user: User}) {
|
||||
const aggregatedScores = aggregateScoresByModule(dateStats).filter((x) => x.total > 0);
|
||||
const assignmentID = dateStats.reduce((_, current) => current.assignment as any, "");
|
||||
const assignment = assignments.find((a) => a.id === assignmentID);
|
||||
const isDisabled = dateStats.some((x) => x.isDisabled);
|
||||
|
||||
const aggregatedLevels = aggregatedScores.map((x) => ({
|
||||
module: x.module,
|
||||
@@ -260,11 +261,13 @@ export default function History({user}: {user: User}) {
|
||||
key={uuidv4()}
|
||||
className={clsx(
|
||||
"flex flex-col gap-4 border border-mti-gray-platinum p-4 cursor-pointer rounded-xl transition ease-in-out duration-300 -md:hidden",
|
||||
isDisabled && "grayscale tooltip",
|
||||
correct / total >= 0.7 && "hover:border-mti-purple",
|
||||
correct / total >= 0.3 && correct / total < 0.7 && "hover:border-mti-red",
|
||||
correct / total < 0.3 && "hover:border-mti-rose",
|
||||
)}
|
||||
onClick={selectExam}
|
||||
onClick={isDisabled ? () => null : selectExam}
|
||||
data-tip="This exam is still being evaluated..."
|
||||
role="button">
|
||||
{content}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user