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

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

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

The Participants page on Moodle 3.4 upwards has a multi-function search box allowing selection of roles, status, enrolment method, etc.

However, by default, Inactive enrolments are displayed in the Teacher view, and they have to manually select "Status: Active" in order to see only active students. It seems to me that this is a change from the previous behaviour. In Moodle 3.3 and prior versions, if an enrolment method is disabled, then the Teacher cannot see students enrolled by that method. I would consider this a bug.

Is there any way to configure "Status: Active" as a default filter on the Participants page? I've put this query on Enrolments as there doesn't seem to be a more suitable place.

Average of ratings: -
In reply to Eoin Campbell

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

by Michael Woods -
Picture of Core developers

Hi Eoin,

Wondering if you found a solution for this? We are keen to upgrade from 3.2 to 3.5, but this change in behaviour will be a big deal for our teachers. They are used to going into Participants, Select All --> Send Message etc... knowing they are only looking at active enrolments.

Thanks,
Michael

Average of ratings: Useful (1)
In reply to Michael Woods

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

by Eoin Campbell -
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)