Beispiel #1
0
 /**
  * This function deals with the action handling
  * @return	void
  * @author Patrick Cool <*****@*****.**>, Ghent University
  * @version February 2007
  */
 public static function handle_reporting_actions($survey_data, $people_filled)
 {
     $action = isset($_GET['action']) ? $_GET['action'] : null;
     // Getting the number of question
     $temp_questions_data = SurveyManager::get_questions($_GET['survey_id']);
     // Sorting like they should be displayed and removing the non-answer question types (comment and pagebreak)
     $my_temp_questions_data = $temp_questions_data == null ? array() : $temp_questions_data;
     $questions_data = array();
     foreach ($my_temp_questions_data as $key => &$value) {
         if ($value['type'] != 'comment' && $value['type'] != 'pagebreak') {
             $questions_data[$value['sort']] = $value;
         }
     }
     // Counting the number of questions that are relevant for the reporting
     $survey_data['number_of_questions'] = count($questions_data);
     if ($action == 'questionreport') {
         SurveyUtil::display_question_report($survey_data);
     }
     if ($action == 'userreport') {
         SurveyUtil::display_user_report($people_filled, $survey_data);
     }
     if ($action == 'comparativereport') {
         SurveyUtil::display_comparative_report();
     }
     if ($action == 'completereport') {
         SurveyUtil::display_complete_report($survey_data);
     }
     if ($action == 'deleteuserreport') {
         SurveyUtil::delete_user_report($_GET['survey_id'], $_GET['user']);
     }
 }