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())} +

+