Files
WhatIDo/public/quiz-public.html
T
dev 533bd5b3d6 Публичный опрос: детальный просмотр результатов и правка вёрстки входа
- quiz-public.js/html: детальный разбор ответов после прохождения с
  отметками верно/неверно, баллами, правильными вариантами и текстом
  ответа; новые CSS-классы .qp-result-* и переменные --qp-*
- index.html: имя и группа в одной строке (.fields-row), убран
  padding у .photo-card, перевод строки в конце файла
2026-12-03 11:19:46 +03:00

113 lines
9.9 KiB
HTML

<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Опрос</title>
<link rel="stylesheet" href="admin.css">
<link rel="stylesheet" href="/admin-dark.css" disabled id="themeCss">
<script src="js/theme.js"></script>
<style>
body { background: var(--bg); }
.qp-wrap { max-width: 760px; margin: 0 auto; padding: 28px 16px 64px; }
.qp-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.qp-brand { font-size: .82rem; color: var(--muted); }
.qp-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.qp-cover { width: 100%; object-fit: cover; border-radius: 10px; display: block; margin-bottom: 14px; }
.qp-title { font-size: 1.35rem; font-weight: 700; line-height: 1.3; }
.qp-sub { color: var(--muted); font-size: .84rem; margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.qp-desc { margin-top: 12px; font-size: .92rem; line-height: 1.65; overflow-wrap: anywhere; }
.qp-desc img { max-width: 100%; height: auto; border-radius: 10px; }
.qp-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
.qz-q { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-top: 14px; background: var(--card); }
.qz-q-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.qz-q-num { font-size: .76rem; font-weight: 700; color: #fff; background: var(--accent); border-radius: 8px; min-width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; flex-shrink: 0; }
.qz-q-text { font-size: .95rem; font-weight: 600; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.qz-q-desc { font-size: .82rem; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.qz-opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-top: 8px; background: var(--bg); cursor: pointer; }
.qz-opt input { margin-top: 2px; width: 17px; height: 17px; accent-color: var(--accent); flex-shrink: 0; }
.qz-opts.inline { display: flex; flex-wrap: wrap; gap: 8px; }
.qz-opts.inline .qz-opt { flex: 1 1 160px; margin-top: 0; }
.qz-opt-text { flex: 1; font-size: .88rem; line-height: 1.5; overflow-wrap: anywhere; }
.qz-opt-desc { font-size: .78rem; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.qz-answer { width: 100%; }
.qz-assets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.qz-asset { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--card); max-width: 100%; }
.qz-asset img { display: block; width: 160px; height: 100px; object-fit: cover; cursor: zoom-in; }
.qz-asset audio { display: block; width: min(320px, 78vw); height: 36px; }
.qz-asset video { display: block; width: min(320px, 78vw); max-height: 180px; background: #000; }
.qz-asset a { display: flex; align-items: center; gap: 6px; padding: 9px 11px; font-size: .78rem; overflow-wrap: anywhere; }
.qz-asset-cap { font-size: .72rem; color: var(--muted); padding: 5px 9px; border-top: 1px solid var(--border); }
.qz-timer { font-variant-numeric: tabular-nums; font-size: .86rem; font-weight: 700; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); }
.qz-timer.low { color: #b91c1c; border-color: rgba(220,38,38,.4); background: rgba(220,38,38,.07); }
.qp-hint { font-size: .78rem; color: var(--muted); line-height: 1.5; }
.qp-error { text-align: center; color: #b91c1c; padding: 28px 16px; font-size: .9rem; border: 1px dashed rgba(220,38,38,.4); border-radius: var(--radius); }
.qp-done { text-align: center; padding: 12px 0 4px; --qp-ok: var(--success, #15803d); --qp-bad: var(--danger, #b91c1c); --qp-ok-soft: rgba(34,197,94,.09); --qp-bad-soft: rgba(239,68,68,.08); --qp-ok-line: rgba(34,197,94,.45); --qp-bad-line: rgba(239,68,68,.42); }
.qp-done .qp-done-ic { font-size: 2.4rem; line-height: 1; margin-bottom: 8px; }
.qp-done .qp-done-ic.ok { color: var(--qp-ok); }
.qp-done .qp-done-ic.bad { color: var(--qp-bad); }
.qp-done-hint { margin-top: 8px; }
.qp-grade { margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.qp-grade img { width: 56px; height: 56px; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); }
.qp-grade-label { font-weight: 700; font-size: 1.1rem; }
.qp-score { margin-top: 12px; display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 6px 10px; }
.qp-score-val { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.qp-score-max { margin-left: 4px; font-size: 1rem; font-weight: 600; color: var(--muted); }
.qp-score-pct { font-size: .8rem; font-weight: 700; color: var(--muted); background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; font-variant-numeric: tabular-nums; }
.qp-badge { display: inline-flex; align-items: center; font-size: .78rem; font-weight: 700; border-radius: 999px; padding: 3px 10px; border: 1px solid var(--border); background: var(--bg); color: var(--muted); }
.qp-badge.ok { color: var(--qp-ok); border-color: var(--qp-ok-line); background: var(--qp-ok-soft); }
.qp-badge.bad { color: var(--qp-bad); border-color: var(--qp-bad-line); background: var(--qp-bad-soft); }
.qp-result-head { margin-top: 22px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; text-align: left; font-size: .74rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.qp-result-sum { display: inline-flex; align-items: baseline; gap: 10px; font-size: .78rem; font-weight: 600; letter-spacing: 0; text-transform: none; }
.qp-result-sum .ok { color: var(--qp-ok); }
.qp-result-sum .bad { color: var(--qp-bad); }
.qp-result { margin-top: 10px; display: grid; gap: 10px; }
.qp-result-item { text-align: left; display: grid; gap: 9px; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--bg); }
.qp-result-item.ok { border-color: var(--qp-ok-line); background: var(--qp-ok-soft); }
.qp-result-item.bad { border-color: var(--qp-bad-line); background: var(--qp-bad-soft); }
.qp-result-q { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 6px 8px; font-size: .85rem; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.qp-result-num { flex-shrink: 0; min-width: 22px; height: 22px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 7px; background: var(--card); color: var(--muted); font-size: .7rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.qp-result-q-text { flex: 1 1 240px; }
.qp-result-meta { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }
.qp-result-points { font-size: .72rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.qp-result-mark { font-size: .7rem; font-weight: 700; border-radius: 999px; padding: 2px 8px; border: 1px solid var(--border); background: var(--card); color: var(--muted); white-space: nowrap; }
.qp-result-mark.ok { color: var(--qp-ok); border-color: var(--qp-ok-line); background: transparent; }
.qp-result-mark.bad { color: var(--qp-bad); border-color: var(--qp-bad-line); background: transparent; }
.qp-result-opts { display: grid; gap: 6px; }
.qp-result-opt { display: flex; align-items: flex-start; gap: 8px; border: 1px solid var(--border); border-radius: 9px; padding: 7px 10px; background: var(--card); font-size: .8rem; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.qp-result-opt.ok { border-color: var(--qp-ok-line); background: var(--qp-ok-soft); color: var(--text); }
.qp-result-opt.bad { border-color: var(--qp-bad-line); background: var(--qp-bad-soft); color: var(--text); }
.qp-result-opt.picked { border-color: var(--accent); background: var(--accent-soft, rgba(37,99,235,.06)); color: var(--text); }
.qp-result-ic { flex-shrink: 0; width: 14px; text-align: center; font-weight: 700; color: var(--qp-ok); }
.qp-result-opt.bad .qp-result-ic { color: var(--qp-bad); }
.qp-result-opt.picked .qp-result-ic { color: var(--accent); }
.qp-result-opt-text { flex: 1; }
.qp-result-opt-desc { margin-top: 2px; font-size: .74rem; color: var(--muted); }
.qp-result-tag { flex-shrink: 0; margin-left: auto; font-size: .64rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.qp-result-answer { font-size: .8rem; line-height: 1.55; color: var(--text); overflow-wrap: anywhere; }
.qp-result-answer-label { color: var(--muted); }
.qp-result-answer.muted { color: var(--muted); font-style: italic; }
.qp-actions-center { justify-content: center; }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.75); display: none; align-items: center; justify-content: center; z-index: 200; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal-overlay img { max-width: 92vw; max-height: 88vh; border-radius: 10px; }
</style>
</head>
<body>
<div class="qp-wrap">
<div class="qp-top">
<span class="qp-brand" id="qpBrand">Тест</span>
<button type="button" class="btn-link" data-theme-toggle>Тема</button>
</div>
<div id="qpBody"></div>
</div>
<div class="modal-overlay" id="imgModal"><img id="imgModalSrc" alt=""></div>
<div class="toast" id="toast"></div>
<script src="vendor/lucide.min.js"></script>
<script src="js/md.js"></script>
<script src="js/quiz-public.js"></script>
</body>
</html>