From 4355b942912577bb4982c2477a005f4f1752ffd8 Mon Sep 17 00:00:00 2001 From: Drobysh Date: Wed, 14 Oct 2026 09:13:34 +0000 Subject: [PATCH] =?UTF-8?q?[Eva]=20/next=20=D1=81=D0=BE=D1=85=D1=80=D0=B0?= =?UTF-8?q?=D0=BD=D1=8F=D0=B5=D1=82=20=D1=81=D0=BE=D1=81=D1=82=D0=BE=D1=8F?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D1=83=D1=80=D0=BE=D0=B2=D0=BD=D1=8F=20?= =?UTF-8?q?=D0=B8=20=D1=81=D0=B1=D1=80=D0=B0=D1=81=D1=8B=D0=B2=D0=B0=D0=B5?= =?UTF-8?q?=D1=82=20=D1=81=D1=87=D1=91=D1=82=D1=87=D0=B8=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/bubblewords.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/routers/bubblewords.py b/routers/bubblewords.py index c2c4750..5de2a28 100644 --- a/routers/bubblewords.py +++ b/routers/bubblewords.py @@ -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,