Moodle doesn’t officially support a pronoun field. There’s a long-standing tracker item about this, to which various CLAMP schools have contributed over the years. Moodle HQ’s current plan is a custom profile field that ships with Moodle by default. This would be coupled with an even older request to allow custom profile fields to be shown anywhere in the “Edit profile” interface, instead of being grouped at the bottom.
That would be a welcome set of improvements and it’s a useful reminder that ever since the custom user identity change in Moodle 3.11 (which CLAMP also included in its subsequent Moodle 3.10 releases), it’s been possible to use a custom user profile to store a user’s pronouns and display them to teachers and students.
Create the field
Custom user profile fields managed in Site administration > Users > Accounts > User profile fields. There are two important constraints: we’re going to use this field as a user identity field, so (a) it must be a text field and (b) its length cannot exceed 255 characters. The default size of new text fields is 2048 characters, so you’ll need to change that setting. Another setting to be aware of is “Who is this field visible to?” By default, it’s everyone. If you want students to see each other’s pronouns, leave it as is.
Show user identity
Now that the field exists, navigate to Site administration > Users > Permissions > User policies. You’re looking for the “Show user identity” field, which is a list of check boxes. These fields are exposed in certain places, such as the Participants list on the course field. Check the box next to Pronouns and save.
Viewing pronouns in the Participants list
As a teacher or administrator, you’re able to see the pronoun field in the Participants list in any course. This is governed by the moodle/site:viewuseridentity
capability so by default is restricted to teachers and managers. The pronoun field will also be displayed in the “User details” pane of a user’s profile, and this is visible to students if they’re enrolled in the same course.
Viewing pronouns on the user profile page
As a student, you’re not able to see the pronoun field in the Participants list, but you can see it on an individual user profile, assuming you didn’t restrict its visibility. A student who clicks through the Participants list to an individual user profile will see that user’s pronouns, if set.
Viewing pronouns in the Roster report
If you’re using the Roster report contrib plugin (included in the Liberal Arts Edition by default), you can configure it to display pronouns. Navigate to Site administration > Plugins > Report > Roster, and add your custom profile field to the list of “Profile fields to display”. Custom profile fields take the convention profile_field_{shortname}
. The roster report will now display pronouns along with other fields.
Uploading pronouns to Moodle
If you have pronouns defined in an external system and need to upload them to Moodle, you can do that as you would with any other custom profile field. Create a CSV containing the proper information. At minimum, this should include a username
column for identifying each user. Custom profile fields may be specified using the format profile_field_pronouns
(for example). Navigate to Site administration > Users > Upload users. Upload the file. You will have an opportunity to review before it executes. When updating existing users, set “Upload type” to “Update existing users only”. You should set “Existing user details” to “Override with file”.
Putting and getting pronouns with web services
Moodle’s web services support custom user profile fields. The core_user_get_users_by_field
function will include an array of customfields, including the pronoun field. In the same fashion, core_user_update_users
accepts a customfields argument.
Updating pronouns from your authentication provider
Moodle authentication plugins support mapping custom fields. This behavior is automatic and requires no additional work to implement. These can be updated when a user first logs in, and optionally every time they authenticate. This is useful if you have an external authentication system such as CAS, Shibboleth, or LDAP, and the pronoun field is released by that system. Navigate to Site administration > Plugins > Authentication, find your authentication plugin, then scroll down to the Data mapping section. Configure as needed and save.
Summary
As you can see, it’s possible support pronouns in Moodle without a core implementation and without doing custom development. The piece that’s still missing is pronouns getting integrated more tightly into different parts of the interface, but at least it’s possible to load pronouns into Moodle and display them to teachers and students.