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

Re: KB used by teachers in my private files

$
0
0
by Rob Hardy.  

The following query might help you. It finds users who have a "Tutor" role assigned in the context of some course (contextlevel 50), and calculates the sizes of their files:

select us.username, sum(fi.filesize) / 1024 as 'KB used'
from mdl_user us, mdl_files fi
where us.id in (select ra.userid
from mdl_role_assignments ra, mdl_role ro,
mdl_context co
where co.contextlevel = 50
and ra.contextid = co.id
and ra.roleid = ro.id
and ro.name in ('Tutor'))
and fi.userid = us.id
and fi.component = 'user'
and fi.filearea = 'private'
group by us.username;


It might be worth running it when the server is quiet, as it could take a bit of time.


Viewing all articles
Browse latest Browse all 37675

Trending Articles



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