Properly compute the number of new materials uploaded. Also make sure that the materials have the last update/create timestamps stored (like a normal filesystem)
Only return the top-level materials folders when enumerating the folders belonging to a course.
Simplify the design a little; allow only one root folder per course.