Solved a bug where the speaking and interactive speaking were not being correctly evaluated

This commit is contained in:
Tiago Ribeiro
2024-03-23 15:43:25 +00:00
parent 38c0c823e1
commit 13ebb9bbd8
9 changed files with 23 additions and 8 deletions

View File

@@ -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>