'; // print_r($answers[$question['question_id']]); // echo ''; } } } /** * This function displays the report by question. * It displays a table with all the options of the question and the number of users who have answered positively on the option. * The number of users who answered positive on a given option is expressed in an absolute number, in a percentage of the total * and graphically using bars * By clicking on the absolute number you get a list with the persons who have answered this. * You can then click on the name of the person and you will then go to the report by user where you see all the * answers of that user. * * @param array $survey_data all the data of the survey * * @return html code that displays the report by question * * @todo allow switching between horizontal and vertical. * @todo multiple response: percentage are probably not OK * @todo the question and option text have to be shortened and should expand when the user clicks on it. * @todo the pagebreak and comment question types should not be shown => removed from $survey_data before * * @author Patrick Cool
'; echo ' | '.get_lang('AbsoluteTotal').' | '; echo ''.get_lang('Percentage').' | '; echo ''.get_lang('VisualRepresentation').' | '; echo '
---|---|---|---|
'.$value['option_text'].' | '; echo ''.$absolute_number.' | '; echo ''.round($absolute_number/$number_of_answers*100, 2).' % | '; echo '|
'.get_lang('Total').' | '; echo ''.$number_of_answers.' | '; echo ''; echo ' | '; echo ' |
'; print_r($data); echo ''; */ // displaying the table: headers echo '
'; echo ' | '.get_lang('Score').' | '; echo ''.get_lang('AbsoluteTotal').' | '; echo ''.get_lang('Percentage').' | '; echo ''.get_lang('VisualRepresentation').' | '; echo '
---|---|---|---|---|
'.$value['option_text'].' | '; echo ''.$i.' | '; echo ''.$absolute_number.' | '; echo ''.round($absolute_number/$number_of_answers*100, 2).' % | '; echo '|
'.get_lang('Total').' | '; echo ''; echo ' | '.$number_of_answers.' | '; echo ''; echo ' | '; echo ' |
'; } else { if ($question_x['type']=='score') { for($x=1; $x<=$question_x['maximum_score']; $x++) { echo ' | '.$question_x['answers'][($ii-1)].' '.$x.' | ';
}
$x='';
}
else
{
echo ' '.$question_x['answers'][($ii-1)].' | '; } } } echo ''.$question_y['answers'][($ij)].' '.$y.' | '; break; } else { echo ''; echo comparative_check($answers_x, $answers_y, $question_x['answersid'][($ii-1)], $question_y['answersid'][($ij)], $x, $y); echo ' | '; } } } else { if ($ii == 0) { echo ''.$question_y['answers'][($ij)].' '.$y.' | '; } else { echo ''; echo comparative_check($answers_x, $answers_y, $question_x['answersid'][($ii-1)], $question_y['answersid'][($ij)], 0, $y); echo ' | '; } } } echo ' '; } } // The Y axis is NOT a score question type so the number of rows = the number of options else { echo '
---|---|---|---|
'.$question_y['answers'][($ij)].' | '; break; } else { echo ''; echo comparative_check($answers_x, $answers_y, $question_x['answersid'][($ii-1)], $question_y['answersid'][($ij)], $x, 0); echo ' | '; } } } else { if ($ii == 0) { echo ''.$question_y['answers'][($ij)].' | '; } else { echo ''; echo comparative_check($answers_x, $answers_y, $question_x['answersid'][($ii-1)], $question_y['answersid'][($ij)]); echo ' | '; } } } echo '