$b[$tracking_column]) { return 1; } else { return -1; } } function rsort_sessions($a, $b) { global $tracking_column; if ($b[$tracking_column] > $a[$tracking_column]) { return 1; } else { return -1; } } /* * MAIN CODE */ $is_coach = api_is_coach(); $is_platform_admin = api_is_platform_admin(); $is_drh = api_is_drh(); $is_session_admin = api_is_session_admin(); if ($is_session_admin) { header('location:session.php'); exit; } // Get views $views = array('admin', 'teacher', 'coach', 'drh'); $view = 'teacher'; if (isset($_GET['view']) && in_array($_GET['view'], $views)) { $view = $_GET['view']; } $menu_items = array(); $nb_teacher_courses = 0; global $_configuration; // interbreadcrumbs if (api_is_allowed_to_create_course() && $_GET['display'] != 'yourstudents') { $session_id = intval($_GET['session_id']); if (!empty($session_id)) { $courses = Tracking::get_courses_followed_by_coach($_user['user_id'], $session_id); } else { $courses = CourseManager::get_course_list_of_user_as_course_admin($_user['user_id']); } $nb_teacher_courses = count($courses); $sessions = Tracking::get_sessions_coached_by_user($_user['user_id']); $nb_sessions = count($sessions); if ($nb_teacher_courses || $nb_sessions) { if (!$is_coach && !$is_platform_admin) { $view = 'teacher'; } if ($view == 'teacher' && empty($session_id)) { $menu_items[] = get_lang('TeacherInterface'); if ($nb_teacher_courses) { $title = get_lang('YourCourseList'); } } else { if (!empty($session_id)) { $session_name = api_get_session_name($session_id); $title = get_lang('Session').' '.$session_name; } $menu_items[] = ''.get_lang('TeacherInterface').''; } } } if ($is_coach && $_GET['display'] != 'yourstudents') { if ($nb_teacher_courses == 0 && !$is_platform_admin) { $view = 'coach'; } if ($view == 'coach') { $menu_items[] = get_lang('CoachInterface'); $title = get_lang('YourStatistics'); } else { $menu_items[] = ''.get_lang('CoachInterface').''; } } if ($is_platform_admin && $_GET['display'] != 'yourstudents') { if ($nb_teacher_courses == 0 && $nb_sessions == 0) { $view = 'admin'; } if ($view == 'admin') { $menu_items[] = get_lang('AdminInterface'); $title = get_lang('CoachList'); $menu_items[] = ''.get_lang('ExamTracking').''; //$menu_items[] = $title; } else { $menu_items[] = ''.get_lang('AdminInterface').''; $menu_items[] = ''.get_lang('ExamTracking').''; } } if ($is_drh || $_GET['display'] == 'yourstudents') { $view = 'drh'; $menu_items[] = get_lang('Students'); $menu_items[] = ''.get_lang('Trainers').''; $menu_items[] = ''.get_lang('Courses').''; $menu_items[] = ''.get_lang('Sessions').''; } // Actions menu $nb_menu_items = count($menu_items); if ($nb_teacher_courses > 0 ) { echo '
'.get_lang('InactivesStudents').' | '.$nb_inactive_students.' |
'.get_lang('AverageTimeSpentOnThePlatform').' | '.(is_null($avg_time_spent) ? '' : api_time_to_hms($avg_time_spent)).' |
'.get_lang('AverageCoursePerStudent').' | '.(is_null($avg_courses_per_student) ? '' : $avg_courses_per_student).' |
'.get_lang('AverageProgressInLearnpath').' | '.(is_null($avg_total_progress) ? '' : round($avg_total_progress, 2).'%').' |
'.get_lang('AverageResultsToTheExercices').' | '.(is_null($avg_results_to_exercises) ? '' : round($avg_results_to_exercises, 2).'%').' |
'.get_lang('AveragePostsInForum').' | '.(is_null($nb_posts) ? '' : round($nb_posts, 2)).' |
'.get_lang('AverageAssignments').' | '.(is_null($nb_assignments) ? '' : round($nb_assignments, 2)).' |
'.get_lang('NbActiveSessions').' | '.$nb_sessions_current.' |
'.get_lang('NbPastSessions').' | '.$nb_sessions_past.' |
'.get_lang('NbFutureSessions').' | '.$nb_sessions_future.' |
'.get_lang('NbStudentPerSession').' | '.(is_null($nb_students_per_session) ? '' : $nb_students_per_session).' |
'.get_lang('NbCoursesPerSession').' | '.(is_null($nb_courses_per_session) ? '' : $nb_courses_per_session).' |