I think the functionality you want already exists. Take a look in /course/lib.php for the functions print_overview and print_recent_activity
Analytics and reporting
Filter by users with updates on their courses
This discussion has been locked so you can no longer reply to it.