diff --git a/VERSION b/VERSION index 32447ce..a87467f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.11.1 +5.11.2 diff --git a/play-life-web/package.json b/play-life-web/package.json index ce5f72a..ef503f3 100644 --- a/play-life-web/package.json +++ b/play-life-web/package.json @@ -1,6 +1,6 @@ { "name": "play-life-web", - "version": "5.11.1", + "version": "5.11.2", "type": "module", "scripts": { "dev": "vite", diff --git a/play-life-web/src/components/TestWords.jsx b/play-life-web/src/components/TestWords.jsx index 35597b5..2c46e85 100644 --- a/play-life-web/src/components/TestWords.jsx +++ b/play-life-web/src/components/TestWords.jsx @@ -34,6 +34,7 @@ function TestWords({ onNavigate, wordCount: initialWordCount, configId: initialC const cardsShownRef = useRef(0) // Синхронный счётчик для избежания race condition const saveProgressPromiseRef = useRef(null) // Промис сохранения прогресса (null = ещё не запущено) const savePayloadRef = useRef(null) // Данные для сохранения при нажатии «Закончить» (если сохранение ещё не запускали) + const [currentSide, setCurrentSide] = useState(null) // Текущая случайная сторона карточки ('word' или 'translation') // Функция равномерного распределения слов в пуле с гарантией максимального расстояния между одинаковыми словами // excludeFirstWordId - ID слова, которое не должно быть первым в пуле (только что показанная карточка) @@ -213,6 +214,7 @@ function TestWords({ onNavigate, wordCount: initialWordCount, configId: initialC setWords([]) setTestWords([]) setCurrentWord(null) + setCurrentSide(null) setFlippedCards(new Set()) setWordStats({}) wordStatsRef.current = {} @@ -437,6 +439,7 @@ function TestWords({ onNavigate, wordCount: initialWordCount, configId: initialC cardsShownRef.current = nextCardsShown setCurrentWord(validWord) + setCurrentSide(Math.random() < 0.5 ? 'word' : 'translation') setCardsShown(nextCardsShown) setFlippedCards(new Set()) @@ -450,6 +453,7 @@ function TestWords({ onNavigate, wordCount: initialWordCount, configId: initialC // showCard: показываем карточку setCurrentWord(nextWord) + setCurrentSide(Math.random() < 0.5 ? 'word' : 'translation') setCardsShown(nextCardsShown) setFlippedCards(new Set()) @@ -604,9 +608,6 @@ function TestWords({ onNavigate, wordCount: initialWordCount, configId: initialC } } - const getRandomSide = (word) => { - return word.id % 2 === 0 ? 'word' : 'translation' - } return (