Inactive students listed on Participants page by default in Moodle 3.4/5

Re: Inactive students listed on Participants page by default in Moodle 3.4/5

by Eoin Campbell -
Number of replies: 0
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

I figured out that the following code can be added to /user/index.php before line 106 ("// If they passed a role make sure they can view that role."). This will automatically add the filter "Status: Active" to the Participants page if a Teacher is viewing it.

// If this is a Teacher, add 'Active' filter by default, so that inactive students in disabled meta course links don't appear.
if ($bulkoperations and !is_siteadmin()) {
    $filtersapplied[] = USER_FILTER_STATUS . ':' . ENROL_USER_ACTIVE;
}

There are hopefully more elegant solutions than this, but it does the job.

Average of ratings: Useful (1)