Hello Dan
I found a way to use the "core_grades_update_grades" function.
It's quite simple, I used Postman. There's attached an example and a screenshot.
https://www.screencast.com/t/7RhCjVghN
https://MOODLEURLSITE.COM/webservice/rest/server.php?wstoken=MYTOKEN&wsfunction=core_grades_update_grades&moodlewsrestformat=json&source=assignment &courseid=IDOFCOURSE&component=mod_assign&activityid=IDOFACTIVITY&itemnumber=0&itemdetails[itemname]=NAMEITEM&itemdetails[hidden]=1
wstoken: MYTOKEN // Token generated from my site in moodle.
wsfunction: core_grades_update_grades // Name of the function used
moodlewsrestformat: json // Format in which I wish the information to be returned
source: assignment // With "source" I have a lot of doubts, due to Moodle documentation says that it must be the companion of the "mod", I do not know why we still use the component.
Courseid: IDOFCOURSE // Course ID, type Int
component: mod_assign // As I mentioned before, "Source" is a bit redundant to use it as a component and source.
activityid: IDOFACTIVITY // ID of the activity, to find this ID I recommend using the "gradereport_user_get_grade_items" function to do it in a systematized way.
itemnumber: 0 // If you have not defined an identifier to the Item this must be "0"
itemdetails[itemname]: NAMEITEM // Name which the Item could to be renamed.
itemdetails[hidden]: 1 // To hide the item use "1" otherwise "0"
This function core_grades_update_grades, can return 4 types of states:
0 => OK, 1 => Fail, 2 => Multiple updated, 4 => Locked (Yes, 0 means OK and 3 is missing, see lib / grade / constans.php) ";
Unfortunately, this function doesn't do what I need. Now I need to block the grade items using a WS function. I have not found the right function. Do you know if you can block rating elements or rating categories?
Best regards,