ENCOA-239: Bug: Corporate after viewing assignment the dashboard button forwards the account to the wrong view
This commit is contained in:
@@ -98,6 +98,11 @@ export default function Finish({ user, practiceScores, scores, modules, informat
|
|||||||
return exam.exercises.length;
|
return exam.exercises.length;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const clickDashboard = () => {
|
||||||
|
if (user.type !== "student") return router.back()
|
||||||
|
destination === "/exam" ? router.reload() : router.push(destination || "/")
|
||||||
|
}
|
||||||
|
|
||||||
const bandScore: number = calculateBandScore(selectedScore.correct, selectedScore.total, selectedModule, user.focus);
|
const bandScore: number = calculateBandScore(selectedScore.correct, selectedScore.total, selectedModule, user.focus);
|
||||||
|
|
||||||
const showLevel = (level: number) => {
|
const showLevel = (level: number) => {
|
||||||
@@ -344,7 +349,7 @@ export default function Finish({ user, practiceScores, scores, modules, informat
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Button onClick={() => destination === "/exam" ? router.reload() : router.push(destination || "/")} color="purple" className="w-full max-w-[200px] self-end">
|
<Button onClick={clickDashboard} color="purple" className="w-full max-w-[200px] self-end">
|
||||||
Dashboard
|
Dashboard
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user