myStudents.php 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Implements the tracking of students in the Reporting pages
  5. * @package chamilo.reporting
  6. */
  7. require_once '../inc/global.inc.php';
  8. api_block_anonymous_users();
  9. if (!api_is_allowed_to_create_course() && !api_is_session_admin() && !api_is_drh() && !api_is_student_boss()) {
  10. // Check if the user is tutor of the course
  11. $user_course_status = CourseManager::get_tutor_in_course_status(
  12. api_get_user_id(),
  13. api_get_course_id()
  14. );
  15. if ($user_course_status != 1) {
  16. api_not_allowed(true);
  17. }
  18. }
  19. $htmlHeadXtra[] = '<script>
  20. function show_image(image,width,height) {
  21. width = parseInt(width) + 20;
  22. height = parseInt(height) + 20;
  23. window_x = window.open(image,\'windowX\',\'width=\'+ width + \', height=\'+ height + \'\');
  24. }
  25. </script>';
  26. $export_csv = isset ($_GET['export']) && $_GET['export'] == 'csv' ? true : false;
  27. if ($export_csv) {
  28. ob_start();
  29. }
  30. $csv_content = array();
  31. $from_myspace = false;
  32. if (isset ($_GET['from']) && $_GET['from'] == 'myspace') {
  33. $from_myspace = true;
  34. $this_section = SECTION_TRACKING;
  35. } else {
  36. $this_section = SECTION_COURSES;
  37. }
  38. $nameTools = get_lang('StudentDetails');
  39. $get_course_code = Security :: remove_XSS($_GET['course']);
  40. if (isset($_GET['details'])) {
  41. if (!empty ($_GET['origin']) && $_GET['origin'] == 'user_course') {
  42. $course_info = CourseManager :: get_course_information($get_course_code);
  43. if (empty ($cidReq)) {
  44. $interbreadcrumb[] = array (
  45. "url" => api_get_path(WEB_COURSE_PATH) . $course_info['directory'],
  46. 'name' => $course_info['title']
  47. );
  48. }
  49. $interbreadcrumb[] = array (
  50. "url" => "../user/user.php?cidReq=" . $get_course_code,
  51. "name" => get_lang("Users")
  52. );
  53. } else
  54. if (!empty($_GET['origin']) && $_GET['origin'] == 'tracking_course') {
  55. $course_info = CourseManager :: get_course_information($get_course_code);
  56. $interbreadcrumb[] = array (
  57. "url" => "../tracking/courseLog.php?cidReq=".$get_course_code.'&id_session=' . api_get_session_id(),
  58. "name" => get_lang("Tracking")
  59. );
  60. } else
  61. if (!empty ($_GET['origin']) && $_GET['origin'] == 'resume_session') {
  62. $interbreadcrumb[] = array (
  63. 'url' => '../admin/index.php',
  64. "name" => get_lang('PlatformAdmin')
  65. );
  66. $interbreadcrumb[] = array (
  67. 'url' => "../admin/session_list.php",
  68. "name" => get_lang('SessionList')
  69. );
  70. $interbreadcrumb[] = array (
  71. 'url' => "../admin/resume_session.php?id_session=" . Security :: remove_XSS($_GET['id_session']),
  72. "name" => get_lang('SessionOverview')
  73. );
  74. } else {
  75. $interbreadcrumb[] = array (
  76. "url" => "index.php",
  77. "name" => get_lang('MySpace')
  78. );
  79. if (isset ($_GET['id_coach']) && intval($_GET['id_coach']) != 0) {
  80. $interbreadcrumb[] = array (
  81. "url" => "student.php?id_coach=" . Security :: remove_XSS($_GET['id_coach']),
  82. "name" => get_lang("CoachStudents")
  83. );
  84. $interbreadcrumb[] = array (
  85. "url" => "myStudents.php?student=" . Security :: remove_XSS($_GET['student']) . '&id_coach=' . Security :: remove_XSS($_GET['id_coach']),
  86. "name" => get_lang("StudentDetails")
  87. );
  88. } else {
  89. $interbreadcrumb[] = array (
  90. "url" => "student.php",
  91. "name" => get_lang("MyStudents")
  92. );
  93. $interbreadcrumb[] = array (
  94. "url" => "myStudents.php?student=" . Security :: remove_XSS($_GET['student']),
  95. "name" => get_lang("StudentDetails")
  96. );
  97. }
  98. }
  99. $nameTools = get_lang("DetailsStudentInCourse");
  100. } else {
  101. if (!empty ($_GET['origin']) && $_GET['origin'] == 'resume_session') {
  102. $interbreadcrumb[] = array (
  103. 'url' => '../admin/index.php',
  104. "name" => get_lang('PlatformAdmin')
  105. );
  106. $interbreadcrumb[] = array (
  107. 'url' => "../admin/session_list.php",
  108. "name" => get_lang('SessionList')
  109. );
  110. $interbreadcrumb[] = array (
  111. 'url' => "../admin/resume_session.php?id_session=" . Security :: remove_XSS($_GET['id_session']),
  112. "name" => get_lang('SessionOverview')
  113. );
  114. } else {
  115. $interbreadcrumb[] = array (
  116. "url" => "index.php",
  117. "name" => get_lang('MySpace')
  118. );
  119. if (isset ($_GET['id_coach']) && intval($_GET['id_coach']) != 0) {
  120. if (isset ($_GET['id_session']) && intval($_GET['id_session']) != 0) {
  121. $interbreadcrumb[] = array (
  122. "url" => "student.php?id_coach=" . Security :: remove_XSS($_GET['id_coach']) . "&id_session=" . $_GET['id_session'],
  123. "name" => get_lang("CoachStudents")
  124. );
  125. } else {
  126. $interbreadcrumb[] = array (
  127. "url" => "student.php?id_coach=" . Security :: remove_XSS($_GET['id_coach']),
  128. "name" => get_lang("CoachStudents")
  129. );
  130. }
  131. } else {
  132. $interbreadcrumb[] = array (
  133. "url" => "student.php",
  134. "name" => get_lang("MyStudents")
  135. );
  136. }
  137. }
  138. }
  139. // Database Table Definitions
  140. $tbl_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
  141. $tbl_stats_exercices = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
  142. if (isset($_GET['user_id']) && $_GET['user_id'] != "") {
  143. $user_id = intval($_GET['user_id']);
  144. } else {
  145. $user_id = api_get_user_id();
  146. }
  147. $session_id = intval($_GET['id_session']);
  148. if (empty($session_id)) {
  149. $session_id = api_get_session_id();
  150. }
  151. $student_id = intval($_GET['student']);
  152. // Action behaviour
  153. $check = Security::check_token('get');
  154. if ($check) {
  155. switch ($_GET['action']) {
  156. case 'reset_lp' :
  157. $course = isset($_GET['course']) ? $_GET['course'] : "";
  158. $lp_id = isset($_GET['lp_id']) ? intval($_GET['lp_id']) : "";
  159. if (api_is_allowed_to_edit() &&
  160. !empty($course) &&
  161. !empty($lp_id) &&
  162. !empty($student_id)
  163. ) {
  164. $course_info = api_get_course_info($course);
  165. Event::delete_student_lp_events(
  166. $student_id,
  167. $lp_id,
  168. $course_info,
  169. $session_id
  170. );
  171. //@todo delete the stats.track_e_exercises records. First implement this http://support.chamilo.org/issues/1334
  172. $message = Display::return_message(
  173. get_lang('LPWasReset'),
  174. 'success'
  175. );
  176. }
  177. break;
  178. default:
  179. break;
  180. }
  181. Security::clear_token();
  182. }
  183. // user info
  184. $user_info = api_get_user_info($student_id);
  185. $courses_in_session = array();
  186. //See #4676
  187. $drh_can_access_all_courses = false;
  188. if (api_is_drh() || api_is_platform_admin() || api_is_student_boss()) {
  189. $drh_can_access_all_courses = true;
  190. }
  191. $courses = CourseManager::get_course_list_of_user_as_course_admin(api_get_user_id());
  192. $courses_in_session_by_coach = array();
  193. $sessions_coached_by_user = Tracking::get_sessions_coached_by_user(api_get_user_id());
  194. // RRHH or session admin
  195. if (api_is_session_admin() || api_is_drh()) {
  196. $courses = CourseManager::get_courses_followed_by_drh(api_get_user_id());
  197. $session_by_session_admin = SessionManager::get_sessions_followed_by_drh(api_get_user_id());
  198. if (!empty($session_by_session_admin)) {
  199. foreach ($session_by_session_admin as $session_coached_by_user) {
  200. $courses_followed_by_coach = Tracking :: get_courses_list_from_session($session_coached_by_user['id']);
  201. $courses_in_session_by_coach[$session_coached_by_user['id']] = $courses_followed_by_coach;
  202. }
  203. }
  204. }
  205. // Teacher or admin
  206. if (!empty($sessions_coached_by_user)) {
  207. foreach ($sessions_coached_by_user as $session_coached_by_user) {
  208. $sid = intval($session_coached_by_user['id']);
  209. $courses_followed_by_coach = Tracking :: get_courses_followed_by_coach(api_get_user_id(), $sid);
  210. $courses_in_session_by_coach[$sid] = $courses_followed_by_coach;
  211. }
  212. }
  213. $sql = "SELECT course_code
  214. FROM $tbl_course_user
  215. WHERE
  216. relation_type <> ".COURSE_RELATION_TYPE_RRHH." AND
  217. user_id = ".intval($user_info['user_id']);
  218. $rs = Database::query($sql);
  219. while ($row = Database :: fetch_array($rs)) {
  220. if ($drh_can_access_all_courses) {
  221. $courses_in_session[0][] = $row['course_code'];
  222. } else {
  223. if (isset($courses[$row['course_code']])) {
  224. $courses_in_session[0][] = $row['course_code'];
  225. }
  226. }
  227. }
  228. // Get the list of sessions where the user is subscribed as student
  229. $sql = 'SELECT id_session, course_code
  230. FROM '.Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER).'
  231. WHERE id_user=' . intval($user_info['user_id']);
  232. $rs = Database::query($sql);
  233. $tmp_sessions = array();
  234. while ($row = Database :: fetch_array($rs)) {
  235. $tmp_sessions[] = $row['id_session'];
  236. if ($drh_can_access_all_courses) {
  237. if (in_array($row['id_session'], $tmp_sessions)) {
  238. $courses_in_session[$row['id_session']][] = $row['course_code'];
  239. }
  240. } else {
  241. if (isset($courses_in_session_by_coach[$row['id_session']])) {
  242. if (in_array($row['id_session'], $tmp_sessions)) {
  243. $courses_in_session[$row['id_session']][] = $row['course_code'];
  244. }
  245. }
  246. }
  247. }
  248. $isDrhOfCourse = CourseManager::isUserSubscribedInCourseAsDrh(
  249. api_get_user_id(),
  250. api_get_course_info()
  251. );
  252. if (api_is_drh() && !api_is_platform_admin()) {
  253. if (!empty($student_id)) {
  254. if (api_drh_can_access_all_session_content()) {
  255. //@todo securize drh with student id
  256. /*$users = SessionManager::getAllUsersFromCoursesFromAllSessionFromStatus('drh_all', api_get_user_id());
  257. $userList = array();
  258. foreach ($users as $user) {
  259. $userList[] = $user['user_id'];
  260. }
  261. if (!in_array($student_id, $userList)) {
  262. api_not_allowed(true);
  263. }*/
  264. } else {
  265. if (!($isDrhOfCourse)) {
  266. if (api_is_drh() &&
  267. !UserManager::is_user_followed_by_drh($student_id, api_get_user_id())
  268. ) {
  269. api_not_allowed(true);
  270. }
  271. }
  272. }
  273. }
  274. }
  275. Display :: display_header($nameTools);
  276. if (isset($message)) {
  277. echo $message;
  278. }
  279. $token = Security::get_token();
  280. if (!empty($student_id)) {
  281. // Actions bar
  282. echo '<div class="actions">';
  283. echo '<a href="javascript: window.back();" ">'.Display::return_icon('back.png', get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>';
  284. echo '<a href="javascript: void(0);" onclick="javascript: window.print();">'.Display::return_icon('printer.png', get_lang('Print'),'',ICON_SIZE_MEDIUM).'</a>';
  285. echo '<a href="' . api_get_self() . '?' . Security :: remove_XSS($_SERVER['QUERY_STRING']) . '&export=csv">'.Display::return_icon('export_csv.png', get_lang('ExportAsCSV'),'',ICON_SIZE_MEDIUM).'</a> ';
  286. if (!empty ($user_info['email'])) {
  287. $send_mail = '<a href="mailto:'.$user_info['email'].'">'.Display :: return_icon('mail_send.png', get_lang('SendMail'),'',ICON_SIZE_MEDIUM).'</a>';
  288. } else {
  289. $send_mail = Display :: return_icon('mail_send_na.png', get_lang('SendMail'),'',ICON_SIZE_MEDIUM);
  290. }
  291. echo $send_mail;
  292. if (!empty($student_id) && !empty($_GET['course'])) {
  293. // Only show link to connection details if course and student were defined in the URL
  294. echo '<a href="access_details.php?student=' . $student_id . '&course=' . Security :: remove_XSS($_GET['course']) . '&amp;origin=' . Security :: remove_XSS($_GET['origin']) . '&amp;cidReq='.Security::remove_XSS($_GET['course']).'&amp;id_session='.$session_id.'">'.
  295. Display :: return_icon('statistics.png', get_lang('AccessDetails'),'',ICON_SIZE_MEDIUM).'</a>';
  296. }
  297. if (api_can_login_as($student_id)) {
  298. echo '<a href="'.api_get_path(WEB_CODE_PATH).'admin/user_list.php?action=login_as&amp;user_id='.$student_id.'&amp;sec_token='.$token.'">'.
  299. Display::return_icon('login_as.png', get_lang('LoginAs'), null, ICON_SIZE_MEDIUM).'</a>&nbsp;&nbsp;';
  300. }
  301. echo '</div>';
  302. // is the user online ?
  303. if (user_is_online($_GET['student'])) {
  304. $online = get_lang('Yes');
  305. } else {
  306. $online = get_lang('No');
  307. }
  308. // get average of score and average of progress by student
  309. $avg_student_progress = $avg_student_score = 0;
  310. $course_code = Security :: remove_XSS($_GET['course']);
  311. if (!CourseManager :: is_user_subscribed_in_course($user_info['user_id'], $course_code, true)) {
  312. unset($courses[$key]);
  313. } else {
  314. $avg_student_progress = Tracking::get_avg_student_progress(
  315. $user_info['user_id'],
  316. $course_code,
  317. array(),
  318. $session_id
  319. );
  320. //the score inside the Reporting table
  321. $avg_student_score = Tracking::get_avg_student_score(
  322. $user_info['user_id'],
  323. $course_code,
  324. array(),
  325. $session_id
  326. );
  327. }
  328. $avg_student_progress = round($avg_student_progress, 2);
  329. // time spent on the course
  330. $courseInfo = api_get_course_info($course_code);
  331. $time_spent_on_the_course = api_time_to_hms(
  332. Tracking:: get_time_spent_on_the_course(
  333. $user_info['user_id'],
  334. $courseInfo['real_id'],
  335. $session_id
  336. )
  337. );
  338. // get information about connections on the platform by student
  339. $first_connection_date = Tracking :: get_first_connection_date($user_info['user_id']);
  340. if ($first_connection_date == '') {
  341. $first_connection_date = get_lang('NoConnexion');
  342. }
  343. $last_connection_date = Tracking :: get_last_connection_date($user_info['user_id'], true);
  344. if ($last_connection_date == '') {
  345. $last_connection_date = get_lang('NoConnexion');
  346. }
  347. // cvs information
  348. $csv_content[] = array(
  349. get_lang('Informations', '')
  350. );
  351. $csv_content[] = array (
  352. get_lang('Name', ''),
  353. get_lang('Email', ''),
  354. get_lang('Tel', '')
  355. );
  356. $csv_content[] = array(
  357. $user_info['complete_name'],
  358. $user_info['email'],
  359. $user_info['phone']
  360. );
  361. $csv_content[] = array();
  362. // csv tracking
  363. $csv_content[] = array(
  364. get_lang('Tracking', '')
  365. );
  366. $csv_content[] = array(
  367. get_lang('FirstLogin', ''),
  368. get_lang('LatestLogin', ''),
  369. get_lang('TimeSpentInTheCourse', ''),
  370. get_lang('Progress', ''),
  371. get_lang('Score', '')
  372. );
  373. $csv_content[] = array(
  374. strip_tags($first_connection_date),
  375. strip_tags($last_connection_date),
  376. $time_spent_on_the_course,
  377. $avg_student_progress . '%',
  378. $avg_student_score
  379. );
  380. //Show title
  381. $info_course = CourseManager :: get_course_information($course_code);
  382. $coachs_name = '';
  383. $session_name = '';
  384. $nb_login = Tracking :: count_login_per_student($user_info['user_id'], $info_course['real_id']);
  385. //get coach and session_name if there is one and if session_mode is activated
  386. if ($session_id > 0) {
  387. $session_info = api_get_session_info($session_id);
  388. $course_coachs = api_get_coachs_from_course($session_id, $course_code);
  389. $nb_login = '';
  390. if (!empty($course_coachs)) {
  391. $info_tutor_name = array();
  392. foreach ($course_coachs as $course_coach) {
  393. $info_tutor_name[] = api_get_person_name($course_coach['firstname'], $course_coach['lastname']);
  394. }
  395. $info_course['tutor_name'] = implode(",",$info_tutor_name);
  396. } elseif ($session_coach_id != 0) {
  397. $session_coach_id = intval($session_info['id_coach']);
  398. $coach_info = UserManager::get_user_info_by_id($session_coach_id);
  399. $info_course['tutor_name'] = api_get_person_name($coach_info['firstname'], $coach_info['lastname']);
  400. }
  401. $coachs_name = $info_course['tutor_name'];
  402. $session_name = $session_info['name'];
  403. } // end
  404. $info_course = CourseManager :: get_course_information($get_course_code);
  405. $table_title = Display::return_icon('user.png', get_lang('User'), array(), ICON_SIZE_SMALL).$user_info['complete_name'];
  406. echo Display::page_subheader($table_title);
  407. echo '<table width="100%" border="0">';
  408. echo '<tr>';
  409. $image_array = UserManager :: get_user_picture_path_by_id($user_info['user_id'], 'web', false, true);
  410. echo '<td class="borderRight" width="10%" valign="top">';
  411. // get the path,width and height from original picture
  412. $image_file = $image_array['dir'] . $image_array['file'];
  413. $big_image = $image_array['dir'] . 'big_' . $image_array['file'];
  414. $big_image_size = api_getimagesize($big_image);
  415. $big_image_width = $big_image_size['width'];
  416. $big_image_height = $big_image_size['height'];
  417. $url_big_image = $big_image . '?rnd=' . time();
  418. $img_attributes = 'src="' . $image_file . '?rand=' . time() . '" ' .
  419. 'alt="' . $user_info['complete_name']. '" ' .
  420. 'style="float:' . ($text_dir == 'rtl' ? 'right' : 'left') . '; padding:5px;" ';
  421. if ($image_array['file'] == 'unknown.jpg') {
  422. echo '<img ' . $img_attributes . ' />';
  423. } else {
  424. echo '<input type="image" ' . $img_attributes . ' onclick="javascript: return show_image(\'' . $url_big_image . '\',\'' . $big_image_width . '\',\'' . $big_image_height . '\');"/>';
  425. }
  426. echo '</td>';
  427. ?>
  428. <td width="40%" valign="top">
  429. <table width="100%" class="data_table">
  430. <tr>
  431. <th><?php echo get_lang('Information'); ?></th>
  432. </tr>
  433. <tr>
  434. <td><?php echo get_lang('Name') . ' : '.$user_info['complete_name']; ?></td>
  435. </tr>
  436. <tr>
  437. <td><?php echo get_lang('Email') . ' : ';
  438. if (!empty ($user_info['email'])) {
  439. echo '<a href="mailto:' . $user_info['email'] . '">' . $user_info['email'] . '</a>';
  440. } else {
  441. echo get_lang('NoEmail');
  442. } ?>
  443. </td>
  444. </tr>
  445. <tr>
  446. <td> <?php echo get_lang('Tel') . ' : ';
  447. if (!empty ($user_info['phone'])) {
  448. echo $user_info['phone'];
  449. } else {
  450. echo get_lang('NoTel');
  451. }
  452. ?>
  453. </td>
  454. </tr>
  455. <tr>
  456. <td> <?php echo get_lang('OfficialCode') . ' : ';
  457. if (!empty ($user_info['official_code'])) {
  458. echo $user_info['official_code'];
  459. } else {
  460. echo get_lang('NoOfficialCode');
  461. }
  462. ?>
  463. </td>
  464. </tr>
  465. <tr>
  466. <td><?php echo get_lang('OnLine') . ' : '.$online; ?> </td>
  467. </tr>
  468. <?php
  469. // Display timezone if the user selected one and if the admin allows the use of user's timezone
  470. $timezone = null;
  471. $timezone_user = UserManager::get_extra_user_data_by_field($user_info['user_id'],'timezone');
  472. $use_users_timezone = api_get_setting('use_users_timezone', 'timezones');
  473. if ($timezone_user['timezone'] != null && $use_users_timezone == 'true') {
  474. $timezone = $timezone_user['timezone'];
  475. }
  476. if ($timezone !== null) {
  477. ?>
  478. <tr>
  479. <td> <?php echo get_lang('Timezone') . ' : '.$timezone; ?> </td>
  480. </tr>
  481. <?php
  482. }
  483. ?>
  484. </table>
  485. </td>
  486. <td class="borderLeft" width="35%" valign="top">
  487. <table width="100%" class="data_table">
  488. <tr>
  489. <th colspan="2"><?php echo get_lang('Tracking'); ?></th>
  490. </tr>
  491. <tr><td align="right"><?php echo get_lang('FirstLogin') ?></td>
  492. <td align="left"><?php echo $first_connection_date ?></td>
  493. </tr>
  494. <tr>
  495. <td align="right"><?php echo get_lang('LatestLogin') ?></td>
  496. <td align="left"><?php echo $last_connection_date ?></td>
  497. </tr>
  498. <?php if (isset($_GET['details']) && $_GET['details'] == 'true') {?>
  499. <tr>
  500. <td align="right"><?php echo get_lang('TimeSpentInTheCourse') ?></td>
  501. <td align="left"><?php echo $time_spent_on_the_course ?></td>
  502. </tr>
  503. <tr>
  504. <td align="right">
  505. <?php
  506. echo get_lang('Progress').' ';
  507. Display :: display_icon('info3.gif', get_lang('ScormAndLPProgressTotalAverage'), array ('align' => 'absmiddle', 'hspace' => '3px'));?>
  508. </td>
  509. <td align="left"><?php echo $avg_student_progress.'%' ?></td>
  510. </tr>
  511. <tr>
  512. <td align="right">
  513. <?php
  514. echo get_lang('Score').' ';
  515. Display :: display_icon('info3.gif', get_lang('ScormAndLPTestTotalAverage'), array ('align' => 'absmiddle', 'hspace' => '3px')); ?>
  516. </td>
  517. <td align="left"><?php if (is_numeric($avg_student_score)) { echo $avg_student_score.'%';} else { echo $avg_student_score ;} ?></td>
  518. </tr>
  519. <?php
  520. if (!empty($nb_login)) {
  521. echo '<tr><td align="right">'.get_lang('CountToolAccess').'</td>';
  522. echo '<td align="left">'.$nb_login.'</td>';
  523. echo '</tr>';
  524. }
  525. } ?>
  526. </table>
  527. </td>
  528. </tr>
  529. </table>
  530. <?php
  531. $table_title = '';
  532. if (!empty($session_id)) {
  533. $session_name = api_get_session_name($session_id);
  534. $table_title = ($session_name? Display::return_icon('session.png', get_lang('Session'), array(), ICON_SIZE_SMALL).' '.$session_name.' ':'');
  535. }
  536. if (!empty($info_course['title'])) {
  537. $table_title .= ($info_course ? Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$info_course['title'].' ':'');
  538. }
  539. echo Display::page_subheader($table_title);
  540. if (empty($_GET['details'])) {
  541. $csv_content[] = array();
  542. $csv_content[] = array(
  543. get_lang('Session', ''),
  544. get_lang('Course', ''),
  545. get_lang('Time', ''),
  546. get_lang('Progress', ''),
  547. get_lang('Score', ''),
  548. get_lang('AttendancesFaults', ''),
  549. get_lang('Evaluations')
  550. );
  551. $attendance = new Attendance();
  552. foreach ($courses_in_session as $key => $courses) {
  553. $session_id = $key;
  554. $session_info = api_get_session_info($session_id);
  555. $session_name = $session_info['name'];
  556. $date_start = '';
  557. if (!empty($session_info['date_start']) && $session_info['date_start'] != '0000-00-00') {
  558. $date_start = api_format_date($session_info['date_start'], DATE_FORMAT_SHORT);
  559. }
  560. $date_end = '';
  561. if (!empty($session_info['date_end']) && $session_info['date_end'] != '0000-00-00') {
  562. $date_end = api_format_date($session_info['date_end'], DATE_FORMAT_SHORT);
  563. }
  564. if (!empty($date_start) && !empty($date_end)) {
  565. $date_session = get_lang('From') . ' ' . $date_start . ' ' . get_lang('Until') . ' ' . $date_end;
  566. }
  567. $title = '';
  568. if (empty($session_id)) {
  569. $title = Display::return_icon('course.png', get_lang('Courses'), array(), ICON_SIZE_SMALL).' '.get_lang('Courses');
  570. } else {
  571. $title = Display::return_icon('session.png', get_lang('Session'), array(), ICON_SIZE_SMALL).' '.$session_name.($date_session?' ('.$date_session.')':'');
  572. }
  573. // Courses
  574. echo '<h3>'.$title.'</h3>';
  575. echo '<table class="data_table">';
  576. echo '<tr>
  577. <th>'.get_lang('Course').'</th>
  578. <th>'.get_lang('Time').'</th>
  579. <th>'.get_lang('Progress').'</th>
  580. <th>'.get_lang('Score').'</th>
  581. <th>'.get_lang('AttendancesFaults').'</th>
  582. <th>'.get_lang('Evaluations').'</th>
  583. <th>'.get_lang('Details').'</th>
  584. </tr>';
  585. if (!empty($courses)) {
  586. foreach ($courses as $course_code) {
  587. $courseInfo = api_get_course_info($course_code);
  588. $courseId = $courseInfo['real_id'];
  589. if (CourseManager :: is_user_subscribed_in_course($student_id, $course_code, true)) {
  590. $course_info = CourseManager :: get_course_information($course_code);
  591. $time_spent_on_course = api_time_to_hms(Tracking :: get_time_spent_on_the_course($user_info['user_id'], $courseId, $session_id));
  592. // get average of faults in attendances by student
  593. $results_faults_avg = $attendance->get_faults_average_by_course($student_id, $course_code, $session_id);
  594. if (!empty($results_faults_avg['total'])) {
  595. if (api_is_drh()) {
  596. $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>';
  597. } else {
  598. $attendances_faults_avg = $results_faults_avg['faults'].'/'.$results_faults_avg['total'].' ('.$results_faults_avg['porcent'].'%)';
  599. }
  600. } else {
  601. $attendances_faults_avg = '0/0 (0%)';
  602. }
  603. // Get evaluations by student
  604. $cats = Category::load(null, null, $course_code, null, null, $session_id);
  605. $scoretotal = array();
  606. if (isset($cats) && isset($cats[0])) {
  607. if (!empty($session_id)) {
  608. $scoretotal= $cats[0]->calc_score($student_id, null, $course_code, $session_id);
  609. } else {
  610. $scoretotal= $cats[0]->calc_score($student_id, null, $course_code);
  611. }
  612. }
  613. $scoretotal_display = '0/0 (0%)';
  614. if (!empty($scoretotal)) {
  615. $scoretotal_display = round($scoretotal[0],1).'/'.round($scoretotal[1],1).' ('.round(($scoretotal[0] / $scoretotal[1]) * 100,2) . ' %)';
  616. }
  617. $progress = Tracking::get_avg_student_progress($user_info['user_id'], $course_code, null, $session_id);
  618. $score = Tracking :: get_avg_student_score($user_info['user_id'], $course_code, null, $session_id);
  619. $progress = empty($progress) ? '0%' : $progress.'%';
  620. $score = empty($score) ? '0%' : $score.'%';
  621. $csv_content[] = array(
  622. $session_name,
  623. $course_info['title'],
  624. $time_spent_on_course,
  625. $progress,
  626. $score,
  627. $attendances_faults_avg,
  628. $scoretotal_display
  629. );
  630. echo '<tr>
  631. <td >'.$course_info['title'].'</td>
  632. <td >'.$time_spent_on_course .'</td>
  633. <td >'.$progress.'</td>
  634. <td >'.$score.'</td>
  635. <td >'.$attendances_faults_avg.'</td>
  636. <td >'.$scoretotal_display.'</td>';
  637. if (isset ($_GET['id_coach']) && intval($_GET['id_coach']) != 0) {
  638. echo '<td width="10"><a href="'.api_get_self().'?student='.$user_info['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>';
  639. } else {
  640. echo '<td width="10"><a href="'.api_get_self().'?student='.$user_info['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>';
  641. }
  642. echo '</tr>';
  643. }
  644. }
  645. } else {
  646. echo "<tr><td colspan='5'>".get_lang('NoCourse')."</td></tr>";
  647. }
  648. echo '</table>';
  649. }
  650. } else {
  651. if ($user_info['status'] != INVITEE) {
  652. $csv_content[] = array();
  653. $csv_content[] = array(str_replace('&nbsp;', '', $table_title));
  654. $t_lp = Database :: get_course_table(TABLE_LP_MAIN);
  655. // csv export headers
  656. $csv_content[] = array();
  657. $csv_content[] = array(
  658. get_lang('Learnpath'),
  659. get_lang('Time'),
  660. get_lang('AverageScore'),
  661. get_lang('LatestAttemptAverageScore'),
  662. get_lang('Progress'),
  663. get_lang('LastConnexion')
  664. );
  665. if (empty($session_id)) {
  666. $sql_lp = " SELECT lp.name, lp.id FROM $t_lp lp
  667. WHERE session_id = 0 AND c_id = {$info_course['real_id']}
  668. ORDER BY lp.display_order";
  669. } else {
  670. $sql_lp = " SELECT lp.name, lp.id FROM $t_lp lp
  671. WHERE c_id = {$info_course['real_id']}
  672. ORDER BY lp.display_order";
  673. }
  674. $rs_lp = Database::query($sql_lp);
  675. if (Database :: num_rows($rs_lp) > 0) {
  676. ?>
  677. <!-- LPs-->
  678. <table class="data_table">
  679. <tr>
  680. <th><?php echo get_lang('Learnpaths');?></th>
  681. <th><?php echo get_lang('Time').' '; Display :: display_icon('info3.gif', get_lang('TotalTimeByCourse'), array ('align' => 'absmiddle', 'hspace' => '3px')); ?></th>
  682. <th><?php echo get_lang('AverageScore').' '; Display :: display_icon('info3.gif', get_lang('AverageIsCalculatedBasedInAllAttempts'), array ( 'align' => 'absmiddle', 'hspace' => '3px')); ?></th>
  683. <th><?php echo get_lang('LatestAttemptAverageScore').' '; Display :: display_icon('info3.gif', get_lang('AverageIsCalculatedBasedInTheLatestAttempts'), array ( 'align' => 'absmiddle', 'hspace' => '3px')); ?></th>
  684. <th><?php echo get_lang('Progress').' '; Display :: display_icon('info3.gif', get_lang('LPProgressScore'), array ('align' => 'absmiddle','hspace' => '3px')); ?></th>
  685. <th><?php echo get_lang('LastConnexion').' '; Display :: display_icon('info3.gif', get_lang('LastTimeTheCourseWasUsed'), array ('align' => 'absmiddle','hspace' => '3px')); ?></th>
  686. <?php
  687. echo '<th>'.get_lang('Details').'</th>';
  688. if (api_is_allowed_to_edit()) {
  689. echo '<th>'.get_lang('ResetLP').'</th>';
  690. }
  691. ?>
  692. </tr>
  693. <?php
  694. $i = 0;
  695. while ($learnpath = Database :: fetch_array($rs_lp)) {
  696. $lp_id = intval($learnpath['id']);
  697. $lp_name = $learnpath['name'];
  698. $any_result = false;
  699. // Get progress in lp
  700. $progress = Tracking::get_avg_student_progress(
  701. $student_id,
  702. $course_code,
  703. array($lp_id),
  704. $session_id
  705. );
  706. if ($progress === null) {
  707. $progress = '0%';
  708. } else {
  709. $any_result = true;
  710. }
  711. // Get time in lp
  712. $total_time = Tracking::get_time_spent_in_lp(
  713. $student_id,
  714. $course_code,
  715. array($lp_id),
  716. $session_id
  717. );
  718. if (!empty($total_time)) {
  719. $any_result = true;
  720. }
  721. // Get last connection time in lp
  722. $start_time = Tracking::get_last_connection_time_in_lp(
  723. $student_id,
  724. $course_code,
  725. $lp_id,
  726. $session_id
  727. );
  728. if (!empty($start_time)) {
  729. $start_time = api_convert_and_format_date($start_time, DATE_TIME_FORMAT_LONG);
  730. } else {
  731. $start_time = '-';
  732. }
  733. if (!empty($total_time)) $any_result = true;
  734. // Quiz in lp
  735. $score = Tracking::get_avg_student_score(
  736. $student_id,
  737. $course_code,
  738. array($lp_id),
  739. $session_id
  740. );
  741. // Latest exercise results in a LP
  742. $score_latest = Tracking:: get_avg_student_score(
  743. $student_id,
  744. $course_code,
  745. array($lp_id),
  746. $session_id,
  747. false,
  748. true
  749. );
  750. if ($i % 2 == 0) $css_class = "row_even";
  751. else $css_class = "row_odd";
  752. $i++;
  753. // csv export content
  754. $csv_content[] = array (
  755. api_html_entity_decode(stripslashes($lp_name), ENT_QUOTES, $charset),
  756. api_time_to_hms($total_time),
  757. $score . '%',
  758. $score_latest . '%',
  759. $progress.'%',
  760. $start_time
  761. );
  762. echo '<tr class="'.$css_class.'">';
  763. echo Display::tag('td', stripslashes($lp_name));
  764. echo Display::tag('td', api_time_to_hms($total_time));
  765. if (!is_null($score)) {
  766. if (is_numeric($score)) {
  767. $score = $score.'%';
  768. }
  769. }
  770. echo Display::tag('td', $score);
  771. if (!is_null($score_latest)) {
  772. if (is_numeric($score_latest)) {
  773. $score_latest = $score_latest.'%';
  774. }
  775. }
  776. echo Display::tag('td', $score_latest);
  777. if (is_numeric($progress)) {
  778. $progress = $progress.'%';
  779. } else {
  780. $progress = '-';
  781. }
  782. echo Display::tag('td', $progress);
  783. //Do not change with api_convert_and_format_date, because this value came from the lp_item_view table
  784. //which implies several other changes not a priority right now
  785. echo Display::tag('td', $start_time);
  786. if ($any_result === true) {
  787. $from = '';
  788. if ($from_myspace) {
  789. $from ='&from=myspace';
  790. }
  791. $link = Display::url(
  792. '<img src="../img/2rightarrow.gif" border="0" />',
  793. 'lp_tracking.php?cidReq='.Security::remove_XSS($_GET['course']).'&course='.Security::remove_XSS($_GET['course']).$from.'&origin='.Security::remove_XSS($_GET['origin']).'&lp_id='.$learnpath['id'].'&student_id='.$user_info['user_id'].'&id_session='.$session_id
  794. );
  795. echo Display::tag('td', $link);
  796. }
  797. if (api_is_allowed_to_edit()) {
  798. echo '<td>';
  799. if ($any_result === true) {
  800. echo '<a href="myStudents.php?action=reset_lp&sec_token='.$token.'&cidReq='.Security::remove_XSS($_GET['course']).'&course='.Security::remove_XSS($_GET['course']).'&details='.Security::remove_XSS($_GET['details']).'&origin='.Security::remove_XSS($_GET['origin']).'&lp_id='.$learnpath['id'].'&student='.$user_info['user_id'].'&details=true&id_session='.Security::remove_XSS($_GET['id_session']).'">';
  801. echo Display::return_icon('clean.png',get_lang('Clean'),'',ICON_SIZE_SMALL).'</a>';
  802. echo '</a>';
  803. }
  804. echo '</td>';
  805. echo '</tr>';
  806. }
  807. $data_learnpath[$i][] = $lp_name;
  808. $data_learnpath[$i][] = $progress . '%';
  809. }
  810. } else {
  811. //echo '<tr><td colspan="6">'.get_lang('NoLearnpath').'</td></tr>';
  812. }
  813. ?>
  814. </table>
  815. <?php } ?>
  816. <!-- line about exercises -->
  817. <?php if ($user_info['status'] != INVITEE) { ?>
  818. <table class="data_table">
  819. <tr>
  820. <th><?php echo get_lang('Exercices'); ?></th>
  821. <th><?php echo get_lang('LearningPath');?></th>
  822. <th><?php echo get_lang('AvgCourseScore').' '.Display :: return_icon('info3.gif', get_lang('AverageScore'), array('align' => 'absmiddle', 'hspace' => '3px')) ?></th>
  823. <th><?php echo get_lang('Attempts'); ?></th>
  824. <th><?php echo get_lang('LatestAttempt'); ?></th>
  825. <th><?php echo get_lang('AllAttempts'); ?></th>
  826. </tr>
  827. <?php
  828. $csv_content[] = array();
  829. $csv_content[] = array(
  830. get_lang('Exercices'),
  831. get_lang('LearningPath'),
  832. get_lang('AvgCourseScore'),
  833. get_lang('Attempts')
  834. );
  835. $t_quiz = Database :: get_course_table(TABLE_QUIZ_TEST);
  836. $sql = "SELECT quiz.title, id FROM " . $t_quiz . " AS quiz
  837. WHERE
  838. quiz.c_id = ".$info_course['real_id']." AND
  839. (quiz.session_id = $session_id OR quiz.session_id = 0) AND
  840. active IN (0, 1)
  841. ORDER BY quiz.title ASC ";
  842. $result_exercices = Database::query($sql);
  843. $i = 0;
  844. if (Database :: num_rows($result_exercices) > 0) {
  845. while ($exercices = Database :: fetch_array($result_exercices)) {
  846. $exercise_id = intval($exercices['id']);
  847. $count_attempts = Tracking::count_student_exercise_attempts($student_id, $courseInfo['real_id'], $exercise_id, 0, 0, $session_id, 2);
  848. $score_percentage = Tracking::get_avg_student_exercise_score($student_id, $course_code, $exercise_id, $session_id, 1, 0);
  849. if (!isset($score_percentage) && $count_attempts > 0) {
  850. $scores_lp = Tracking::get_avg_student_exercise_score($student_id, $course_code, $exercise_id, $session_id, 2, 1);
  851. $score_percentage = $scores_lp[0];
  852. $lp_name = $scores_lp[1];
  853. } else {
  854. $lp_name = '-';
  855. }
  856. $lp_name = !empty($lp_name) ? $lp_name : get_lang('NoLearnpath');
  857. if ($i % 2) {
  858. $css_class = 'row_odd';
  859. } else {
  860. $css_class = 'row_even';
  861. }
  862. echo '<tr class="'.$css_class.'"><td>'.$exercices['title'].'</td>';
  863. echo '<td>';
  864. if (!empty($lp_name)) {
  865. echo $lp_name;
  866. } else {
  867. echo '-';
  868. }
  869. echo '</td>';
  870. echo '<td>';
  871. if ($count_attempts > 0) {
  872. echo $score_percentage . '%';
  873. } else {
  874. echo '-';
  875. $score_percentage = 0;
  876. }
  877. echo '</td>';
  878. echo '<td>'.$count_attempts.'</td>';
  879. echo '<td>';
  880. $sql_last_attempt = 'SELECT exe_id FROM ' . $tbl_stats_exercices . '
  881. WHERE exe_exo_id ="'.$exercise_id.'" AND
  882. exe_user_id ="'.$student_id.'" AND
  883. c_id = '.$courseInfo['real_id'].' AND
  884. session_id ="'.$session_id.'" AND
  885. status = ""
  886. ORDER BY exe_date DESC LIMIT 1';
  887. $result_last_attempt = Database::query($sql_last_attempt);
  888. if (Database :: num_rows($result_last_attempt) > 0) {
  889. $id_last_attempt = Database :: result($result_last_attempt, 0, 0);
  890. if ($count_attempts > 0)
  891. echo '<a href="../exercice/exercise_show.php?id=' . $id_last_attempt . '&cidReq='.$course_code.'&session_id='.$session_id.'&student='.$student_id.'&origin='.(empty($_GET['origin'])?'tracking':Security::remove_XSS($_GET['origin'])).'"> <img src="' . api_get_path(WEB_IMG_PATH) . 'quiz.gif" border="0" /> </a>';
  892. }
  893. echo '</td>';
  894. echo '<td>';
  895. $all_attempt_url = "../exercice/exercise_report.php?exerciseId=$exercise_id&cidReq=$course_code&filter_by_user=$student_id&id_session=$session_id";
  896. echo Display::url(Display::return_icon('test_results.png', get_lang('AllAttempts'), array(), ICON_SIZE_SMALL), $all_attempt_url );
  897. echo '</td></tr>';
  898. $data_exercices[$i][] = $exercices['title'];
  899. $data_exercices[$i][] = $score_percentage . '%';
  900. $data_exercices[$i][] = $count_attempts;
  901. $csv_content[] = array(
  902. $exercices['title'],
  903. $lp_name,
  904. $score_percentage,
  905. $count_attempts
  906. );
  907. $i++;
  908. }
  909. } else {
  910. echo '<tr><td colspan="6">'.get_lang('NoExercise').'</td></tr>';
  911. }
  912. echo '</table>';
  913. }
  914. //@when using sessions we do not show the survey list
  915. if (empty($session_id)) {
  916. $survey_list = survey_manager::get_surveys($course_code, $session_id);
  917. $survey_data = array();
  918. foreach($survey_list as $survey) {
  919. $user_list = survey_manager::get_people_who_filled_survey($survey['survey_id'], false, $info_course['real_id']);
  920. $survey_done = Display::return_icon("accept_na.png", get_lang('NoAnswer'), array(), ICON_SIZE_SMALL);
  921. if (in_array($student_id, $user_list)) {
  922. $survey_done = Display::return_icon("accept.png", get_lang('Answered'), array(), ICON_SIZE_SMALL);
  923. }
  924. $data = array('title' => $survey['title'], 'done' => $survey_done);
  925. $survey_data[] = $data;
  926. }
  927. if (!empty($survey_list)) {
  928. $table = new HTML_Table(array('class' => 'data_table'));
  929. $header_names = array(get_lang('Survey'), get_lang('Answered'));
  930. $row = 0;
  931. $column = 0;
  932. foreach ($header_names as $item) {
  933. $table->setHeaderContents($row, $column, $item);
  934. $column++;
  935. }
  936. $row = 1;
  937. if (!empty($survey_data)) {
  938. foreach ($survey_data as $data) {
  939. $column = 0;
  940. $table->setCellContents($row, $column, $data);
  941. $class = 'class="row_odd"';
  942. if($row % 2) {
  943. $class = 'class="row_even"';
  944. }
  945. $table->setRowAttributes($row, $class, true);
  946. $column++;
  947. $row++;
  948. }
  949. }
  950. echo $table->toHtml();
  951. }
  952. }
  953. // line about other tools
  954. echo '<table class="data_table">';
  955. $csv_content[] = array ();
  956. $nb_assignments = Tracking::count_student_assignments($student_id, $course_code, $session_id);
  957. $messages = Tracking::count_student_messages($student_id, $course_code, $session_id);
  958. $links = Tracking::count_student_visited_links($student_id, $info_course['real_id'], $session_id);
  959. $chat_last_connection = Tracking::chat_last_connection($student_id, $info_course['real_id'], $session_id);
  960. $documents = Tracking::count_student_downloaded_documents($student_id, $info_course['real_id'], $session_id);
  961. $uploaded_documents = Tracking::count_student_uploaded_documents($student_id, $course_code, $session_id);
  962. $csv_content[] = array(
  963. get_lang('OtherTools')
  964. );
  965. $csv_content[] = array(
  966. get_lang('Student_publication'),
  967. $nb_assignments
  968. );
  969. $csv_content[] = array(
  970. get_lang('Messages'),
  971. $messages
  972. );
  973. $csv_content[] = array(
  974. get_lang('LinksDetails'),
  975. $links
  976. );
  977. $csv_content[] = array(
  978. get_lang('DocumentsDetails'),
  979. $documents
  980. );
  981. $csv_content[] = array(
  982. get_lang('UploadedDocuments'),
  983. $uploaded_documents
  984. );
  985. $csv_content[] = array(
  986. get_lang('ChatLastConnection'),
  987. $chat_last_connection
  988. );
  989. ?>
  990. <tr>
  991. <th colspan="2"><?php echo get_lang('OtherTools'); ?></th>
  992. </tr>
  993. <tr><!-- assignments -->
  994. <td width="40%"><?php echo get_lang('Student_publication') ?></td>
  995. <td><?php echo $nb_assignments ?></td>
  996. </tr>
  997. <tr><!-- messages -->
  998. <td><?php echo get_lang('Forum').' - '.get_lang('NumberOfPostsForThisUser') ?></td>
  999. <td><?php echo $messages ?></td>
  1000. </tr>
  1001. <tr><!-- links -->
  1002. <td><?php echo get_lang('LinksDetails') ?></td>
  1003. <td><?php echo $links ?></td>
  1004. </tr>
  1005. <tr><!-- downloaded documents -->
  1006. <td><?php echo get_lang('DocumentsDetails') ?></td>
  1007. <td><?php echo $documents ?></td>
  1008. </tr>
  1009. <tr><!-- uploaded documents -->
  1010. <td><?php echo get_lang('UploadedDocuments') ?></td>
  1011. <td><?php echo $uploaded_documents ?></td>
  1012. </tr>
  1013. <tr><!-- Chats -->
  1014. <td><?php echo get_lang('ChatLastConnection') ?></td>
  1015. <td><?php echo $chat_last_connection; ?></td>
  1016. </tr>
  1017. </table>
  1018. </td>
  1019. </tr>
  1020. </table>
  1021. <?php
  1022. } //end details
  1023. }
  1024. if ($export_csv) {
  1025. ob_end_clean();
  1026. Export :: export_table_csv($csv_content, 'reporting_student');
  1027. exit;
  1028. }
  1029. Display :: display_footer();