🌊 Волна 13: frontend остальное (6 багов) — аудит v2 закрыт
This commit is contained in:
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user