[Eva] Ева, прочитай .gitignore #36

Merged
Drobysh merged 7 commits from eva/chat-c3088d-backend into main 2026-10-13 12:02:29 +00:00
Showing only changes of commit 959f789f24 - Show all commits
+10 -5
View File
@@ -429,11 +429,16 @@ async def complete_level(request: Request):
detail="Hints and word list are disabled on Hard difficulty"
)
# Очки: база 100, −20 за каждую подсказку, −20 за список слов,
# +10 если без подсказок.
# Формула: max(20, min(110, 100 - 20*hints_used - 20*list_opened + bonus))
bonus = 10 if hints_used == 0 else 0
points = max(20, min(110, 100 - 20 * hints_used - 20 * (1 if list_opened else 0) + bonus))
# Очки в зависимости от сложности
if difficulty == "hard":
# Hard: фикс 110 (без подсказок и списка)
points = 110
else:
# Easy / Medium
bonus = 10 if hints_used == 0 else 0
penalty_hints = 20 * hints_used
penalty_list = 0 if difficulty == "easy" else 20 * (1 if list_opened else 0)
points = max(20, min(110, 100 - penalty_hints - penalty_list + bonus))
# Начисляем XP через единую функцию
from services.xp import award_xp