From 5f9e34edf6b7ad1949720a525de3fdb19a0eafe8 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Wed, 8 Feb 2017 14:34:30 -0500 Subject: [PATCH] Fix bug in results by question page if no user has answered FIB questions yet --- main/exercise/fill_blanks.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main/exercise/fill_blanks.class.php b/main/exercise/fill_blanks.class.php index 6673a6b9fb..0f9410f2bd 100755 --- a/main/exercise/fill_blanks.class.php +++ b/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