[svn r14200] fix non anonymous values on an anonymous survey

skala
Eric Marguin 17 years ago
parent b4d2e11c0a
commit 0787144842
  1. 32
      main/survey/reporting.php

@ -21,7 +21,7 @@
* @package dokeos.survey
* @author unknown, the initial survey that did not make it in 1.8 because of bad code
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University: cleanup, refactoring and rewriting large parts of the code
* @version $Id: reporting.php 13886 2007-12-02 01:20:55Z yannoo $
* @version $Id: reporting.php 14200 2008-01-30 12:45:06Z elixir_inter $
*
* @todo The question has to be more clearly indicated (same style as when filling the survey)
*/
@ -311,7 +311,7 @@ function display_user_report()
}
else
{
$name = $person;
$name = $key+1;
$id = $person;
}
echo '<option value="reporting.php?action='.$_GET['action'].'&amp;survey_id='.$_GET['survey_id'].'&amp;user='.$id.'" ';
@ -817,26 +817,34 @@ function display_complete_report()
*/
function display_complete_report_row($possible_answers, $answers_of_user, $user, $questions)
{
global $survey_data;
$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION);
echo '<tr>';
if(intval($user)!==0)
if ($survey_data['anonymous'] == 0)
{
$sql = 'SELECT firstname, lastname FROM '.Database::get_main_table(TABLE_MAIN_USER).' WHERE user_id='.intval($user);
$rs = api_sql_query($sql, __FILE__, __LINE__);
if($row = mysql_fetch_array($rs, MYSQL_ASSOC))
if(intval($user)!==0)
{
$user_displayed = $row['lastname'].' '.$row['firstname'];
$sql = 'SELECT firstname, lastname FROM '.Database::get_main_table(TABLE_MAIN_USER).' WHERE user_id='.intval($user);
$rs = api_sql_query($sql, __FILE__, __LINE__);
if($row = mysql_fetch_array($rs, MYSQL_ASSOC))
{
$user_displayed = $row['lastname'].' '.$row['firstname'];
}
else
{
$user_displayed = '-';
}
echo ' <th><a href="'.api_get_self().'?action=userreport&survey_id='.$_GET['survey_id'].'&user='.$user.'">'.$user_displayed.'</a></th>'; // the user column
}
else
{
$user_displayed = '-';
echo ' <th>'.$user.'</th>'; // the user column
}
echo ' <th><a href="'.api_get_self().'?action=userreport&survey_id='.$_GET['survey_id'].'&user='.$user.'">'.$user_displayed.'</a></th>'; // the user column
}
else
{
echo ' <th>'.$user.'</th>'; // the user column
{
echo '<th>-</th>';
}

Loading…
Cancel
Save