[Eva] bubblewords: читать серверные счётчики hints+list

This commit is contained in:
2026-10-14 09:19:59 +00:00
parent 1f7ac86ef5
commit 07d2d197fd
+7 -4
View File
@@ -348,12 +348,15 @@ async def complete_bubble_level(request: Request):
current_level = user["current_level"] or "A1"
difficulty = user["difficulty"] or "medium"
# Читаем серверный hints_used
hints_used = await conn.fetchval(
"SELECT current_hints_used FROM bubble_words_progress WHERE user_id = $1",
# Читаем серверные счётчики (не из body)
progress = await conn.fetchrow(
"SELECT current_hints_used, current_list_opened "
"FROM bubble_words_progress WHERE user_id = $1",
telegram_id
) or 0
)
hints_used = (progress["current_hints_used"] if progress else 0) or 0
hints_used = min(max(0, hints_used), 3)
list_opened = (progress["current_list_opened"] if progress else 0) or 0
# 🔧 НОВОЕ (14.10.2026): очки по формуле филворда.
# Hard — фикс 110. Easy/Medium — 100 − 20×hints − 20×list + bonus.