Login Form

#82 – How to add username field in the report, coz i want to import my quiz data to excel with username field in it.

Posted in ‘BF Quiz’
This is a public ticket. Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.
Monday, 06 January 2014 14:35 AEDT
noefk2k
Joomla! version: (2.5.8)
Dear Tamlynsoftware,
Can you tell me how to insert username field in the quiz report? It really important because i want to import my data to excel include username field in it.
Please help me. Thank you
Monday, 06 January 2014 21:21 AEDT 5'
Tim
BF Quiz Plus 3 Years, BF Survey 12 Months
Hi Nurul,
The answer table that stores the responses to the quiz contains a uid field, it does not actually store the username. So what you'd need to do is adjust the query used by the report to join with the table joining on the id field and that should get you the username. The file that you'd need to edit is /administrator/components/com_bfquiz_plus/views/report/tmpl/default.php

Between lines 415 - 470 you can see how to query is built and stored in the $sql variable. You'd basically need to append to this query the join to get the additional username field from the table.

I hope this helps.

regards

Tim
Follow us on twitter http://twitter.com/tamlynsoftware
Wednesday, 08 January 2014 21:56 AEDT 60'
Tim
BF Quiz Plus 3 Years, BF Survey 12 Months
Hi Nurul,
I don't generally have the time to provide a custom development service, but I've had a quick go at this joining on the email field instead of the uid.
Try changing lines 411-415 of /administrator/components/com_bfquiz_plus/views/report/tmpl/default.php

//line 411
if($input == ""){
$input=str_replace("'", "", $myFields);
}

$sql=' '.$input.' FROM '.$table.' ';


//change to
if($input == ""){
$input=str_replace("'", "", $myFields);
$input=str_replace("uid", "uxd", $input);
$input=str_replace("matrixid", "matrixxd", $input);
$input=str_replace("id", $table.".id", $input);
$input=str_replace("Name", $table.".Name", $input);
$input=str_replace("Email", $table.".Email", $input);
$input=str_replace("uxd", "uid", $input);
$input=str_replace("matrixxd", "matrixid", $input);
$input.=",username";
$myFields .= ",'username'";
$input2[count( $input2 )]='username';
$options[count( $options )]='username';
}

$sql=' '.$input.' FROM '.$table.' ';
$sql.=' left join #__users AS c ON c.email='.$table.'.Email';


regards

Tim
Follow us on twitter http://twitter.com/tamlynsoftware
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.
Go to top