diff --git a/Cargo.lock b/Cargo.lock index cbbfa73d64156af72de5421431b39f515a70a86d..240340ce88a0766e8f4bfc1fad6971a906feee03 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1167,7 +1167,7 @@ dependencies = [ [[package]] name = "rusty-hektor" -version = "6.0.2" +version = "6.1.0" dependencies = [ "anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", "assert_cmd 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index 8d4c4e4a47af548bc488e412cf9c3aab817e302a..2eb11b1c056837a2b093960c6a4df229c6b7749a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rusty-hektor" -version = "6.0.2" +version = "6.1.0" authors = ["robinwilliam.hundt <robinwilliam.hundt@stud.uni-goettingen.de>"] license = "MIT OR Apache-2.0" description = "A tool to convert ILIAS exam output" diff --git a/src/transform/submissions.rs b/src/transform/submissions.rs index f9c11349ba7940c1d9c1083f4b8385bceefedee8..bd5f03df0d6238543a917b9cc5d8bc8351f1f0ed 100644 --- a/src/transform/submissions.rs +++ b/src/transform/submissions.rs @@ -2,7 +2,7 @@ use std::collections::HashMap; use itertools::Itertools; -use anyhow::{anyhow, Context, Result}; +use anyhow::{Context, Result}; use crate::input_types::ilias::results_file::Solution; use crate::input_types::ipynb::Notebook; @@ -86,13 +86,21 @@ pub fn transform_submissions( .or_insert_with(|| vec![]) .push(submission); } - None => return Err(anyhow!( - "Unable to find solution with field={}, for active_fi={}, question_fi={}.\ - Did you provide the correct field for the `cloze-question-field` option?", - field, - active_fi, - question_fi - )), + None => { + log::warn!( + "Unable to find solution with field={}, for active_fi={}, question_fi={}. \ + Falling back to empty solution.", + field, + active_fi, + question_fi + ); + + let submission = create_submission(&question_fi, String::from(""))?; + submission_map + .entry(active_fi) + .or_insert_with(|| vec![]) + .push(submission); + } } } else { // in this branch we're parsing question of type "assSourceCode"