Hi Arodi, No unfortuantely I didn't continue looking into this function any further. Good luck and if you do find the answer please share!
Thanks
Dan
Re: core_grades_update_grades syntax
Webroot.com/safe | Download, Install & Activate with Key Code
Most people are using the internet from devices such as a computer, laptop, and smartphones. It is compulsory to secure your device from different types of viruses. Webroot provides online security for each operating system, such as Linux, Windows, and Mac. If you want to download, install, and activate Webroot Safe antivirus with product key, then go to webroot.com/safe.
What are the advantages of Webroot Safe antivirus?
Mobile Security: You can't just protect your computer by downloading the Webroot antivirus, but you can also protect your mobile phone through it. It will secure all your mobile data and files.
Re: core_grades_update_grades syntax
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,
Re: core_grades_update_grades syntax
Hi, maybe this information can help you, https://www.refineddata.com/api/
Optional //Any grade item settings to alter object { itemname string Optional //The grade item name idnumber int Optional //Arbitrary ID provided by the module responsible for the grade item gradetype int Optional //The type of grade (0 = none, 1 = value, 2 = scale, 3 = text) grademax double Optional //Maximum grade allowed grademin double Optional //Minimum grade allowed scaleid int Optional //The ID of the custom scale being is used multfactor double Optional //Multiply all grades by this number plusfactor double Optional //Add this to all grades deleted int Optional //True if the grade item should be deleted hidden int Optional //True if the grade item is hidden }
You can find "core_grades_update_grades" use ctl+f, in this section you will find the parameters.
regards
Are Webservice APIs sessionless?
While going through the Webservice API documentation, can see that some of these APIs need authentication which can be done either by token or username/password.
Want to know if these APIs create any session? Can see MoodleSession as one of the cookies. But don't see these cookies ever been used in webservice APIs example ( mod_scorm_get_scorm_attempt_count, mod_scorm_insert_scorm_tracks).
Should these APIs be considered as sessionless APIs?
Update calendar: events core_calendar_create_update_submit_form
I tried to update event using
localhost/moodle/webservice/server.php?wstoken=....&wsfunction=.......&ws.. json=68999855
Formdataid:1,
Iam failing to send formdata to update
Need to send form data..help me out
Re: Aw: Re: Re: Aw: Re: Re: Rest API for authentication
Thanks for your help, but I have a question. How can I authenticate a user (in an external restful service) and start session into moodle? I don't need to create courses, just validate if a person exist in the external WS (using username and password) and give him access into moodle.
Thanks!
Re: Aw: Re: Re: Aw: Re: Re: Rest API for authentication
I have same problem,
Could you resolve your problem ?
I like to authenticate some user via API, then when he/she enter my moodle site see content not login page !
Asktechman.com
Re: core_grades_update_grades syntax
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,
Re: Using swagger-php for Moodle web services
Hi Mohammed,
I would like to create set up swagger into Moodle. How will i do that?
How me add student to certain course using REST API?
Hello, interested in the question, how through the REST API in moodle, do I add a certain student to a certain course? And as on tests to open and close access at all (including those who is in a course where this test is located) through api?
Re: Getting a web service token with SSO
Hello Gordon, I was wondering if you found a solution. We are going to implement a single signon "hub" and attempt to display some moodle information - user courses for example within the hub.
Thanks and happy holidays.
API for user deletion
I am investigating the following moodle API specifications and would like to know if you know.
https://docs.moodle.org/dev/Talk:Web_service_API_functions
Question: Without deleting user (student) related information (course registration and grades)
Is there an error when executing the user deletion API?
I think that the API executed when deleting a user is "core_user_delete_users"
At this time, relevant information such as the course registration status and grades of the user to be deleted is
Is it necessary to delete with another API before executing the user deletion API?
Or please tell me if the moodle user table has referential constraints.
Humbly, thank you.
Moodle API update_user function
We are using Moodle 3.4 and are trying to use this user_update_users API to update users from an external site.
I notice that the user_update does not pass if we send the existing email without any change. I understand there is validation being done at the user/externallib.php.
We want to be able to send the email parameter every time we send update even though the email is not being changed, is there any way to make this work without bypassing the email validation?
Web Services & Role Assignment
I created a plugin for Moodle that allows teachers to grade assignments by scanning a QR code with an app. To use the app I must create a token for the user, and I must also assign a role that allows them to use the associated web service at the system level. I've tried assigning the role at the course level, but it doesn't work. That's unfortunate, because some teachers are also students in another course and granting them the ability to use their token system wide essentially gives them the ability to grade their own assignments. Is there any way to grant access in such a way that teachers can only use their token in classes they teach?
The plugin is: https://github.com/mbbackus/moodle-mod_qrcode
I can also provide the app along with source code if that will help.
mailformat and maildisplay
Hi folks
Can someone guide me to the possible values for
mailformat
and
maildisplay
and what each value means?
I'm searching the Moodle forums and Google but coming up short.
Thank you!
airnotifier access key
Dear All
I have moodle version 3.7 (http://lms.uop.edu.jo/moodle/)
and I can not get the access key for airnotifier (I asked may times and no reply
Please any one can help me in this issue or how can I build my own server.
any one can direct me where to go.
Get enrolment timestart / timeend via WebService
Hi,
is there a WebService function which allows me to get the timestart / timeend of a manual enrolment?
Jozef K had a similar topic described here: https://moodle.org/mod/forum/discuss.php?d=380623
Thanks
Re: Webservice api: How does a 'query' in 'core_cohort_search_cohorts' has to look like?
Hi,
Maybe it's too late, but we tried "query"=>"myCohort" and it seems to search the string in all fields, including "name". It is not as clean as it should be but it works.
Hope it helps someone.
Best regards.