Browse Source

Fix bug in results by question page if no user has answered FIB questions yet

Yannick Warnier 8 years ago
parent
commit
5f9e34edf6
1 changed files with 4 additions and 0 deletions
  1. 4 0
      main/exercise/fill_blanks.class.php

+ 4 - 0
main/exercise/fill_blanks.class.php

@@ -823,6 +823,10 @@ class FillBlanks extends Question
         $tblTrackEAttempt = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
         $tblTrackEExercise = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
         $courseId = api_get_course_int_id();
+        // If no user has answered questions, no need to go further. Return empty array.
+        if (empty($studentsIdList)) {
+            return array();
+        }
         // request to have all the answers of student for this question
         // student may have doing it several time
         // student may have not answered the bracket id, in this case, is result of the answer is empty