[Eva] bubblewords: очистка состояния + сброс счётчиков в /complete
This commit is contained in:
@@ -379,13 +379,18 @@ async def complete_bubble_level(request: Request):
|
|||||||
score = xp_result["points"]
|
score = xp_result["points"]
|
||||||
|
|
||||||
await conn.execute("""
|
await conn.execute("""
|
||||||
INSERT INTO bubble_words_progress (user_id, levels_completed, total_score, level, current_hints_used)
|
INSERT INTO bubble_words_progress
|
||||||
VALUES ($1, 1, $2, $3, 0)
|
(user_id, levels_completed, total_score, level,
|
||||||
|
current_hints_used, current_list_opened, current_level_words, hinted_words)
|
||||||
|
VALUES ($1, 1, $2, $3, 0, 0, '[]'::jsonb, '{}')
|
||||||
ON CONFLICT (user_id) DO UPDATE
|
ON CONFLICT (user_id) DO UPDATE
|
||||||
SET levels_completed = bubble_words_progress.levels_completed + 1,
|
SET levels_completed = bubble_words_progress.levels_completed + 1,
|
||||||
total_score = bubble_words_progress.total_score + $2,
|
total_score = bubble_words_progress.total_score + $2,
|
||||||
level = $3,
|
level = $3,
|
||||||
current_hints_used = 0
|
current_hints_used = 0,
|
||||||
|
current_list_opened = 0,
|
||||||
|
current_level_words = '[]'::jsonb,
|
||||||
|
hinted_words = '{}'
|
||||||
""", telegram_id, score, current_level)
|
""", telegram_id, score, current_level)
|
||||||
|
|
||||||
# Данные для достижений
|
# Данные для достижений
|
||||||
|
|||||||
Reference in New Issue
Block a user