From 937afb17c89a9a9d345ee3e2850a90e1ae00249c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Burak=20Boduro=C4=9Flu?=
<80620802+burakboduroglu@users.noreply.github.com>
Date: Wed, 23 Sep 2026 16:31:44 +0300
Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20show=20known=20names=20in?=
=?UTF-8?q?=20exam=20sheets=20and=20user=20list?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- carry the selected student label into answer sheets without attempts
- fall back to usernames for users without a first or last name
- cover the no-attempt answer sheet label with a regression test
---
.../exams/answer-sheet-view.test.tsx | 6 +++---
src/components/exams/answer-sheet-view.tsx | 4 ++--
src/components/users/user-table.tsx | 2 +-
src/pages/exam-detail-page.tsx | 21 ++++++++++++++-----
4 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/src/components/exams/answer-sheet-view.test.tsx b/src/components/exams/answer-sheet-view.test.tsx
index fccc3b0..c0d81ca 100644
--- a/src/components/exams/answer-sheet-view.test.tsx
+++ b/src/components/exams/answer-sheet-view.test.tsx
@@ -21,7 +21,7 @@ afterEach(() => {
vi.clearAllMocks();
});
-test("an answer sheet without an attempt never displays the student UUID", async () => {
+test("an answer sheet without an attempt displays the known student name, not the UUID", async () => {
const userId = "123e4567-e89b-42d3-a456-426614174000";
getExamQuestions.mockResolvedValue({ items: [] });
getStudentAttempts.mockResolvedValue([]);
@@ -29,12 +29,12 @@ test("an answer sheet without an attempt never displays the student UUID", async
render(() => (
{t("exams.pastAttemptReadOnly")}
{d().hasSheet ? personLabel(d().sheet.user) : "—"}
+{props.userLabel || (d().hasSheet ? personLabel(d().sheet.user) : "—")}