Hey,
I am trying to create a query which will report on the sizes of my course based within a certain time frame..
any ideas ?
What is course size?
Hey
Thanks for the reply, ideally i would like to know the files that have contributed to the course, which would generate the size (mb) of the course.
AFAIK, currently, this can only be done via a backup, but I don't think that this is what you are after. My thought is that you can ask the database, via an SQL query. I suspect, though, it will not likely be worth the time required to build the query to get the result you are looking for. A basic outline of that query would be something along the lines of
select files.name, files.size, ....from myMoodledb where files.contextid="%*" and so on,
The issue is that while this might tell you the name, filesize and whatever other information you want of any file you use in any course, it will still not be accurate if you have a page resource, a forum, glossaries, grades etc. I don't think that the byte size of any other resource or activity types are recorded anywhere - well, I haven't found them yet.
The Course size report might give you a few ideas too:
https://moodle.org/plugins/report_coursesize
the report is built by the sql queries here:
https://github.com/danmarsden/moodle-report_coursesize/blob/master/index.php#L63
Hi,
Thank you all for the responses..
I am trying to install the plugin.. but it doesnt get recognised when check for updates ?
Which folder directory does it install into ?
Regards
Hi..
Managed to solve that last issue.
Thanks again.
If you are looking size of uploaded files in a course then below query can help you.
"SELECT sum(filesize) as filesize FROM `mdl_files` f INNER JOIN mdl_context cn ON cn.id = f.contextid INNER JOIN mdl_course c ON c.id = cn.instanceid AND cn.contextlevel = 50 where c.id = ?";
But if you are looking entire course size including text stored in database, then create a course back up and check size of back up data.