]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-10300 - cleaning incorrectly applied to overall feedback.
authortjhunt <tjhunt>
Mon, 30 Jul 2007 10:33:43 +0000 (10:33 +0000)
committertjhunt <tjhunt>
Mon, 30 Jul 2007 10:33:43 +0000 (10:33 +0000)
mod/quiz/locallib.php
mod/quiz/mod_form.php
mod/quiz/report/overview/report.php

index 48cb83786efd35e3d9788c2644e40eeab0b5e87f..bf4efc9c34206c16fb9e52b9f1a1d3349d104763 100644 (file)
@@ -346,7 +346,7 @@ function quiz_rescale_grade($rawgrade, $quiz) {
 
 /**
  * Get the feedback text that should be show to a student who
- * got this grade on this quiz.
+ * got this grade on this quiz. The feedback is processed ready for diplay.
  *
  * @param float $grade a grade on this quiz.
  * @param integer $quizid the id of the quiz object.
@@ -360,6 +360,11 @@ function quiz_feedback_for_grade($grade, $quizid) {
         $feedback = '';
     }
 
+    // Clean the text, ready for display.
+    $formatoptions = new stdClass;
+    $formatoptions->noclean = true;
+    $feedback = format_text($feedback, FORMAT_MOODLE, $formatoptions);
+
     return $feedback;
 }
 
index fac1761d205e5d7aefc9e45e2843fde7a0d71d7d..c34deb476baccd6d315d58df8e0ebf0054e6d1fe 100644 (file)
@@ -228,7 +228,7 @@ class mod_quiz_mod_form extends moodleform_mod {
         }
         $numfeedbacks = max(count($this->_feedbacks) * 1.5, 5);
 
-        $mform->setType('feedbacktext', PARAM_TEXT);
+        $mform->setType('feedbacktext', PARAM_RAW);
         $mform->setType('feedbackboundaries', PARAM_NOTAGS);
 
         $nextel=$this->repeat_elements($repeatarray, $numfeedbacks-1,
index ff9fc5db5e8ffa8f3f1cab5267c11ef494085862..7e29ddf1fc3e1d26acba85c5647d4159e3acbbc2 100644 (file)
@@ -42,6 +42,10 @@ class quiz_report extends quiz_default_report {
             break;
         }
 
+        // Set of format options for teacher-created content, for example overall feedback.
+        $nocleanformatoptions = new stdClass;
+        $nocleanformatoptions->noclean = true;
+
         // Set table options
         $noattempts = optional_param('noattempts', 0, PARAM_INT);
         $detailedmarks = optional_param('detailedmarks', 0, PARAM_INT);
@@ -466,7 +470,7 @@ class quiz_report extends quiz_default_report {
                     }
                     if ($hasfeedback) {
                         if ($attempt->timefinish) {
-                            $row[] = $attempt->feedbacktext;
+                            $row[] = format_text($attempt->feedbacktext, FORMAT_MOODLE, $nocleanformatoptions);
                         } else {
                             $row[] = '-';
                         }