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

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

@ -21,7 +21,7 @@
* @package dokeos.survey * @package dokeos.survey
* @author unknown, the initial survey that did not make it in 1.8 because of bad code * @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 * @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) * @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 else
{ {
$name = $person; $name = $key+1;
$id = $person; $id = $person;
} }
echo '<option value="reporting.php?action='.$_GET['action'].'&amp;survey_id='.$_GET['survey_id'].'&amp;user='.$id.'" '; echo '<option value="reporting.php?action='.$_GET['action'].'&amp;survey_id='.$_GET['survey_id'].'&amp;user='.$id.'" ';
@ -817,9 +817,12 @@ function display_complete_report()
*/ */
function display_complete_report_row($possible_answers, $answers_of_user, $user, $questions) 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); $table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION);
echo '<tr>'; echo '<tr>';
if ($survey_data['anonymous'] == 0)
{
if(intval($user)!==0) if(intval($user)!==0)
{ {
$sql = 'SELECT firstname, lastname FROM '.Database::get_main_table(TABLE_MAIN_USER).' WHERE user_id='.intval($user); $sql = 'SELECT firstname, lastname FROM '.Database::get_main_table(TABLE_MAIN_USER).' WHERE user_id='.intval($user);
@ -838,6 +841,11 @@ function display_complete_report_row($possible_answers, $answers_of_user, $user,
{ {
echo ' <th>'.$user.'</th>'; // the user column echo ' <th>'.$user.'</th>'; // the user column
} }
}
else
{
echo '<th>-</th>';
}
foreach ($possible_answers as $question_id=>$possible_option) foreach ($possible_answers as $question_id=>$possible_option)

Loading…
Cancel
Save