feat: add learning objective targets
This commit is contained in:
@@ -322,7 +322,7 @@ pub fn student_value(diagnostic: &StudentDiagnostic, config: &RenderConfig) -> V
|
||||
value.insert_some("level", question.level.map(|l| Value::Int(l as i64)));
|
||||
value.insert(
|
||||
"objectives",
|
||||
Value::Array(question.objectives.iter().map(|o| Value::str(o)).collect()),
|
||||
Value::Array(question.objectives.iter().map(Value::str).collect()),
|
||||
);
|
||||
value.insert_some("correct", question.correct.map(Value::Bool));
|
||||
value.insert("credit", Value::Float(question.credit));
|
||||
@@ -350,7 +350,7 @@ pub fn student_value(diagnostic: &StudentDiagnostic, config: &RenderConfig) -> V
|
||||
}
|
||||
value.insert(
|
||||
"taught-in",
|
||||
Value::Array(question.taught_in.iter().map(|s| Value::str(s)).collect()),
|
||||
Value::Array(question.taught_in.iter().map(Value::str).collect()),
|
||||
);
|
||||
value.insert(
|
||||
"review",
|
||||
@@ -741,7 +741,7 @@ pub fn cohort_value(diagnostic: &CohortDiagnostic, config: &RenderConfig) -> Val
|
||||
|
||||
out.insert(
|
||||
"blueprint",
|
||||
Value::Array(diagnostic.blueprint.iter().map(|s| Value::str(s)).collect()),
|
||||
Value::Array(diagnostic.blueprint.iter().map(Value::str).collect()),
|
||||
);
|
||||
|
||||
out.insert(
|
||||
@@ -767,7 +767,7 @@ pub fn cohort_value(diagnostic: &CohortDiagnostic, config: &RenderConfig) -> Val
|
||||
|
||||
out.insert(
|
||||
"warnings",
|
||||
Value::Array(diagnostic.warnings.iter().map(|s| Value::str(s)).collect()),
|
||||
Value::Array(diagnostic.warnings.iter().map(Value::str).collect()),
|
||||
);
|
||||
|
||||
out
|
||||
@@ -793,7 +793,7 @@ fn triage_value(row: &crate::diagnostic::TriageRow, content: bool) -> Value {
|
||||
);
|
||||
value.insert(
|
||||
"taught-in",
|
||||
Value::Array(row.taught_in.iter().map(|t| Value::str(t)).collect()),
|
||||
Value::Array(row.taught_in.iter().map(Value::str).collect()),
|
||||
);
|
||||
value.insert_some("option", row.option.as_ref().map(Value::str));
|
||||
value.insert_some("option-share", row.option_share.map(Value::Float));
|
||||
@@ -845,7 +845,7 @@ fn cohort_question_value(question: &CohortQuestionRow, content: bool) -> Value {
|
||||
value.insert_some("level", question.level.map(|l| Value::Int(l as i64)));
|
||||
value.insert(
|
||||
"objectives",
|
||||
Value::Array(question.objectives.iter().map(|o| Value::str(o)).collect()),
|
||||
Value::Array(question.objectives.iter().map(Value::str).collect()),
|
||||
);
|
||||
value.insert(
|
||||
"objective-texts",
|
||||
@@ -859,11 +859,11 @@ fn cohort_question_value(question: &CohortQuestionRow, content: bool) -> Value {
|
||||
);
|
||||
value.insert(
|
||||
"taught-in",
|
||||
Value::Array(question.taught_in.iter().map(|t| Value::str(t)).collect()),
|
||||
Value::Array(question.taught_in.iter().map(Value::str).collect()),
|
||||
);
|
||||
value.insert(
|
||||
"lectures",
|
||||
Value::Array(question.lectures.iter().map(|l| Value::str(l)).collect()),
|
||||
Value::Array(question.lectures.iter().map(Value::str).collect()),
|
||||
);
|
||||
value.insert("difficulty-band", Value::str(&question.difficulty_band));
|
||||
value.insert(
|
||||
@@ -876,7 +876,7 @@ fn cohort_question_value(question: &CohortQuestionRow, content: bool) -> Value {
|
||||
value.insert("blank-rate", Value::Float(question.blank_rate));
|
||||
value.insert(
|
||||
"key",
|
||||
Value::Array(question.key.iter().map(|k| Value::str(k)).collect()),
|
||||
Value::Array(question.key.iter().map(Value::str).collect()),
|
||||
);
|
||||
value.insert(
|
||||
"options",
|
||||
@@ -899,7 +899,7 @@ fn cohort_question_value(question: &CohortQuestionRow, content: bool) -> Value {
|
||||
);
|
||||
value.insert(
|
||||
"flags",
|
||||
Value::Array(question.flags.iter().map(|f| Value::str(f)).collect()),
|
||||
Value::Array(question.flags.iter().map(Value::str).collect()),
|
||||
);
|
||||
value.insert(
|
||||
"notes",
|
||||
@@ -1236,4 +1236,4 @@ mod tests {
|
||||
assert!(text.contains("reliability"));
|
||||
assert!(!text.contains("stem"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user