Skip to content

Commit

Permalink
MDL-80231 ltix_gradebookservices: correct grade and grade item source
Browse files Browse the repository at this point in the history
This value is arbitrary and ends up in the grade_grades_history and
grade_items_history tables. For grade_grades_history, this is visible,
as a string, in the grade history report. This change just makes sure
that it's using ltixservice_gradebookservices now, instead of
modltiservice_gradebookservices, and will not change existing history.
  • Loading branch information
snake committed May 21, 2024
1 parent 7c1942b commit 589dc9f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ private function process_put_request($body, $olditem, $typeid) {
}
}
if ($updategradeitem) {
if (!$item->update('mod/ltixservice_gradebookservices')) {
if (!$item->update('ltixservice_gradebookservices')) {
throw new \Exception(null, 500);
}
if ($rescalegrades) {
Expand Down Expand Up @@ -300,7 +300,7 @@ private function process_delete_request($item) {
if (($gbs = gradebookservices::find_ltixservice_gradebookservice_for_lineitem($item->id)) == false) {
throw new \Exception(null, 403);
}
if (!$gradeitem->delete('mod/ltixservice_gradebookservices')) {
if (!$gradeitem->delete('ltixservice_gradebookservices')) {
throw new \Exception(null, 500);
} else {
$sqlparams = array();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ public function add_standalone_lineitem(string $courseid, string $label, float $
\grade_item::set_properties($item, $params);
$item->itemtype = 'manual';
$item->grademax = $maximumscore;
$id = $item->insert('mod/ltixservice_gradebookservices');
$id = $item->insert('ltixservice_gradebookservices');
$DB->insert_record('ltixservice_gradebookservices', (object)array(
'gradeitemid' => $id,
'courseid' => $courseid,
Expand Down Expand Up @@ -495,7 +495,7 @@ public static function save_score($gradeitem, $score, $userid) {
*/
public function save_grade_item($gradeitem, $score, $userid) {
global $DB, $CFG;
$source = 'mod' . $this->get_component_id();
$source = $this->get_component_id();
if ($DB->get_record('user', array('id' => $userid)) === false) {
throw new \Exception(null, 400);
}
Expand Down

0 comments on commit 589dc9f

Please sign in to comment.