Exercises: Fix draggable question, answer order results BT#18584.

pull/3837/head
Julio Montoya 5 years ago
parent 75fd5b782d
commit 3bafa35cd6
  1. 7
      main/exercise/exercise.class.php

@ -4560,13 +4560,18 @@ class Exercise
$real_list[$realAnswer['id_auto']] = $realAnswer['answer']; $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 $sql = "SELECT id, answer, correct, id_auto, ponderation
FROM $table_ans FROM $table_ans
WHERE WHERE
c_id = $course_id AND c_id = $course_id AND
question_id = $questionId AND question_id = $questionId AND
correct <> 0 correct <> 0
ORDER BY id_auto"; $orderBy";
$result = Database::query($sql); $result = Database::query($sql);
$options = []; $options = [];
$correctAnswers = []; $correctAnswers = [];

Loading…
Cancel
Save