diff --git a/main/inc/lib/tracking.lib.php b/main/inc/lib/tracking.lib.php index 141841b7ab..b77bf6eb8c 100755 --- a/main/inc/lib/tracking.lib.php +++ b/main/inc/lib/tracking.lib.php @@ -1121,8 +1121,10 @@ class Tracking STUDENT ); $students = array(); - foreach ($studentList as $studentData) { - $students[] = $studentData['user_id']; + if (is_array($studentList)) { + foreach ($studentList as $studentData) { + $students[] = $studentData['user_id']; + } } $studentBossesList = SessionManager::getAllUsersFromCoursesFromAllSessionFromStatus( @@ -1141,8 +1143,10 @@ class Tracking STUDENT_BOSS ); $studentBosses = array(); - foreach ($studentBossesList as $studentBossData) { - $studentBosses[] = $studentBossData['user_id']; + if (is_array($studentBossesList)) { + foreach ($studentBossesList as $studentBossData) { + $studentBosses[] = $studentBossData['user_id']; + } } $teacherList = SessionManager::getAllUsersFromCoursesFromAllSessionFromStatus( @@ -1182,8 +1186,10 @@ class Tracking ); $humanResourcesList = array(); - foreach ($humanResources as $item) { - $humanResourcesList[] = $item['user_id']; + if (is_array($humanResources)) { + foreach ($humanResources as $item) { + $humanResourcesList[] = $item['user_id']; + } } $platformCourses = SessionManager::getAllCoursesFollowedByUser( @@ -1772,7 +1778,11 @@ class Tracking $sql = "SELECT count(id) FROM $tbl_course_quiz WHERE c_id = {$course_info['real_id']} $condition_active $condition_quiz "; - $count_quiz = Database::fetch_row(Database::query($sql)); + $count_quiz = 0; + $countQuizResult = Database::query($sql); + if (!empty($countQuizResult)) { + $count_quiz = Database::fetch_row($countQuizResult); + } if (!empty($count_quiz[0]) && !empty($student_id)) { if (is_array($student_id)) { @@ -1789,7 +1799,7 @@ class Tracking $result = Database::query($sql); $exercise_list = array(); $exercise_id = null; - if (Database::num_rows($result)) { + if (!empty($result) && Database::num_rows($result)) { while ($row = Database::fetch_array($result)) { $exercise_list[] = $row['id']; } @@ -4686,7 +4696,10 @@ class Tracking } //Score $html .= Display::tag('td', $percentage_score, array('align'=>'center')); - $html .= Display::tag('td', $last_connection, array('align'=>'center')); + if (empty($last_connection) or is_bool($last_connection)) { + $last_connection = ''; + } + $html .= Display::tag('td', $last_connection, array('align' => 'center')); if ($course_code == $courseCodeFromGet && $_GET['session_id'] == $session_id_from_get) { $details = ''; @@ -4852,6 +4865,9 @@ class Tracking $my_score = $score/$weighting; } //@todo this function slows the page + if (is_int($user_list)) { + $user_list = array($user_list); + } $position = ExerciseLib::get_exercise_result_ranking($my_score, $exe_id, $exercices['id'], $course_info['code'], $session_id, $user_list); $graph = self::generate_exercise_result_thumbnail_graph($to_graph_exercise_result[$exercices['id']]); @@ -5527,7 +5543,8 @@ class Tracking * @param int $sessionId The session ID (session.id) * @param int $courseId The course ID (course.id) * @param int $exerciseId The quiz ID (c_quiz.id) - * @param int $answer The answer status (0 = incorrect, 1 = correct, 2 = both) + * @param string $date_from + * @param string $date_to * @param array $options An array of options you can pass to the query (limit, where and order) * @return array An array with the data of exercise(s) progress */ diff --git a/main/inc/lib/usermanager.lib.php b/main/inc/lib/usermanager.lib.php index 1c0c44143d..71fbd62749 100755 --- a/main/inc/lib/usermanager.lib.php +++ b/main/inc/lib/usermanager.lib.php @@ -2270,7 +2270,7 @@ class UserManager /** * Get all the extra field information of a certain field (also the options) * - * @param int $field_name the name of the field we want to know everything of + * @param int $fieldId the ID of the field we want to know everything of * @return array $return containing all th information about the extra profile field * @author Julio Montoya * @deprecated