'use strict';
/* ──────────────────────────────────────────────────────────────────
Dashboard view — landing screen of /exam-prep/:examKey
In F1: shows track meta + global counts + first-pass user progress.
Full live dashboard (slabnik themes, streak, plan) ships in F4 / F8 / F10.
────────────────────────────────────────────────────────────────── */
(async function () {
const { info } = await EP.boot();
const main = document.getElementById('ep-main');
if (!info?.track) {
main.innerHTML = `
Не удалось загрузить данные экзамена
Проверьте, что миграция применена и трек math9 включён.
`;
if (window.lucide) lucide.createIcons();
return;
}
const { track, counts, progress } = info;
const solvedPct = counts.total
? Math.round((progress.tasks_solved / counts.total) * 100)
: 0;
const accuracy = progress.total_attempts
? Math.round((progress.correct_attempts / progress.total_attempts) * 100)
: null;
main.innerHTML = `
Решено задач
${progress.tasks_solved} / ${counts.total}
${solvedPct}% от банка
Точность
${accuracy == null ? '—' : accuracy + '%'}
${progress.correct_attempts} верно из ${progress.total_attempts} попыток
Серия (streak)
—
Будет в F4
До экзамена
—
Задайте дату в F10
С чего начать
${escapeHtml(stripTags(track.intro_html || ''))}
Банк задач
Всего ${counts.total} задач в ${track.variants_count} вариантах.
Тестовая часть (А)
${counts.mc}
выбор варианта а–д
Краткий ответ
${counts.open}
число / дробь / пара
Развёрнутые
${counts.long}
выражения, графики
Слабые темы
Топ-3 темы с худшей точностью появятся после фазы F6 (тегирование) и F8.
`;
if (window.lucide) lucide.createIcons();
})();
function escapeHtml(s) {
return String(s || '').replace(/[&<>"']/g, c => ({ '&':'&', '<':'<', '>':'>', '"':'"', "'":''' }[c]));
}
function stripTags(s) {
return String(s || '').replace(/<[^>]+>/g, '');
}