feat: add learning objective targets
This commit is contained in:
32 files changed
+2396
-448
No files matched your search
@@ -57,6 +57,8 @@ pub fn schema() -> Schema {
|
||||
Field::new("score", DataType::Float64, false),
|
||||
Field::new("response_time_seconds", DataType::Utf8, false),
|
||||
Field::new("level", DataType::UInt32, false),
|
||||
// The stored column name predates the objective/target rename and is left
|
||||
// alone: an existing parquet file has to keep loading.
|
||||
Field::new("learning_objectives", DataType::Utf8, false),
|
||||
Field::new("topics", DataType::Utf8, false),
|
||||
Field::new("bonus", DataType::Boolean, false),
|
||||
@@ -120,7 +122,7 @@ fn to_batch(rows: &[FlatResponse]) -> Result<RecordBatch> {
|
||||
f64c(|r| r.score),
|
||||
s(|r| &r.response_time_seconds),
|
||||
u32c(|r| r.level as u32),
|
||||
s(|r| &r.learning_objectives),
|
||||
s(|r| &r.learning_targets),
|
||||
s(|r| &r.topics),
|
||||
boolc(|r| r.bonus),
|
||||
boolc(|r| r.dropped),
|
||||
@@ -285,7 +287,7 @@ fn from_batch(batch: &RecordBatch, path: &Path) -> Result<Vec<FlatResponse>> {
|
||||
let score = floats("score")?;
|
||||
let response_time_seconds = strings("response_time_seconds")?;
|
||||
let level = uints("level")?;
|
||||
let learning_objectives = strings("learning_objectives")?;
|
||||
let learning_targets = strings("learning_objectives")?;
|
||||
let topics = strings("topics")?;
|
||||
let bonus = bools("bonus")?;
|
||||
let dropped = bools("dropped")?;
|
||||
@@ -326,7 +328,7 @@ fn from_batch(batch: &RecordBatch, path: &Path) -> Result<Vec<FlatResponse>> {
|
||||
score: score.value(i),
|
||||
response_time_seconds: response_time_seconds.value(i).to_string(),
|
||||
level: level.value(i) as u8,
|
||||
learning_objectives: learning_objectives.value(i).to_string(),
|
||||
learning_targets: learning_targets.value(i).to_string(),
|
||||
topics: topics.value(i).to_string(),
|
||||
bonus: bonus.value(i),
|
||||
dropped: dropped.value(i),
|
||||
@@ -372,7 +374,7 @@ mod tests {
|
||||
score: 1.5,
|
||||
response_time_seconds: "42.0".into(),
|
||||
level: 3,
|
||||
learning_objectives: "lo-a,lo-b".into(),
|
||||
learning_targets: "lo-a,lo-b".into(),
|
||||
topics: "kinetics".into(),
|
||||
bonus: false,
|
||||
dropped: false,
|
||||
@@ -404,7 +406,7 @@ mod tests {
|
||||
assert_eq!(back.len(), 2);
|
||||
assert_eq!(back[0].student_key, "s1");
|
||||
assert_eq!(back[1].item_number, 2);
|
||||
assert_eq!(back[0].learning_objectives, "lo-a,lo-b");
|
||||
assert_eq!(back[0].learning_targets, "lo-a,lo-b");
|
||||
assert_eq!(back[0].credit, 1.0);
|
||||
assert_eq!(back[0].level, 3);
|
||||
assert!(!back[0].bonus);
|
||||
|
||||
Reference in new issue
Block a user