From 4b31ac5cd178400dc489937f5274c7f1fdcf9646 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Mon, 27 Oct 2008 04:23:23 +0000 Subject: [PATCH] qtype multichoice: MDL-17029 answernumbering option was not being backed up or restored. --- question/type/multichoice/questiontype.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/question/type/multichoice/questiontype.php b/question/type/multichoice/questiontype.php index 02d48e29b88..669db3b4e24 100644 --- a/question/type/multichoice/questiontype.php +++ b/question/type/multichoice/questiontype.php @@ -438,6 +438,9 @@ class question_multichoice_qtype extends default_questiontype { fwrite ($bf,full_tag("CORRECTFEEDBACK",$level+1,false,$multichoice->correctfeedback)); fwrite ($bf,full_tag("PARTIALLYCORRECTFEEDBACK",$level+1,false,$multichoice->partiallycorrectfeedback)); fwrite ($bf,full_tag("INCORRECTFEEDBACK",$level+1,false,$multichoice->incorrectfeedback)); + fwrite ($bf,full_tag("INCORRECTFEEDBACK",$level+1,false,$multichoice->incorrectfeedback)); + fwrite ($bf,full_tag("INCORRECTFEEDBACK",$level+1,false,$multichoice->incorrectfeedback)); + fwrite ($bf,full_tag("ANSWERNUMBERING",$level+1,false,$multichoice->answernumbering)); $status = fwrite ($bf,end_tag("MULTICHOICE",$level,true)); } @@ -488,6 +491,11 @@ class question_multichoice_qtype extends default_questiontype { } else { $multichoice->incorrectfeedback = ''; } + if (array_key_exists("ANSWERNUMBERING", $mul_info['#'])) { + $multichoice->answernumbering = backup_todb($mul_info['#']['ANSWERNUMBERING']['0']['#']); + } else { + $multichoice->answernumbering = 'abc'; + } //We have to recode the answers field (a list of answers id) //Extracts answer id from sequence