Can gradebook export Username field?

Can gradebook export Username field?

by Jim Rehmann -
Number of replies: 2

Is there a way to export the username field along with the grades when I export them?

  • I open a module and click on Grades
  • From the Choose and Action... dropdown, I choose Export to Excel Spreadsheet
  • I choose all the training to export and select Submit.

When I open it in Excel, I have the following fields:

  • First Name
  • Last Name
  • ID number
  • Institution
  • Department
  • eMail address
  • Grade

I would like to include the username field with this.. is there a way?

In reply to Jim Rehmann

Re: Can gradebook export Username field?

by Elena Ivanova -
There is a way, and it is pretty easy, but it needs to be programmed (at least in 1.8 that we have). Sorry, I cannot tell exactly how.
In reply to Jim Rehmann

Re: Can gradebook export Username field?

by Robert Russo -
On line 259 of grade/export/lib.php change email to username as so:

echo "<td>$user->firstname</td><td>$user->lastname</td><td>$user->idnumber</td><td>$user->institution</td><td>$user->department</td><td>$user->e
mail</td>";

becomes

echo "<td>$user->firstname</td><td>$user->lastname</td><td>$user->idnumber</td><td>$user->institution</td><td>$user->department</td><td>$user->username</td>";

You can then use the language string editor to change the email string to username.