From c3dafee6c31c34dbe4438de2085ef76caef9b3d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=84=AD=E6=B2=9B=E8=BB=92?= Date: Tue, 7 Oct 2025 01:07:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=BE=A9=E6=96=B0=E8=A4=87?= =?UTF-8?q?=E7=BF=92=E9=A0=81=E9=9D=A2=E7=9A=84=20TypeScript=20=E9=A1=9E?= =?UTF-8?q?=E5=9E=8B=E9=8C=AF=E8=AA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 CardState interface 中添加 difficultyLevelNumeric 屬性 - 確保與 reviewSimpleData 中的類型定義兼容 - 修復 QuizProgress 組件的類型匹配問題 - /review 頁面現在能正常編譯和運行 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- frontend/hooks/review/useReviewSession.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/hooks/review/useReviewSession.ts b/frontend/hooks/review/useReviewSession.ts index da7adc5..77b943a 100644 --- a/frontend/hooks/review/useReviewSession.ts +++ b/frontend/hooks/review/useReviewSession.ts @@ -8,6 +8,7 @@ interface CardState extends Flashcard { isCompleted: boolean originalOrder: number synonyms?: string[] + difficultyLevelNumeric: number // 添加缺少的屬性 } interface QuizItem { @@ -96,7 +97,8 @@ const generateQuizItemsFromFlashcards = (flashcards: Flashcard[]): QuizItem[] => wrongCount: 0, isCompleted: false, originalOrder: order / 2, // 原始詞卡的順序 - synonyms: [] + synonyms: [], + difficultyLevelNumeric: card.masteryLevel || 1 // 添加缺少的屬性 } // 為每張詞卡生成兩種測驗模式