Adding username to datasets in exported Files

Adding username to datasets in exported Files

by Florian Gruber -
Number of replies: 7

We desperately need the username to be a part of the exported datasets again. In former Versions of Moodle, there was a column "username" on the "detailed"-sheet of the Excel file. The new export formats such as .csv are great, but some automated processing of the results that we are using rely heavily on the username. Is there any way to get it back? Thanks in advance!

Average of ratings: -
In reply to Florian Gruber

Re: Adding username to datasets in exported Files

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

I had not noticed that before.  They actually took out the overview page as well which I think I like...I am guessing you would have to hack the core files to get the username back.  I don't see any settings for that.  I would also suggest adding a tracker request.

In reply to Emma Richardson

Re: Adding username to datasets in exported Files

by Florian Gruber -

Thanks for your reply. I have added a tracker request as you suggested: https://tracker.moodle.org/browse/MDL-55317

In reply to Florian Gruber

Re: Adding username to datasets in exported Files

by BISS Edtech -
According to the tracker, this is fixed, but even with the required permissions set, still can't export data with the username field.
In reply to BISS Edtech

Re: Adding username to datasets in exported Files

by Florian Gruber -

Actually, it is not. The issue is closed, but it is not fixed. On the contrary, it says explicitly that there won't be a fix, unfortunately. Exporting the username seems to be regarded as a security hole or privacy issue.

In reply to Florian Gruber

Re: Adding username to datasets in exported Files

by BISS Edtech -
Oh I see. I though this "However in 3.1 feedback export all user identity fields are exported if the current user has 'moodle/site:viewuseridentity' capability." meant that it should work.
In reply to BISS Edtech

Re: Adding username to datasets in exported Files

by Mohammad kabir -

Hi,

Upgrade moodle from 2.8.3  to moodle 3.2.1  

and missing username to datasets in exported files.


I really need username to do some work.

If anybody help me where to hack, then I can hack and download the csv file with username.  I will delete the hacked code soon after download file.

Thanks in advance.



In reply to Mohammad kabir

Re: Adding username to datasets in exported Files

by Mohammad kabir -

Thank you . Hacked it and find the solution.


Hacked file:

www/mod/feedback/classes/responses_table.php

function init(){

/*  hacked below 3 lilnes.  just add: username with existing code */

$tablecolumns = array('userpic', 'fullname', 'username');

 $tableheaders = array(get_string('userpic'), get_string('fullnameuser'), get_string('username'));

 $fields = 'c.id, c.timemodified as completed_timemodified, c.courseid, u.username, '.$ufields;

}

Its temporary solution. If that helps some people.