New activity: Simple Certificate

Re: New activity: Simple Certificate export of the data include the username

by Educantel Educantel -
Number of replies: 1
The simple certificate resource allows you to export the report of users who have downloaded the certificate in the "Certificates issued" tab. How to make the export of the data include the username (username that is used to log in)? (3.1.3+)
Thanks for the help.


In reply to Educantel Educantel

Re: New activity: Simple Certificate export of the data include the username

by Carlos Alexandre Fonseca -
Picture of Plugin developers

There is not way to do it without changing the code,

I don't know which plguning version you have, and i don't know which format you want, so i  show the code for all formats

https://github.com/bozoh/moodle-mod_simplecertificate/blob/MOODLE_33/locallib.php#L1956-L2085

if you want in xls format:

https://github.com/bozoh/moodle-mod_simplecertificate/blob/MOODLE_33/locallib.php#L2001-L2043

if you want in ods format

https://github.com/bozoh/moodle-mod_simplecertificate/blob/MOODLE_33/locallib.php#L1956-L1999

in txt (csv) format

https://github.com/bozoh/moodle-mod_simplecertificate/blob/MOODLE_33/locallib.php#L2046-L2085

To get the username you must use

$user->username

in xls format will be (after line 2036):

$myxls->write_string($row, 6, $user->username);


hope this helps you