Merge branch 'MDL-40626-master' of git://github.com/danpoltawski/moodle
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Mon, 22 Jul 2013 15:40:03 +0000 (17:40 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Mon, 22 Jul 2013 15:40:03 +0000 (17:40 +0200)
grade/report/grader/lib.php

index a58e189..1c6fd33 100644 (file)
@@ -226,6 +226,10 @@ class grade_report_grader extends grade_report {
                         $changedgrades = true;
 
                     } else if ($datatype === 'feedback') {
+                        // If quick grading is on, feedback needs to be compared without line breaks.
+                        if ($this->get_pref('quickgrading')) {
+                            $oldvalue->feedback = preg_replace("/\r\n|\r|\n/", "", $oldvalue->feedback);
+                        }
                         if (($oldvalue->feedback === $postedvalue) or ($oldvalue->feedback === NULL and empty($postedvalue))) {
                             continue;
                         }