# of Files in a Course

Let me preface this by saying there are 3 different versions of this query and 1 is actually used in a program I wrote for our department.

The definition of an empty course is a course that does not contain any items in its respective Course Files repository. All newly created course shells have an empty Course Files repository by default. A course without any imported or instructor created content will generate a file count of 0.

The first one will simply be the number of all files in a course’s content collection. It’s important to note that the count does include folders even if they’re empty.

This second one will be the number of all of the files in a course’s content collection MINUS the number of folders. This will probably be the one you’re more likely to use.

Lastly is a query I developed for the program mentioned above. Set your course ID by using the variable

and then run the query. The result when run in conjunction with a list of courses and the appropriate if-then-else clause will return all courses that have zero files other than the default course structure.

 

Leave a Reply

Your email address will not be published. Required fields are marked *