From 188170b7207e921416fb411d80717c3298482ba5 Mon Sep 17 00:00:00 2001 From: Niklas Saari Date: Fri, 30 Aug 2024 16:04:28 +0300 Subject: [PATCH] Wrap multichoice feedback text with CDATA --- src/question.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/question.rs b/src/question.rs index 059591b..04391c7 100644 --- a/src/question.rs +++ b/src/question.rs @@ -191,19 +191,19 @@ impl Question for MultiChoiceQuestion { writer, "correctfeedback", TextFormat::default().into(), - |writer| write_text_tag(writer, &self.correctfeedback, false), + |writer| write_text_tag(writer, &self.correctfeedback, true), )?; write_named_formatted_scope( writer, "partiallycorrectfeedback", TextFormat::default().into(), - |writer| write_text_tag(writer, &self.partiallycorrectfeedback, false), + |writer| write_text_tag(writer, &self.partiallycorrectfeedback, true), )?; write_named_formatted_scope( writer, "incorrectfeedback", TextFormat::default().into(), - |writer| write_text_tag(writer, &self.incorrectfeedback, false), + |writer| write_text_tag(writer, &self.incorrectfeedback, true), )?; write_named_formatted_scope(writer, "answernumbering", None, |writer| { writer.write(XmlEvent::characters(&self.answernumbering.to_string()))?; @@ -492,6 +492,7 @@ mod tests { let mut buf = String::new(); tmp_file.seek(std::io::SeekFrom::Start(0)).unwrap(); tmp_file.read_to_string(&mut buf).unwrap(); + print!("{buf}"); let expected = r#" @@ -521,13 +522,13 @@ mod tests { true 1 - Correct! + - Partially correct! + - Incorrect! + abc "#;