pub trait Question {
// Required methods
fn get_name(&self) -> &str;
fn get_description(&self) -> &str;
fn set_text_format(&mut self, format: TextFormat);
fn add_answers(&mut self, answers: Vec<Answer>) -> Result<(), QuizError>;
fn to_xml(&self, writer: &mut EventWriter<&File>) -> Result<(), QuizError>;
}
Expand description
Common trait for all question types
Required Methods§
Sourcefn get_description(&self) -> &str
fn get_description(&self) -> &str
Returns the description of the question.
Sourcefn set_text_format(&mut self, format: TextFormat)
fn set_text_format(&mut self, format: TextFormat)
Set the text rendering format TextFormat
for the question.