Complete training workflow and acceptance hardening
This commit is contained in:
parent
4c4b91064f
commit
7237265833
243 changed files with 17014 additions and 1500 deletions
|
|
@ -16,39 +16,102 @@ export function Debrief({ report, big = false }: { report: SessionReport; big?:
|
|||
const noticed = diff?.noticed ?? [];
|
||||
const overcautious = diff?.overcautious ?? [];
|
||||
const notes = report.notes ?? [];
|
||||
const passedMetrics = Math.max(0, report.metrics.length - report.failed_metrics);
|
||||
const improvementPoints = report.metrics.filter((metric) => !metric.passed).slice(0, 3);
|
||||
|
||||
return (
|
||||
<section className={big ? "debrief debrief-big" : "debrief"}>
|
||||
<h2>
|
||||
Разбор · оценка {report.score_final.toFixed(0)} из 100
|
||||
{report.overridden_by && ` · скорректировано (${report.overridden_by}), автооценка ${report.score_auto.toFixed(0)}`}
|
||||
</h2>
|
||||
<h2>Результаты занятия</h2>
|
||||
<div className="debrief-summary" aria-label="Краткие итоги занятия">
|
||||
<article className={report.passed ? "debrief-stat is-passed" : "debrief-stat is-failed"}>
|
||||
<span>Итог</span><strong>{report.passed ? "Зачёт" : "Не зачтено"}</strong>
|
||||
<small>Критерии: выполнено {passedMetrics} из {report.metrics.length}</small>
|
||||
<small>Допустимо не выполнить: {report.criteria.allowed_errors}</small>
|
||||
</article>
|
||||
<article className="debrief-stat debrief-score">
|
||||
<span>Ваша итоговая оценка</span><strong>{report.score_final.toFixed(0)}<small> из 100</small></strong>
|
||||
{report.overridden_by && <small>Изменено: {report.overridden_by}</small>}
|
||||
</article>
|
||||
<article className="debrief-stat">
|
||||
<span>Автоматическая оценка</span><strong>{report.score_auto.toFixed(0)}<small> из 100</small></strong>
|
||||
<small>{report.overridden_by ? "до корректировки преподавателя" : "расчёт по критериям занятия"}</small>
|
||||
</article>
|
||||
<article className="debrief-stat">
|
||||
<span>Упражнение</span><strong>{report.exercise === "dds" ? "ДДС" : report.exercise === "card" ? "КИО" : report.exercise === "call" ? "Вызов 112" : "112 → ДДС"}</strong>
|
||||
<small>{report.attempt ? `Попытка ${report.attempt}` : "Завершённое упражнение"}</small>
|
||||
</article>
|
||||
</div>
|
||||
<details className="debrief-tech-details">
|
||||
<summary>Служебные сведения</summary>
|
||||
<p>Идентификатор сценария: {report.scenario_id} · номер занятия: {report.session_id}</p>
|
||||
</details>
|
||||
<section className={`debrief-next-step ${report.passed ? "is-passed" : "is-failed"}`} aria-label="Что обсудить на разборе">
|
||||
<strong>{report.passed ? "Что получилось" : "На чём сосредоточиться"}</strong>
|
||||
{report.passed ? (
|
||||
<p>Курсант выполнил критерии зачёта. Разберите сильные решения и закрепите порядок действий.</p>
|
||||
) : improvementPoints.length ? (
|
||||
<>
|
||||
<p>Начните с этих критериев — по ним нужно разобрать решение курсанта:</p>
|
||||
<ul>{improvementPoints.map((metric) => <li key={metric.key}>{metric.title} — {metric.fact}</li>)}</ul>
|
||||
</>
|
||||
) : (
|
||||
<p>Зачёт не получен. Сверьте отметки и факты ниже с ходом занятия.</p>
|
||||
)}
|
||||
</section>
|
||||
<p className="ref">
|
||||
Скачать отчёт: <a href={`/api/sessions/${report.session_id}/report.csv`}>CSV</a>
|
||||
{" · "}<a href={`/api/sessions/${report.session_id}/report.pdf`}>PDF</a>
|
||||
Скачать отчёт: <a href={`/api/sessions/${report.session_id}/report.csv`}>таблица (CSV)</a>
|
||||
{" · "}<a href={`/api/sessions/${report.session_id}/report.pdf`}>документ (PDF)</a>
|
||||
</p>
|
||||
<p className={report.passed ? "state-ok" : "state-violated"}>
|
||||
{report.passed ? "Зачёт" : "Не зачтено"}: нарушено {report.failed_metrics} метрик,
|
||||
допустимо {report.criteria.allowed_errors}. Лимит решения ДДС —
|
||||
{` ${report.criteria.decision_time_limit_seconds} с`}; грамматика
|
||||
{report.criteria.require_correct_grammar ? " входит" : " не входит"} в оценку.
|
||||
{report.passed ? "Зачёт" : "Не зачтено"}: на разборе {report.failed_metrics} пунктов; допустимо пропустить {report.criteria.allowed_errors}. {report.exercise === "dds" && <>На первичное решение ДДС отводится
|
||||
{` ${report.criteria.decision_time_limit_seconds} с`}</>}
|
||||
{report.exercise === "dds" && <>; норматив отработки карточки ДДС —
|
||||
{` ${report.criteria.dds_card_work_time_limit_seconds ?? 180} с`}</>}
|
||||
{report.exercise === "card" && <>Норматив заполнения КИО —
|
||||
{` ${report.criteria.card_fill_time_limit_seconds ?? 180} с`}</>}
|
||||
{report.exercise && report.exercise !== "dds" && <>
|
||||
; грамматика описания КИО {report.criteria.require_correct_grammar ? "входит" : "не входит"} в оценку
|
||||
</>}.
|
||||
</p>
|
||||
{Object.keys(report.criteria.score_weights ?? {}).length > 0 && <p className="ref">
|
||||
Преподаватель переопределил веса: {Object.entries(report.criteria.score_weights ?? {})
|
||||
.map(([key, weight]) => `${key} — ${weight}`).join("; ")}.
|
||||
</p>}
|
||||
|
||||
{Boolean(report.card_results?.length) && <section className="debrief-card-results">
|
||||
<h3>Карточки занятия ({report.card_results!.length})</h3>
|
||||
{report.card_results!.map((card, index) => <details key={card.card_id}>
|
||||
<summary>Карточка {index + 1}: {card.title || card.scenario_id} · {card.score_auto.toFixed(0)} / 100
|
||||
{card.address ? ` · ${card.address}` : ""}</summary>
|
||||
{card.managed_service && <p><strong>Ответственная служба:</strong> {card.managed_service}</p>}
|
||||
<p><strong>Ответ диспетчера:</strong> {card.reply_text || "не внесён"}</p>
|
||||
{card.metrics.some((metric) => !metric.passed || (metric.credit != null && metric.credit < 1)) && <ul>
|
||||
{card.metrics.filter((metric) => !metric.passed || (metric.credit != null && metric.credit < 1)).map((metric) =>
|
||||
<li key={metric.key} className={metric.passed ? "ref" : "state-violated"}>
|
||||
<strong>{metric.title}:</strong> {metric.fact} · норматив {metric.norm}
|
||||
{metric.credit != null && ` · вклад ${Math.round(metric.credit * 100)}%`}
|
||||
</li>)}
|
||||
</ul>}
|
||||
{card.findings.map((finding, findingIndex) => <p className="state-violated" key={`${finding.code}-${findingIndex}`}>
|
||||
{finding.code}: {finding.summary}{finding.fact ? ` — ${finding.fact}` : ""}
|
||||
</p>)}
|
||||
</details>)}
|
||||
</section>}
|
||||
|
||||
<div className="columns">
|
||||
<section>
|
||||
<h3>Нормативы и факты</h3>
|
||||
<h3>Разбор по критериям</h3>
|
||||
<p className="ref">Сравните, что сделал курсант, с ожидаемым порядком действий.</p>
|
||||
<table className="grid">
|
||||
<tbody>
|
||||
{report.metrics.map((metric) => (
|
||||
<tr key={metric.key}>
|
||||
<th>{metric.title}</th>
|
||||
<td className={metric.passed ? "state-ok" : "state-violated"}>
|
||||
{metric.fact} · норматив {metric.norm}
|
||||
{` · вес ${metric.weight ?? 1}`}
|
||||
<strong className={`debrief-metric-status ${metric.passed ? "is-ok" : "is-needs-work"}`}>
|
||||
{metric.passed ? "Выполнено" : "Разобрать"}
|
||||
</strong>
|
||||
<span>{metric.fact} · ожидалось: {metric.norm}</span>
|
||||
{metric.ref && <span className="ref"> ({metric.ref})</span>}
|
||||
</td>
|
||||
</tr>
|
||||
|
|
@ -56,6 +119,14 @@ export function Debrief({ report, big = false }: { report: SessionReport; big?:
|
|||
</tbody>
|
||||
</table>
|
||||
|
||||
{report.metrics.some((metric) => metric.weight != null || metric.credit != null) && <details className="debrief-scoring-details">
|
||||
<summary>Как критерии повлияли на балл</summary>
|
||||
<ul>{report.metrics.filter((metric) => metric.weight != null || metric.credit != null).map((metric) => <li key={metric.key}>
|
||||
<strong>{metric.title}:</strong> вес {metric.weight ?? 1}
|
||||
{metric.credit != null && ` · вклад в оценку ${Math.round(metric.credit * 100)}%`}
|
||||
</li>)}</ul>
|
||||
</details>}
|
||||
|
||||
<h3>Отметки</h3>
|
||||
<table className="grid">
|
||||
<tbody>
|
||||
|
|
@ -68,7 +139,7 @@ export function Debrief({ report, big = false }: { report: SessionReport; big?:
|
|||
</td>
|
||||
</tr>
|
||||
))}
|
||||
{report.findings.length === 0 && <tr><td colSpan={2}>ошибок не найдено</td></tr>}
|
||||
{report.findings.length === 0 && <tr><td colSpan={2}>Замечаний по ходу занятия нет.</td></tr>}
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
|
@ -135,7 +206,9 @@ export function Debrief({ report, big = false }: { report: SessionReport; big?:
|
|||
</section>
|
||||
</div>
|
||||
|
||||
<h3>Транскрипт</h3>
|
||||
<details className="debrief-transcript">
|
||||
<summary>Весь ход разговора ({report.transcript.length} реплик)</summary>
|
||||
<p className="ref">Отметки и комментарии преподавателя привязаны к соответствующим репликам.</p>
|
||||
<table className="grid">
|
||||
<tbody>
|
||||
{report.transcript.map((line) => {
|
||||
|
|
@ -158,6 +231,7 @@ export function Debrief({ report, big = false }: { report: SessionReport; big?:
|
|||
})}
|
||||
</tbody>
|
||||
</table>
|
||||
</details>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue