From d517cde6c72b49ba9b2962268faa5cee0a7857e1 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Tue, 15 Apr 2008 23:36:21 +0200 Subject: [PATCH] [svn r14910] Fixed bug not ordering questions correctly in survey export (see FS#2466) --- documentation/changelog.html | 2 +- main/survey/survey.lib.php | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/documentation/changelog.html b/documentation/changelog.html index 0fe4fe1d0f..550dad8176 100644 --- a/documentation/changelog.html +++ b/documentation/changelog.html @@ -44,7 +44,7 @@
  • Prerequisites management in learning paths fixed (includes quizzes, hotpotatoes and SCORM)
  • Various minor bugs fixed in the learning path tool (scoring, copy, re-ordering)
  • Various minor bugs fixed in the session handling
  • -
  • Fixes to the survey tool (date management)
  • +
  • Fixes to the survey tool (date management, questions order in export)
  • Fixes to the calendar tool (access by students)
  • Fixes to the announcement tool (access by students)
  • Fixes to the group tool (default group settings)
  • diff --git a/main/survey/survey.lib.php b/main/survey/survey.lib.php index 64ddaaacfb..bb879dff19 100644 --- a/main/survey/survey.lib.php +++ b/main/survey/survey.lib.php @@ -23,7 +23,7 @@ $config['survey']['debug'] = false; /** * @package dokeos.survey * @author Patrick Cool , Ghent University: cleanup, refactoring and rewriting large parts (if not all) of the code -* @version $Id: survey.lib.php 14822 2008-04-10 04:44:54Z yannoo $ +* @version $Id: survey.lib.php 14910 2008-04-15 21:36:21Z yannoo $ * * @todo move this file to inc/lib * @todo use consistent naming for the functions (save vs store for instance) @@ -2462,7 +2462,8 @@ class SurveyUtil { ON questions.question_id = options.question_id WHERE questions.question_id = options.question_id AND questions.survey_id = '".Database::escape_string($_GET['survey_id'])."' - GROUP BY questions.question_id"; + GROUP BY questions.question_id + ORDER BY questions.sort ASC"; $result = api_sql_query($sql, __FILE__, __LINE__); while ($row = Database::fetch_array($result)) { @@ -2678,7 +2679,8 @@ class SurveyUtil { FROM $table_survey_question questions LEFT JOIN $table_survey_question_option options ON questions.question_id = options.question_id " ." AND questions.survey_id = '".Database::escape_string($_GET['survey_id'])."' - GROUP BY questions.question_id"; + GROUP BY questions.question_id " + ." ORDER BY questions.sort ASC"; $result = api_sql_query($sql, __FILE__, __LINE__); while ($row = Database::fetch_array($result)) { @@ -2871,7 +2873,8 @@ class SurveyUtil { FROM $table_survey_question questions LEFT JOIN $table_survey_question_option options ON questions.question_id = options.question_id " ." AND questions.survey_id = '".Database::escape_string($_GET['survey_id'])."' - GROUP BY questions.question_id"; + GROUP BY questions.question_id " + ." ORDER BY questions.sort ASC"; $result = api_sql_query($sql, __FILE__, __LINE__); while ($row = Database::fetch_array($result)) {