Permalink
Browse files

MDL-40626 gradebook: Prevent incorrect override with multiline feedback

The quick grading option doesn't allow mutliline editing.
  • Loading branch information...
1 parent 1a449aa commit 58940c96c4f2f36e2f98b4bd87c0878c87ffa743 @tlock tlock committed with danpoltawski Jul 11, 2013
Showing with 4 additions and 0 deletions.
  1. +4 −0 grade/report/grader/lib.php
@@ -226,6 +226,10 @@ public function process_data($data) {
$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;
}

0 comments on commit 58940c9

Please sign in to comment.