Hello everyone,
I'm a beginner for the developpement of a plugin Moodle.
So i developp a plugin which can list the activites and ressources of a court ??
And i want to know what is an instance ?
Thank you for your help !
Hi
Instance is nothing but respective module id.
For eaxmple in mdl_course_modules take one row consider module value is 9 and instance value is 2 it means first check mdl_modules table where id is 9 name is forum now instance is nothing but the value in mdl_forum where id is 2 if module name is page instance is mdl_page table id the same thing applicable to all course activities and resources.
Hope this help to you.
Regards,
Vijayalaxmi.
Thank you !! for your answer.
If i want to create a list of activities or ressources for a court i have to do some sql request ?
I assume you know there is an "activities" block which lists resource / activity types and then pulls back a report of all resources of that type when clicking on it?
If you have a look through the code for that it may help you.
Make sure you call
$modinfo = get_fast_modinfo($courseid);
Take a look through the code in lib/modinfolib.php - class course_modinfo, to see what functions you can call to get info out of the $modinfo object (which is of type course_modinfo).
Note that the $modinfo->get_cm($cmid) function returns details of the specified course activity as a cm_info object, so it worth looking at the details of that in the same PHP file.
Ask again if you need more help with using get_fast_modinfo (there's lots of examples of using it inside the Moodle code base).