From c0ffeb396984f71dfb375cd9b91b193a9f97e2a5 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Tue, 27 May 2008 13:42:27 +0000 Subject: [PATCH] MDL-14764 - Imported multichoice questions may have a blank answernumbering value, which results in an "ERR" prefix to all answers' text. Thanks to Nate H for the fix. --- question/format/xml/format.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/question/format/xml/format.php b/question/format/xml/format.php index 6d1f3e4ee5..62da62affa 100755 --- a/question/format/xml/format.php +++ b/question/format/xml/format.php @@ -180,7 +180,12 @@ class qformat_xml extends qformat_default { $qo->correctfeedback = $this->getpath( $question, array('#','correctfeedback',0,'#','text',0,'#'), '', true ); $qo->partiallycorrectfeedback = $this->getpath( $question, array('#','partiallycorrectfeedback',0,'#','text',0,'#'), '', true ); $qo->incorrectfeedback = $this->getpath( $question, array('#','incorrectfeedback',0,'#','text',0,'#'), '', true ); - + + // There was a time on the 1.8 branch when it could output an empty answernumbering tag, so fix up any found. + if (empty($qo->answernumbering)) { + $qo->answernumbering = 'abc'; + } + // run through the answers $answers = $question['#']['answer']; $a_count = 0; -- 2.39.5