diff --git a/main/survey/surveyUtil.class.php b/main/survey/surveyUtil.class.php index 156f37b605..855fa0c714 100755 --- a/main/survey/surveyUtil.class.php +++ b/main/survey/surveyUtil.class.php @@ -235,7 +235,7 @@ class SurveyUtil $questions_data = []; foreach ($my_temp_questions_data as $key => &$value) { - if ($value['type'] != 'comment' && $value['type'] != 'pagebreak') { + if ($value['type'] != 'pagebreak') { $questions_data[$value['sort']] = $value; } } @@ -519,18 +519,18 @@ class SurveyUtil public static function display_question_report($survey_data) { $singlePage = isset($_GET['single_page']) ? (int) $_GET['single_page'] : 0; + // Determining the offset of the sql statement (the n-th question of the survey) + $offset = !isset($_GET['question']) ? 0 : (int) $_GET['question']; + $currentQuestion = isset($_GET['question']) ? (int) $_GET['question'] : 0; + $surveyId = (int) $_GET['survey_id']; + $action = Security::remove_XSS($_GET['action']); $course_id = api_get_course_int_id(); + // Database table definitions $table_survey_question = Database::get_course_table(TABLE_SURVEY_QUESTION); $table_survey_question_option = Database::get_course_table(TABLE_SURVEY_QUESTION_OPTION); $table_survey_answer = Database::get_course_table(TABLE_SURVEY_ANSWER); - - // Determining the offset of the sql statement (the n-th question of the survey) - $offset = !isset($_GET['question']) ? 0 : (int) $_GET['question']; - $currentQuestion = isset($_GET['question']) ? (int) $_GET['question'] : 0; $questions = []; - $surveyId = (int) $_GET['survey_id']; - $action = Security::remove_XSS($_GET['action']); echo '
'; echo ''. @@ -575,8 +575,7 @@ class SurveyUtil WHERE c_id = $course_id AND survey_id='".$surveyId."' AND - type <>'pagebreak' - + type <>'pagebreak' ORDER BY sort ASC $limitStatement"; $result = Database::query($sql); @@ -584,7 +583,6 @@ class SurveyUtil $questions[$row['question_id']] = $row; } } - foreach ($questions as $question) { $chartData = []; $options = [];