Unfortunately I can’t quite follow how the custom field API works. What I actually want are additional fields for the custom course format such as address, directions and other (hybrid courses). And no, I don’t want to use the web interface for this. As I understand it, two files are needed, myFormatPlugin/classes/customfields/course_handler.php and myFormatPlugin/customfield.php Do I need to register the
Tag: moodle
How can I make a page accessible to only admins in moodle?
I have a link on the settings.php page of my activity module that goes to a clear.php page that truncates a table in the database. As it stands even guests can still run this function by going to the clear.php themselves by typing in the address bar. Is there a way to check if a USER is an admin or
How do I call extract_to_pathname function on a user uploaded zip file?
I have an instance of an activity and when I want to view it I want to extract the associated zip file to be extracted and set the index.html file inside to be the starting page inside view.php. I found out that the filepath I passed in the extract function doesn’t exist, but I can access its fields in the
how to pass the selected option as value in moodle select
i want to pass the options as values : here is my code. If i use this means it is looking like below : what i want is the exact value will be pass in to the option values. how to get that Answer You can simplify this with the get records menu functions. https://docs.moodle.org/dev/Data_manipulation_API#get_records_menu To pass the selected value,
OpenID connect plugin uninstall button is disappeared
I have installed the openID connect the plugin to connect Azure AD in my moodle site. Now I want to uninstall the plugin. But uninstall button is not appearing. I have already checked all dependencies and removed them. But still, uninstall is not there. real environment example Answer Can you check if any users are using the plugin. Go to
Moodle Events API
I’m trying to develop a plugin for Moodle, using Events API that will send out emails when new blog post is created. I created my plugin with the following structure: blog_observer/ ├── classes │ └──…
Is the sending of data to moodle REST API limited?
I’m using moodle 3.5, I’m trying to send an array of 2308 (user/corresponding cohort) to the external function ‘core_cohort_add_cohort_members’ by POST, the answer of the API is : array(3) { [“…
I want get userid value from a private object
I want to get the userid from: [“userid”:”course_modinfo”:private]=> string(1) “5” Here value from moodle $mod in cm info variable, I have tried var_dump($mod->userid); but it returns …
Can’t reach Moodle (a system written in PHP) from other devices
First time to install Moodle and am installing it locally on Windows 10 using WAMP. My knowledge in Apache and servers in general is very limited. Installation completed successfully and every thing is working fine on my localhost but when i try to access it from other devices (i.e another laptop using chrome) i will be redirected to “http://localhost/moodle” and
Moodle email templates
I am working on a Learning Management System build upon Moodle. I want to add an email header and footer for each email. I did some change in Moodle for adding an image in ./lib/moodlelib.php as follows: but I want the header and footer as fixed templates. Please help me. Answer You could create a message header in a language