--- question/type/ddmatch/questiontype.php	2007-09-13 07:41:16.000000000 +0400
+++ question/type/ddmatch/questiontype.php	2008-11-27 15:24:58.000000000 +0300
@@ -293,10 +293,9 @@
         // Prepare a list of answers, removing duplicates.
         foreach ($subquestions as $subquestion) {
             foreach ($subquestion->options->answers as $ans) {
-                $allanswers[$ans->id] = $ans->answer;
-                if (!in_array($ans->answer, $answers)) {
-                    $ans->answer = $this->format_text($ans->answer,
-                        $question->questiontextformat, $cmoptions);
+                $allanswers[$ans->id] = $this->format_text($ans->answer, $question->questiontextformat, $cmoptions);
+                if (!in_array($allanswers[$ans->id], $answers)) {
+                    $ans->answer = $allanswers[$ans->id];
                     $answers[$ans->id] = $ans->answer;
                     $answerids[$ans->answer] = $ans->id;
                 }
