MDL-40626 gradebook: Prevent incorrect override with multiline feedback

The quick grading option doesn't allow mutliline editing.
This commit is contained in:
Tim Lock 2013-07-11 18:03:34 +09:30 committed by Dan Poltawski
parent ffc3f5308b
commit 986c833743

View 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;
}