🌊 Волна 13: frontend остальное (6 багов) — аудит v2 закрыт

This commit is contained in:
2026-09-24 13:06:43 +03:00
parent f878411dce
commit 66c90c16e9
6 changed files with 61 additions and 37 deletions
+5 -13
View File
@@ -140,19 +140,11 @@ const PracticeViewPage: React.FC = () => {
} else {
setIsCompleting(true);
const currentQ = questions[currentIndex];
const answer = selectedAnswers[currentQ.question.question_id];
if (answer && sessionId) {
const timeTaken = Date.now() - startTimeRef.current;
// 🔧 ИСПРАВЛЕНО: проверяем, была ли подсказка для этого вопроса
const wasHintUsed = !!hintUsed[currentQ.question.question_id];
try {
await saveLearningAnswer(sessionId, currentQ.question.question_id, answer, timeTaken, true, wasHintUsed);
} catch (e) {
console.error('Error saving final answer:', e);
}
}
// 🔧 ФИКС (24.09.2026): PRACTICE_DUPLICATE_SAVE —
// раньше saveLearningAnswer вызывался повторно для последнего вопроса,
// хотя он уже был сохранён в handleAnswerSelect / handleTextInputBlur.
// Теперь НЕ дублируем — просто завершаем сессию.
// Ответ уже сохранён при выборе/вводе.
await new Promise(resolve => setTimeout(resolve, 300));