MDL-28259 Individual answers Feedback not shown in Cloze questions
authorTim Hunt <T.J.Hunt@open.ac.uk>
Wed, 14 Sep 2011 19:44:13 +0000 (20:44 +0100)
committerTim Hunt <T.J.Hunt@open.ac.uk>
Fri, 16 Sep 2011 11:02:08 +0000 (12:02 +0100)
question/type/multianswer/renderer.php

index 36e1c08..29c23d6 100644 (file)
@@ -132,6 +132,10 @@ abstract class qtype_multianswer_subq_renderer_base extends qtype_renderer {
             $feedback[] = $state->default_string(true);
         }
 
+        if ($feedbacktext) { // Note $options->feedback is already checked above.
+            $feedback[] = $feedbacktext;
+        }
+
         if ($options->rightanswer) {
             $feedback[] = get_string('correctansweris', 'qtype_shortanswer', $rightanswer);
         }
@@ -144,6 +148,10 @@ abstract class qtype_multianswer_subq_renderer_base extends qtype_renderer {
             $feedback[] = get_string('markoutofmax', 'question', $a);
         }
 
+        if (!$feedback) {
+            return '';
+        }
+
         return html_writer::tag('span', implode('<br />', $feedback),
                 array('class' => 'feedbackspan accesshide'));
     }