feat: more comprehensive cohort report
Pipeline / check (pull_request) Failing after 35s
Pipeline / docs (pull_request) Skipped
Pipeline / nightly (pull_request) Skipped
Pipeline / release (pull_request) Skipped

This commit is contained in:
2026-09-22 01:19:35 -04:00
parent cea9769022
commit 220363d4d3
4 changed files with 418 additions and 21 deletions
+45
View File
@@ -620,6 +620,18 @@ pub fn cohort_value(diagnostic: &CohortDiagnostic, config: &RenderConfig) -> Val
.collect(),
),
);
// Separate from `questions` so no statistic can pick them up, and merged
// back in by the evidence section, which describes rather than measures.
out.insert(
"dropped-detail",
Value::Array(
diagnostic
.dropped_detail
.iter()
.map(|q| cohort_question_value(q, content))
.collect(),
),
);
out.insert(
"grades",
@@ -872,6 +884,18 @@ fn cohort_question_value(question: &CohortQuestionRow, content: bool) -> Value {
.collect(),
),
);
value.insert_some(
"stem",
question
.stem
.as_ref()
.map(|text| markup_value(text, content)),
);
value.insert("dropped", Value::Bool(question.dropped));
value.insert(
"dropped-full-credit",
Value::Bool(question.dropped_full_credit),
);
value.insert(
"taught-in",
Value::Array(question.taught_in.iter().map(Value::str).collect()),
@@ -902,6 +926,27 @@ fn cohort_question_value(question: &CohortQuestionRow, content: bool) -> Value {
.map(|option| {
let mut value = Value::dict();
value.insert("letter", Value::str(&option.letter));
value.insert_some(
"text",
option.text.as_ref().map(|text| markup_value(text, content)),
);
// The letter on each paper, so a statistic reported against
// the bank letter can be checked against a student's copy.
value.insert(
"printed",
Value::Array(
option
.printed
.iter()
.map(|printed| {
let mut pair = Value::dict();
pair.insert("form", Value::str(&printed.form));
pair.insert("letter", Value::str(&printed.letter));
pair
})
.collect(),
),
);
value.insert("count", Value::Int(option.count as i64));
value.insert("rate", Value::Float(option.rate));
value.insert("is-key", Value::Bool(option.is_key));