Cleaning my reporting

skala
Julio Montoya 13 years ago
parent 1e059faa8e
commit f6556c59f9
  1. 29
      main/mySpace/course.php
  2. 565
      main/mySpace/index.php
  3. 14
      main/mySpace/lp_tracking.php
  4. 810
      main/mySpace/myStudents.php
  5. 52
      main/mySpace/session.php
  6. 141
      main/mySpace/student.php
  7. 28
      main/mySpace/teachers.php
  8. 19
      main/tracking/courseLog.php
  9. 19
      main/tracking/course_session_report.php
  10. 23
      main/tracking/exams.php
  11. 25
      main/tracking/question_course_report.php

@ -82,31 +82,30 @@ if (api_is_drh() || api_is_session_admin() || api_is_platform_admin()) {
$a_courses = array_keys($courses);
if (!api_is_session_admin()) {
$menu_items[] = '<a href="index.php?view=drh_students&amp;display=yourstudents">'.get_lang('Students').'</a>';
$menu_items[] = '<a href="teachers.php">'.get_lang('Teachers').'</a>';
if (empty($_GET['user_id']) && empty($id_session)) {
$menu_items[] = get_lang('Courses');
} else {
$menu_items[] = '<a href="course.php">'.get_lang('Courses').'</a>';
}
$menu_items[] = '<a href="session.php">'.get_lang('Sessions').'</a>';
$menu_items[] = Display::url(Display::return_icon('stats.png', get_lang('MyStats'),'',32),api_get_path(WEB_CODE_PATH)."auth/my_progress.php" );
$menu_items[] = Display::url(Display::return_icon('user.png', get_lang('Students'), array(), 32), "index.php?view=drh_students&amp;display=yourstudents");
$menu_items[] = Display::url(Display::return_icon('teacher.png', get_lang('Trainers'), array(), 32), 'teachers.php');
$menu_items[] = Display::return_icon('course_na.png', get_lang('Courses'), array(), 32);
$menu_items[] = Display::url(Display::return_icon('session.png', get_lang('Sessions'), array(), 32), 'session.php');
}
echo '<div class="actions-title" style ="font-size:10pt;">';
echo '<div class="actions">';
$nb_menu_items = count($menu_items);
if ($nb_menu_items > 1) {
foreach ($menu_items as $key => $item) {
echo $item;
if ($key != $nb_menu_items - 1) {
echo '&nbsp;|&nbsp;';
}
echo $item;
}
}
if (count($a_courses) > 0) {
echo '&nbsp;&nbsp;<a href="javascript: void(0);" onclick="javascript: window.print()"><img align="absbottom" src="../img/printmgr.gif">&nbsp;'.get_lang('Print').'</a> ';
echo '<span style="float:right">';
echo Display::url(Display::return_icon('printer.png', get_lang('Print'), array(), 32), 'javascript: void(0);', array('onclick'=>'javascript: window.print();'));
echo '</span>';
}
echo '</div>';
echo '<h4>'.$title.'</h4>';
echo '<h2>'.$title.'</h2>';
}
// Database Table Definitions

