chore: add dropped question to reports
This commit is contained in:
@@ -299,6 +299,7 @@ pub fn student_value(diagnostic: &StudentDiagnostic, config: &RenderConfig) -> V
|
||||
value.insert_some("correct", question.correct.map(Value::Bool));
|
||||
value.insert("credit", Value::Float(question.credit));
|
||||
value.insert("bonus", Value::Bool(question.bonus));
|
||||
value.insert("dropped", Value::Bool(question.dropped));
|
||||
value.insert("blank", Value::Bool(question.blank));
|
||||
value.insert_some("class-rate", question.class_rate.map(Value::Float));
|
||||
value.insert(
|
||||
@@ -348,6 +349,17 @@ pub fn student_value(diagnostic: &StudentDiagnostic, config: &RenderConfig) -> V
|
||||
),
|
||||
);
|
||||
|
||||
out.insert(
|
||||
"dropped-questions",
|
||||
Value::Array(
|
||||
diagnostic
|
||||
.dropped_questions
|
||||
.iter()
|
||||
.map(|n| Value::Int(*n as i64))
|
||||
.collect(),
|
||||
),
|
||||
);
|
||||
|
||||
out.insert(
|
||||
"review-lectures",
|
||||
Value::Array(
|
||||
@@ -612,6 +624,17 @@ pub fn cohort_value(diagnostic: &CohortDiagnostic, config: &RenderConfig) -> Val
|
||||
),
|
||||
);
|
||||
|
||||
out.insert(
|
||||
"dropped-questions",
|
||||
Value::Array(
|
||||
diagnostic
|
||||
.dropped_questions
|
||||
.iter()
|
||||
.map(|n| Value::Int(*n as i64))
|
||||
.collect(),
|
||||
),
|
||||
);
|
||||
|
||||
let triage_rows = |rows: &[crate::diagnostic::TriageRow]| -> Value {
|
||||
Value::Array(rows.iter().map(|row| triage_value(row, content)).collect())
|
||||
};
|
||||
@@ -1128,6 +1151,7 @@ mod tests {
|
||||
gaps: Vec::new(),
|
||||
grades: Vec::new(),
|
||||
lectures: Vec::new(),
|
||||
dropped_questions: Vec::new(),
|
||||
questions: Vec::new(),
|
||||
triage: crate::diagnostic::Triage::default(),
|
||||
predictions: crate::diagnostic::PredictionSummary::default(),
|
||||
|
||||
Reference in New Issue
Block a user