[Eva] ChooseWord /next: проверка языка + wrong_count по сложности

This commit is contained in:
2026-10-15 17:01:39 +00:00
parent 07eebf6fed
commit 279fc5f313
+6
View File
@@ -22,6 +22,12 @@ async def get_next_quiz(request: Request):
lang = user["app_language"] or "pl"
current_level = user["current_level"] or "A1"
if lang == 'pl':
raise HTTPException(403, "ChooseWord не поддерживает польский язык. Используйте другой язык.")
difficulty = user.get("difficulty") or "medium"
wrong_count = {"easy": 2, "medium": 3, "hard": 4}.get(difficulty, 3)
progress = await conn.fetchrow(
"SELECT words_guessed, recent_words FROM word_quiz_progress WHERE user_id = $1",
telegram_id