Skip to content
Snippets Groups Projects
Commit 5c167cbc authored by robinwilliam.hundt's avatar robinwilliam.hundt
Browse files

Changed parsing of submission code attribute

parent 58f58dee
No related branches found
No related tags found
No related merge requests found
Pipeline #118823 passed
...@@ -343,16 +343,17 @@ fn extract_submission_for_student( ...@@ -343,16 +343,17 @@ fn extract_submission_for_student(
let mut val = el let mut val = el
.attribute_value("value1") .attribute_value("value1")
.expect("No value1 attr found, unable to parse code"); .expect("No value1 attr found, unable to parse code");
if val == "0" { // TODO this seems rather brittle...
if val.len() == 1 {
val = el val = el
.attribute_value("value2") .attribute_value("value2")
.expect("value1 is 0 but value2 attr not found, unable to parse code"); .expect("value1 is only one long, but value2 attr not found, unable to parse code");
} }
val val
}); });
let code = match encoded_attr { let code = match encoded_attr {
Some(val) => String::from_utf8(decode(val)?)?, Some(val) => String::from_utf8(decode(val).expect(&format!("Unable to decode: {}", &val)))?,
None => "".to_string(), None => "".to_string(),
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment