Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-26647

Ability to consistently display idnumber, other fields in user lists

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: 2.2
    • Component/s: General
    • Labels:
      None
    • Testing Instructions:
      Hide

      Testing instructions (EASY, but long)

      You will need a course with some enroled members (one of whom must be a teacher) and a group; a forum, a quiz, a SCORM activity, and an assignment. The last three must all have at least one submission. You must have enabled activity completion and course completion for the course. At least one activity must have been configured with completion settings (eg manual completion).

      There must be at least one user who is not in the group, and at least one user in the system who is not enroled in the course.

      At least one of the users should have all the following profile fields set to different values: ID number, email address, phone, mobile phone, institution, and department.

      PART ONE - SETTINGS

      1. As admin user, go to Admin / Users / Permissions / User policies
      Verify that 'Show user identity' option is present and has options ID number, email address, phone, mobile phone, institution, and department.
      Verify that 'email address' option, and nothing else, is selected.

      PART TWO - PAGES

      NOTE: It will save time if you open each of these numbered pages into a new browser tab so that you can reload them later instead of having to navigate again.

      NOTE: In this section, 'As before' means that behaviour is intended to be identical to previous Moodle behaviour. 'New' indicates that there is intended to be a change as part of all these reports becoming more consistent - usually that the email field now appears and didn't before.

      2a. Open 'Assign system roles' (just an example of a user selector) and click any role.
      Verify that the names under potential/existing users show with the email address in brackets. (As before.)

      2b. In the search box, begin typing some characters from the start of a user's first or last name.
      Verify that the user comes up in search result. (As before.)

      3. Open site administration / users / accounts / browse list of users.
      Verify that the list shows users including email address. (As before.)

      4a. Open any course. Open the Groups screen (settings / course administration / users / groups). Select an existing group or create one if necessary. Click to add/remove users.
      Verify that the names under potential and group members show with the email address in brackets. (New. This user selector was previously inconsistent with all others in that it didn't show email.)

      4b. Begin typing the start of one of the email addresses.
      Verify that search result includes that user.

      5. Open any forum. Click to settings / forum administration / show/edit current subscribers (another example of user selector, needed slight code tweak to work) and click 'Turn editing on'.
      Verify that the names under potential/existing subscribers show with the email address in brackets. (As before.)

      6a. Open the Participants page (in navigation menu).
      Verify that the list of names displays and includes email address. (As before.)

      6b. Using the user list dropdown, change from 'Brief' to 'User details'.
      Verify that the list of users displays and includes email address. (As before.)

      7. Under 'Reports' in the navigation, open up 'Course completion'.
      Verify that the list of users displays and includes email address. (New.)

      8. Under 'Reports' in the navigation, open up 'Activity completion'.
      Verify that the list of users displays and includes email address. (New.)

      9. Open the gradebook (course administration / grades).
      Verify that list of users displays and includes email address. (New.)

      10. Open the quiz and click 'Results' in the Navigation menu (easy to miss). If no users are shown, choose 'All participants who have or have not attempted the quiz' option from first dropdown.
      Verify that list of users displays and includes email address. (New.)

      11. Open the SCORM activity and click 'Reports' tab.
      Verify that list of users displays and contains email address. (New.)

      12. Open the assignment and click 'View N submitted assignments' link.
      Verify that list of users displays and contains email address. (New.)

      13a. Open course administration / users / enrolled users.
      Verify that list of users contains email address.

      13b. Click 'Enrol users' button
      Verify that list of users to select from contains email address.

      PART THREE - ALL OFF

      14. Go back to the settings and turn all the checkboxes off, then save settings.

      15. Now repeat the tests in tabs 2 to 13 inclusive, above. In each case check that none of the fields are displayed, except see the following extra notes:
      note 4b - searching for email address should NOT display the user this time
      note 6 - the 'user details' mode always displays email (for those with permissions)

      PART FOUR - FULL ON

      16. Go back to the settings screen and turn all the checkboxes on, then save settings.

      17. Now repeat the tests in tabs 2 to 13 inclusive, above. In each case check that all the fields are now displayed. Use the following extra notes for some cases:

      note 2, 4, 5 - Display will probably not fit in box - this is ok, nobody should turn on all options anyhow. It looks a bit weird if any of the fields are blank (you get a comma for the blank field) but this is OK as users shouldn't turn on these options unless they are reliably set (and the comma makes it unambiguous anyhow)

      note 3 - on most Moodle themes the report will probably not fit in browser width and may get cut off rather than using scrollbars, this is a separate pre-existing bug in most moodle themes and not related to this issue (also doesn't so much apply in realistic cases where you only tick one or two boxes)

      note 4b, 13b - on this screen, try searching for the start of a different field such as idnumber or phone number. (In the 'Enrol Users' screen you have to press Return after typing in your search text, which may be confusing; MDL-30139)

      note 3, 6, 9, 10, 11, 12, 13 - on these screens, additionally try sorting by one of the new columns (click it); behaviour should be same as if you sort by an existing column.

      note 13 - this screen looks pretty stupid when you have all the options ticked, but it's not too awful; and provided you only tick one or two, they fit in nicely.

      PART FIVE - CAPABILITY

      18. On the course, go to the overrides screen (course administration / users / permissions). Next to the permission moodle/site:viewuseridentity, click the X beside Teacher so that your example teacher does not have the permission.

      19. Log in as the example teacher.

      20. Repeat the tests in tabs 4 to 12 inclusive, above. In each case check that none of the fields are displayed (as per PART THREE above).

      PART SIX - POSSIBLE GRADEBOOK SUCKAGE

      21. Log back in as admin. Go back to the settings screen and turn on the 'idnumber' and 'department' checkboxes (just so we have a more realistic situation / less horrible table) and save settings.

      22. Return to the grades screen. Reload.

      • Verify that it's working with those two fields.

      23. Turn editing on.

      • Verify it's still working - meaning that the table columns/rows remain in synch with the headers.

      24. Open site administration / grades / report settings / grader report. Flip the values of all the tickboxes so the opposite options are selected, then save settings.

      25. Return to grades screen. Reload.

      • Verify it's still working.

      26. Toggle editing. Reload.

      • Verify it's still working.

      27. Open course administration / users / permissions. Turn off gradereport/user:view for the Teacher role. Log in as your sample teacher. View the grade report. (This should have caused the little grade icon next to user's name to disappears.)

      • Verify it's still working.

      NOTE: At this point you might want to flip back the grade settings to default so they don't affect future tests. You can either do this manually or in database, DELETE FROM prefix_config WHERE name LIKE 'grade_report_%'; , then visit admin page and save settings.

      Show
      Testing instructions (EASY, but long) You will need a course with some enroled members (one of whom must be a teacher) and a group; a forum, a quiz, a SCORM activity, and an assignment. The last three must all have at least one submission. You must have enabled activity completion and course completion for the course. At least one activity must have been configured with completion settings (eg manual completion). There must be at least one user who is not in the group, and at least one user in the system who is not enroled in the course. At least one of the users should have all the following profile fields set to different values: ID number, email address, phone, mobile phone, institution, and department. PART ONE - SETTINGS 1. As admin user, go to Admin / Users / Permissions / User policies Verify that 'Show user identity' option is present and has options ID number, email address, phone, mobile phone, institution, and department. Verify that 'email address' option, and nothing else, is selected. PART TWO - PAGES NOTE: It will save time if you open each of these numbered pages into a new browser tab so that you can reload them later instead of having to navigate again. NOTE: In this section, 'As before' means that behaviour is intended to be identical to previous Moodle behaviour. 'New' indicates that there is intended to be a change as part of all these reports becoming more consistent - usually that the email field now appears and didn't before. 2a. Open 'Assign system roles' (just an example of a user selector) and click any role. Verify that the names under potential/existing users show with the email address in brackets. (As before.) 2b. In the search box, begin typing some characters from the start of a user's first or last name. Verify that the user comes up in search result. (As before.) 3. Open site administration / users / accounts / browse list of users. Verify that the list shows users including email address. (As before.) 4a. Open any course. Open the Groups screen (settings / course administration / users / groups). Select an existing group or create one if necessary. Click to add/remove users. Verify that the names under potential and group members show with the email address in brackets. (New. This user selector was previously inconsistent with all others in that it didn't show email.) 4b. Begin typing the start of one of the email addresses. Verify that search result includes that user. 5. Open any forum. Click to settings / forum administration / show/edit current subscribers (another example of user selector, needed slight code tweak to work) and click 'Turn editing on'. Verify that the names under potential/existing subscribers show with the email address in brackets. (As before.) 6a. Open the Participants page (in navigation menu). Verify that the list of names displays and includes email address. (As before.) 6b. Using the user list dropdown, change from 'Brief' to 'User details'. Verify that the list of users displays and includes email address. (As before.) 7. Under 'Reports' in the navigation, open up 'Course completion'. Verify that the list of users displays and includes email address. (New.) 8. Under 'Reports' in the navigation, open up 'Activity completion'. Verify that the list of users displays and includes email address. (New.) 9. Open the gradebook (course administration / grades). Verify that list of users displays and includes email address. (New.) 10. Open the quiz and click 'Results' in the Navigation menu (easy to miss). If no users are shown, choose 'All participants who have or have not attempted the quiz' option from first dropdown. Verify that list of users displays and includes email address. (New.) 11. Open the SCORM activity and click 'Reports' tab. Verify that list of users displays and contains email address. (New.) 12. Open the assignment and click 'View N submitted assignments' link. Verify that list of users displays and contains email address. (New.) 13a. Open course administration / users / enrolled users. Verify that list of users contains email address. 13b. Click 'Enrol users' button Verify that list of users to select from contains email address. PART THREE - ALL OFF 14. Go back to the settings and turn all the checkboxes off, then save settings. 15. Now repeat the tests in tabs 2 to 13 inclusive, above. In each case check that none of the fields are displayed, except see the following extra notes: note 4b - searching for email address should NOT display the user this time note 6 - the 'user details' mode always displays email (for those with permissions) PART FOUR - FULL ON 16. Go back to the settings screen and turn all the checkboxes on, then save settings. 17. Now repeat the tests in tabs 2 to 13 inclusive, above. In each case check that all the fields are now displayed. Use the following extra notes for some cases: note 2, 4, 5 - Display will probably not fit in box - this is ok, nobody should turn on all options anyhow. It looks a bit weird if any of the fields are blank (you get a comma for the blank field) but this is OK as users shouldn't turn on these options unless they are reliably set (and the comma makes it unambiguous anyhow) note 3 - on most Moodle themes the report will probably not fit in browser width and may get cut off rather than using scrollbars, this is a separate pre-existing bug in most moodle themes and not related to this issue (also doesn't so much apply in realistic cases where you only tick one or two boxes) note 4b, 13b - on this screen, try searching for the start of a different field such as idnumber or phone number. (In the 'Enrol Users' screen you have to press Return after typing in your search text, which may be confusing; MDL-30139 ) note 3, 6, 9, 10, 11, 12, 13 - on these screens, additionally try sorting by one of the new columns (click it); behaviour should be same as if you sort by an existing column. note 13 - this screen looks pretty stupid when you have all the options ticked, but it's not too awful; and provided you only tick one or two, they fit in nicely. PART FIVE - CAPABILITY 18. On the course, go to the overrides screen (course administration / users / permissions). Next to the permission moodle/site:viewuseridentity, click the X beside Teacher so that your example teacher does not have the permission. 19. Log in as the example teacher. 20. Repeat the tests in tabs 4 to 12 inclusive, above. In each case check that none of the fields are displayed (as per PART THREE above). PART SIX - POSSIBLE GRADEBOOK SUCKAGE 21. Log back in as admin. Go back to the settings screen and turn on the 'idnumber' and 'department' checkboxes (just so we have a more realistic situation / less horrible table) and save settings. 22. Return to the grades screen. Reload. Verify that it's working with those two fields. 23. Turn editing on. Verify it's still working - meaning that the table columns/rows remain in synch with the headers. 24. Open site administration / grades / report settings / grader report. Flip the values of all the tickboxes so the opposite options are selected, then save settings. 25. Return to grades screen. Reload. Verify it's still working. 26. Toggle editing. Reload. Verify it's still working. 27. Open course administration / users / permissions. Turn off gradereport/user:view for the Teacher role. Log in as your sample teacher. View the grade report. (This should have caused the little grade icon next to user's name to disappears.) Verify it's still working. NOTE: At this point you might want to flip back the grade settings to default so they don't affect future tests. You can either do this manually or in database, DELETE FROM prefix_config WHERE name LIKE 'grade_report_%'; , then visit admin page and save settings.
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE
    • Pull Master Branch:
      MDL-26647-master

      Description

      (NOTE: I have changed this description since the original one because the goal of this enhancement has changed and I felt leaving the original description was misleading. The main change is that it no longer offers an option to display username.)

      At large institutions, staff require reliable and convenient ways to identify users when adding users (to groups/etc) and when looking at lists of users.

      In Moodle, users are generally identified by their name (first name and last name). This works well for small systems where a teacher knows all their students, but is not a reliable way to identify users in large systems where administrative/course staff are typically not familiar with the names of students. Apart from anything else, for most names, we have more than one user with the same name. For example there are 10 users in our Moodle system called Sam Marshall, only one of whom is me! It is also frequently the case in our system that users have two OU [not just Moodle] accounts (one staff account, one student account) which will obviously have the same name.

      In addition to first name and last name, Moodle already offers other ways to identify users in certain locations:

      • In user selectors, the email address is displayed by default. There is also an option to display idnumber and username in this selector.
      • In the gradebook, quiz report, SCORM report, and activity/course completion reports, the idnumber can be optionally displayed. (The setting for this is inside gradebook settings, which doesn't make too much sense.)

      This causes the following problems:

      1) Behaviour is inconsistent; some reports optionally show idnumber, others don't, and user selectors show email addresses.
      2) There is an admin option to display usernames in user selector, which is considered by Moodle HQ to be a security risk.
      3) There is no security check on this display. For example, at some institutions (including ours) the student number [idnumber] is a privileged piece of information that is only supposed to be available to people to certain roles. Similarly it would be nice to configure for specific roles in specific courses or forums etc.
      4) It is not possible to enable consistent display of user fields that may be vital for administrative staff to work efficiently (such as idnumber, department, or other value, depending on institution).

      My proposed solution to these problems is as follows:

      1) Add new options that replace the existing options in user settings (where you used to be able to select username, idnumber, and email for user selectors) and in grade settings (where you used to be able to select idnumber for grade and, undocumented, other reports). The options will offer the following fields:

      • ID number
      • Email address
      • Phone number
      • Mobile phone
      • Department
      • Institution

      I chose this list after examining the user table and considering which fields were likely to be useful to administrators. For example, you can imagine somebody emailing to request an administrator makes a change, in which case email would be useful identifier; similar with the phone number. Institution and department are clearly potentially useful ('since this is a Science course, we probably want the John Smith from Science').

      Users would be expected to select zero, one, or two options from this list which correspond to profile settings that are mandatory at their institution. It does works if you select all of them, but that leads to some stupidly wide tables.

      Default is currently just email, which preserves existing behaviour in user selectors.

      2) Add a new capability to control access to this information

      moodle/site:viewuseridentity

      By default teachers, editing teachers, managers would have this, but students would not.

      This ensures that if any private fields (such as idnumber, in our case) are included in this information, we will not reveal that information to anyone who shouldn't see it.

      3) Add some API functions to make it easier to implement these changes

      I have a function that gets the list of fields (ie blank if you don't have the capability) and one that gets SQL suitable for including in a SELECT so you can make sure that database queries include required fields.

      4) Implement these options across most reports and other relevant locations in the system

      • User selectors (role assign in some places, groups, forum subscribers)
      • Browse users
      • Course participants
      • Grader report
      • Quiz report, SCORM report, assignment report
      • Course/activity completion reports
      • Enrol users

        Gliffy Diagrams

          Attachments

          1. enrol.png
            enrol.png
            45 kB
          2. grades.png
            grades.png
            24 kB
          3. groups.png
            groups.png
            40 kB
          4. participants.png
            participants.png
            53 kB
          5. settings.png
            settings.png
            26 kB

            Issue Links

              Activity

                People

                • Votes:
                  25 Vote for this issue
                  Watchers:
                  19 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    5/Dec/11