mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-40697 core_grades: removed existing user_graded event triggers
This commit is contained in:
parent
3419a38980
commit
c09e6fa3e3
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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 "
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user