🌊 Волна 3: frontend юзабилити топ (4 бага)
- HINT_AUTO_SELECTS_CORRECT: подсказка не засчитывается как ответ (PracticeViewPage.tsx, паттерн из LessonViewPage) - ALERT_IN_TELEGRAM_MINIAPP: alert() → кастомный toast (TeacherChatPage.tsx, 3 места) - BUBBLE_ERROR_MESSAGE_STUCK: errorTimeoutRef + автоскрытие (BubbleWordsPage.tsx) - WORDSEARCH_STREAK_ON_ALREADY_FOUND: инкремент внутри проверки includes (WordSearchPage.tsx) Аудит: Issue #3, frontend 4/34 задач
This commit is contained in:
@@ -113,20 +113,22 @@ const PracticeViewPage: React.FC = () => {
|
||||
}
|
||||
};
|
||||
|
||||
// 🔧 ИСПРАВЛЕНО: handleHintClick теперь сохраняет ответ с hintUsed=true
|
||||
// 🔧 ФИКС (23.09.2026): HINT_AUTO_SELECTS_CORRECT — подсказка больше НЕ засчитывается как ответ.
|
||||
// Было: saveAnswer(..., correctAnswer, true, true) + setSelectedAnswers(correctAnswer)
|
||||
// → ученик жал «💡 Подсказка», и вопрос засчитывался как правильный без решения.
|
||||
// Стало: подсказка — только UI. Отправляем факт подсказки с isFinalAnswer=false,
|
||||
// пустым ответом. Вариант в UI НЕ выбирается автоматически.
|
||||
// Кнопка «Далее» ждёт, пока ученик сам выберет ответ.
|
||||
// Паттерн скопирован из LessonViewPage.handleHintClick.
|
||||
const handleHintClick = async () => {
|
||||
if (!currentQuestion || hintUsed[currentQuestion.question.question_id]) return;
|
||||
|
||||
|
||||
setHintUsed(prev => ({ ...prev, [currentQuestion.question.question_id]: true }));
|
||||
setShowHint(true);
|
||||
|
||||
const correctOption = currentQuestion.options.find(o => o.is_correct);
|
||||
const correctAnswer = correctOption ? correctOption.option_key : '';
|
||||
// 🔧 ИСПРАВЛЕНО: isFinalAnswer=true, hintUsed=true — система будет знать, что была подсказка
|
||||
await saveAnswer(currentQuestion.question.question_id, correctAnswer, true, true);
|
||||
|
||||
// 🔧 НОВОЕ: также отмечаем ответ как выбранный, чтобы кнопка "Далее" стала активной
|
||||
setSelectedAnswers(prev => ({ ...prev, [currentQuestion.question.question_id]: correctAnswer }));
|
||||
|
||||
// 🔧 Логируем факт подсказки — но НЕ как финальный ответ.
|
||||
// Пустой answer, isFinalAnswer=false, usedHint=true.
|
||||
await saveAnswer(currentQuestion.question.question_id, '', false, true);
|
||||
};
|
||||
|
||||
const handleNext = async () => {
|
||||
|
||||
Reference in New Issue
Block a user