From 2eb24c6c479a2dbd136f1b330a2ce8897ca387ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B3=E4=BD=A9=E5=BA=AD?= Date: Mon, 29 Sep 2025 21:00:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=89=8B=E6=A9=9F=E4=BB=8B?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/analytics/page.tsx | 52 +++++++-------- app/admin/results/page.tsx | 126 +++++++++++++++++------------------ 2 files changed, 89 insertions(+), 89 deletions(-) diff --git a/app/admin/analytics/page.tsx b/app/admin/analytics/page.tsx index b81dbd0..e70c0bd 100644 --- a/app/admin/analytics/page.tsx +++ b/app/admin/analytics/page.tsx @@ -249,54 +249,54 @@ function AnalyticsContent() {
{/* Overall Statistics */} -
+
- -
- + +
+
-
{overallStats.totalUsers}
-
總用戶數
+
{overallStats.totalUsers}
+
總用戶數
- -
- + +
+
-
{overallStats.totalParticipants}
-
參與用戶
+
{overallStats.totalParticipants}
+
參與用戶
- -
- + +
+
-
{overallStats.overallParticipationRate}%
-
參與率
+
{overallStats.overallParticipationRate}%
+
參與率
- -
- + +
+
-
{overallStats.averageScore}
-
平均分數
+
{overallStats.averageScore}
+
平均分數
- -
- + +
+
-
{overallStats.totalTests}
-
總測試次數
+
{overallStats.totalTests}
+
總測試次數
diff --git a/app/admin/results/page.tsx b/app/admin/results/page.tsx index 4e3e192..369b381 100644 --- a/app/admin/results/page.tsx +++ b/app/admin/results/page.tsx @@ -237,9 +237,9 @@ function AdminResultsContent() { const link = document.createElement('a') link.href = url link.download = data.filename - document.body.appendChild(link) - link.click() - document.body.removeChild(link) + document.body.appendChild(link) + link.click() + document.body.removeChild(link) window.URL.revokeObjectURL(url) } else { console.error('匯出失敗:', data.message) @@ -299,44 +299,44 @@ function AdminResultsContent() {
{/* Summary Cards */} -
+
- -
- + +
+
-
{stats.totalResults}
-
總測試次數
+
{stats.totalResults}
+
總測試次數
- -
- + +
+
-
{stats.averageScore}
-
平均分數
+
{stats.averageScore}
+
平均分數
- -
- + +
+
-
{stats.totalUsers}
-
總用戶數
+
{stats.totalUsers}
+
總用戶數
- -
- + +
+
-
{stats.participationRate}%
-
參與率
+
{stats.participationRate}%
+
參與率
@@ -431,17 +431,17 @@ function AdminResultsContent() { ) : ( <> - - - 用戶 - 部門 - 測試類型 - 分數 - 等級 - 完成時間 + + + 用戶 + 部門 + 測試類型 + 分數 + 等級 + 完成時間 操作 - - + + {results.map((result) => { const testTypeInfo = getTestTypeInfo(result.type) @@ -475,7 +475,7 @@ function AdminResultsContent() { {scoreLevel.level} - +
{formatDate(result.completedAt)}
@@ -488,8 +488,8 @@ function AdminResultsContent() { 查看詳情 - - +
+ ) })}
@@ -644,7 +644,7 @@ function AdminResultsContent() { {/* 詳細結果模態框 */} - + 測驗詳細結果 @@ -665,7 +665,7 @@ function AdminResultsContent() { 基本資訊 -
+

{detailData.user.name}

@@ -715,43 +715,43 @@ function AdminResultsContent() { {detailData.questions .filter((q: any) => q.type === 'logic') .map((question: any, index: number) => ( -
-
-

第 {index + 1} 題

- +
+
+

第 {index + 1} 題

+ {question.isCorrect ? "正確" : "錯誤"}
-
+
-

{question.question}

+

{question.question}

-
+
- {question.option_a &&

A. {question.option_a}

} - {question.option_b &&

B. {question.option_b}

} - {question.option_c &&

C. {question.option_c}

} - {question.option_d &&

D. {question.option_d}

} - {question.option_e &&

E. {question.option_e}

} + {question.option_a &&

A. {question.option_a}

} + {question.option_b &&

B. {question.option_b}

} + {question.option_c &&

C. {question.option_c}

} + {question.option_d &&

D. {question.option_d}

} + {question.option_e &&

E. {question.option_e}

}
-

用戶答案: {question.userAnswer}

-

正確答案: {question.correctAnswer}

+

用戶答案: {question.userAnswer}

+

正確答案: {question.correctAnswer}

{question.explanation && (
-

{question.explanation}

+

{question.explanation}

)}
@@ -772,28 +772,28 @@ function AdminResultsContent() { {detailData.questions .filter((q: any) => q.type === 'creative') .map((question: any, index: number) => ( -
-
-

第 {index + 1} 題

- +
+
+

第 {index + 1} 題

+ {question.score} 分
-
+
-

{question.statement}

+

{question.statement}

-
+
-

{question.userAnswer}

+

{question.userAnswer}

-

{question.score} 分

+

{question.score} 分