From ecce4b013ad6b928bafd3acf499ee2ae2289f4e8 Mon Sep 17 00:00:00 2001 From: Maxim Dolgolyov Date: Wed, 3 Jun 2026 17:24:17 +0300 Subject: [PATCH] =?UTF-8?q?fix(analytics):=20=C2=AB%=20=D0=BE=D1=88=D0=B8?= =?UTF-8?q?=D0=B1=D0=BE=D0=BA=C2=BB=20=D0=B1=D0=BE=D0=BB=D1=8C=D1=88=D0=B5?= =?UTF-8?q?=20=D0=BD=D0=B5=20=D0=BF=D1=80=D0=B5=D0=B2=D1=8B=D1=88=D0=B0?= =?UTF-8?q?=D0=B5=D1=82=20100%=20(=D0=B4=D0=B2=D0=BE=D0=B9=D0=BD=D0=BE?= =?UTF-8?q?=D0=B5=20=C3=97100)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit errorRate приходит из API уже в процентах (SUM(is_correct=0)*100/COUNT в analyticsController), а фронт умножал ещё раз на 100 → 4130%. Убрал лишнее ×100; заодно корректно работают пороги цвета (>=35 / >=60). Co-Authored-By: Claude Opus 4.8 (1M context) --- frontend/analytics.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/analytics.html b/frontend/analytics.html index 955ca6a..4cb2337 100644 --- a/frontend/analytics.html +++ b/frontend/analytics.html @@ -439,7 +439,8 @@ Попыток `; hardQuestions.forEach((q, i) => { - const errPct = Math.round((q.errorRate || 0) * 100); + // errorRate приходит из API уже в процентах (0–100), не умножаем повторно + const errPct = Math.round(q.errorRate || 0); const errCls = errPct >= 60 ? 'hq-pct-hi' : errPct >= 35 ? 'hq-pct-mid' : 'hq-pct-lo'; const diffLabel = q.difficulty === 1 ? 'Лёгкий' : q.difficulty === 2 ? 'Средний' : 'Сложный'; const diffCls = q.difficulty === 1 ? 'diff-1' : q.difficulty === 2 ? 'diff-2' : 'diff-3';