fix(analytics): «% ошибок» больше не превышает 100% (двойное ×100)
errorRate приходит из API уже в процентах (SUM(is_correct=0)*100/COUNT в analyticsController), а фронт умножал ещё раз на 100 → 4130%. Убрал лишнее ×100; заодно корректно работают пороги цвета (>=35 / >=60). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -439,7 +439,8 @@
|
||||
<th>Попыток</th>
|
||||
</tr></thead><tbody>`;
|
||||
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';
|
||||
|
||||
Reference in New Issue
Block a user