fix(cbt): Periodic Table image clarity and reliable full-screen exit
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import React from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import { CheckCircle2, XCircle, AlertCircle, Clock, Award, ArrowRight, RotateCcw } from "lucide-react";
|
||||
import Link from 'next/link';
|
||||
|
||||
interface ExamAttemptPayload {
|
||||
score: number;
|
||||
@@ -22,6 +22,7 @@ interface ExamResultProps {
|
||||
}
|
||||
|
||||
export function ExamResult({ payload, onRetake }: ExamResultProps) {
|
||||
const router = useRouter();
|
||||
const answered = payload.answers.filter(a => a.selected_answer !== null).length;
|
||||
const unanswered = payload.total_questions - answered;
|
||||
|
||||
@@ -114,15 +115,22 @@ export function ExamResult({ payload, onRetake }: ExamResultProps) {
|
||||
<Button variant="outline" size="lg" className="rounded-xl h-14 px-8 font-bold text-lg gap-2" onClick={onRetake}>
|
||||
<RotateCcw className="size-5" /> Retake Mock Test
|
||||
</Button>
|
||||
<Link href="/dashboard/cbt">
|
||||
<Button
|
||||
size="lg"
|
||||
className="rounded-xl h-14 px-8 font-bold text-lg shadow-[0_0_20px_-5px_var(--color-primary)] gap-2 w-full sm:w-auto"
|
||||
onClick={() => document.fullscreenElement && document.exitFullscreen()}
|
||||
>
|
||||
Dashboard <ArrowRight className="size-5" />
|
||||
</Button>
|
||||
</Link>
|
||||
<Button
|
||||
size="lg"
|
||||
className="rounded-xl h-14 px-8 font-bold text-lg shadow-[0_0_20px_-5px_var(--color-primary)] gap-2 w-full sm:w-auto"
|
||||
onClick={async () => {
|
||||
try {
|
||||
if (document.fullscreenElement) {
|
||||
await document.exitFullscreen();
|
||||
}
|
||||
} catch (err) {
|
||||
console.error("Error exiting fullscreen", err);
|
||||
}
|
||||
router.push("/dashboard/cbt");
|
||||
}}
|
||||
>
|
||||
Dashboard <ArrowRight className="size-5" />
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user