MDL-28222 quiz reports missing context in call to quiz_report_feedback_for_grade.
authorTim Hunt <T.J.Hunt@open.ac.uk>
Wed, 6 Jul 2011 18:08:52 +0000 (19:08 +0100)
committerTim Hunt <T.J.Hunt@open.ac.uk>
Wed, 6 Jul 2011 18:08:52 +0000 (19:08 +0100)
mod/quiz/report/attemptsreport.php

index 1df5d9b..4a4698f 100644 (file)
@@ -469,15 +469,15 @@ abstract class quiz_attempt_report_table extends table_sql {
             return '-';
         }
 
-        if (!$this->is_downloading()) {
-            return quiz_report_feedback_for_grade(
-                    quiz_rescale_grade($attempt->sumgrades, $this->quiz, false),
-                    $this->quiz->id, $this->context);
-        } else {
-            return strip_tags(quiz_report_feedback_for_grade(
-                    quiz_rescale_grade($attempt->sumgrades, $this->quiz, false),
-                    $this->quiz->id));
+        $feedback = quiz_report_feedback_for_grade(
+                quiz_rescale_grade($attempt->sumgrades, $this->quiz, false),
+                $this->quiz->id, $this->context);
+
+        if ($this->is_downloading()) {
+            $feedback = strip_tags($feedback);
         }
+
+        return $feedback;
     }
 
     public function get_row_class($attempt) {