From bcc0f698a063400de24aee7bb8bfee2ed17df48d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Burak=20Boduro=C4=9Flu?= <80620802+burakboduroglu@users.noreply.github.com> Date: Tue, 21 Jul 2026 14:35:01 +0300 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20exam=20room=20full=20screen?= =?UTF-8?q?,=20attempts=20display,=20and=20fresh=20data=20-=20update=20App?= =?UTF-8?q?Shell=20to=20hide=20sidebars=20and=20top=20header=20for=20/exam?= =?UTF-8?q?-room=20-=20keep=20max-width=20reset=20so=20questions=20take=20?= =?UTF-8?q?up=20more=20screen=20space=20-=20display=20used=20and=20remaini?= =?UTF-8?q?ng=20attempt=20counts=20on=20the=20exam=20detail=20page=20-=20a?= =?UTF-8?q?dd=20`cache`=20option=20to=20API=20client=20`RequestOptions`=20?= =?UTF-8?q?-=20bypass=20browser=20cache=20(`no-store`)=20for=20exam,=20att?= =?UTF-8?q?empt,=20and=20time=20endpoints=20to=20ensure=20fresh=20status?= =?UTF-8?q?=20and=20precise=20clock=20sync=20without=20stale=20data=20-=20?= =?UTF-8?q?add=20exam=20start=20date,=20end=20date,=20and=20duration=20to?= =?UTF-8?q?=20the=20detail=20metric=20cards=20grid=20-=20show=20contextual?= =?UTF-8?q?=20alert=20for=20submitted=20exams=20(prompt=20to=20retake=20us?= =?UTF-8?q?ing=20remaining=20attempts)=20-=20display=20attempt=20submissio?= =?UTF-8?q?n=20timestamp=20in=20the=20alert=20box?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/client/client.ts | 2 ++ src/api/exams/getExamAttempt.ts | 2 +- src/api/exams/getExamById.ts | 2 +- src/api/time/getTime.ts | 2 +- src/components/layout/app-shell.tsx | 5 ++-- src/i18n/messages.ts | 21 ++++++++++++-- src/lib/exam-status.ts | 9 ++++-- src/pages/exam-detail-page.tsx | 44 ++++++++++++++++++++++++++--- 8 files changed, 73 insertions(+), 14 deletions(-) diff --git a/src/api/client/client.ts b/src/api/client/client.ts index 2671554..da96b3d 100644 --- a/src/api/client/client.ts +++ b/src/api/client/client.ts @@ -16,6 +16,7 @@ type RequestOptions = { method?: "GET" | "POST" | "PATCH" | "DELETE"; body?: unknown; signal?: AbortSignal; + cache?: RequestCache; }; const API_PREFIX = "/api"; @@ -132,6 +133,7 @@ export async function client(path: string, options: RequestOptions = {}): Pro body, credentials: "same-origin", signal: options.signal, + cache: options.cache, }); if (res.status === 204) { diff --git a/src/api/exams/getExamAttempt.ts b/src/api/exams/getExamAttempt.ts index 94a2096..51f26da 100644 --- a/src/api/exams/getExamAttempt.ts +++ b/src/api/exams/getExamAttempt.ts @@ -2,5 +2,5 @@ import { client } from "../client"; import type { ExamAttempt } from "../client"; export function getExamAttempt(examId: string, signal?: AbortSignal): Promise { - return client(`/exams/${examId}/attempt`, { signal }); + return client(`/exams/${examId}/attempt`, { signal, cache: "no-store" }); } diff --git a/src/api/exams/getExamById.ts b/src/api/exams/getExamById.ts index a0cceb5..3fb7272 100644 --- a/src/api/exams/getExamById.ts +++ b/src/api/exams/getExamById.ts @@ -2,5 +2,5 @@ import { client } from "../client"; import type { Exam } from "../client"; export function getExamById(id: string, signal?: AbortSignal): Promise { - return client(`/exams/${id}`, { signal }); + return client(`/exams/${id}`, { signal, cache: "no-store" }); } diff --git a/src/api/time/getTime.ts b/src/api/time/getTime.ts index 7a85fce..7943b44 100644 --- a/src/api/time/getTime.ts +++ b/src/api/time/getTime.ts @@ -1,5 +1,5 @@ import { client } from "@/api/client"; export async function getTime(signal?: AbortSignal): Promise<{ now: number }> { - return client<{ now: number }>("/time", { signal }); + return client<{ now: number }>("/time", { signal, cache: "no-store" }); } diff --git a/src/components/layout/app-shell.tsx b/src/components/layout/app-shell.tsx index 412acb8..1113a4c 100644 --- a/src/components/layout/app-shell.tsx +++ b/src/components/layout/app-shell.tsx @@ -26,6 +26,7 @@ export function AppShell(props: ParentProps) { const collapsed = () => prefs.sidebarCollapsed(); const location = useLocation(); const wide = () => location().pathname.startsWith("/exam-room/") || location().searchStr.includes("answerUser=") || location().pathname === "/messages"; + const fullScreen = () => location().pathname.startsWith("/exam-room/"); const routeLabel = createMemo(() => { const path = location().pathname; if (path === "/") return t("nav.home"); @@ -63,7 +64,7 @@ export function AppShell(props: ParentProps) {
- +
@@ -553,7 +580,16 @@ function ExamDetailContent() { -

{ownAttempt()!.status === "submitted" ? t("attempt.submittedInfo") : t("attempt.expiredInfo")}

+

+ {ownAttempt()!.status === "submitted" + ? (noAttemptsLeft() ? t("attempt.submittedFinalInfo") : t("attempt.submittedCanRetakeInfo")) + : t("attempt.expiredInfo")} +

+ +

+ {t("attempt.submittedAt")}: {formatDateTime(ownAttempt()!.finished_at, locale())} +

+