Merge branch 'MDL-31036-27' of git://github.com/zbdd/moodle into MOODLE_27_STABLE
This commit is contained in:
@@ -96,7 +96,7 @@ class assign_feedback_comments extends assign_feedback_plugin {
|
||||
}
|
||||
// Note that this handles the difference between empty and not in the quickgrading
|
||||
// form at all (hidden column).
|
||||
$newvalue = optional_param('quickgrade_comments_' . $userid, false, PARAM_TEXT);
|
||||
$newvalue = optional_param('quickgrade_comments_' . $userid, false, PARAM_RAW);
|
||||
return ($newvalue !== false) && ($newvalue != $commenttext);
|
||||
}
|
||||
|
||||
@@ -176,17 +176,16 @@ class assign_feedback_comments extends assign_feedback_plugin {
|
||||
public function save_quickgrading_changes($userid, $grade) {
|
||||
global $DB;
|
||||
$feedbackcomment = $this->get_feedback_comments($grade->id);
|
||||
$feedbackpresent = optional_param('quickgrade_comments_' . $userid, false, PARAM_TEXT) !== false;
|
||||
if (!$feedbackpresent) {
|
||||
// Nothing to save (e.g. hidden column).
|
||||
$quickgradecomments = optional_param('quickgrade_comments_' . $userid, null, PARAM_RAW);
|
||||
if (!$quickgradecomments) {
|
||||
return true;
|
||||
}
|
||||
if ($feedbackcomment) {
|
||||
$feedbackcomment->commenttext = optional_param('quickgrade_comments_' . $userid, '', PARAM_TEXT);
|
||||
$feedbackcomment->commenttext = $quickgradecomments;
|
||||
return $DB->update_record('assignfeedback_comments', $feedbackcomment);
|
||||
} else {
|
||||
$feedbackcomment = new stdClass();
|
||||
$feedbackcomment->commenttext = optional_param('quickgrade_comments_' . $userid, '', PARAM_TEXT);
|
||||
$feedbackcomment->commenttext = $quickgradecomments;
|
||||
$feedbackcomment->commentformat = FORMAT_HTML;
|
||||
$feedbackcomment->grade = $grade->id;
|
||||
$feedbackcomment->assignment = $this->assignment->get_instance()->id;
|
||||
|
||||
Reference in New Issue
Block a user