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

Additional names fields not included in grade export

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 2.6.3
    • Gradebook

      The additional names fields are not included in grade exports despite adding the fields to the grade_export_userprofilefields admin setting.

      I tracked this to the get_user_profile_fields() function in grade/lib.php, which will continue over a field if the field is either hidden or not in an array of user default fields. The user default fields are defined by the user_get_default_fields() in user/lib.php. That function has a hardcoded list of fields and none of the new-in-2.6 additional names fields are in that list, so none of them can be included in grade exports.

      Steps to reproduce:

      1. Go to Site admin > Grades > General Settings and add the alternatename field to grade_export_userprofilefields.
      2. Go to Site admin > Users > Permissions > User Policies and change the fullnamedisplay setting to "firstname lastname (alternatename)".
      3. Go to any course with enrolled users and grade items.
      4. Make sure that at least one enrolled user in a course has an Alternate Name set in the user profile.
      5. View the gradebook for the course. Note that users with an alternate name have the alternate name display in the gradebook.
      6. Export grades for this course to CSV (or Excel or whatever).

      Expected result: The alternatename field should be included in the exported file.
      Actual result: The alternatename field is not included in the exported file.

      As a test, I added the alternatename field to the list of fields in user_get_default_fields() and exported again. The field was included in the exported file as expected. However, since I don't know how else that function is used, I don't know if this is the right fix.

            Unassigned Unassigned
            cfollin Chris Follin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.