Events & Scheduled Tasks in MOODLE | Task APIs
HTML-код
- Опубликовано: 12 сен 2024
- Hey Guys! Welcome to Moodler Arjun & we are here with another awesome video on Moodle. In this video we are going to create events and write scheduled tasks in Moodle. Also we should see how to run cron, triggers events & processes task queue in Moodle.
As per New Logging System in Moodle, which start from Moodle version 2.7 onwards, add_to_log() function has been deprecated. The New Logging System is an event observer, listening to all events & directing them to logging storage plugins in a controlled manner. Event Handlers have below attributes as :
1) eventname (event classname) : \plugintype_pluginname\event\something_happened
2) callback (PHP callable type)
3) internal (set to false usually which means it cannot be called during database transaction )
Please remember that Event Observers are cached. If you are adding or changing observers, you need to purge caches or else it would not be recognised.
About CRON :
CRON is a command line function that calls certain tasks in Moodle to make database changesm moves files around, clean up data and other time based tasks. We can run CRON via:
Commad Line : root/admin/cli/cron.php
Browser : moodlesite/admin/cron.php
Creating a Scheduled Task in Moodle :
Step 1 : Create a subclass of \core\task\scheduled_task
Step 2 : Create an entry in db/tasks.php
Step 3 : Increase plugin version
Read more about Moodle Task API here :
docs.moodle.or...
Read more about Moodle Scheduled Tasks by visiting :
docs.moodle.or...
Also, do checkout the below videos on writing Web Services in Moodle :
• How to Create Web Serv...
I hope you gain something out of this video. Incase you got any queries, do comment the same in the comment box. Also please make sure to like this video and subscribe to my channel.
{ Moodle Arjun }: { / @moodlerarjun }
🌹🌹
Please make a video on How to setup Global search in moodle in webserver?
bro, mne event to bn liya h but uska use and usko check kese krna h
Hi Arjun, how can i approach to learn more about Moodle API and plugin stuffs ?
Hello, I have problem withe Adoc_Task. Can you help me? Thank you
How can I get the code????
افلام فاندام