feat(exam-prep F3): интерактивный тренажёр — task-card + автопроверка ответа + retry + auto-open решения
This commit is contained in:
+194
-3
@@ -318,6 +318,195 @@
|
||||
font-family: 'Unbounded', sans-serif; font-weight: 800; color: #06D6A0;
|
||||
}
|
||||
|
||||
/* ═══════════════════════════════════════════════════════════════
|
||||
TaskCard component (`tc-*`) — reusable across views (F3+)
|
||||
═══════════════════════════════════════════════════════════════ */
|
||||
|
||||
.tc-card {
|
||||
background: var(--surface); border: 1.5px solid var(--border);
|
||||
border-radius: 14px; margin-bottom: 14px; overflow: hidden;
|
||||
transition: border-color .2s, box-shadow .2s;
|
||||
}
|
||||
.tc-card:hover { border-color: var(--border-h); }
|
||||
.tc-card.tc-correct {
|
||||
border-color: #06D6A0;
|
||||
box-shadow: 0 0 0 1.5px rgba(6,214,160,.25);
|
||||
}
|
||||
.tc-card.tc-wrong {
|
||||
border-color: #E63946;
|
||||
box-shadow: 0 0 0 1.5px rgba(230,57,70,.22);
|
||||
}
|
||||
|
||||
.tc-head {
|
||||
display: flex; align-items: center; gap: 12px;
|
||||
padding: 11px 22px; background: rgba(155,93,229,.04);
|
||||
border-bottom: 1.5px solid var(--border);
|
||||
}
|
||||
.tc-num {
|
||||
width: 28px; height: 28px; border-radius: 50%;
|
||||
background: var(--violet); color: #fff;
|
||||
font-family: 'Unbounded', sans-serif; font-size: .82rem; font-weight: 800;
|
||||
display: flex; align-items: center; justify-content: center; flex-shrink: 0;
|
||||
}
|
||||
.tc-num-label {
|
||||
font-family: 'Unbounded', sans-serif; font-size: .82rem; font-weight: 700;
|
||||
color: var(--text-2); letter-spacing: .02em;
|
||||
}
|
||||
.tc-type-badge {
|
||||
margin-left: auto;
|
||||
font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
|
||||
padding: 3px 8px; border-radius: 6px;
|
||||
background: rgba(155,93,229,.10); color: var(--violet);
|
||||
}
|
||||
.tc-type-open { background: rgba(6,214,160,.12); color: #059669; }
|
||||
.tc-type-long { background: rgba(248,150,30,.12); color: #B45309; }
|
||||
|
||||
.tc-body { padding: 18px 24px; font-size: .98rem; line-height: 1.8; }
|
||||
.tc-text .katex-display { margin: 12px 0 6px; overflow-x: auto; }
|
||||
.tc-figure { margin: 14px 0 4px; }
|
||||
.tc-figure svg, .tc-figure img { max-width: 100%; height: auto; }
|
||||
|
||||
/* MC: radio options as clickable rows */
|
||||
.tc-opts {
|
||||
display: flex; flex-wrap: wrap; gap: 10px 32px;
|
||||
margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border);
|
||||
}
|
||||
.tc-opts-vertical {
|
||||
display: flex; flex-direction: column; gap: 6px;
|
||||
margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
|
||||
}
|
||||
.tc-opt {
|
||||
display: inline-flex; align-items: flex-start; gap: 8px;
|
||||
padding: 6px 10px; border-radius: 8px;
|
||||
cursor: pointer; transition: background .12s;
|
||||
line-height: 1.5;
|
||||
}
|
||||
.tc-opt:hover { background: rgba(155,93,229,.06); }
|
||||
.tc-opt input[type="radio"] {
|
||||
accent-color: var(--violet);
|
||||
margin-top: 4px; flex-shrink: 0;
|
||||
}
|
||||
.tc-opt-lbl {
|
||||
font-family: 'Unbounded', sans-serif; font-weight: 800;
|
||||
color: var(--violet); font-size: .9rem; white-space: nowrap;
|
||||
}
|
||||
|
||||
/* Open: short text answer */
|
||||
.tc-input-row {
|
||||
display: flex; align-items: center; gap: 10px;
|
||||
margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.tc-ans-label {
|
||||
font-family: 'Manrope', sans-serif; font-size: .85rem; font-weight: 700;
|
||||
color: var(--text-2);
|
||||
}
|
||||
.tc-ans-input {
|
||||
flex: 1; min-width: 140px; max-width: 260px;
|
||||
padding: 9px 14px;
|
||||
border: 1.5px solid var(--border-h);
|
||||
border-radius: 9px;
|
||||
background: #fff; color: var(--text);
|
||||
font-family: 'Manrope', sans-serif; font-size: .95rem; font-weight: 600;
|
||||
transition: border-color .15s;
|
||||
}
|
||||
.tc-ans-input:focus { outline: none; border-color: var(--violet); }
|
||||
.tc-ans-input::placeholder { color: var(--text-3); font-weight: 500; }
|
||||
.tc-card.tc-correct .tc-ans-input { border-color: #06D6A0; background: rgba(6,214,160,.08); }
|
||||
.tc-card.tc-wrong .tc-ans-input { border-color: #E63946; background: rgba(230,57,70,.06); }
|
||||
|
||||
/* Check button + verdict */
|
||||
.tc-action-row {
|
||||
display: flex; align-items: center; gap: 14px;
|
||||
margin-top: 14px; flex-wrap: wrap;
|
||||
}
|
||||
.tc-check-btn {
|
||||
display: inline-flex; align-items: center; gap: 6px;
|
||||
padding: 9px 22px;
|
||||
border: none; border-radius: 9px;
|
||||
background: var(--violet); color: #fff;
|
||||
font-family: 'Manrope', sans-serif; font-size: .88rem; font-weight: 700;
|
||||
cursor: pointer; transition: filter .12s, opacity .12s;
|
||||
}
|
||||
.tc-check-btn:hover:not(:disabled) { filter: brightness(1.08); }
|
||||
.tc-check-btn:disabled { opacity: .38; cursor: not-allowed; }
|
||||
|
||||
.tc-verdict {
|
||||
display: inline-flex; align-items: center; gap: 12px;
|
||||
font-family: 'Manrope', sans-serif; font-size: .9rem; font-weight: 700;
|
||||
}
|
||||
.tc-verdict-ok, .tc-verdict-bad {
|
||||
display: inline-flex; align-items: center; gap: 6px;
|
||||
}
|
||||
.tc-verdict-ok { color: #06D6A0; }
|
||||
.tc-verdict-bad { color: #E63946; }
|
||||
.tc-verdict-ok svg, .tc-verdict-bad svg { width: 14px; height: 14px; }
|
||||
|
||||
.tc-retry-btn {
|
||||
display: inline-flex; align-items: center; gap: 5px;
|
||||
padding: 5px 12px;
|
||||
border: 1.5px solid var(--border-h); border-radius: 7px;
|
||||
background: transparent; color: var(--text-2);
|
||||
font-family: 'Manrope', sans-serif; font-size: .8rem; font-weight: 700;
|
||||
cursor: pointer; transition: all .12s;
|
||||
}
|
||||
.tc-retry-btn:hover { border-color: var(--violet); color: var(--violet); }
|
||||
.tc-retry-btn svg { width: 12px; height: 12px; }
|
||||
|
||||
/* Long: self-mark */
|
||||
.tc-self-mark {
|
||||
margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border);
|
||||
}
|
||||
.tc-self-mark-label {
|
||||
display: block; font-size: .85rem; color: var(--text-2);
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.tc-self-mark-btns { display: flex; flex-wrap: wrap; gap: 8px; }
|
||||
.tc-self-btn {
|
||||
display: inline-flex; align-items: center; gap: 6px;
|
||||
padding: 7px 16px;
|
||||
border: 1.5px solid var(--border-h); border-radius: 9px;
|
||||
background: transparent;
|
||||
font-family: 'Manrope', sans-serif; font-size: .85rem; font-weight: 700;
|
||||
cursor: pointer; transition: all .15s;
|
||||
}
|
||||
.tc-self-btn:disabled { opacity: .42; cursor: not-allowed; }
|
||||
.tc-self-btn svg { width: 13px; height: 13px; }
|
||||
.tc-self-yes { color: #06D6A0; border-color: #06D6A0; }
|
||||
.tc-self-yes:hover:not(:disabled) { background: rgba(6,214,160,.10); }
|
||||
.tc-self-no { color: #E63946; border-color: #E63946; }
|
||||
.tc-self-no:hover:not(:disabled) { background: rgba(230,57,70,.10); }
|
||||
|
||||
/* Solution toggle within task card */
|
||||
.tc-sol-wrap { padding: 0 22px 16px; }
|
||||
.tc-sol-btn {
|
||||
display: inline-flex; align-items: center; gap: 7px;
|
||||
padding: 6px 14px; border: 1.5px solid #06D6A0; border-radius: 8px;
|
||||
background: transparent; color: #06D6A0;
|
||||
font-family: 'Manrope', sans-serif; font-size: .85rem; font-weight: 700;
|
||||
cursor: pointer; transition: all .15s;
|
||||
}
|
||||
.tc-sol-btn:hover { background: rgba(6,214,160,.12); }
|
||||
.tc-sol-btn.open { background: #06D6A0; border-color: #06D6A0; color: #fff; }
|
||||
.tc-sol-btn svg { width: 13px; height: 13px; transition: transform .2s; }
|
||||
.tc-sol-btn.open svg { transform: rotate(90deg); }
|
||||
|
||||
.tc-sol-panel {
|
||||
display: none; margin-top: 14px; padding: 16px 20px;
|
||||
background: rgba(6,214,160,.06); border-radius: 10px;
|
||||
border-left: 3px solid #06D6A0;
|
||||
line-height: 1.85; font-size: .94rem;
|
||||
}
|
||||
.tc-sol-panel.visible { display: block; }
|
||||
.tc-sol-panel .katex-display { margin: 10px 0 6px; overflow-x: auto; }
|
||||
.tc-sol-panel ul { margin: 6px 0 6px 22px; }
|
||||
.tc-sol-panel li { margin: 3px 0; }
|
||||
.tc-sol-panel .sol-ans {
|
||||
display: inline-block; margin-top: 12px; padding: 4px 14px;
|
||||
background: rgba(6,214,160,.2); border-radius: 6px;
|
||||
font-family: 'Unbounded', sans-serif; font-weight: 800; color: #06D6A0;
|
||||
}
|
||||
|
||||
/* ── Mobile tweaks ─────────────────────────────────────────────── */
|
||||
@media (max-width: 640px) {
|
||||
.ep-wrap { padding: 20px 16px 60px; }
|
||||
@@ -326,7 +515,9 @@
|
||||
.ep-tab { padding: 9px 12px; font-size: .82rem; }
|
||||
.ep-card { padding: 16px 18px; }
|
||||
.ep-stat { padding: 14px 16px; }
|
||||
.vp-task-body { padding: 14px 18px; }
|
||||
.vp-sol-wrap { padding: 0 18px 14px; }
|
||||
.vp-sol-panel { padding: 14px 16px; }
|
||||
.vp-task-body, .tc-body { padding: 14px 18px; }
|
||||
.vp-sol-wrap, .tc-sol-wrap { padding: 0 18px 14px; }
|
||||
.vp-sol-panel, .tc-sol-panel { padding: 14px 16px; }
|
||||
.tc-input-row { gap: 8px; }
|
||||
.tc-ans-input { max-width: 100%; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user