"index.php", "name" => get_lang('MySpace')); if (isset($_GET["user_id"]) && $_GET["user_id"] != "" && !isset($_GET["type"])) { $interbreadcrumb[] = array ("url" => "teachers.php", "name" => get_lang('Teachers')); } if (isset($_GET["user_id"]) && $_GET["user_id"]!="" && isset($_GET["type"]) && $_GET["type"] == "coach") { $interbreadcrumb[] = array ("url" => "coaches.php", "name" => get_lang('Tutors')); } function get_count_users($keyword = null, $active = null) { return SessionManager::getCountUserTracking($keyword, $active); } function get_users($from, $number_of_items, $column, $direction) { $active = isset($_GET['active']) ? $_GET['active'] : null; $keyword = isset($_GET['keyword']) ? Security::remove_XSS($_GET['keyword']) : null; $is_western_name_order = api_is_western_name_order(); $coach_id = api_get_user_id(); $column = 'u.user_id'; if (api_is_drh()) { if (api_drh_can_access_all_session_content()) { $students = SessionManager::getAllUsersFromCoursesFromAllSessionFromStatus( 'drh_all', api_get_user_id(), false, $from, $number_of_items, $column, $direction, $keyword, $active ); } else { $students = SessionManager::getAllUsersFromCoursesFromAllSessionFromStatus( 'drh', api_get_user_id(), false, $from, $number_of_items, $column, $direction, $keyword, $active ); } } else { if (api_is_platform_admin()) { $students = SessionManager::getAllUsersFromCoursesFromAllSessionFromStatus( 'admin', api_get_user_id(), false, $from, $number_of_items, $column, $direction, $keyword, $active ); } else { $students = SessionManager::getAllUsersFromCoursesFromAllSessionFromStatus( 'teacher', api_get_user_id(), false, $from, $number_of_items, $column, $direction, $keyword, $active ); } } $all_datas = array(); foreach ($students as $student_data) { $student_id = $student_data['user_id']; if (isset($_GET['id_session'])) { $courses = Tracking :: get_course_list_in_session_from_student($student_id, $_GET['id_session']); } $avg_time_spent = $avg_student_score = $avg_student_progress = $total_assignments = $total_messages = 0; $nb_courses_student = 0; if (!empty($courses)) { foreach ($courses as $course_code) { if (CourseManager :: is_user_subscribed_in_course($student_id, $course_code, true)) { $avg_time_spent += Tracking :: get_time_spent_on_the_course($student_id, $course_code, $_GET['id_session']); $my_average = Tracking :: get_avg_student_score($student_id, $course_code); if (is_numeric($my_average)) { $avg_student_score += $my_average; } $avg_student_progress += Tracking :: get_avg_student_progress($student_id, $course_code); $total_assignments += Tracking :: count_student_assignments($student_id, $course_code); $total_messages += Tracking :: count_student_messages($student_id, $course_code); $nb_courses_student++; } } } if ($nb_courses_student > 0) { $avg_time_spent = $avg_time_spent / $nb_courses_student; $avg_student_score = $avg_student_score / $nb_courses_student; $avg_student_progress = $avg_student_progress / $nb_courses_student; } else { $avg_time_spent = null; $avg_student_score = null; $avg_student_progress = null; } $row = array(); if ($is_western_name_order) { $row[] = $student_data['firstname']; $row[] = $student_data['lastname']; } else { $row[] = $student_data['lastname']; $row[] = $student_data['firstname']; } $string_date = Tracking :: get_last_connection_date($student_id, true); $first_date = Tracking :: get_first_connection_date($student_id); $row[] = $first_date; $row[] = $string_date; if (isset($_GET['id_coach']) && intval($_GET['id_coach']) != 0) { $detailsLink = ' '; } else { $detailsLink = ' '; } $row[] = $detailsLink; $all_datas[] = $row; } return $all_datas; } if ($export_csv) { $is_western_name_order = api_is_western_name_order(PERSON_NAME_DATA_EXPORT); } else { $is_western_name_order = api_is_western_name_order(); } $sort_by_first_name = api_sort_by_first_name(); $actions .= '