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 ffc3f53 commit 986c833743fa38f947572e41d741131a41fa03de @tlock tlock committed with danpoltawski Jul 11, 2013
Showing with 4 additions and 0 deletions.
  1. +4 −0 grade/report/grader/lib.php
View
4 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 986c833

Please sign in to comment.