List of Activites and Ressource

List of Activites and Ressource

by Momo Momo1 -
Number of replies: 6

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 !

Average of ratings: -
In reply to Momo Momo1

Re: List of Activites and Ressource

by Vijaya Laxmi -

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.

In reply to Vijaya Laxmi

Re: List of Activites and Ressource

by Momo Momo1 -

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 ?

In reply to Momo Momo1

Re: List of Activites and Ressource

by Jez H -

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.

In reply to Momo Momo1

Re: List of Activites and Ressource

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

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).


In reply to Davo Smith

Re: List of Activites and Ressource

by Momo Momo1 -
Thank you all for your help, i'm goind to try get_fast_modinfo for create my plugin. Your advice(council) is very useful for me