Skip to content

Commit

Permalink
MDL-40626 gradebook: Prevent incorrect override with multiline feedback
Browse files Browse the repository at this point in the history
The quick grading option doesn't allow mutliline editing.
  • Loading branch information
tlock authored and danpoltawski committed Jul 19, 2013
1 parent 1a449aa commit 58940c9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions grade/report/grader/lib.php
Expand Up @@ -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;
}
Expand Down

0 comments on commit 58940c9

Please sign in to comment.