import { useNavigate } from "react-router-dom"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"; import { Badge } from "@/components/ui/badge"; import { Loader2, Clock, Layers, Sparkles } from "lucide-react"; import { usePlacementStart } from "@/hooks/queries/usePlacement"; import type { PlacementSubject } from "@/types"; import { ApiError } from "@/lib/api-client"; import { useState } from "react"; import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"; const dimensions = [ { name: "Grammar", detail: "~30 MCQ", time: "~8 min" }, { name: "Vocabulary", detail: "~20 items", time: "~5 min" }, { name: "Reading", detail: "~10 Q / 2 passages", time: "~10 min" }, { name: "Speaking", detail: "3 prompts", time: "~5 min" }, ]; export default function PlacementBriefing() { const navigate = useNavigate(); const start = usePlacementStart(); const [error, setError] = useState(null); const handleBegin = async () => { setError(null); const subject: PlacementSubject = "english"; try { const res = await start.mutateAsync(subject); sessionStorage.setItem( `placement_session_${res.session_id}`, JSON.stringify({ question: res.first_question }), ); navigate(`/student/placement/test?session=${encodeURIComponent(res.session_id)}`, { state: { question: res.first_question, sessionId: res.session_id }, }); } catch (e) { setError(e instanceof ApiError ? e.message : "Could not start the test"); } }; return (

Placement test

Adaptive English placement across four skills.

Duration

20–30 min

Pace yourself; timer tracks elapsed time.

Sections

4

Grammar, vocabulary, reading, speaking.

Adaptive CAT-style

Difficulty adjusts based on your responses.

What to expect Approximate structure per dimension Dimension Format Time {dimensions.map((row) => ( {row.name} {row.detail} {row.time} ))}
{error && ( Error {error} )}
); }