fix(lesson): подсказка больше не засчитывается как ответ (22.09.2026)
This commit is contained in:
@@ -131,21 +131,21 @@ const LessonViewPage: React.FC = () => {
|
||||
}
|
||||
};
|
||||
|
||||
// 🔧 ИСПРАВЛЕНО: handleHintClick теперь сохраняет ответ с hintUsed=true
|
||||
// 🔧 ФИКС (22.09.2026): подсказка больше НЕ засчитывается как ответ.
|
||||
// Было: saveAnswer(..., correctAnswer, true, true) + setSelectedAnswers(correctAnswer)
|
||||
// → ученик жал «💡 Hint», и вопрос засчитывался как правильный без решения.
|
||||
// Стало: подсказка — только UI. Отправляем факт подсказки с isFinalAnswer=false,
|
||||
// пустым ответом. Вариант в UI НЕ выбирается автоматически.
|
||||
// Кнопка «Далее» ждёт, пока ученик сам выберет ответ.
|
||||
const handleHintClick = async () => {
|
||||
if (!currentQuestion || hintUsed[currentQuestion.question.question_id]) return;
|
||||
|
||||
|
||||
setHintUsed(prev => ({ ...prev, [currentQuestion.question.question_id]: true }));
|
||||
setShowHint(true);
|
||||
|
||||
// Сохраняем ответ с подсказкой (правильный ответ, hintUsed=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