diff --git a/frontend/app/learn/page.tsx b/frontend/app/learn/page.tsx index b7b90f7..40de47f 100644 --- a/frontend/app/learn/page.tsx +++ b/frontend/app/learn/page.tsx @@ -12,7 +12,7 @@ export default function LearnPage() { const [mounted, setMounted] = useState(false) const [currentCardIndex, setCurrentCardIndex] = useState(0) const [isFlipped, setIsFlipped] = useState(false) - const [mode, setMode] = useState<'flip' | 'quiz' | 'fill' | 'listening' | 'speaking'>('flip') + const [mode, setMode] = useState<'flip-memory' | 'vocab-choice' | 'vocab-listening' | 'sentence-listening' | 'sentence-fill' | 'sentence-reorder' | 'sentence-speaking'>('flip-memory') const [score, setScore] = useState({ correct: 0, total: 0 }) const [selectedAnswer, setSelectedAnswer] = useState(null) const [showResult, setShowResult] = useState(false) @@ -107,9 +107,13 @@ export default function LearnPage() { } }, [currentCardIndex, mounted]); - // Client-side mounting and quiz options generation + // Client-side mounting useEffect(() => { setMounted(true) + }, []) + + // Quiz options generation + useEffect(() => { const currentWord = cards[currentCardIndex].word; // Generate quiz options with current word and other words @@ -288,59 +292,79 @@ export default function LearnPage() {
+ +
- {mode === 'flip' ? ( + {mode === 'flip-memory' ? ( /* Flip Card Mode */
{/* Error Report Button for Flip Mode */} @@ -444,8 +468,8 @@ export default function LearnPage() {
- ) : mode === 'quiz' ? ( - /* Quiz Mode - 選擇題:英文定義選中文翻譯 */ + ) : mode === 'vocab-choice' ? ( + /* Vocab Choice Mode - 詞彙選擇 */
{/* Error Report Button for Quiz Mode */}
@@ -461,7 +485,15 @@ export default function LearnPage() {
-
+
+
+ + {currentCard.difficulty} + +
+

+ 詞彙選擇 +

定義

{currentCard.definition}

@@ -539,7 +571,7 @@ export default function LearnPage() {
- ) : mode === 'fill' ? ( + ) : mode === 'sentence-fill' ? ( /* Fill in the Blank Mode - 填空題 */
{/* Error Report Button for Fill Mode */} @@ -563,7 +595,7 @@ export default function LearnPage() {

- 填空題 + 例句填空

@@ -663,7 +695,7 @@ export default function LearnPage() {

- ) : mode === 'listening' ? ( + ) : mode === 'vocab-listening' ? ( /* Listening Test Mode - 聽力測試 */
{/* Error Report Button for Listening Mode */} @@ -687,8 +719,9 @@ export default function LearnPage() {

- 聽力測試 + 詞彙聽力

+

中文翻譯:{currentCard.translation} @@ -773,7 +806,7 @@ export default function LearnPage() {

- ) : mode === 'speaking' ? ( + ) : mode === 'sentence-speaking' ? ( /* Speaking Test Mode - 口說測試 */
{/* Error Report Button for Speaking Mode */} @@ -797,7 +830,7 @@ export default function LearnPage() {

- 口說測試 + 例句口說

@@ -851,6 +884,134 @@ export default function LearnPage() { )}

+ {/* Navigation */} +
+ + +
+
+ ) : mode === 'sentence-listening' ? ( + /* Sentence Listening Test Mode - 例句聽力題 */ +
+ {/* Error Report Button */} +
+ +
+ +
+
+
+ + {currentCard.difficulty} + +
+

+ 例句聽力 +

+

+ 請聽例句並選擇正確的選項: +

+ +
+ +

+ 點擊播放聽例句 +

+
+
+ +
+ {/* 這裡需要例句選項 */} +
+ [例句聽力題功能開發中...] +
+
+
+ + {/* Navigation */} +
+ + +
+
+ ) : mode === 'sentence-reorder' ? ( + /* Sentence Reorder Mode - 例句重組題 */ +
+ {/* Error Report Button */} +
+ +
+ +
+
+
+ + {currentCard.difficulty} + +
+

+ 例句重組 +

+ +
+

+ 詞彙:{currentCard.word} +

+

+ 翻譯:{currentCard.exampleTranslation} +

+
+ +

+ 請將下方的單字重新排列成正確的句子: +

+
+ +
+
+ [例句重組題功能開發中...] +
+
+
+ {/* Navigation */}