MDL-40697 core_grades: removed existing user_graded event triggers

This commit is contained in:
Mark Nelson 2014-09-26 17:29:33 -07:00
parent 3419a38980
commit c09e6fa3e3
3 changed files with 0 additions and 29 deletions

View File

@ -265,14 +265,6 @@ if ($mform->is_cancelled()) {
$grade_item->force_regrading();
}
$grade_grade = new grade_grade(array('userid'=>$data->userid, 'itemid'=>$grade_item->id), true);
if ($old_grade_grade->finalgrade != $grade_grade->finalgrade
or empty($old_grade_grade->overridden) != empty($grade_grade->overridden)
) {
$grade_grade->grade_item = $grade_item;
\core\event\user_graded::create_from_grade($grade_grade)->trigger();
}
redirect($returnurl);
}

View File

@ -120,8 +120,6 @@ switch ($action) {
} else {
$json_object->gradevalue = $finalvalue;
$old_grade_grade = new grade_grade(array('userid' => $userid, 'itemid' => $grade_item->id), true);
if ($grade_item->update_final_grade($userid, $finalgrade, 'gradebook', $feedback, FORMAT_MOODLE)) {
$json_object->result = 'success';
$json_object->message = false;
@ -132,14 +130,6 @@ switch ($action) {
die();
}
$grade_grade = new grade_grade(array('userid' => $userid, 'itemid' => $grade_item->id), true);
if ($old_grade_grade->finalgrade != $grade_grade->finalgrade
or empty($old_grade_grade->overridden) != empty($grade_grade->overridden)
) {
$grade_grade->load_grade_item();
\core\event\user_graded::create_from_grade($grade_grade)->trigger();
}
// Get row data
$sql = "SELECT gg.id, gi.id AS itemid, gi.scaleid AS scale, gg.userid AS userid, finalgrade, gg.overridden AS overridden "
. "FROM {grade_grades} gg, {grade_items} gi WHERE "

View File

@ -305,19 +305,8 @@ class grade_report_grader extends grade_report {
}
}
$oldgradegrade = new grade_grade(array('userid' => $userid, 'itemid' => $gradeitem->id), true);
$gradeitem->update_final_grade($userid, $finalgrade, 'gradebook', $feedback, FORMAT_MOODLE);
$gradegrade = new grade_grade(array('userid' => $userid, 'itemid' => $gradeitem->id), true);
if ($oldgradegrade->finalgrade != $gradegrade->finalgrade
or empty($oldgradegrade->overridden) != empty($gradegrade->overridden)
) {
$gradegrade->grade_item = $gradeitem;
\core\event\user_graded::create_from_grade($gradegrade)->trigger();
}
// We can update feedback without reloading the grade item as it doesn't affect grade calculations
if ($datatype === 'feedback') {
$this->grades[$userid][$itemid]->feedback = $feedback;