Username in quiz results

Username in quiz results

by John D. Black -
Number of replies: 4

For compliance with government health and safety regulations, I need to archive quiz results that show whether students answered correctly on a question-by-question basis. I can access that data as follows: Course Home Page \ Quiz Name \ “Attempts” link. Then I download the table as an Excel worksheet.

Here’s the problem: I need the worksheet to display the username, which it does not do. The username is necessary in order to upload the information to another system. How can I get username data included in the table? Or is there a different report that would show results for individual questions along with the username?

Moodle 2.3.2 (Build 20120910)

Average of ratings: -
In reply to John D. Black

Re: Username in quiz results

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

This is semi-officially supported. Some people think that showing the userid in the user-interface is a security issue, which is why you cannot just go to Site administration Users Permissions User policies  Show user identity and select username.

However, you can set it in config.php. Just add a line like:

$CFG->showuseridentity = 'email,idnumber,username';

Average of ratings: Useful (2)
In reply to Tim Hunt

Re: Username in quiz results

by Troy Shimkus -

Is there a similar command to this for 1.9? I have an older site that I need to get a quiz report with usernames.

In reply to Tim Hunt

Re: Username in quiz results

by Ray Lawrence -

This is a handy tip. Is it possible to get it working with custom profile fields? I get an error reading frm database message. 

In reply to Ray Lawrence

Re: Username in quiz results

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Custom user profile fields are a significantly harder problem, because they have to be loaded from a different database table. It might be possible to make it work, but it is certainly not easy. At any rate, the issues in doing this are really a Moodle core thing, they are not specific to the quiz.