feat: improve dropped question support

This commit is contained in:
2026-09-20 00:41:26 -04:00
parent ba84c4d82a
commit cea03048b8
18 changed files with 302 additions and 86 deletions
+34
View File
@@ -396,6 +396,39 @@ pub fn analyze(
));
}
// A drop changes every student's percentage, so the two ways to get it wrong
// are worth saying out loud. Both are silent otherwise: the numbers simply
// come out different from the platform's.
if let Some(record) = record {
for placement in record.items.iter().filter(|p| p.dropped) {
let rows = set.for_item(placement.number);
if rows.is_empty() {
continue;
}
let all_credited = rows.iter().all(|r| r.credit >= 0.999);
if placement.dropped_with_credit() && !all_credited {
let short = rows.iter().filter(|r| r.credit < 0.999).count();
warnings.push(format!(
"question {} is marked `dropped_as: full_credit`, but {short} of {} responses \
carry less than full credit. Either the platform was not regraded or the \
export predates the regrade; until one of those is fixed this report's \
percentages will sit below the grade of record",
placement.number,
rows.len()
));
}
if !placement.dropped_with_credit() && all_credited {
warnings.push(format!(
"question {} is dropped and every response carries full credit, which is what \
crediting every option on the platform looks like. It is being removed from \
the denominator here, so this report will read slightly lower than the \
platform. Set `dropped_as: full_credit` if the platform kept the point",
placement.number
));
}
}
}
let mut items = Vec::new();
let mut p_values = Vec::new();
let mut rpbs = Vec::new();
@@ -986,6 +1019,7 @@ mod tests {
topics: vec![],
bonus: false,
dropped: false,
dropped_full_credit: false,
}
}