More navigation bugs and fixed broken modal during transition

This commit is contained in:
Carlos-Mesquita
2024-11-26 15:46:20 +00:00
parent 1fc439cb25
commit efb153a33d
5 changed files with 75 additions and 31 deletions

View File

@@ -61,8 +61,8 @@ export default function Finish({ user, practiceScores, scores, modules, informat
const aiUsage = Math.round(ai_usage(solutions) * 100);
//const entity = useMemo(() => assignment?.entity || user.entities[0]?.id || "", [assignment?.entity, user.entities])
//const { gradingSystem } = useGradingSystem(entity);
const entity = useMemo(() => assignment?.entity || user.entities[0]?.id || "", [assignment?.entity, user.entities])
const { gradingSystem } = useGradingSystem(entity);
const router = useRouter()
@@ -104,7 +104,7 @@ export default function Finish({ user, practiceScores, scores, modules, informat
const showLevel = (level: number) => {
if (selectedModule === "level") {
const label = getGradingLabel(level, []);
const label = getGradingLabel(level, gradingSystem?.steps || []);
return (
<div className="flex flex-col items-center justify-center gap-1">
<span className="text-xl font-bold">{label}</span>
@@ -180,7 +180,7 @@ export default function Finish({ user, practiceScores, scores, modules, informat
<BsPen className="h-6 w-6" />
<span className="font-semibold">Writing</span>
</div>
{aiUsage >= 50 && user.type !== "student" && (
{aiUsage >= 50 && selectedModule === "writing" && user.type !== "student" && (
<div
className={clsx("flex items-center justify-center border px-3 h-full rounded", {
"bg-orange-100 border-orange-400 text-orange-700": aiUsage < 80,