I met system performance issue. I setup moodle system on my computer, access it with 127.0.0.1 to exclude network transfer and blcock issue. and only add two demo coures, but i found it's really slow performance. do you know how to improve it? thanks
how many methods to improve the perfermance of Moodle?
Re: error message that came out of the blue
Ken,
I got the option to allow mobile access to the site. I checked it but it didn't hold. Went back to the same error as before. I posted below what I get.
If I opt to upgrade to 3.5 how is that done without losing the content already on platform.
david - still learning
Re: error message that came out of the blue
What's missing is what is called a 'dependency' and is part of Moodle 3.4.x core code. The question that comes to my mind is ... why is a part of core code missing? Might stem from how one installed ... or even tinkering where one shouldn't tinkering. Dunno. No Vulcan Mind Meld possible here!
I see a 'upload zip' link ... am thinking that to repair this you could:
1. download the 3.4 code zip.
https://download.moodle.org/releases/security/
2. unzip it locally.
3. find the moodle/admin/tool/mobile directory in the unzipped folders.
4. zip just that directory ... the 'mobile'.
5. return to the area you show and upload the zip you created.
The question about upgrading to 3.5 ... and if all that content you've created will still be there ... should, because much of the info is actually in the DB and if one did upload files, those files are kept in moodledata. So replacing the code directory with a 3.5.x copy and copying config.php file from the current site into the new 3.5 code (plus any addon code installed in the 3.4), should trigger an upgrade.
Before you do that, however, please know how to do a site backup ... code directory, db dump, and archive of moodle data. As well as read:
https://docs.moodle.org/35/en/Upgrading
especially the part about requirements.
'spirit of sharing', Ken
Re: error message that came out of the blue
Ken,
I have downloaded both available versions of the 3.4 moodle package and done as described in your earlier note to me. Each time I received the same message:
Unavailable missing dependencies
Is it possible that the rest files are some where else. This is really frustrating to me but it should be straight forward. I have to get it solved. Is there something else I can do? I need that mind meld today if possible.
David
Re: error message that came out of the blue
Re: error when adding external functions to a web service.
HI,
i got the same issue after upgrading to moodle 3.6,
here is my debug message :
line 87 of /lib/externallib.php: coding_exception thrown
line 199 of /admin/webservice/forms.php: call to external_api::external_function_info()
line 204 of /lib/formslib.php: call to external_service_functions_form->definition()
line 60 of /admin/webservice/service_functions.php: call to moodleform->__construct()
Can you please suggest me solution
Thanks in advance,
Regards,
Madhukar
Angular Application
Hi, I am the owner of https://pixelbrewco.com and am using the API for a client. What is the best way to integrate Angular for an application?
Moodle API Single-Sign-On (SSO)
Dear Developers and Experts,
Thank you for reading this thread. My project requires me to develop a single-sign-on page that when the user visits the company website and logs in, the user is automatically logged to Moodle account site (https://lms.mycompany.com/my) as well.
I am looking at several API calls here: https://docs.moodle.org/dev/Web_service_API_functions, but none of them is user confirmation, that is, the user exists and is active in our account network.
Could you provide me with some hints? Or my logic here is not as correct as it appears.
Thank you again!
Kevin
Re: error when adding external functions to a web service.
This is one of the most difficult error to debug in my opinion.
The code now, fully stop the execution. I think this should not be a fatal error.
In a emergency, you can add a return before moodle throw a error.
In the file /lib/externallib.php line 87.
if (!file_exists($function->classpath)) {
return;
throw new coding_exception('Cannot find file with external function implementation');
}
How to retrieve the User Enrolment ID
Hi all,
I hope that somebody can give us some ideas. My institution has a Moodle 3.5.3 version. We are trying to use the following method to update the dates of a user enrollment:
core_enrol_edit_user_enrolment
This method requires the User enrolment ID as a parameter although there is no method that we can use to retrieve that information.
We want to update the "Enrolment Ends" date field for a student. Are we doing doing something wrong? Can somebody give us some ideas?
Thanks for your help,
carlos
Re: How to get all users with core_user_get_users and PHP
Hi Josip here's my solution which worked for me
url/webservice/rest/server.php?wstoken=c1a766e447b1e564f3202c55cfd387d1&wsfunction=core_user_get_users&criteria[0][key]=username&criteria[0][value]=username_value
Re: How to retrieve the User Enrolment ID
Hey Carlos,
Yes, you are on the right track. You can easily update the "Enrolment Ends" date field for your user. The webservice function core_enrol_edit_user_enrolment requires three required parameter - courseid, user enrolments id, enrol status and optional parameters like timestart and timeend (timestamp). You can easily find user enrolment id in Moodle's user_enrolment table. This requires a good knowledge of Mysql queries and Moodle's table. You can apply join of user_enrolments and enrol table.
After getting all required fields you can call webservice like
http://localhost/moodle3.6.1/webservice/rest/server.php?wstoken=fd324bf337764cbe45fbdb7760d09604&wsfunction=core_enrol_edit_user_enrolment&moodlewsrestformat=json&courseid=4&ueid=1&status=0×tart=1552410399&timeend=1555089582
If you want I will share the required query with you with the help of which you can get user enrolment id.
If you don't want to do this with webservice API function, you can also use moodle's core function update_user_enrol.
Regards,
Mayank Tyagi
error/forcepasswordchangenotice on New User Creation via web service
Hi Guys,
I am creating a new User via Webservice.
My new user has following attributes -
{
"username":"newuser1",
"password":"Neel@123",
"firstname":"Neel",
"lastname":"Bhave",
"email":"b@c.com"
}
However, when I submit it through GET request, I get the following response -
{
"exception": "moodle_exception",
"errorcode": "forcepasswordchangenotice",
"message": "error/forcepasswordchangenotice"
}
How do I solve this ? Thanks in advance.
Re: error/forcepasswordchangenotice on New User Creation via web service
Hey Neel,
Can you tell me the function which you are using for creating a new user? Are you using Moodle core function or moodle API webservice function? Because I have created users many time with webservices and core function but never get these errors. And share a bit of your code if possible.
how to make moodle sent password reset email without PM emails?
I want to allow moodle send password reset emails, but in the same time when send Massive PM to students do not want to be sent by email too, how to achieve that in moodle?
Re: error/forcepasswordchangenotice on New User Creation via web service
Hi,
I have solved this issue.
The issue was that the user that I was using for the web services had force password reset checked while creation. I had not logged in once the user was created and was only using it for the Webservice. Hence I was this error was showing up. I unchecked force password reset from my admin account and it was solved.
Re: How to retrieve the User Enrolment ID
Thanks Mayank for the information. Let me explain what we want to achieve and please tell me if you have better ideas.
All of our enrolments are handle by Drupal. So Drupal will follow these steps:
1. call for a specific course the following web service method: core_enrol_get_enrooled_users
This method should return the user enrolment id. With this field, I think we will have enough information to call
2. core_enrol_edit_user_enrolment
Does that make sense? Thanks for your ideas.
Carlos
Re: How to retrieve the User Enrolment ID
Hey Carlos,
I don't think so this method will return enrolment id for the user. It will return enrolled users details like firstname, lastname, profile description and many other details related to users. The details return by this method are
[{"id":3,"username":"sooraj","firstname":"Sooraj","lastname":"Singh","fullname":"Sooraj Singh","email":"singhsooraj30zz@gmail.com","department":"","firstaccess":0,"lastaccess":0,"description":"","descriptionformat":1,"country":"IN","profileimageurlsmall":"http:\/\/localhost\/moodle3.6.1\/theme\/image.php\/academic\/core\/1551116448\/u\/f2","profileimageurl":"http:\/\/localhost\/moodle3.6.1\/theme\/image.php\/academic\/core\/1551116448\/u\/f1","groups":[],"roles":[{"roleid":5,"name":"","shortname":"student","sortorder":0}],"enrolledcourses":[{"id":4,"fullname":"dd","shortname":"45"}]}]
All these details are not required for calling core_enrol_edit_user_enrolment.
Thanks and Regards,
Mayank
Excluding web service user from need to accept privacy policy
Hi there,
I just ran into issues when trying to access courses with a web service user, as the policy documents hadn't been accepted by this user. It was easy enough to do that manually, but for the future, in case the policy documents change: Is there a way to exclude a certain global role from needing to accept the policies at all?
Thanks,
Rene
Re: Moodle API Single-Sign-On (SSO)
One approach that you might think about is LTI. LTI does require that both sides/applications use it, but it does provide a way for users to login to one application, and then transfer over to the other one.
It may be that someone else has another idea.
By the way, did you take a look at: https://docs.moodle.org/36/en/CAS_server_(SSO)_authentication