@ -22,13 +22,21 @@ ob_start();
$export_csv = isset($_GET['export']) && $_GET['export'] == 'csv' ? true : false;
$display = isset($_GET['display']) ? Security::remove_XSS($_GET['display']) : null;
$csv_content = array();
$nameTools = get_lang('MySpace');
$nameTools = get_lang('MySpace');
$user_id = api_get_user_id();
$nb_sessions = 0;
$user_id = api_get_user_id();
$is_coach = api_is_coach($_GET['session_id']); // This is used?
$is_platform_admin = api_is_platform_admin();
$is_drh = api_is_drh();
$is_session_admin = api_is_session_admin();
$nb_sessions = 0;
$nb_teacher_courses = 0;
$title = null;
// access control
api_block_anonymous_users();
if (!$export_csv) {
Display :: display_header($nameTools);
} else {
@ -60,12 +68,6 @@ $tbl_track_cours_access = Database :: get_statistic_table(TABLE_STATISTIC_TRACK
/* * FUNCTIONS */
/*
function count_teacher_courses() {
global $nb_teacher_courses;
return $nb_teacher_courses;
}*/
function count_coaches() {
global $total_no_coaches;
return $total_no_coaches;
@ -104,11 +106,6 @@ function rsort_sessions($a, $b) {
/* * MAIN CODE */
$is_coach = api_is_coach($_GET['session_id']);
$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;
@ -122,148 +119,125 @@ if (isset($_GET['view']) && in_array($_GET['view'], $views)) {
}
$menu_items = array();
$nb_teacher_courses = 0;
$title = null;
global $_configuration;
//If is a teacher coach or admin
if (api_is_allowed_to_create_course()) {
$session_id = isset($_GET['session_id']) ? intval($_GET['session_id']): 0;
if (!empty($session_id)) {
$courses = Tracking::get_courses_followed_by_coach($user_id, $session_id);
} else {
$courses = CourseManager::get_course_list_of_user_as_course_admin($user_id);
}
$nb_teacher_courses = count($courses);
$sessions = Tracking::get_sessions_coached_by_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 is a teacher or admin
if (api_is_allowed_to_create_course() || api_is_drh()) {
if ($nb_teacher_courses) {
$title = get_lang('Courses');
}
} else {
if (!empty($session_id)) {
$session_name = api_get_session_name($session_id);
$title = Display::return_icon('session.png', get_lang('Session'), array(), 22).' '.$session_name;
}
$menu_items[] = '<a href="'.api_get_self().'?view=teacher">'.get_lang('TeacherInterface').'</a>';
}
}
}
if ($is_coach && $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[] = '<a href="'.api_get_self().'?view=coach">'.get_lang('CoachInterface').'</a>';
}
}
if ($is_platform_admin && $display != 'yourstudents') {
if ($nb_teacher_courses == 0 && $nb_sessions == 0) {
$view = 'admin';
}
if ($is_platform_admin) {
if ($view == 'admin') {
$menu_items[] = get_lang('AdminInterface');
$title = get_lang('CoachList');
$menu_items[] = '<a href="'.api_get_path(WEB_CODE_PATH).'tracking/exams.php">'.get_lang('ExamTracking').'</a>';
} else {
$menu_items[] = '<a href="'.api_get_self().'?view=admin">'.get_lang('AdminInterface').'</a>';
$menu_items[] = '<a href="'.api_get_path(WEB_CODE_PATH).'tracking/exams.php">'.get_lang('ExamTracking').'</a>';
$menu_items[] = Display::url(Display::return_icon('teacher.png', get_lang('TeacherInterface'), array(), 32), api_get_self().'?view=teacher');
$menu_items[] = Display::url(Display::return_icon('star_na.png', get_lang('AdminInterface'), array(), 32), api_get_self().'?view=admin');
$menu_items[] = Display::url(Display::return_icon('quiz.png', get_lang('ExamTracking'), array(), 32), api_get_path(WEB_CODE_PATH).'tracking/exams.php');
} else {
$menu_items[] = Display::return_icon('teacher_na.png', get_lang('TeacherInterface'), array(), 32);
$menu_items[] = Display::url(Display::return_icon('star.png', get_lang('AdminInterface'), array(), 32), api_get_self().'?view=admin');
$menu_items[] = Display::url(Display::return_icon('quiz.png', get_lang('ExamTracking'), array(), 32), api_get_path(WEB_CODE_PATH).'tracking/exams.php');
}
}
if ($is_drh || ($display == 'yourstudents')) {
if ($is_drh) {
$view = 'drh';
$menu_items[] = get_lang('Students');
$menu_items[] = '<a href="teachers.php">'.get_lang('Trainers').'</a>';
$menu_items[] = '<a href="course.php">'.get_lang('Courses').'</a>';
$menu_items[] = '<a href="session.php">'.get_lang('Sessions').'</a>';
$menu_items[] = Display::return_icon('user_na.png', get_lang('Students'), array(), 32);
$menu_items[] = Display::url(Display::return_icon('teacher.png', get_lang('Trainers'), array(), 32), 'teachers.php');
$menu_items[] = Display::url(Display::return_icon('course.png', get_lang('Courses'), array(), 32), 'course.php');
$menu_items[] = Display::url(Display::return_icon('session.png', get_lang('Sessions'), array(), 32), 'session.php');
}
// Actions menu
$nb_menu_items = count($menu_items);
echo '<div id="actions" class="actions">';
if ($nb_teacher_courses > 0 ) {
echo '<div id="actions" class="actions">';
if ($display == 'useroverview' || $display == 'sessionoverview' || $display == 'courseoverview') {
echo '<a href="'.api_get_self().'?display='.$display.'&export=csv&view='.$view.'">';
echo Display::return_icon("export_csv.png", get_lang('ExportAsCSV'),array(), 32);
echo '</a>';
}
echo '<span style="float:right">';
if ($display == 'useroverview' || $display == 'sessionoverview' || $display == 'courseoverview') {
echo '<a href="'.api_get_self().'?display='.$display.'&export=csv&view='.$view.'">';
echo Display::return_icon("export_csv.png", get_lang('ExportAsCSV'),array(), 32);
echo '</a>';
}
echo '<a href="javascript: void(0);" onclick="javascript: window.print()">'. Display::return_icon('printer.png', get_lang('Print'),'','32').'</a>';
echo '</span>';
if (!empty($session_id)) {
echo '<a href="index.php">'.Display::return_icon('back.png', get_lang('Back'),'','32').'</a>';
} else {
echo Display::url(Display::return_icon('stats.png', get_lang('MyStats'),'',32),api_get_path(WEB_CODE_PATH)."auth/my_progress.php" );
}
echo '<a href="javascript: void(0);" onclick="javascript: window.print()">'. Display::return_icon('printer.png', get_lang('Print'),'','32').'</a>';
if (empty($session_id)) {
if ($nb_menu_items > 1) {
foreach ($menu_items as $key => $item) {
echo $item;
if ($key != $nb_menu_items - 1) {
echo '&nbsp;|&nbsp;';
}
}
}
}
echo '</div>';
if (!empty($session_id)) {
echo '<a href="index.php">'.Display::return_icon('back.png', get_lang('Back'),'','32').'</a>';
} else {
echo '<div id="actions" class="actions">';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'auth/my_progress.php">'.Display::return_icon('stats.png', get_lang('MyStats'),'','32').'</a>';//
echo '</div>';
}
echo Display::url(Display::return_icon('stats.png', get_lang('MyStats'),'',32),api_get_path(WEB_CODE_PATH)."auth/my_progress.php" );
}
echo Display::tag('h2', $title);
// Actions menu
$nb_menu_items = count($menu_items);
if (($is_drh && $view == 'drh') || ($display == 'yourstudents')) {
// get data for human resources manager
$students = array_keys(UserManager::get_users_followed_by_drh($user_id, STUDENT));
$courses_of_the_platform = CourseManager :: get_real_course_list();
foreach ($courses_of_the_platform as $course) {
$courses[$course['code']] = $course['code'];
if (empty($session_id)) {
if ($nb_menu_items > 1) {
foreach ($menu_items as $key => $item) {
echo $item;
}
}
}
echo '</div>';
if ($is_coach && $view == 'coach') {
$students = Tracking::get_student_followed_by_coach($user_id);
$courses = Tracking::get_courses_followed_by_coach($user_id);
}
if ($view == 'coach' || $view == 'drh') {
if ($nb_teacher_courses || $nb_sessions) {
//If we are in course
if (empty($session_id)) {
if ($nb_teacher_courses) {
$title = '<img src="'.api_get_path(WEB_IMG_PATH).'course.gif"> '.get_lang('Courses').' ('.$nb_teacher_courses.') ';
}
} else {
//If we are in Course Session
$session_name = api_get_session_name($session_id);
$title = Display::return_icon('session.png', get_lang('Session'), array(), 22).' '.$session_name;
$menu_items[] = '<a href="'.api_get_self().'?view=teacher">'.get_lang('TeacherInterface').'</a>';
}
}
//if (empty($session_id) && $view == 'teacher') {
if (empty($session_id)) {
//Getting courses followed by a coach (No session courses)
$courses = CourseManager::get_course_list_as_coach($user_id, false);
if (isset($courses[0])) {
$courses = $courses[0];
}
//Getting students from courses and courses in sessions (For show the total students that the user follows)
$students = CourseManager::get_user_list_from_courses_as_coach($user_id);
// Sessions for the coach
$sessions = Tracking::get_sessions_coached_by_user($user_id);
$nb_sessions = count($sessions);
//If is drh
if ($is_drh) {
// get data for human resources manager
$students = array_keys(UserManager::get_users_followed_by_drh($user_id, STUDENT));
$courses_of_the_platform = CourseManager :: get_real_course_list();
foreach ($courses_of_the_platform as $course) {
$courses[$course['code']] = $course['code'];
}
}
//Courses for the teacher
$nb_teacher_courses = count($courses);
//Students
$nb_students = count($students);
$total_time_spent = 0;
$total_courses = 0;
$avg_total_progress = 0;
$avg_results_to_exercises = 0;
$nb_inactive_students = 0;
$total_time_spent = 0;
$total_courses = 0;
$avg_total_progress = 0;
$avg_results_to_exercises = 0;
$nb_inactive_students = 0;
$nb_posts = $nb_assignments = 0;
if (!empty($students))
if (!empty($students))
foreach ($students as $student_id) {
// inactive students
$last_connection_date = Tracking :: get_last_connection_date($student_id, true, true);
@ -274,7 +248,7 @@ if ($view == 'coach' || $view == 'drh') {
} else {
$nb_inactive_students++;
}
$total_time_spent += Tracking :: get_time_spent_on_the_platform($student_id);
$total_courses += Tracking :: count_course_per_student($student_id);
$avg_student_progress = $avg_student_score = 0;
@ -286,10 +260,10 @@ if ($view == 'coach' || $view == 'drh') {
$nb_assignments += Tracking :: count_student_assignments($student_id, $course_code);
$avg_student_progress += Tracking :: get_avg_student_progress($student_id, $course_code);
$myavg_temp = Tracking :: get_avg_student_score($student_id, $course_code);
if (is_numeric($myavg_temp))
$avg_student_score += $myavg_temp;
if ($nb_posts !== null && $nb_assignments !== null && $avg_student_progress !== null && $avg_student_score !== null) {
//if one of these scores is null, it means that we had a problem connecting to the right database, so don't count it in
$nb_courses_student++;
@ -299,13 +273,16 @@ if ($view == 'coach' || $view == 'drh') {
// average progress of the student
$avg_student_progress = $nb_courses_student ?$avg_student_progress / $nb_courses_student:0;
$avg_total_progress += $avg_student_progress;
// average test results of the student
$avg_student_score = $avg_student_score?$avg_student_score / $nb_courses_student:0;
$avg_results_to_exercises += $avg_student_score;
}
if ($nb_students > 0) {
echo Display::tag('h2', '<img src="'.api_get_path(WEB_IMG_PATH).'students.gif">&nbsp;'.get_lang('Students').' ('.$nb_students.')');
// average progress
$avg_total_progress = $avg_total_progress / $nb_students;
// average results to the tests
@ -318,6 +295,56 @@ if ($view == 'coach' || $view == 'drh') {
$nb_assignments = $nb_assignments / $nb_students;
// average posts
$nb_posts = $nb_posts / $nb_students;
if ($export_csv) {
//csv part
$csv_content[] = array(get_lang('Probationers', ''));
$csv_content[] = array(get_lang('InactivesStudents', ''), $nb_inactive_students );
$csv_content[] = array(get_lang('AverageTimeSpentOnThePlatform', ''), $avg_time_spent);
$csv_content[] = array(get_lang('AverageCoursePerStudent', ''), $avg_courses_per_student);
$csv_content[] = array(get_lang('AverageProgressInLearnpath', ''), is_null($avg_total_progress) ? null : round($avg_total_progress, 2).'%');
$csv_content[] = array(get_lang('AverageResultsToTheExercices', ''), is_null($avg_results_to_exercises) ? null : round($avg_results_to_exercises, 2).'%');
$csv_content[] = array(get_lang('AveragePostsInForum', ''), $nb_posts);
$csv_content[] = array(get_lang('AverageAssignments', ''), $nb_assignments);
$csv_content[] = array();
} else {
// html part
echo '
<div class="report_section">
<table class="data_table">
<tr>
<td>'.get_lang('InactivesStudents').'</td>
<td align="right">'.$nb_inactive_students.'</td>
</tr>
<tr>
<td>'.get_lang('AverageTimeSpentOnThePlatform').'</td>
<td align="right">'.(is_null($avg_time_spent) ? '' : api_time_to_hms($avg_time_spent)).'</td>
</tr>
<tr>
<td>'.get_lang('AverageCoursePerStudent').'</td>
<td align="right">'.(is_null($avg_courses_per_student) ? '' : $avg_courses_per_student).'</td>
</tr>
<tr>
<td>'.get_lang('AverageProgressInLearnpath').'</td>
<td align="right">'.(is_null($avg_total_progress) ? '' : round($avg_total_progress, 2).'%').'</td>
</tr>
<tr>
<td>'.get_lang('AverageResultsToTheExercices').'</td>
<td align="right">'.(is_null($avg_results_to_exercises) ? '' : round($avg_results_to_exercises, 2).'%').'</td>
</tr>
<tr>
<td>'.get_lang('AveragePostsInForum').'</td>
<td align="right">'.(is_null($nb_posts) ? '' : round($nb_posts, 2)).'</td>
</tr>
<tr>
<td>'.get_lang('AverageAssignments').'</td>
<td align="right">'.(is_null($nb_assignments) ? '' : round($nb_assignments, 2)).'</td>
</tr>
</table>
<a href="student.php">'.get_lang('SeeStudentList').'</a>
</div><br />';
}
} else {
$avg_total_progress = null;
$avg_results_to_exercises = null;
@ -326,193 +353,20 @@ if ($view == 'coach' || $view == 'drh') {
$nb_assignments = null;
$nb_posts = null;
}
if ($export_csv) {
//csv part
$csv_content[] = array(get_lang('Probationers', ''));
$csv_content[] = array(get_lang('InactivesStudents', ''), $nb_inactive_students );
$csv_content[] = array(get_lang('AverageTimeSpentOnThePlatform', ''), $avg_time_spent);
$csv_content[] = array(get_lang('AverageCoursePerStudent', ''), $avg_courses_per_student);
$csv_content[] = array(get_lang('AverageProgressInLearnpath', ''), is_null($avg_total_progress) ? null : round($avg_total_progress, 2).'%');
$csv_content[] = array(get_lang('AverageResultsToTheExercices', ''), is_null($avg_results_to_exercises) ? null : round($avg_results_to_exercises, 2).'%');
$csv_content[] = array(get_lang('AveragePostsInForum', ''), $nb_posts);
$csv_content[] = array(get_lang('AverageAssignments', ''), $nb_assignments);
$csv_content[] = array();
} else {
// html part
echo '
<div class="report_section">
<h4>
<a href="student.php?display=yourstudents"><img src="'.api_get_path(WEB_IMG_PATH).'students.gif">&nbsp;'.get_lang('Probationers').' ('.$nb_students.')'.'</a>
</h4>
<table class="data_table">
<tr>
<td>
'.get_lang('InactivesStudents').'
</td>
<td align="right">
'.$nb_inactive_students.'
</td>
</tr>
<tr>
<td>
'.get_lang('AverageTimeSpentOnThePlatform').'
</td>
<td align="right">
'.(is_null($avg_time_spent) ? '' : api_time_to_hms($avg_time_spent)).'
</td>
</tr>
<tr>
<td>
'.get_lang('AverageCoursePerStudent').'
</td>
<td align="right">
'.(is_null($avg_courses_per_student) ? '' : $avg_courses_per_student).'
</td>
</tr>
<tr>
<td>
'.get_lang('AverageProgressInLearnpath').'
</td>
<td align="right">
'.(is_null($avg_total_progress) ? '' : round($avg_total_progress, 2).'%').'
</td>
</tr>
<tr>
<td>
'.get_lang('AverageResultsToTheExercices').'
</td>
<td align="right">
'.(is_null($avg_results_to_exercises) ? '' : round($avg_results_to_exercises, 2).'%').'
</td>
</tr>
<tr>
<td>
'.get_lang('AveragePostsInForum').'
</td>
<td align="right">
'.(is_null($nb_posts) ? '' : round($nb_posts, 2)).'
</td>
</tr>
<tr>
<td>
'.get_lang('AverageAssignments').'
</td>
<td align="right">
'.(is_null($nb_assignments) ? '' : round($nb_assignments, 2)).'
</td>
</tr>
</table><br />
<a href="student.php?display=yourstudents">'.get_lang('SeeStudentList').'</a>
</div>';
}
}
if ($view == 'coach') {
/**
* Infos about sessions of the coach
**/
$sessions = Tracking :: get_sessions_coached_by_user($user_id);
$nb_sessions = count($sessions);
$nb_sessions_past = $nb_sessions_future = $nb_sessions_current = 0;
$courses = array();
foreach ($sessions as $session) {
if ($session['date_start'] == '0000-00-00') {
$nb_sessions_current ++;
} else {
$date_start = explode('-', $session['date_start']);
$time_start = mktime(0, 0, 0, $date_start[1], $date_start[2], $date_start[0]);
$date_end = explode('-', $session['date_end']);
$time_end = mktime(0, 0, 0, $date_end[1], $date_end[2], $date_end[0]);
if ($time_start < time() && time() < $time_end) {
$nb_sessions_current++;
} elseif (time() < $time_start) {
$nb_sessions_future++;
} elseif (time() > $time_end) {
$nb_sessions_past++;
}
}
$courses = array_merge($courses, Tracking::get_courses_list_from_session($session['id']));
}
if ($nb_sessions > 0) {
$nb_courses_per_session = round(count($courses) / $nb_sessions, 2);
$nb_students_per_session = round($nb_students / $nb_sessions, 2);
} else {
$nb_courses_per_session = null;
$nb_students_per_session = null;
}
if ($export_csv) {
//csv part
$csv_content[] = array(get_lang('Sessions', ''));
$csv_content[] = array(get_lang('NbActiveSessions', '').';'.$nb_sessions_current);
$csv_content[] = array(get_lang('NbPastSessions', '').';'.$nb_sessions_past);
$csv_content[] = array(get_lang('NbFutureSessions', '').';'.$nb_sessions_future);
$csv_content[] = array(get_lang('NbStudentPerSession', '').';'.$nb_students_per_session);
$csv_content[] = array(get_lang('NbCoursesPerSession', '').';'.$nb_courses_per_session);
$csv_content[] = array();
} else {
// html part
echo '
<div class="report_section">
<h4>
<a href="session.php"><img src="'.api_get_path(WEB_IMG_PATH).'sessions.gif">&nbsp;'.get_lang('Sessions').' ('.$nb_sessions.')'.'</a>
</h4>
<table class="data_table">
<tr>
<td>
'.get_lang('NbActiveSessions').'
</td>
<td align="right">
'.$nb_sessions_current.'
</td>
</tr>
<tr>
<td>
'.get_lang('NbPastSessions').'
</td>
<td align="right">
'.$nb_sessions_past.'
</td>
</tr>
<tr>
<td>
'.get_lang('NbFutureSessions').'
</td>
<td align="right">
'.$nb_sessions_future.'
</td>
</tr>
<tr>
<td>
'.get_lang('NbStudentPerSession').'
</td>
<td align="right">
'.(is_null($nb_students_per_session) ? '' : $nb_students_per_session).'
</td>
</tr>
<tr>
<td>
'.get_lang('NbCoursesPerSession').'
</td>
<td align="right">
'.(is_null($nb_courses_per_session) ? '' : $nb_courses_per_session).'
</td>
</tr>
</table>
<a href="session.php">'.get_lang('SeeSessionList').'</a>
</div>';
}
} else {
$courses = Tracking::get_courses_followed_by_coach($user_id, $session_id);
}
echo '<div class="clear">&nbsp;</div>';
if (api_is_allowed_to_create_course() && $view == 'teacher') {
//Courses
if ($nb_teacher_courses) {
//Courses table
echo Display::tag('h2', $title);
$table = new SortableTable('courses', 'get_number_of_courses' ,array('MySpace','get_course_data'));
$parameters['view'] = 'teacher';
$parameters['class'] = 'data_table';
@ -540,9 +394,9 @@ if (api_is_allowed_to_create_course() && $view == 'teacher') {
$table->display();
}
// Display sessions
// Display list of sessions
if ($nb_sessions > 0 && !isset($_GET['session_id'])) {
echo '<h2>'.get_lang('Sessions').'</h2>';
echo '<h2><img src="'.api_get_path(WEB_IMG_PATH).'session.png">&nbsp;'.get_lang('Sessions').' ('.$nb_sessions.')'.'</h2>';
$table = new SortableTable('tracking_sessions', 'count_sessions_coached');
$table->set_header(0, get_lang('Title'), false);
$table->set_header(1, get_lang('Date'), false);
@ -587,16 +441,87 @@ if (api_is_allowed_to_create_course() && $view == 'teacher') {
$table -> setColAttributes(1, array('align' => 'center'));
$table -> setColAttributes(2, array('align' => 'center'));
$table -> setColAttributes(3, array('align' => 'center'));
/* Start session over view stats */
$nb_sessions_past = $nb_sessions_future = $nb_sessions_current = 0;
$courses = array();
foreach ($sessions as $session) {
if ($session['date_start'] == '0000-00-00') {
$nb_sessions_current ++;
} else {
$date_start = explode('-', $session['date_start']);
$time_start = mktime(0, 0, 0, $date_start[1], $date_start[2], $date_start[0]);
$date_end = explode('-', $session['date_end']);
$time_end = mktime(0, 0, 0, $date_end[1], $date_end[2], $date_end[0]);
if ($time_start < time() && time() < $time_end) {
$nb_sessions_current++;
} elseif (time() < $time_start) {
$nb_sessions_future++;
} elseif (time() > $time_end) {
$nb_sessions_past++;
}
}
$courses = array_merge($courses, Tracking::get_courses_list_from_session($session['id']));
}
if ($nb_sessions > 0) {
$nb_courses_per_session = round(count($courses) / $nb_sessions, 2);
$nb_students_per_session = round($nb_students / $nb_sessions, 2);
} else {
$nb_courses_per_session = null;
$nb_students_per_session = null;
}
if ($export_csv) {
//csv part
$csv_content[] = array(get_lang('Sessions', ''));
$csv_content[] = array(get_lang('NbActiveSessions', '').';'.$nb_sessions_current);
$csv_content[] = array(get_lang('NbPastSessions', '').';'.$nb_sessions_past);
$csv_content[] = array(get_lang('NbFutureSessions', '').';'.$nb_sessions_future);
$csv_content[] = array(get_lang('NbStudentPerSession', '').';'.$nb_students_per_session);
$csv_content[] = array(get_lang('NbCoursesPerSession', '').';'.$nb_courses_per_session);
$csv_content[] = array();
} else {
// html part
echo '
<div class="report_section">
<table class="data_table">
<tr>
<td>'.get_lang('NbActiveSessions').'</td>
<td align="right">'.$nb_sessions_current.'</td>
</tr>
<tr>
<td>'.get_lang('NbPastSessions').'</td>
<td align="right">'.$nb_sessions_past.'</td>
</tr>
<tr>
<td>'.get_lang('NbFutureSessions').'</td>
<td align="right">'.$nb_sessions_future.'</td>
</tr>
<tr>
<td>'.get_lang('NbStudentPerSession').'</td>
<td align="right">'.(is_null($nb_students_per_session) ? '' : $nb_students_per_session).'</td>
</tr>
<tr>
<td>'.get_lang('NbCoursesPerSession').'</td>
<td align="right">'.(is_null($nb_courses_per_session) ? '' : $nb_courses_per_session).'</td>
</tr>
</table>
</div>';
}
/* End session overview */
$table -> display();
}
}
if ($is_platform_admin && $view == 'admin' && $display != 'yourstudents') {
echo '<a href="'.api_get_self().'?view=admin&amp;display=coaches">'.get_lang('DisplayCoaches').'</a> | ';
echo '<a href="'.api_get_self().'?view=admin&amp;display=useroverview">'.get_lang('DisplayUserOverview').'</a>';
if ($display == 'useroverview') {
echo ' | <a href="'.api_get_self().'?view=admin&amp;display=useroverview&amp;export=options">'.get_lang('ExportUserOverviewOptions').'</a>';
echo ' ( <a href="'.api_get_self().'?view=admin&amp;display=useroverview&amp;export=options">'.get_lang('ExportUserOverviewOptions').'</a> )';
}
echo ' | <a href="'.api_get_self().'?view=admin&amp;display=sessionoverview">'.get_lang('DisplaySessionOverview').'</a>';
echo ' | <a href="'.api_get_self().'?view=admin&amp;display=courseoverview">'.get_lang('DisplayCourseOverview').'</a>';

@ -1,14 +1,12 @@
<?php
/* For licensing terms, see /license.txt */
/*
* Created on 26 mars 07 by Eric Marguin
* Script to display the tracking of the students in the learning paths.
*/
$language_file = array ('registration', 'index', 'tracking', 'exercice', 'scorm', 'learnpath');
require_once '../inc/global.inc.php';
// resetting the course id
$cidReset = true;
$from_myspace = false;
$from_link = '';
if (isset($_GET['from']) && $_GET['from'] == 'myspace') {
@ -23,6 +21,8 @@ require_once api_get_path(SYS_CODE_PATH).'newscorm/learnpath.class.php';
require_once api_get_path(SYS_CODE_PATH).'newscorm/learnpathItem.class.php';
require_once api_get_path(LIBRARY_PATH).'export.lib.inc.php';
$session_id = isset($_REQUEST['id_session']) && !empty($_REQUEST['id_session']) ? intval($_REQUEST['id_session']) : api_get_session_id();
$export_csv = isset($_GET['export']) && $_GET['export'] == 'csv' ? true : false;
if ($export_csv) {
ob_start();
@ -56,7 +56,7 @@ if (!empty($_GET['origin']) && $_GET['origin'] == 'user_course') {
$interbreadcrumb[] = array ("url" => "../user/user.php?cidReq=".$cidReq, "name" => get_lang("Users"));
} else if(!empty($_GET['origin']) && $_GET['origin'] == 'tracking_course') {
// $interbreadcrumb[] = array ("url" => api_get_path(WEB_COURSE_PATH).$course_info['directory'], 'name' => $course_info['name']);
$interbreadcrumb[] = array ("url" => "../tracking/courseLog.php?cidReq=".$cidReq.'&studentlist=true&id_session='.$_SESSION['id_session'], "name" => get_lang("Tracking"));
$interbreadcrumb[] = array ("url" => "../tracking/courseLog.php?cidReq=".$cidReq.'&studentlist=true&id_session='.$session_id, "name" => get_lang("Tracking"));
} else {
$interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('MySpace'));
$interbreadcrumb[] = array ("url" => "student.php", "name" => get_lang("MyStudents"));
@ -102,7 +102,7 @@ echo '</div>';
echo '<div class="clear"></div>';
$session_name = api_get_session_name(api_get_session_id());
$session_name = api_get_session_name($session_id);
$table_title = ($session_name? Display::return_icon('session.png', get_lang('Session'), array(), 22).' '.$session_name.' ':' ').
Display::return_icon('course.png', get_lang('Course'), array(), 22).' '.$course_info['name'].' '.
Display::return_icon('user.png', get_lang('User'), array(), 22).' '.$name;

@ -8,9 +8,9 @@
// name of the language file that needs to be included
$language_file = array('registration', 'index', 'tracking', 'exercice', 'admin', 'gradebook');
$cidReset = true;
require_once '../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'tracking.lib.php';
require_once api_get_path(LIBRARY_PATH).'export.lib.inc.php';
require_once api_get_path(SYS_CODE_PATH).'newscorm/learnpath.class.php';
require_once api_get_path(SYS_CODE_PATH).'mySpace/myspace.lib.php';
@ -20,7 +20,6 @@ require_once api_get_path(SYS_CODE_PATH).'gradebook/lib/be/result.class.php';
require_once api_get_path(SYS_CODE_PATH).'gradebook/lib/be/linkfactory.class.php';
require_once api_get_path(SYS_CODE_PATH).'gradebook/lib/be/category.class.php';
require_once api_get_path(LIBRARY_PATH).'attendance.lib.php';
require_once api_get_path(LIBRARY_PATH).'sessionmanager.lib.php';
$htmlHeadXtra[] = '<script type="text/javascript">
@ -29,7 +28,6 @@ function show_image(image,width,height) {
height = parseInt(height) + 20;
window_x = window.open(image,\'windowX\',\'width=\'+ width + \', height=\'+ height + \'\');
}
</script>';
$export_csv = isset ($_GET['export']) && $_GET['export'] == 'csv' ? true : false;
@ -48,7 +46,7 @@ if (isset ($_GET['from']) && $_GET['from'] == 'myspace') {
}
$nameTools = get_lang('StudentDetails');
//$cidReset = true;
$get_course_code = Security :: remove_XSS($_GET['course']);
if (isset ($_GET['details'])) {
if (!empty ($_GET['origin']) && $_GET['origin'] == 'user_course') {
@ -156,7 +154,9 @@ if (isset ($_GET['details'])) {
api_block_anonymous_users();
if (!api_is_allowed_to_edit() && !api_is_coach() && !api_is_drh() && !api_is_course_tutor() && $_user['status'] != SESSIONADMIN && !api_is_platform_admin(true)) {
if (!api_is_allowed_to_create_course() && !api_is_session_admin()) {
api_not_allowed(true);
}
@ -194,9 +194,7 @@ $student_id = intval($_GET['student']);
$check= Security::check_token('get');
if ($check) {
switch ($_GET['action']) {
case 'reset_lp' :
//$origin = isset($_GET['origin']) ?Security::remove_XSS($_GET['origin']):"";
//$details = isset($_GET['details']) ?Security::remove_XSS($_GET['details']):"";
case 'reset_lp' :
$course = isset($_GET['course']) ?$_GET['course']:"";
$lp_id = isset($_GET['lp_id']) ?intval($_GET['lp_id']):"";
@ -214,11 +212,87 @@ if ($check) {
}
Security::clear_token();
}
// infos about user
$info_user = UserManager::get_user_info_by_id($student_id);
$courses_in_session = array();
/*if (!isset ($_GET['id_coach'])) {
$sessions_coached_by_user = Tracking::get_sessions_coached_by_user($_user['user_id']);
foreach ($sessions_coached_by_user as $session_coached_by_user) {
$sid = intval($session_coached_by_user['id']);
$courses_followed_by_coach = Tracking :: get_courses_followed_by_coach($_user['user_id'], $sid);
$courses_in_session[$sid] = $courses_followed_by_coach;
}
} else {
$sessions_coached_by_user = Tracking::get_sessions_coached_by_user(intval($_GET['id_coach']));
foreach ($sessions_coached_by_user as $session_coached_by_user) {
$sid = intval($session_coached_by_user['id']);
$courses_followed_by_coach = Tracking :: get_courses_followed_by_coach(intval($_GET['id_coach']), $sid);
$courses_in_session[$sid] = $courses_followed_by_coach;
}
}*/
$courses = CourseManager::get_course_list_of_user_as_course_admin(api_get_user_id());
$courses_in_session_by_coach = array();
$sessions_coached_by_user = Tracking::get_sessions_coached_by_user(api_get_user_id());
//RRHH or session admin
if (api_is_session_admin()) {
if (!empty ($_GET['student'])) {
$session_by_session_admin = SessionManager::get_sessions_followed_by_drh(api_get_user_id());
if (!empty($session_by_session_admin)) {
foreach ($session_by_session_admin as $session_coached_by_user) {
$courses_followed_by_coach = Tracking :: get_courses_list_from_session($session_coached_by_user['id']);
$courses_in_session_by_coach[$session_coached_by_user['id']] = $courses_followed_by_coach;
}
}
}
// infos about user
$info_user = UserManager :: get_user_info_by_id($student_id);
// Teacher or admin
if (!empty($sessions_coached_by_user)) {
foreach ($sessions_coached_by_user as $session_coached_by_user) {
$sid = intval($session_coached_by_user['id']);
$courses_followed_by_coach = Tracking :: get_courses_followed_by_coach(api_get_user_id(), $sid);
$courses_in_session_by_coach[$sid] = $courses_followed_by_coach;
}
}
$sql = 'SELECT course_code FROM ' . $tbl_course_user . ' WHERE relation_type<>'.COURSE_RELATION_TYPE_RRHH.' AND user_id=' . Database :: escape_string($info_user['user_id']);
$rs = Database::query($sql);
while ($row = Database :: fetch_array($rs)) {
if (isset($courses[$row['course_code']])) {
$courses_in_session[0][] = $row['course_code'];
}
}
// Get the list of sessions where the user is subscribed as student
$sql = 'SELECT id_session, course_code FROM ' . Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER) . ' WHERE id_user=' . intval($info_user['user_id']);
$rs = Database::query($sql);
$tmp_sessions = array();
while ($row = Database :: fetch_array($rs)) {
$tmp_sessions[] = $row['id_session'];
if (isset($courses_in_session_by_coach[$row['id_session']])) {
if (in_array($row['id_session'], $tmp_sessions)) {
$courses_in_session[$row['id_session']][] = $row['course_code'];
}
}
}
if (empty($courses_in_session)) {
echo '<div class="actions">';
echo '<a href="javascript: window.back();" ">'.Display::return_icon('back.png', get_lang('Back'),'','32').'</a>';
echo '</div>';
Display::display_warning_message(get_lang('NoDataAvailable'));
Display::display_footer();
exit;
}
if (!empty($_GET['student'])) {
if (api_is_drh() && !UserManager::is_user_followed_by_drh($student_id, $_user['user_id'])) {
api_not_allowed();
}
@ -229,10 +303,8 @@ if (!empty ($_GET['student'])) {
echo '<div class="actions">';
echo '<a href="javascript: window.back();" ">'.Display::return_icon('back.png', get_lang('Back'),'','32').'</a>';
echo '<a href="javascript: void(0);" onclick="javascript: window.print();">
'.Display::return_icon('printer.png', get_lang('Print'),'','32').'</a>';
echo '<a href="' . api_get_self() . '?' . Security :: remove_XSS($_SERVER['QUERY_STRING']) . '&export=csv">
'.Display::return_icon('export_csv.png', get_lang('ExportAsCSV'),'','32').'</a>';
echo '<a href="javascript: void(0);" onclick="javascript: window.print();">'.Display::return_icon('printer.png', get_lang('Print'),'','32').'</a>';
echo '<a href="' . api_get_self() . '?' . Security :: remove_XSS($_SERVER['QUERY_STRING']) . '&export=csv">'.Display::return_icon('export_csv.png', get_lang('ExportAsCSV'),'','32').'</a> ';
if (!empty ($info_user['email'])) {
$send_mail = '<a href="mailto:'.$info_user['email'].'">'.Display :: return_icon('mail_send.png', get_lang('SendMail'),'','32').'</a>';
} else {
@ -247,7 +319,7 @@ if (!empty ($_GET['student'])) {
// is the user online ?
$student_online = Security :: remove_XSS($_GET['student']);
$student_online = intval($_GET['student']);
$users_online = who_is_online(30);
foreach ($users_online as $online) {
if (in_array($_GET['student'], $online)) {
@ -260,20 +332,21 @@ if (!empty ($_GET['student'])) {
// get average of score and average of progress by student
$avg_student_progress = $avg_student_score = $nb_courses = 0;
$course_id = Security :: remove_XSS($_GET['course']);
if (!CourseManager :: is_user_subscribed_in_course($info_user['user_id'], $course_id, true)) {
unset ($courses[$key]);
$course_code = Security :: remove_XSS($_GET['course']);
if (!CourseManager :: is_user_subscribed_in_course($info_user['user_id'], $course_code, true)) {
unset($courses[$key]);
} else {
$nb_courses++;
$avg_student_progress = Tracking::get_avg_student_progress($info_user['user_id'], $course_id, array(), $session_id);
$avg_student_progress = Tracking::get_avg_student_progress($info_user['user_id'], $course_code, array(), $session_id);
//the score inside the Reporting table
$avg_student_score = Tracking::get_avg_student_score($info_user['user_id'], $course_id, array(), $session_id);
$avg_student_score = Tracking::get_avg_student_score($info_user['user_id'], $course_code, array(), $session_id);
//var_dump($avg_student_score);
}
}
$avg_student_progress = round($avg_student_progress, 2);
// time spent on the course
$time_spent_on_the_course = api_time_to_hms(Tracking :: get_time_spent_on_the_course($info_user['user_id'], $course_id, $session_id));
$time_spent_on_the_course = api_time_to_hms(Tracking :: get_time_spent_on_the_course($info_user['user_id'], $course_code, $session_id));
// get information about connections on the platform by student
$first_connection_date = Tracking :: get_first_connection_date($info_user['user_id']);
@ -324,16 +397,15 @@ if (!empty ($_GET['student'])) {
//Show title
$course_code = $_GET['course'];
$info_course = CourseManager :: get_course_information($course_code);
$info_course = CourseManager :: get_course_information($course_code);
$coachs_name = '';
$session_name = '';
$nb_login = Tracking :: count_login_per_student($info_user['user_id'], $_GET['course']);
$nb_login = Tracking :: count_login_per_student($info_user['user_id'], $_GET['course']);
//get coach and session_name if there is one and if session_mode is activated
if (api_get_setting('use_session_mode') == 'true' && $session_id > 0) {
$session_info = api_get_session_info($session_id);
$course_coachs = api_get_coachs_from_course($session_id,$course_code);
$course_coachs = api_get_coachs_from_course($session_id, $course_code);
$nb_login = '';
if (!empty($course_coachs)) {
$info_tutor_name = array();
@ -350,18 +422,14 @@ if (!empty ($_GET['student'])) {
$session_name = $session_info['name'];
} // end
$info_course = CourseManager :: get_course_information($get_course_code);
$session_name = api_get_session_name($session_id);
$table_title = ($session_name? Display::return_icon('session.png', get_lang('Session'), array(), 22).' '.$session_name.' ':'');
$table_title .= ($info_course ? Display::return_icon('course.png', get_lang('Course'), array(), 22).' '.$info_course['title'].' ':'');
$table_title .= Display::return_icon('user.png', get_lang('User'), array(), 22).api_get_person_name($info_user['firstname'], $info_user['lastname']);
$info_course = CourseManager :: get_course_information($get_course_code);
$table_title = Display::return_icon('user.png', get_lang('User'), array(), 22).api_get_person_name($info_user['firstname'], $info_user['lastname']);
echo '<h2>'.$table_title.'</h2>';
?>
<a name="infosStudent"></a>
<table width="100%" border="0" >
<tr>
<table width="100%" border="0">
<tr>
<?php
$image_array = UserManager :: get_user_picture_path_by_id($info_user['user_id'], 'web', false, true);
echo '<td class="borderRight" width="10%" valign="top">';
@ -384,86 +452,68 @@ if (!empty ($_GET['student'])) {
}
echo '</td>';
?>
<td width="40%" valign="top">
<table width="100%" class="data_table">
<tr>
<th><?php echo get_lang('Information'); ?></th>
</tr>
<tr>
<td>
<?php
echo get_lang('Name') . ' : ';
echo api_get_person_name($info_user['firstname'], $info_user['lastname']);
?>
</td>
</tr>
<tr>
<td>
<?php
echo get_lang('Email') . ' : ';
if (!empty ($info_user['email'])) {
echo '<a href="mailto:' . $info_user['email'] . '">' . $info_user['email'] . '</a>';
} else {
echo get_lang('NoEmail');
}
?>
</td>
</tr>
<tr>
<td>
<?php
echo get_lang('Tel') . ' : ';
if (!empty ($info_user['phone'])) {
echo $info_user['phone'];
} else {
echo get_lang('NoTel');
}
?>
</td>
</tr>
<tr>
<td>
<?php
echo get_lang('OfficialCode') . ' : ';
if (!empty ($info_user['official_code'])) {
echo $info_user['official_code'];
} else {
echo get_lang('NoOfficialCode');
}
?>
</td>
</tr>
<tr>
<td>
<?php
echo get_lang('OnLine') . ' : ';
echo $online;
?>
</td>
</tr>
<?php
// Display timezone if the user selected one and if the admin allows the use of user's timezone
$timezone = null;
$timezone_user = UserManager::get_extra_user_data_by_field($info_user['user_id'],'timezone');
$use_users_timezone = api_get_setting('use_users_timezone', 'timezones');
if ($timezone_user['timezone'] != null && $use_users_timezone == 'true') {
$timezone = $timezone_user['timezone'];
}
if ($timezone !== null) {
?>
<tr>
<td>
<?php
echo get_lang('Timezone') . ' : ';
echo $timezone;
?>
</td>
</tr>
<?php
}
?>
</table>
<td width="40%" valign="top">
<table width="100%" class="data_table">
<tr>
<th><?php echo get_lang('Information'); ?></th>
</tr>
<tr>
<td><?php echo get_lang('Name') . ' : '.api_get_person_name($info_user['firstname'], $info_user['lastname']); ?></td>
</tr>
<tr>
<td><?php echo get_lang('Email') . ' : ';
if (!empty ($info_user['email'])) {
echo '<a href="mailto:' . $info_user['email'] . '">' . $info_user['email'] . '</a>';
} else {
echo get_lang('NoEmail');
} ?>
</td>
</tr>
<tr>
<td> <?php echo get_lang('Tel') . ' : ';
if (!empty ($info_user['phone'])) {
echo $info_user['phone'];
} else {
echo get_lang('NoTel');
}
?>
</td>
</tr>
<tr>
<td> <?php echo get_lang('OfficialCode') . ' : ';
if (!empty ($info_user['official_code'])) {
echo $info_user['official_code'];
} else {
echo get_lang('NoOfficialCode');
}
?>
</td>
</tr>
<tr>
<td><?php echo get_lang('OnLine') . ' : '.$online; ?> </td>
</tr>
<?php
// Display timezone if the user selected one and if the admin allows the use of user's timezone
$timezone = null;
$timezone_user = UserManager::get_extra_user_data_by_field($info_user['user_id'],'timezone');
$use_users_timezone = api_get_setting('use_users_timezone', 'timezones');
if ($timezone_user['timezone'] != null && $use_users_timezone == 'true') {
$timezone = $timezone_user['timezone'];
}
if ($timezone !== null) {
?>
<tr>
<td> <?php echo get_lang('Timezone') . ' : '.$timezone; ?> </td>
</tr>
<?php
}
?>
</table>
</td>
<td class="borderLeft" width="35%" valign="top">
<table width="100%" class="data_table">
<tr>
@ -493,12 +543,8 @@ if ($timezone !== null) {
</tr>
<?php
if (!empty($nb_login)) {
echo '<tr><td align="right">';
echo get_lang('CountToolAccess');
echo '</td>';
echo '<td align="left">';
echo $nb_login;
echo '</td>';
echo '<tr><td align="right">'.get_lang('CountToolAccess').'</td>';
echo '<td align="left">'.$nb_login.'</td>';
echo '</tr>';
}
} ?>
@ -509,39 +555,165 @@ if ($timezone !== null) {
<?php
if (!empty ($_GET['details'])) {
$csv_content[] = array ();
$csv_content[] = array (str_replace('&nbsp;', '', $table_title));
?>
<br />
$table_title = '';
<!-- line about learnpaths -->
<table class="data_table">
<tr>
<th>
<?php echo get_lang('Learnpaths');?>
</th>
<th>
<?php echo get_lang('Time'); Display :: display_icon('info3.gif', get_lang('TotalTimeByCourse'), array ('align' => 'absmiddle', 'hspace' => '3px')); ?>
</th>
<th>
<?php echo get_lang('AverageScore'); Display :: display_icon('info3.gif', get_lang('AverageIsCalculatedBasedInAllAttempts'), array ( 'align' => 'absmiddle', 'hspace' => '3px')); ?>
</th>
<th>
<?php echo get_lang('LatestAttemptAverageScore'); Display :: display_icon('info3.gif', get_lang('AverageIsCalculatedBasedInTheLatestAttempts'), array ( 'align' => 'absmiddle', 'hspace' => '3px')); ?>
</th>
<th>
<?php echo get_lang('Progress'); Display :: display_icon('info3.gif', get_lang('LPProgressScore'), array ('align' => 'absmiddle','hspace' => '3px')); ?>
</th>
<th>
<?php echo get_lang('LastConnexion'); Display :: display_icon('info3.gif', get_lang('LastTimeTheCourseWasUsed'), array ('align' => 'absmiddle','hspace' => '3px')); ?>
</th>
<?php
echo '<th>'.get_lang('Details').'</th>';
if (api_is_course_admin()) {
echo '<th>'.get_lang('ResetLP').'</th>';
if (!empty($session_id)) {
$session_name = api_get_session_name($session_id);
$table_title = ($session_name? Display::return_icon('session.png', get_lang('Session'), array(), 22).' '.$session_name.' ':'');
}
if (!empty($info_course['title'])) {
$table_title .= ($info_course ? Display::return_icon('course.png', get_lang('Course'), array(), 22).' '.$info_course['title'].' ':'');
}
echo Display::tag('h2', $table_title);
if (empty($_GET['details'])) {
$csv_content[] = array ();
$csv_content[] = array (
get_lang('Session', ''),
get_lang('Course', ''),
get_lang('Time', ''),
get_lang('Progress', ''),
get_lang('Score', ''),
get_lang('AttendancesFaults', ''),
get_lang('Evaluations')
);
$attendance = new Attendance();
foreach ($courses_in_session as $key => $courses) {
$session_id = $key;
$session_info = api_get_session_info($session_id);
$session_name = $session_info['name'];
$date_start = '';
if (!empty($session_info['date_start']) && $session_info['date_start'] != '0000-00-00') {
$date_start = api_format_date($session_info['date_start'], DATE_FORMAT_SHORT);
}
$date_end = '';
if (!empty($session_info['date_end']) && $session_info['date_end'] != '0000-00-00') {
$date_end = api_format_date($session_info['date_end'], DATE_FORMAT_SHORT);
}
if (!empty($date_start) && !empty($date_end)) {
$date_session = get_lang('From') . ' ' . $date_start . ' ' . get_lang('Until') . ' ' . $date_end;
}
$title = '';
if (empty($session_id)) {
$title = Display::return_icon('course.png', get_lang('Courses'), array(), 22).' '.get_lang('Courses');
} else {
$title = Display::return_icon('session.png', get_lang('Session'), array(), 22).' '.$session_name.($date_session?' ('.$date_session.')':'');
}
// Courses
echo '<h3>'.$title.'</h3>';
echo '<table class="data_table">';
echo '<tr>
<th>'.get_lang('Course').'</th>
<th>'.get_lang('Time').'</th>
<th>'.get_lang('Progress').'</th>
<th>'.get_lang('Score').'</th>
<th>'.get_lang('AttendancesFaults').'</th>
<th>'.get_lang('Evaluations').'</th>
<th>'.get_lang('Details').'</th>
</tr>';
if (!empty($courses)) {
foreach ($courses as $course_code) {
if (CourseManager :: is_user_subscribed_in_course($student_id, $course_code, true)) {
$course_info = CourseManager :: get_course_information($course_code);
$time_spent_on_course = api_time_to_hms(Tracking :: get_time_spent_on_the_course($info_user['user_id'], $course_code, $session_id));
// get average of faults in attendances by student
$results_faults_avg = $attendance->get_faults_average_by_course($student_id, $course_code, $session_id);
if (!empty($results_faults_avg['total'])) {
if (api_is_drh()) {
$attendances_faults_avg = '<a title="'.get_lang('GoAttendance').'" href="'.api_get_path(WEB_CODE_PATH).'attendance/index.php?cidReq='.$course_code.'&id_session='.$session_id.'&student_id='.$student_id.'">'.$results_faults_avg['faults'].'/'.$results_faults_avg['total'].' ('.$results_faults_avg['porcent'].'%)</a>';
} else {
$attendances_faults_avg = $results_faults_avg['faults'].'/'.$results_faults_avg['total'].' ('.$results_faults_avg['porcent'].'%)';
}
} else {
$attendances_faults_avg = '0/0 (0%)';
}
// get evaluatios by student
$cats = Category::load(null, null, $course_code, null, null, $session_id);
$scoretotal = array();
if (isset($cats)) {
if (!empty($session_id)) {
$scoretotal= $cats[0]->calc_score($student_id, $course_code, $session_id);
} else {
$scoretotal= $cats[0]->calc_score($student_id, $course_code);
}
}
$scoretotal_display = '0/0 (0%)';
if (!empty($scoretotal)) {
$scoretotal_display = round($scoretotal[0],2).'/'.round($scoretotal[1],2).'('.round(($scoretotal[0] / $scoretotal[1]) * 100,2) . ' %)';
}
?>
$progress = Tracking::get_avg_student_progress($info_user['user_id'], $course_code, null, $session_id);
$score = Tracking :: get_avg_student_score($info_user['user_id'], $course_code, null, $session_id);
$progress = empty($progress) ? '0%' : $progress.'%';
$score = empty($score) ? '0%' : $score.'%';
$csv_content[] = array (
$session_name,
$course_info['title'],
$time_spent_on_course,
$progress,
$score,
$attendances_faults_avg,
$scoretotal_display
);
echo '<tr>
<td align="right">'.$course_info['title'].'</td>
<td align="right">'.$time_spent_on_course .'</td>
<td align="right">'.$progress.'</td>
<td align="right">'.$score.'</td>
<td align="right">'.$attendances_faults_avg.'</td>
<td align="right">'.$scoretotal_display.'</td>';
if (isset ($_GET['id_coach']) && intval($_GET['id_coach']) != 0) {
echo '<td align="center" width="10"><a href="'.api_get_self().'?student='.$info_user['user_id'].'&details=true&course='.$course_info['code'].'&id_coach='.Security::remove_XSS($_GET['id_coach']).'&origin='.Security::remove_XSS($_GET['origin']).'&id_session='.$session_id.'#infosStudent"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a></td>';
} else {
echo '<td align="center" width="10"><a href="'.api_get_self().'?student='.$info_user['user_id'].'&details=true&course='.$course_info['code'].'&origin='.Security::remove_XSS($_GET['origin']).'&id_session='.$session_id.'#infosStudent"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a></td>';
}
echo '</tr>';
}
}
} else {
echo "<tr><td colspan='5'>".get_lang('NoCourse')."</td></tr>";
}
echo '</table>';
}
} else {
$csv_content[] = array ();
$csv_content[] = array (str_replace('&nbsp;', '', $table_title));
?>
<br />
<!-- LPs-->
<table class="data_table">
<tr>
<th><?php echo get_lang('Learnpaths');?></th>
<th><?php echo get_lang('Time'); Display :: display_icon('info3.gif', get_lang('TotalTimeByCourse'), array ('align' => 'absmiddle', 'hspace' => '3px')); ?></th>
<th><?php echo get_lang('AverageScore'); Display :: display_icon('info3.gif', get_lang('AverageIsCalculatedBasedInAllAttempts'), array ( 'align' => 'absmiddle', 'hspace' => '3px')); ?></th>
<th><?php echo get_lang('LatestAttemptAverageScore'); Display :: display_icon('info3.gif', get_lang('AverageIsCalculatedBasedInTheLatestAttempts'), array ( 'align' => 'absmiddle', 'hspace' => '3px')); ?></th>
<th><?php echo get_lang('Progress'); Display :: display_icon('info3.gif', get_lang('LPProgressScore'), array ('align' => 'absmiddle','hspace' => '3px')); ?></th>
<th><?php echo get_lang('LastConnexion'); Display :: display_icon('info3.gif', get_lang('LastTimeTheCourseWasUsed'), array ('align' => 'absmiddle','hspace' => '3px')); ?></th>
<?php
echo '<th>'.get_lang('Details').'</th>';
if (api_is_course_admin()) {
echo '<th>'.get_lang('ResetLP').'</th>';
}
?>
</tr>
<?php
$headerLearnpath = array (
@ -551,9 +723,9 @@ if ($timezone !== null) {
get_lang('LastConnexion')
);
$t_lp = Database :: get_course_table(TABLE_LP_MAIN, $info_course['db_name']);
$tbl_stats_exercices = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);
$tbl_quiz_questions = Database :: get_course_table(TABLE_QUIZ_QUESTION, $info_course['db_name']);
$t_lp = Database :: get_course_table(TABLE_LP_MAIN, $info_course['db_name']);
$tbl_stats_exercices = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);
$tbl_quiz_questions = Database :: get_course_table(TABLE_QUIZ_QUESTION, $info_course['db_name']);
// csv export headers
$csv_content[] = array ();
@ -565,9 +737,7 @@ if ($timezone !== null) {
get_lang('Progress', ''),
get_lang('LastConnexion', '')
);
//
//$sql_lp = " SELECT lp.name, lp.id FROM $t_lp lp WHERE lp.session_id = $session_id ORDER BY lp.display_order";
if (empty($session_id)) {
$sql_lp = " SELECT lp.name, lp.id FROM $t_lp lp WHERE session_id = 0 ORDER BY lp.display_order";
} else {
@ -665,7 +835,7 @@ if ($timezone !== null) {
if ($from_myspace) {
$from ='&from=myspace';
}
$link = Display::url('<img src="../img/2rightarrow.gif" border="0" />','lp_tracking.php?course='.Security::remove_XSS($_GET['course']).$from.'&origin='.Security::remove_XSS($_GET['origin']).'&lp_id='.$learnpath['id'].'&student_id='.$info_user['user_id'].'&session_id='.$session_id);
$link = Display::url('<img src="../img/2rightarrow.gif" border="0" />','lp_tracking.php?course='.Security::remove_XSS($_GET['course']).$from.'&origin='.Security::remove_XSS($_GET['origin']).'&lp_id='.$learnpath['id'].'&student_id='.$info_user['user_id'].'&id_session='.$session_id);
echo Display::tag('td', $link, array('align'=>'center'));
}
@ -799,307 +969,37 @@ if ($timezone !== null) {
$chat_last_connection
);
?>
<tr>
<th colspan="2">
<?php echo get_lang('OtherTools'); ?>
</th>
</tr>
<tr><!-- assignments -->
<td width="40%">
<?php echo get_lang('Student_publication') ?>
</td>
<td>
<?php echo $nb_assignments ?>
</td>
</tr>
<tr><!-- messages -->
<td>
<?php echo get_lang('Messages') ?>
</td>
<td>
<?php echo $messages ?>
</td>
</tr>
<tr><!-- links -->
<td>
<?php echo get_lang('LinksDetails') ?>
</td>
<td>
<?php echo $links ?>
</td>
</tr>
<tr><!-- documents -->
<td>
<?php echo get_lang('DocumentsDetails') ?>
</td>
<td>
<?php echo $documents ?>
</td>
</tr>
<tr><!-- Chats -->
<td>
<?php echo get_lang('ChatLastConnection') ?>
</td>
<td>
<?php echo $chat_last_connection; ?>
</td>
</tr>
</table>
</td>
<tr>
<th colspan="2"><?php echo get_lang('OtherTools'); ?></th>
</tr>
<tr><!-- assignments -->
<td width="40%"><?php echo get_lang('Student_publication') ?></td>
<td><?php echo $nb_assignments ?></td>
</tr>
<tr><!-- messages -->
<td><?php echo get_lang('Messages') ?></td>
<td><?php echo $messages ?></td>
</tr>
<tr><!-- links -->
<td><?php echo get_lang('LinksDetails') ?></td>
<td><?php echo $links ?></td>
</tr>
<tr><!-- documents -->
<td><?php echo get_lang('DocumentsDetails') ?></td>
<td><?php echo $documents ?></td>
</tr>
<tr><!-- Chats -->
<td><?php echo get_lang('ChatLastConnection') ?></td>
<td><?php echo $chat_last_connection; ?></td>
</tr>
</table>
</table>
</td>
</tr>
</table>
<?php
} else {
$courses_in_session = array ();
if (!api_is_platform_admin(true) && $_user['status'] != DRH) {
// courses followed by user where we are coach
if (!isset ($_GET['id_coach'])) {
$sessions_coached_by_user = Tracking::get_sessions_coached_by_user($_user['user_id']);
foreach ($sessions_coached_by_user as $session_coached_by_user) {
$sid = intval($session_coached_by_user['id']);
$courses_followed_by_coach = Tracking :: get_courses_followed_by_coach($_user['user_id'], $sid);
$courses_in_session[$sid] = $courses_followed_by_coach;
}
} else {
$sessions_coached_by_user = Tracking::get_sessions_coached_by_user(intval($_GET['id_coach']));
foreach ($sessions_coached_by_user as $session_coached_by_user) {
$sid = intval($session_coached_by_user['id']);
$courses_followed_by_coach = Tracking :: get_courses_followed_by_coach(intval($_GET['id_coach']), $sid);
$courses_in_session[$sid] = $courses_followed_by_coach;
}
}
} else {
$sql = 'SELECT course_code FROM ' . $tbl_course_user . ' WHERE relation_type<>'.COURSE_RELATION_TYPE_RRHH.' AND user_id=' . Database :: escape_string($info_user['user_id']);
$rs = Database::query($sql);
while ($row = Database :: fetch_array($rs)) {
$courses_in_session[0][] = $row['course_code'];
}
} //end details
// get the list of sessions where the user is subscribed as student
$sql = 'SELECT id_session, course_code FROM ' . Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER) . ' WHERE id_user=' . intval($info_user['user_id']);
$rs = Database::query($sql);
$tmp_sessions = array();
while ($row = Database :: fetch_array($rs)) {
$tmp_sessions[] = $row['id_session'];
if (in_array($row['id_session'],$tmp_sessions)) {
$courses_in_session[$row['id_session']][] = $row['course_code'];
}
}
}
$csv_content[] = array ();
$csv_content[] = array (
get_lang('Session', ''),
get_lang('Course', ''),
get_lang('Time', ''),
get_lang('Progress', ''),
get_lang('Score', ''),
get_lang('AttendancesFaults', ''),
get_lang('Evaluations')
);
$attendance = new Attendance();
foreach ($courses_in_session as $key => $courses) {
$session_id = $key;
$session_info = api_get_session_info($session_id);
$session_name = $session_info['name'];
$date_start = '';
if (!empty ($session_info['date_start'])) {
$date_start = explode('-', $session_info['date_start']);
$date_start = $date_start[2] . '/' . $date_start[1] . '/' . $date_start[0];
}
$date_end = '';
if (!empty ($session_info['date_end'])) {
$date_end = explode('-', $session_info['date_end']);
$date_end = $date_end[2] . '/' . $date_end[1] . '/' . $date_end[0];
}
$date_session = get_lang('From') . ' ' . $date_start . ' ' . get_lang('To') . ' ' . $date_end;
$title = '';
if (empty($session_id)) {
$title = get_lang('Courses');
} else {
$title = ucfirst($session_name).($date_session?' ('.$date_session.')':'');
}
// courses
echo '<h4>'.$title.'</h4>';
echo '<table class="data_table">';
echo '<tr>
<th>'.get_lang('Course').'</th>
<th>'.get_lang('Time').'</th>
<th>'.get_lang('Progress').'</th>
<th>'.get_lang('Score').'</th>
<th>'.get_lang('AttendancesFaults').'</th>
<th>'.get_lang('Evaluations').'</th>
<th>'.get_lang('Details').'</th>
</tr>';
if (!empty($courses)) {
foreach ($courses as $course_code) {
if (CourseManager :: is_user_subscribed_in_course($student_id, $course_code, true)) {
$course_info = CourseManager :: get_course_information($course_code);
$time_spent_on_course = api_time_to_hms(Tracking :: get_time_spent_on_the_course($info_user['user_id'], $course_code, $session_id));
// get average of faults in attendances by student
$results_faults_avg = $attendance->get_faults_average_by_course($student_id, $course_code, $session_id);
if (!empty($results_faults_avg['total'])) {
if (api_is_drh()) {
$attendances_faults_avg = '<a title="'.get_lang('GoAttendance').'" href="'.api_get_path(WEB_CODE_PATH).'attendance/index.php?cidReq='.$course_code.'&id_session='.$session_id.'&student_id='.$student_id.'">'.$results_faults_avg['faults'].'/'.$results_faults_avg['total'].' ('.$results_faults_avg['porcent'].'%)</a>';
} else {
$attendances_faults_avg = $results_faults_avg['faults'].'/'.$results_faults_avg['total'].' ('.$results_faults_avg['porcent'].'%)';
}
} else {
$attendances_faults_avg = '0/0 (0%)';
}
// get evaluatios by student
$cats = Category::load(null, null, $course_code, null, null, $session_id);
$scoretotal = array();
if (isset($cats)) {
if (!empty($session_id)) {
$scoretotal= $cats[0]->calc_score($student_id, $course_code, $session_id);
} else {
$scoretotal= $cats[0]->calc_score($student_id, $course_code);
}
}
$scoretotal_display = '0/0 (0%)';
if (!empty($scoretotal)) {
/*
if (api_is_drh()) {
$session_param = !empty($session_id)?'&id_session='.$session_id:'';
$scoretotal_display = '<a title="'.get_lang('GoAssessments').'" href="'.api_get_path(WEB_CODE_PATH).'gradebook/index.php?cidReq='.$course_code.'&id_session='.$session_id.'&student_id='.$student_id.'">'.round($scoretotal[0],2).'/'.round($scoretotal[1],2).'('.round(($scoretotal[0] / $scoretotal[1]) * 100,2) . ' %)</a>';
} else {
$scoretotal_display = round($scoretotal[0],2).'/'.round($scoretotal[1],2).'('.round(($scoretotal[0] / $scoretotal[1]) * 100,2) . ' %)';
}
*/
$scoretotal_display = round($scoretotal[0],2).'/'.round($scoretotal[1],2).'('.round(($scoretotal[0] / $scoretotal[1]) * 100,2) . ' %)';
}
$progress = Tracking::get_avg_student_progress($info_user['user_id'], $course_code, null, $session_id);
$score = Tracking :: get_avg_student_score($info_user['user_id'], $course_code, null, $session_id);
$progress = empty($progress) ? '0%' : $progress.'%';
$score = empty($score) ? '0%' : $score.'%';
$csv_content[] = array (
$session_name,
$course_info['title'],
$time_spent_on_course,
$progress,
$score,
$attendances_faults_avg,
$scoretotal_display
);
echo '<tr>
<td align="right">'.$course_info['title'].'</td>
<td align="right">'.$time_spent_on_course .'</td>
<td align="right">'.$progress.'</td>
<td align="right">'.$score.'</td>
<td align="right">'.$attendances_faults_avg.'</td>
<td align="right">'.$scoretotal_display.'</td>';
if (isset ($_GET['id_coach']) && intval($_GET['id_coach']) != 0) {
echo '<td align="center" width="10"><a href="'.api_get_self().'?student='.$info_user['user_id'].'&details=true&course='.$course_info['code'].'&id_coach='.Security::remove_XSS($_GET['id_coach']).'&origin='.Security::remove_XSS($_GET['origin']).'&id_session='.$session_id.'#infosStudent"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a></td>';
} else {
echo '<td align="center" width="10"><a href="'.api_get_self().'?student='.$info_user['user_id'].'&details=true&course='.$course_info['code'].'&origin='.Security::remove_XSS($_GET['origin']).'&id_session='.$session_id.'#infosStudent"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a></td>';
}
echo '</tr>';
}
}
} else {
echo "<tr><td colspan='5'>".get_lang('NoCourse')."</td></tr>";
}
echo '</table>';
}
} //end of else !empty($details)
/* @todo this code seems to be NOT used jmontoya
if (!empty ($_GET['details']) && $_GET['origin'] != 'tracking_course' && $_GET['origin'] != 'user_course') {
echo '<br /><br />';
}
if (!empty ($_GET['exe_id'])) {
$t_q = Database :: get_course_table(TABLE_QUIZ_TEST, $info_course['db_name']);
$t_qq = Database :: get_course_table(TABLE_QUIZ_QUESTION, $info_course['db_name']);
$t_qa = Database :: get_course_table(TABLE_QUIZ_ANSWER, $info_course['db_name']);
$t_qtq = Database :: get_course_table(TABLE_QUIZ_TEST_QUESTION, $info_course['db_name']);
$sql_exercice_details = "SELECT qq.question, qq.ponderation, qq.id
FROM " . $t_qq . " as qq
INNER JOIN " . $t_qtq . " as qrq
ON qrq.question_id = qq.id
AND qrq.exercice_id = " . intval($_GET['exe_id']);
$result_exercice_details = Database::query($sql_exercice_details);
$sql_ex_name = "SELECT quiz.title
FROM " . $t_q . " AS quiz
WHERE quiz.id = " . intval($_GET['exe_id']);
;
$resultExName = Database::query($sql_ex_name);
$exName = Database :: fetch_array($resultExName);
echo "<table class='data_table'>
<tr>
<th colspan='2'>
" . $exName['title'] . "
</th>
</tr>
";
while ($exerciceDetails = Database :: fetch_array($result_exercice_details)) {
$sqlAnswer = " SELECT qa.comment, qa.answer
FROM " . $t_qa . " as qa
WHERE qa.question_id = " . $exerciceDetails['id'];
$resultAnswer = Database::query($sqlAnswer);
echo "<a name='infosExe'></a>";
echo "
<tr>
<td colspan='2'>
<strong>" . $exerciceDetails['question'] . ' /' . $exerciceDetails['ponderation'] . "</strong>
</td>
</tr>
";
while ($answer = Database :: fetch_array($resultAnswer)) {
echo "
<tr>
<td>
" . $answer['answer'] . "
</td>
<td>
";
if (!empty ($answer['comment']))
echo $answer['comment'];
else
echo get_lang('NoComment');
echo "
</td>
</tr>
";
}
}
echo "</table>";
}
*/
//YW - commented out because it doesn't seem to be used
//$header = array_merge($headerLearnpath,$headerExercices,$headerProductions);
}
if ($export_csv) {
ob_end_clean();

@ -11,8 +11,6 @@ $language_file = array ('registration', 'index', 'trad4all', 'tracking', 'admin'
$cidReset = true;
require_once '../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'tracking.lib.php';
require_once api_get_path(LIBRARY_PATH).'sessionmanager.lib.php';
require_once api_get_path(LIBRARY_PATH).'export.lib.inc.php';
api_block_anonymous_users();
@ -36,9 +34,7 @@ if (isset($_GET['export']) && $_GET['export'] == 'csv') {
}
/*
===============================================================================
FUNCTION
===============================================================================
*/
function count_sessions_coached() {
@ -64,11 +60,7 @@ function rsort_sessions($a, $b) {
}
}
/*
===============================================================================
MAIN CODE
===============================================================================
*/
/* MAIN CODE */
if (isset($_GET['id_coach']) && $_GET['id_coach'] != '') {
$id_coach = intval($_GET['id_coach']);
@ -81,28 +73,29 @@ if (api_is_drh() || api_is_session_admin() || api_is_platform_admin()) {
$a_sessions = SessionManager::get_sessions_followed_by_drh($_user['user_id']);
if (!api_is_session_admin()) {
$menu_items[] = '<a href="index.php?view=drh_students&amp;display=yourstudents">'.get_lang('Students').'</a>';
$menu_items[] = '<a href="teachers.php">'.get_lang('Trainers').'</a>';
$menu_items[] = '<a href="course.php">'.get_lang('Courses').'</a>';
$menu_items[] = Display::url(Display::return_icon('stats.png', get_lang('MyStats'),'',32),api_get_path(WEB_CODE_PATH)."auth/my_progress.php" );
$menu_items[] = Display::url(Display::return_icon('user.png', get_lang('Students'), array(), 32), "index.php?view=drh_students&amp;display=yourstudents");
$menu_items[] = Display::url(Display::return_icon('teacher.png', get_lang('Trainers'), array(), 32), 'teachers.php');
$menu_items[] = Display::url(Display::return_icon('course.png', get_lang('Courses'), array(), 32), 'course.php');
$menu_items[] = Display::return_icon('session_na.png', get_lang('Sessions'), array(), 32);
}
$menu_items[] = get_lang('Sessions');
echo '<div class="actions-title" style ="font-size:10pt;">';
echo '<div class="actions">';
$nb_menu_items = count($menu_items);
if ($nb_menu_items > 1) {
foreach ($menu_items as $key => $item) {
echo $item;
if ($key != $nb_menu_items - 1) {
echo '&nbsp;|&nbsp;';
}
echo $item;
}
}
if (count($a_sessions) > 0) {
echo '&nbsp;&nbsp;<a href="javascript: void(0);" onclick="javascript: window.print()"><img align="absbottom" src="../img/printmgr.gif">&nbsp;'.get_lang('Print').'</a> ';
echo '<a href="'.api_get_self().'?export=csv"><img align="absbottom" src="../img/csv.gif">&nbsp;'.get_lang('ExportAsCSV').'</a>';
echo '<span style="float:right">';
echo Display::url(Display::return_icon('printer.png', get_lang('Print'), array(), 32), 'javascript: void(0);', array('onclick'=>'javascript: window.print();'));
echo Display::url(Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), array(), 32), api_get_self().'?export=csv');
echo '</span>';
}
echo '</div>';
echo '<h4>'.get_lang('YourSessionsList').'</h4>';
echo '<h2>'.get_lang('YourSessionsList').'</h2>';
} else {
/*if (api_is_platform_admin()) {
@ -119,13 +112,7 @@ if ($export_csv) {
}
if ($nb_sessions > 0) {
if (!api_is_drh()) {
echo '<div align="right">
<a href="javascript: void(0);" onclick="javascript: window.print();"><img align="absbottom" src="../img/printmgr.gif">&nbsp;'.get_lang('Print').'</a>
<a href="'.api_get_self().'?export=csv"><img align="absbottom" src="../img/excel.gif">&nbsp;'.get_lang('ExportAsCSV').'</a>
</div>';
}
$table = new SortableTable('tracking', 'count_sessions_coached');
$table->set_header(0, get_lang('Title'));
$table->set_header(1, get_lang('Date'));
@ -187,11 +174,4 @@ if ($nb_sessions > 0) {
} else {
echo get_lang('NoSession');
}
/*
==============================================================================
FOOTER
==============================================================================
*/
Display::display_footer();
Display::display_footer();

@ -6,7 +6,6 @@ $language_file = array ('registration', 'index', 'tracking', 'admin');
$cidReset = true;
require_once '../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'tracking.lib.php';
require_once api_get_path(LIBRARY_PATH).'export.lib.inc.php';
$export_csv = isset($_GET['export']) && $_GET['export'] == 'csv' ? true : false;
@ -54,10 +53,8 @@ $tbl_session_course_user = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE
$tbl_session_rel_user = Database :: get_main_table(TABLE_MAIN_SESSION_USER);
/*
===============================================================================
FUNCTION
===============================================================================
*/
FUNCTION
*/
function count_student_coached() {
global $students;
@ -83,14 +80,11 @@ function rsort_users($a, $b)
}
}
/*
===============================================================================
MAIN CODE
===============================================================================
*/
if ($isCoach || api_is_platform_admin() || api_is_drh()) {
/* MAIN CODE */
//if ($isCoach || api_is_platform_admin() || api_is_drh()) {
if (api_is_allowed_to_create_course() || api_is_drh()) {
if ($export_csv) {
$is_western_name_order = api_is_western_name_order(PERSON_NAME_DATA_EXPORT);
} else {
@ -98,7 +92,7 @@ if ($isCoach || api_is_platform_admin() || api_is_drh()) {
}
$sort_by_first_name = api_sort_by_first_name();
if (api_is_drh() || $_GET['display'] == 'yourstudents') {
if (api_is_drh()) {
$title = get_lang('YourStudents');
if (!isset($_GET['id_session'])) {
@ -121,7 +115,7 @@ if ($isCoach || api_is_platform_admin() || api_is_drh()) {
}
$students = array_unique($students);
} else {
$students = array_keys(UserManager::get_users_followed_by_drh($_user['user_id'], STUDENT));
$students = array_keys(UserManager::get_users_followed_by_drh(api_get_user_id() , STUDENT));
}
$courses_of_the_platform = CourseManager :: get_real_course_list();
@ -129,55 +123,59 @@ if ($isCoach || api_is_platform_admin() || api_is_drh()) {
$courses[$course['code']] = $course['code'];
}
}
$menu_items[] = '<a href="index.php?view=drh_students">'.get_lang('Students').'</a>';
$menu_items[] = '<a href="teachers.php">'.get_lang('Trainers').'</a>';
$menu_items[] = '<a href="course.php">'.get_lang('Courses').'</a>';
$menu_items[] = '<a href="session.php">'.get_lang('Sessions').'</a>';
$menu_items[] = Display::url(Display::return_icon('stats.png', get_lang('MyStats'),'',32),api_get_path(WEB_CODE_PATH)."auth/my_progress.php" );
$menu_items[] = Display::return_icon('user_na.png', get_lang('Students'), array(), 32);
$menu_items[] = Display::url(Display::return_icon('teacher.png', get_lang('Trainers'), array(), 32), 'teachers.php');
$menu_items[] = Display::url(Display::return_icon('course.png', get_lang('Courses'), array(), 32), 'course.php');
$menu_items[] = Display::url(Display::return_icon('session.png', get_lang('Sessions'), array(), 32), 'session.php');
echo '<div class="actions-title" style ="font-size:10pt;">';
$nb_menu_items = count($menu_items);
if ($nb_menu_items > 1) {
foreach ($menu_items as $key => $item) {
echo $item;
if ($key != $nb_menu_items - 1) {
echo '&nbsp;|&nbsp;';
}
echo $item;
}
}
if (count($students) > 0) {
echo '&nbsp;&nbsp;<a href="javascript: void(0);" onclick="javascript: window.print()"><img align="absbottom" src="../img/printmgr.gif">&nbsp;'.get_lang('Print').'</a> ';
echo '<a href="'.api_get_self().'?export=csv"><img align="absbottom" src="../img/csv.gif">&nbsp;'.get_lang('ExportAsCSV').'</a>';
echo '<span style="float:right">';
echo Display::url(Display::return_icon('printer.png', get_lang('Print'), array(), 32), 'javascript: void(0);', array('onclick'=>'javascript: window.print();'));
echo Display::url(Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), array(), 32), api_get_self().'?export=xls');
echo '</span>';
}
echo '</div>';
echo '<h4>'.$title.'</h4>';
} else {
echo '<div align="left" style="float:left"><h4>'.$title.'</h4></div>
<div align="right">
echo '<h2>'.$title.'</h2>';
} else {
echo '<div class="actions"><div style="float:right;">
<a href="javascript: void(0);" onclick="javascript: window.print();"><img align="absbottom" src="../img/printmgr.gif">&nbsp;'.get_lang('Print').'</a>
<a href="'.api_get_self().'?export=csv"><img align="absbottom" src="../img/excel.gif">&nbsp;'.get_lang('ExportAsCSV').'</a>
</div><div class="clear"></div>';
</div></div>';
echo '<h2>'.$title.'</h2>';
}
if (isset($_GET['id_coach'])) {
$coach_id = intval($_GET['id_coach']);
} else {
$coach_id = $_user['user_id'];
$coach_id = api_get_user_id();
}
if (!isset($_GET['id_session'])) {
if ($isCoach) {
$courses = Tracking :: get_courses_followed_by_coach($coach_id);
$students = Tracking :: get_student_followed_by_coach($coach_id);
if (!isset($_GET['id_session'])) {
//Getting courses
$courses = CourseManager::get_course_list_as_coach($coach_id, false);
if (isset($courses[0])) {
$courses = $courses[0];
}
//Getting students
$students = CourseManager::get_user_list_from_courses_as_coach($coach_id);
} else {
$students = Tracking :: get_student_followed_by_coach_in_a_session($_GET['id_session'], $coach_id);
$students = Tracking :: get_student_followed_by_coach_in_a_session($_GET['id_session'], $coach_id);
}
$tracking_column = isset($_GET['tracking_column']) ? $_GET['tracking_column'] : ($is_western_name_order xor $sort_by_first_name) ? 1 : 0;
$tracking_column = isset($_GET['tracking_column']) ? $_GET['tracking_column'] : ($is_western_name_order xor $sort_by_first_name) ? 1 : 0;
$tracking_direction = isset($_GET['tracking_direction']) ? $_GET['tracking_direction'] : DESC;
if (count($students) > 0) {
@ -189,25 +187,25 @@ if ($isCoach || api_is_platform_admin() || api_is_drh()) {
$table -> set_header(0, get_lang('LastName'), false, 'align="center');
$table -> set_header(1, get_lang('FirstName'), false, 'align="center');
}
$table -> set_header(2, get_lang('Time'), false);
/* $table -> set_header(2, get_lang('Time'), false);
$table -> set_header(3, get_lang('Progress'), false);
$table -> set_header(4, get_lang('Score'), false);
$table -> set_header(5, get_lang('Student_publication'), false);
$table -> set_header(6, get_lang('Messages'), false);
$table -> set_header(7, get_lang('FirstLogin'), false);
$table -> set_header(8, get_lang('LatestLogin'), false);
$table -> set_header(9, get_lang('Details'), false);
$table -> set_header(6, get_lang('Messages'), false);*/
$table -> set_header(2, get_lang('FirstLogin'), false);
$table -> set_header(3, get_lang('LatestLogin'), false);
$table -> set_header(4, get_lang('Details'), false);
if ($export_csv) {
if ($is_western_name_order) {
$csv_header[] = array (
get_lang('FirstName', ''),
get_lang('LastName', ''),
get_lang('Time', ''),
get_lang('Progress', ''),
get_lang('Score', ''),
get_lang('Student_publication', ''),
get_lang('Messages', ''),
//get_lang('Time', ''),
//get_lang('Progress', ''),
//get_lang('Score', ''),
//get_lang('Student_publication', ''),
//get_lang('Messages', ''),
get_lang('FirstLogin', ''),
get_lang('LatestLogin', '')
);
@ -215,31 +213,31 @@ if ($isCoach || api_is_platform_admin() || api_is_drh()) {
$csv_header[] = array (
get_lang('LastName', ''),
get_lang('FirstName', ''),
get_lang('Time', ''),
get_lang('Progress', ''),
get_lang('Score', ''),
get_lang('Student_publication', ''),
get_lang('Messages', ''),
//get_lang('Time', ''),
//get_lang('Progress', ''),
//get_lang('Score', ''),
//get_lang('Student_publication', ''),
//get_lang('Messages', ''),
get_lang('FirstLogin', ''),
get_lang('LatestLogin', '')
);
}
}
$all_datas = array();
$all_datas = array();
foreach ($students as $student_id) {
$student_data = UserManager :: get_user_info_by_id($student_id);
if(isset($_GET['id_session'])) {
$courses = Tracking :: get_course_list_in_session_from_student($student_id, $_GET['id_session']);
}
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;
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_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);
@ -267,12 +265,14 @@ if ($isCoach || api_is_platform_admin() || api_is_drh()) {
$row[] = $student_data['lastname'];
$row[] = $student_data['firstname'];
}
/*
$row[] = api_time_to_hms($avg_time_spent);
$row[] = is_null($avg_student_progress) ? null : round($avg_student_progress, 2).'%';
$row[] = is_null($avg_student_score) ? null : round($avg_student_score, 2).'%';
$row[] = $total_assignments;
$row[] = $total_messages;
*/
$string_date = Tracking :: get_last_connection_date($student_id, true);
$first_date = Tracking :: get_first_connection_date($student_id);
@ -308,12 +308,12 @@ if ($isCoach || api_is_platform_admin() || api_is_drh()) {
}
$table -> updateColAttributes(0, array('align' => 'left'));
$table -> updateColAttributes(1, array('align' => 'left'));
$table -> updateColAttributes(7, array('align' => 'left'));
/* $table -> updateColAttributes(7, array('align' => 'left'));
$table -> updateColAttributes(8, array('align' => 'left'));
$table -> setColAttributes(9, array('align' => 'center'));
$table -> setColAttributes(9, array('align' => 'center'));*/
$table -> display();
} else {
echo '<p>'.get_lang('NoStudent').'</p>';
echo Display::display_warning_message(get_lang('NoStudent'));
}
// send the csv file if asked
@ -324,10 +324,5 @@ if ($isCoach || api_is_platform_admin() || api_is_drh()) {
}
}
/*
==============================================================================
FOOTER
==============================================================================
*/
Display :: display_footer();
/* FOOTER */
Display :: display_footer();

@ -9,6 +9,8 @@ $cidReset = true;
require_once '../inc/global.inc.php';
require_once 'myspace.lib.php';
require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
require_once api_get_path(LIBRARY_PATH).'tracking.lib.php';
$this_section = SECTION_TRACKING;
@ -23,28 +25,28 @@ if (api_is_drh() || api_is_platform_admin()) {
// followed teachers by drh
$formateurs = UserManager::get_users_followed_by_drh($_user['user_id'], COURSEMANAGER);
$menu_items[] = '<a href="index.php?view=drh_students&amp;display=yourstudents">'.get_lang('Students').'</a>';
$menu_items[] = get_lang('Trainers');
$menu_items[] = '<a href="course.php">'.get_lang('Courses').'</a>';
$menu_items[] = '<a href="session.php">'.get_lang('Sessions').'</a>';
$menu_items[] = Display::url(Display::return_icon('stats.png', get_lang('MyStats'),'',32),api_get_path(WEB_CODE_PATH)."auth/my_progress.php" );
$menu_items[] = Display::url(Display::return_icon('user.png', get_lang('Students'), array(), 32), "index.php?view=drh_students&amp;display=yourstudents");
$menu_items[] = Display::return_icon('teacher_na.png', get_lang('Trainers'), array(), 32);
$menu_items[] = Display::url(Display::return_icon('course.png', get_lang('Courses'), array(), 32), 'course.php');
$menu_items[] = Display::url(Display::return_icon('session.png', get_lang('Sessions'), array(), 32), 'session.php');
echo '<div class="actions-title" style ="font-size:10pt;">';
echo '<div class="actions">';
$nb_menu_items = count($menu_items);
if ($nb_menu_items > 1) {
foreach ($menu_items as $key => $item) {
echo $item;
if ($key != $nb_menu_items - 1) {
echo '&nbsp;|&nbsp;';
}
echo $item;
}
}
if (count($formateurs) > 0) {
echo '&nbsp;&nbsp;<a href="javascript: void(0);" onclick="javascript: window.print()"><img align="absbottom" src="../img/printmgr.gif">&nbsp;'.get_lang('Print').'</a> ';
echo '<a href="'.api_get_self().'?export=xls"><img align="absbottom" src="../img/csv.gif">&nbsp;'.get_lang('ExportAsCSV').'</a>';
echo '<span style="float:right">';
echo Display::url(Display::return_icon('printer.png', get_lang('Print'), array(), 32), 'javascript: void(0);', array('onclick'=>'javascript: window.print();'));
echo Display::url(Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), array(), 32), api_get_self().'?export=xls');
echo '</span>';
}
echo '</div>';
echo '<h4>'.get_lang('YourTeachers').'</h4>';
echo '<h2>'.get_lang('YourTeachers').'</h2>';
echo '<br />';
}

@ -29,7 +29,7 @@ if ($from == 'myspace') {
}
// Access restrictions.
$is_allowedToTrack = $is_courseAdmin || api_is_platform_admin() || $is_courseCoach || api_is_session_admin() || api_is_drh() || api_is_course_tutor() || api_is_coach();
$is_allowedToTrack = api_is_platform_admin() || api_is_allowed_to_create_course() || api_is_session_admin() || api_is_drh() || api_is_course_tutor();
if (!$is_allowedToTrack) {
Display :: display_header(null);
@ -45,7 +45,6 @@ require_once api_get_path(SYS_CODE_PATH).'newscorm/learnpathItem.class.php';
require_once api_get_path(SYS_CODE_PATH).'newscorm/learnpathList.class.php';
require_once api_get_path(SYS_CODE_PATH).'newscorm/scorm.class.php';
require_once api_get_path(SYS_CODE_PATH).'newscorm/scormItem.class.php';
require_once api_get_path(LIBRARY_PATH).'tracking.lib.php';
require_once api_get_path(LIBRARY_PATH).'export.lib.inc.php';
require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
require_once api_get_path(LIBRARY_PATH).'statsUtils.lib.inc.php';
@ -104,12 +103,12 @@ $nameTools = get_lang('Tracking');
Display::display_header($nameTools, 'Tracking');
// getting all the students of the course
if (!empty($_SESSION['id_session'])) {
// Registered students in session.
$a_students = CourseManager :: get_student_list_from_course_code(api_get_course_id(), true, api_get_session_id());
if (empty($session_id)) {
// Registered students in a course outside session.
$a_students = CourseManager :: get_student_list_from_course_code(api_get_course_id());
} else {
// Registered students in a course outside session.
$a_students = CourseManager :: get_student_list_from_course_code(api_get_course_id());
// Registered students in session.
$a_students = CourseManager :: get_student_list_from_course_code(api_get_course_id(), true, api_get_session_id());
}
$nbStudents = count($a_students);
@ -467,11 +466,11 @@ if ($_GET['studentlist'] == 'false') {
$course_info = api_get_course_info(api_get_course_id());
$course_name = get_lang('Course').' '.$course_info['name'];
if (api_get_session_id()) {
echo '<h2>'.Display::return_icon('session.png', get_lang('Session'), array(), 22).' '.api_get_session_name(api_get_session_id()).' '.
if ($session_id) {
echo '<h2>'.Display::return_icon('session.png', get_lang('Session'), array(), 22).' '.api_get_session_name($session_id).' '.
Display::return_icon('course.png', get_lang('Course'), array(), 22).' '.$course_name.'</h2>';
} else {
echo '<h2>'.Display::return_icon('course.png', get_lang('Course'), array(), 22).' '.$course_info['name'].'</h2>';
echo '<h2>'.Display::return_icon('course.png', get_lang('Course'), array(), 22).' '.$course_info['name'].'</h2>';
}
$extra_field_select = TrackingCourseLog::display_additional_profile_fields();

@ -9,16 +9,12 @@
$language_file = array ('registration', 'index', 'tracking', 'exercice','survey');
$cidReset = true;
require_once '../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'course.lib.php';
require_once (api_get_path(LIBRARY_PATH).'tracking.lib.php');
require_once api_get_path(LIBRARY_PATH).'sessionmanager.lib.php';
require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
require_once api_get_path(LIBRARY_PATH).'pear/Spreadsheet_Excel_Writer/Writer.php';
require_once api_get_path(SYS_CODE_PATH).'exercice/exercise.class.php';
require_once api_get_path(SYS_CODE_PATH).'exercice/question.class.php';
require_once api_get_path(LIBRARY_PATH).'events.lib.inc.php';
require_once api_get_path(SYS_CODE_PATH).'newscorm/learnpathList.class.php';
require_once api_get_path(SYS_CODE_PATH).'newscorm/learnpath.class.php';
require_once api_get_path(SYS_CODE_PATH).'newscorm/learnpathList.class.php';
@ -85,19 +81,17 @@ if (!$export_to_xls) {
echo '<div class="actions" style ="font-size:10pt;" >';
if ($global) {
$menu_items[] = '<a href="'.api_get_path(WEB_CODE_PATH).'mySpace/?view=teacher">'.get_lang('TeacherInterface').'</a>';
$menu_items[] = get_lang('AdminInterface');
$menu_items[] = '<a href="'.api_get_path(WEB_CODE_PATH).'tracking/exams.php">'.get_lang('ExamTracking').'</a>';
$menu_items[] = Display::url(Display::return_icon('stats.png', get_lang('MyStats'),'',32),api_get_path(WEB_CODE_PATH)."auth/my_progress.php" );
$menu_items[] = Display::url(Display::return_icon('teacher.png', get_lang('TeacherInterface'), array(), 32), api_get_path(WEB_CODE_PATH).'mySpace/?view=teacher');
$menu_items[] = Display::return_icon('star_na.png', get_lang('AdminInterface'), array(), 32);
$menu_items[] = Display::url(Display::return_icon('quiz.png', get_lang('ExamTracking'), array(), 32), api_get_path(WEB_CODE_PATH).'tracking/exams.php');
$nb_menu_items = count($menu_items);
if($nb_menu_items>1) {
foreach($menu_items as $key=> $item) {
echo $item;
if($key!=$nb_menu_items-1) {
echo ' | ';
}
}
echo '<br />';
}
@ -110,7 +104,6 @@ if (!$export_to_xls) {
}
echo '</div>';
echo '<h4>'.get_lang('CoachList').'</h4>';
if (api_is_platform_admin()) {
echo '<a href="'.api_get_path(WEB_CODE_PATH).'mySpace/?view=admin&amp;display=coaches">'.get_lang('DisplayCoaches').'</a> | ';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'mySpace/?view=admin&amp;display=useroverview">'.get_lang('DisplayUserOverview').'</a>';

@ -87,28 +87,25 @@ if (!$export_to_xls) {
echo '</a>';
echo '<span style="float:right">';
echo '<a href="'.api_get_self().'?export=1&score='.$filter_score.'&exercise_id='.$exercise_id.'">
'.Display::return_icon('export_excel.png',get_lang('ExportAsXLS'),'','32').'</a>';
echo '<a href="'.api_get_self().'?export=1&score='.$filter_score.'&exercise_id='.$exercise_id.'">'.Display::return_icon('export_excel.png',get_lang('ExportAsXLS'),'','32').'</a>';
echo '<a href="javascript: void(0);" onclick="javascript: window.print()">'.Display::return_icon('printer.png',get_lang('Print'),'','32').'</a>';
echo '</span>';
echo '<a href="javascript: void(0);" onclick="javascript: window.print()">
'.Display::return_icon('printer.png',get_lang('Print'),'','32').'</a>';
$menu_items[] = '<a href="'.api_get_path(WEB_CODE_PATH).'mySpace/?view=teacher">'.get_lang('TeacherInterface').'</a>';
$menu_items[] = Display::url(Display::return_icon('teacher.png', get_lang('TeacherInterface'), array(), 32), api_get_path(WEB_CODE_PATH).'mySpace/?view=teacher');
if (api_is_platform_admin()) {
$menu_items[] = '<a href="'.api_get_path(WEB_CODE_PATH).'mySpace/?view=admin">'.get_lang('AdminInterface').'</a>';
$menu_items[] = Display::url(Display::return_icon('star.png', get_lang('AdminInterface'), array(), 32), api_get_path(WEB_CODE_PATH).'mySpace/?view=admin');
} else {
$menu_items[] = '<a href="'.api_get_path(WEB_CODE_PATH).'mySpace/?view=coach">'.get_lang('AdminInterface').'</a>';
$menu_items[] = Display::url(Display::return_icon('star.png', get_lang('CoachInterface'), array(), 32), api_get_path(WEB_CODE_PATH).'mySpace/?view=coach');
}
$menu_items[] = get_lang('ExamTracking');
$menu_items[] = Display::return_icon('quiz_na.png', get_lang('ExamTracking'), array(), 32);
$nb_menu_items = count($menu_items);
if($nb_menu_items>1) {
foreach($menu_items as $key=> $item) {
echo $item;
if($key!=$nb_menu_items-1) {
echo ' | ';
}
echo $item;
}
}
} else {

@ -9,8 +9,6 @@
$language_file = array ('registration', 'index', 'tracking', 'exercice','survey');
$cidReset = true;
require_once '../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'tracking.lib.php';
require_once api_get_path(LIBRARY_PATH).'sessionmanager.lib.php';
require_once api_get_path(SYS_CODE_PATH).'exercice/exercise.class.php';
require_once api_get_path(SYS_CODE_PATH).'exercice/question.class.php';
@ -152,21 +150,19 @@ if (!empty($course_info)) {
if (!$export_to_xls) {
Display :: display_header(get_lang("MySpace"));
echo '<div class="actions" style ="font-size:10pt;" >';
if ($global) {
$menu_items[] = '<a href="'.api_get_path(WEB_CODE_PATH).'mySpace/?view=teacher">'.get_lang('TeacherInterface').'</a>';
$menu_items[] = get_lang('AdminInterface');
$menu_items[] = '<a href="'.api_get_path(WEB_CODE_PATH).'tracking/exams.php">'.get_lang('ExamTracking').'</a>';
echo '<div class="actions" style ="font-size:10pt;" >';
if ($global) {
$menu_items[] = Display::url(Display::return_icon('stats.png', get_lang('MyStats'),'',32),api_get_path(WEB_CODE_PATH)."auth/my_progress.php" );
$menu_items[] = Display::url(Display::return_icon('teacher.png', get_lang('TeacherInterface'), array(), 32), api_get_path(WEB_CODE_PATH).'mySpace/?view=teacher');
$menu_items[] = Display::return_icon('star_na.png', get_lang('AdminInterface'), array(), 32);
$menu_items[] = Display::url(Display::return_icon('quiz.png', get_lang('ExamTracking'), array(), 32), api_get_path(WEB_CODE_PATH).'tracking/exams.php');
$nb_menu_items = count($menu_items);
if($nb_menu_items>1) {
foreach($menu_items as $key=> $item) {
echo $item;
if($key!=$nb_menu_items-1) {
echo ' | ';
}
}
echo '<br />';
echo $item;
}
}
} else {
echo '<div style="float:left; clear:left">
@ -176,7 +172,6 @@ if (!$export_to_xls) {
echo '</div>';
}
echo '</div>';
echo '<h4>'.get_lang('CoachList').'</h4>';
if (api_is_platform_admin()) {
echo '<a href="'.api_get_path(WEB_CODE_PATH).'mySpace/?view=admin&amp;display=coaches">'.get_lang('DisplayCoaches').'</a> | ';

Loading…
Cancel
Save