Increase the number of visible users per page on group creation and user selection screen in Moodle 2.2

,

So we had a query come through our Help Desk recently to ask if we can increase the users in the user selection box as staff members were having difficulty managing their classes and creating groups as they couldn’t CTRL click and had to type in the names of their students. So I started having a dig around the code in Moodle to find out if we can change the default value.

After poking around the source code and looking at some search results on Google, I found the file that was needed and it can be found in user/selector/lib.php – Line: 740

So we want to go to line and change MAX_USERS_PER_PAGE to equal what we want (a higher value, and in this case we gave it 500). The following is an extract of what we are changing.

/**
 * User selector subclass for the list of users who are not in a certain group.
 * Used on the add group members page.
 */
class group_non_members_selector extends groups_user_selector_base {
    const MAX_USERS_PER_PAGE = 500;

Save the file and now reload your group creation page and you should now be able to select multiple users in a large user base list. Also, it is important to note that the MAX_USERS_PER_PAGE variable is in multiple places and affects different user selection boxes depending on where you edit it.


Leave a Reply

More Posts

Fixing The trust relationship between this computer and the primary domain failed Error when restoring a Snapshot or Old Virtual Machine

I had a VM snapshot/checkpoint running for several months in my test lab and after reverting the snapshot back I went to login to the machine and got the dreaded Trust relationship between this computer and the primary domain failed error message.   So I logged in as a local admin onto that machine, opened […]

Get a list of users in Active Directory who have not logged in for specified number of days using PowerShell

A client is currently in the planning stages of doing a migration to Azure AD and Office 365 and one of the things we needed was a list of users who have not logged on in the last few months but are still active in our AD. Well it’s PowerShell to the rescue again (with […]

Renaming a Hyper-V Failover Cluster

If you find yourself taking over a cluster with a name that is silly or doesn’t make sense, you can rename it without much issue. Your main thing to watch out for are backup software that target the cluster (such as Veeam or DPM). You just need to ensure they are reconfigured to use the […]