Updated the grading system to work based on entities

This commit is contained in:
Tiago Ribeiro
2024-11-22 15:36:21 +00:00
parent f301001ebe
commit 50bbb0dacf
14 changed files with 236 additions and 484 deletions

View File

@@ -8,7 +8,7 @@ import { calculateBandScore, getGradingLabel } from "@/utils/score";
import clsx from "clsx";
import Link from "next/link";
import { useRouter } from "next/router";
import { Fragment, useEffect, useState } from "react";
import { Fragment, useEffect, useMemo, useState } from "react";
import {
BsArrowCounterclockwise,
BsBan,
@@ -59,7 +59,9 @@ export default function Finish({ user, scores, modules, information, solutions,
const aiUsage = Math.round(ai_usage(solutions) * 100);
const exams = useExamStore((state) => state.exams);
const { gradingSystem } = useGradingSystem();
const entity = useMemo(() => assignment?.entity || user.entities[0]?.id || "", [assignment?.entity, user.entities])
const { gradingSystem } = useGradingSystem(entity);
const router = useRouter()