From a313c08b95bfe2409a0b7f86c785393fbe923a08 Mon Sep 17 00:00:00 2001 From: Drobysh Date: Fri, 16 Oct 2026 11:08:00 +0000 Subject: [PATCH 1/2] =?UTF-8?q?[Eva]=20B4:=20=D1=87=D0=B8=D1=82=D0=B0?= =?UTF-8?q?=D0=B5=D0=BC=20difficulty=20=D1=8E=D0=B7=D0=B5=D1=80=D0=B0=20?= =?UTF-8?q?=D0=B2=20/sentences/next?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/sentences.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/routers/sentences.py b/routers/sentences.py index 0ad38b0..f4dc0f7 100644 --- a/routers/sentences.py +++ b/routers/sentences.py @@ -100,13 +100,14 @@ async def get_next_sentence(request: Request): pool = await get_pool() async with pool.acquire() as conn: user = await conn.fetchrow( - "SELECT app_language, current_level FROM users WHERE telegram_id = $1", telegram_id + "SELECT app_language, current_level, difficulty FROM users WHERE telegram_id = $1", telegram_id ) if not user: raise HTTPException(401, "User not registered") lang = user["app_language"] or "pl" current_level = user["current_level"] or "A1" + difficulty = user["difficulty"] or "medium" # Находим случайное непройденное предложение нужного уровня row = await conn.fetchrow(""" -- 2.54.0 From 965d5d25030d49be0b9f69d598d6a61e266f61a8 Mon Sep 17 00:00:00 2001 From: Drobysh Date: Fri, 16 Oct 2026 11:08:03 +0000 Subject: [PATCH 2/2] =?UTF-8?q?[Eva]=20B4:=20=D0=B4=D0=BE=D0=B1=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D1=8F=D0=B5=D0=BC=20user=5Fdifficulty=20=D0=B2=20?= =?UTF-8?q?=D0=BE=D1=82=D0=B2=D0=B5=D1=82=20/sentences/next?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/sentences.py | 1 + 1 file changed, 1 insertion(+) diff --git a/routers/sentences.py b/routers/sentences.py index f4dc0f7..c732c98 100644 --- a/routers/sentences.py +++ b/routers/sentences.py @@ -148,6 +148,7 @@ async def get_next_sentence(request: Request): "correct_words": display_words, "translation": translation, "difficulty": row["difficulty"], + "user_difficulty": difficulty, "level": row["level"], } -- 2.54.0