Browse Source

Important - Alter Exercise::selectRandomList() query to fix issue with questions list - JOIN between c_quiz_question and c_quiz_rel_question was not made to be made on q.iid, but on q.id as the q.c_id value was part of the query.

Yannick Warnier 8 years ago
parent
commit
59d8db8e3b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      main/exercise/exercise.class.php

+ 1 - 1
main/exercise/exercise.class.php

@@ -1203,7 +1203,7 @@ class Exercise
         $sql = "SELECT e.question_id
                 FROM $TBL_EXERCISE_QUESTION e 
                 INNER JOIN $TBL_QUESTIONS q
-                ON (e.question_id= q.iid AND e.c_id = q.c_id)
+                ON (e.question_id= q.id AND e.c_id = q.c_id)
                 WHERE e.c_id = {$this->course_id} AND e.exercice_id	= '".Database::escape_string($this->id)."'
                 $randomLimit ";
         $result = Database::query($sql);