[Eva] Ева, патч 21 применён — теперь ты можешь #41

Merged
Drobysh merged 8 commits from eva/chat-b7c183-backend into main 2026-10-14 09:25:07 +00:00
Showing only changes of commit 4355b94291 - Show all commits
+22
View File
@@ -163,6 +163,28 @@ async def get_next_bubble_level(request: Request):
random.shuffle(all_parts)
# 🔧 НОВОЕ (14.10.2026): сохраняем состояние уровня для подсказок
# и сбрасываем счётчики подсказок/списка при новом уровне.
level_state = [
{
"word_pl": w["word_pl"],
"translation": w["translation"],
"parts": w["parts"],
}
for w in result_words
]
await conn.execute("""
INSERT INTO bubble_words_progress
(user_id, levels_completed, total_score, level,
current_hints_used, current_list_opened, current_level_words, hinted_words)
VALUES ($1, 0, 0, $2, 0, 0, $3::jsonb, '{}')
ON CONFLICT (user_id) DO UPDATE
SET current_hints_used = 0,
current_list_opened = 0,
current_level_words = $3::jsonb,
hinted_words = '{}'
""", telegram_id, current_level, json.dumps(level_state))
return {
"words": result_words,
"bubbles": all_parts,