Quantcast
Channel: General developer forum
Viewing all articles
Browse latest Browse all 37675

Re: List of resources

$
0
0
by Davo Smith.  

You might want to start by investigating the function get_fast_modinfo - as that will give you all the information about the modules in a particular course (without the need for lots of database queries).

var_dump(get_fast_modinfo($courseid));  // This will show what information is included

The images (and all other files) are not stored in the 'course' they are stored within each activity in the course. To find the files for each activity you should use the files API ( http://docs.moodle.org/dev/File_API ) or, if you are trying to search for lots of files at once, you could look directly in the mdl_files table - the contextid will be based on the context for each activity/resource in the course (which may be directly in get_fast_modinfo, otherwise you'll need to call context_module::instance($cmid) for each one), after that you'll need to search based on the mimetype of the records, if you want to find all the images.


Viewing all articles
Browse latest Browse all 37675

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>