]> git.mjollnir.org Git - moodle.git/commitdiff
qtype multichoice: MDL-17029 answernumbering option was not being backed up or restored.
authortjhunt <tjhunt>
Mon, 27 Oct 2008 04:23:23 +0000 (04:23 +0000)
committertjhunt <tjhunt>
Mon, 27 Oct 2008 04:23:23 +0000 (04:23 +0000)
question/type/multichoice/questiontype.php

index 02d48e29b880c259f59cbe91b79df7557f4167e7..669db3b4e24f57a99d51b8f62843686780b746fc 100644 (file)
@@ -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