diff --git a/main/exercise/exercise.class.php b/main/exercise/exercise.class.php index 9a85130f4b..c14ec43313 100755 --- a/main/exercise/exercise.class.php +++ b/main/exercise/exercise.class.php @@ -4560,13 +4560,18 @@ class Exercise $real_list[$realAnswer['id_auto']] = $realAnswer['answer']; } + $orderBy = ' ORDER BY id_auto '; + if (DRAGGABLE == $answerType) { + $orderBy = ' ORDER BY correct '; + } + $sql = "SELECT id, answer, correct, id_auto, ponderation FROM $table_ans WHERE c_id = $course_id AND question_id = $questionId AND correct <> 0 - ORDER BY id_auto"; + $orderBy"; $result = Database::query($sql); $options = []; $correctAnswers = [];