Lashtw commited on
Commit
3aa679b
·
verified ·
1 Parent(s): 98c4e5f

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +7 -6
index.html CHANGED
@@ -762,22 +762,23 @@
762
  wordPool = [...words];
763
  }
764
 
765
- // 2. Then, check if random selection is enabled.
766
- if (randomQuestionsCheckbox.checked) {
 
 
 
767
  const randomCount = parseInt(randomQuestionsCountInput.value, 10);
768
  if (!isNaN(randomCount) && randomCount > 0 && randomCount <= wordPool.length) {
769
- // Shuffle the pool and take the specified number of words.
770
  wordsForCurrentMode = shuffleArray([...wordPool]).slice(0, randomCount);
771
  } else {
772
  alert('請輸入有效的隨機題數。題數不能為零或超過所選範圍的單字總數。');
773
  return;
774
  }
775
  } else {
776
- // If not random, use the entire pool.
777
  wordsForCurrentMode = wordPool;
778
  }
779
 
780
-
781
  if (wordsForCurrentMode.length === 0) {
782
  alert("選定的範圍內沒有單字,請重新選擇或新增。");
783
  return;
@@ -1066,7 +1067,7 @@
1066
  nextBtn.addEventListener('click', () => { if (currentCardIndex < wordsForCurrentMode.length - 1) { currentCardIndex++; displayCard(); }});
1067
  quizForm.addEventListener('submit', (e) => { e.preventDefault(); checkAnswer(); });
1068
  speakBtn.addEventListener('click', (e) => { e.stopPropagation(); const word = getCurrentWordToSpeak(); if(word) speakWord(word, 0.75); });
1069
- speakSlowBtn.addEventListener('click', (e) => { e.stopPropagation(); const word = getCurrentWordToSpeak(); if(word) speakWord(word, 0.35); });
1070
  hintBtn.addEventListener('click', () => {
1071
  const card = currentMode === 'speed' ? currentSpeedCard : quizQueue[0];
1072
  if (!card) return;
 
762
  wordPool = [...words];
763
  }
764
 
765
+ // 2. Then, determine the final word set for the mode.
766
+ if (mode === 'review') {
767
+ // For review mode, ALWAYS use the full pool, ignoring random settings.
768
+ wordsForCurrentMode = wordPool;
769
+ } else if (randomQuestionsCheckbox.checked) {
770
  const randomCount = parseInt(randomQuestionsCountInput.value, 10);
771
  if (!isNaN(randomCount) && randomCount > 0 && randomCount <= wordPool.length) {
 
772
  wordsForCurrentMode = shuffleArray([...wordPool]).slice(0, randomCount);
773
  } else {
774
  alert('請輸入有效的隨機題數。題數不能為零或超過所選範圍的單字總數。');
775
  return;
776
  }
777
  } else {
778
+ // For other modes without random, use the entire pool.
779
  wordsForCurrentMode = wordPool;
780
  }
781
 
 
782
  if (wordsForCurrentMode.length === 0) {
783
  alert("選定的範圍內沒有單字,請重新選擇或新增。");
784
  return;
 
1067
  nextBtn.addEventListener('click', () => { if (currentCardIndex < wordsForCurrentMode.length - 1) { currentCardIndex++; displayCard(); }});
1068
  quizForm.addEventListener('submit', (e) => { e.preventDefault(); checkAnswer(); });
1069
  speakBtn.addEventListener('click', (e) => { e.stopPropagation(); const word = getCurrentWordToSpeak(); if(word) speakWord(word, 0.75); });
1070
+ speakSlowBtn.addEventListener('click', (e) => { e.stopPropagation(); const word = getCurrentWordToSpeak(); if(word) speakWord(word, 0.2); });
1071
  hintBtn.addEventListener('click', () => {
1072
  const card = currentMode === 'speed' ? currentSpeedCard : quizQueue[0];
1073
  if (!card) return;