diff --git a/mod/workshop/assessment.php b/mod/workshop/assessment.php index ddddfe0c8c6..c8a62557b9c 100644 --- a/mod/workshop/assessment.php +++ b/mod/workshop/assessment.php @@ -188,7 +188,10 @@ if (is_null($assessment->grade) and !$assessmenteditable) { if (isset($data->weight) and $cansetassessmentweight) { $coredata->weight = $data->weight; } - $DB->update_record('workshop_assessments', $coredata); + // Update the assessment data if there is something other than just the 'id'. + if (count((array)$coredata) > 1 ) { + $DB->update_record('workshop_assessments', $coredata); + } // And finally redirect the user's browser. if (!is_null($rawgrade) and isset($data->saveandclose)) { diff --git a/mod/workshop/exassessment.php b/mod/workshop/exassessment.php index 6112a41cf27..d0d0f84a6ac 100644 --- a/mod/workshop/exassessment.php +++ b/mod/workshop/exassessment.php @@ -126,7 +126,10 @@ if ($mform->is_cancelled()) { // Remember the last one who edited the reference assessment. $coredata->reviewerid = $USER->id; } - $DB->update_record('workshop_assessments', $coredata); + // Update the assessment data if there is something other than just the 'id'. + if (count((array)$coredata) > 1 ) { + $DB->update_record('workshop_assessments', $coredata); + } if (!is_null($rawgrade) and isset($data->saveandclose)) { if ($canmanage) {