myStudents.php 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188
  1. <?php // $Id: myStudents.php 16739 2008-11-13 15:36:40Z pcool $
  2. /*
  3. ==============================================================================
  4. Dokeos - elearning and course management software
  5. Copyright (c) 2004-2008 Dokeos SPRL
  6. Copyright (c) 2003 Ghent University (UGent)
  7. For a full list of contributors, see "credits.txt".
  8. The full license can be read in "license.txt".
  9. This program is free software; you can redistribute it and/or
  10. modify it under the terms of the GNU General Public License
  11. as published by the Free Software Foundation; either version 2
  12. of the License, or (at your option) any later version.
  13. See the GNU General Public License for more details.
  14. Contact: Dokeos, rue Notre Dame, 152, B-1140 Evere, Belgium, info@dokeos.com
  15. ==============================================================================
  16. */
  17. // name of the language file that needs to be included
  18. $language_file = array ('registration', 'index', 'tracking', 'exercice','admin');
  19. $cidReset=true;
  20. include ('../inc/global.inc.php');
  21. include_once(api_get_path(LIBRARY_PATH).'tracking.lib.php');
  22. include_once(api_get_path(LIBRARY_PATH).'export.lib.inc.php');
  23. include_once(api_get_path(LIBRARY_PATH).'usermanager.lib.php');
  24. include_once(api_get_path(LIBRARY_PATH).'course.lib.php');
  25. include_once('../newscorm/learnpath.class.php');
  26. $export_csv = isset($_GET['export']) && $_GET['export'] == 'csv' ? true : false;
  27. if($export_csv)
  28. {
  29. ob_start();
  30. }
  31. $csv_content = array();
  32. $this_section = "session_my_space";
  33. $nameTools=get_lang("StudentDetails");
  34. if(isset($_GET['details']))
  35. {
  36. if(!empty($_GET['origin']) && $_GET['origin'] == 'user_course')
  37. {
  38. $course_infos = CourseManager :: get_course_information($_GET['course']);
  39. if(empty($cidReq))
  40. $interbreadcrumb[] = array ("url" => api_get_path(WEB_COURSE_PATH).$course_infos['directory'], 'name' => $course_infos['title']);
  41. $interbreadcrumb[] = array ("url" => "../user/user.php?cidReq=".$_GET['course'], "name" => get_lang("Users"));
  42. }
  43. else if(!empty($_GET['origin']) && $_GET['origin'] == 'tracking_course')
  44. {
  45. $course_infos = CourseManager :: get_course_information($_GET['course']);
  46. if(empty($cidReq))
  47. $interbreadcrumb[] = array ("url" => api_get_path(WEB_COURSE_PATH).$course_infos['directory'], 'name' => $course_infos['title']);
  48. $interbreadcrumb[] = array ("url" => "../tracking/courseLog.php?cidReq=".$_GET['course'].'&studentlist=true&id_session='.(empty($_SESSION['id_session'])?'':$_SESSION['id_session']), "name" => get_lang("Tracking"));
  49. }
  50. else
  51. {
  52. $interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('MySpace'));
  53. if(isset($_GET['id_coach']) && intval($_GET['id_coach'])!=0){
  54. $interbreadcrumb[] = array ("url" => "student.php?id_coach=".$_GET['id_coach'], "name" => get_lang("CoachStudents"));
  55. $interbreadcrumb[] = array ("url" => "myStudents.php?student=".$_GET['student'].'&id_coach='.$_GET['id_coach'], "name" => get_lang("StudentDetails"));
  56. }
  57. else{
  58. $interbreadcrumb[] = array ("url" => "student.php", "name" => get_lang("MyStudents"));
  59. $interbreadcrumb[] = array ("url" => "myStudents.php?student=".$_GET['student'], "name" => get_lang("StudentDetails"));
  60. }
  61. }
  62. $nameTools=get_lang("DetailsStudentInCourse");
  63. }
  64. else
  65. {
  66. $interbreadcrumb[] = array ('url' => '../admin/index.php', 'name' => get_lang('PlatformAdmin'));
  67. if(isset($_GET['id_coach']) && intval($_GET['id_coach'])!=0)
  68. {
  69. if(isset($_GET['id_session']) && intval($_GET['id_session'])!=0)
  70. {
  71. $interbreadcrumb[] = array ("url" => "student.php?id_coach=".$_GET['id_coach']."&id_session=".$_GET['id_session'], "name" => get_lang("CoachStudents"));
  72. }
  73. else
  74. {
  75. $interbreadcrumb[] = array ("url" => "student.php?id_coach=".$_GET['id_coach'], "name" => get_lang("CoachStudents"));
  76. }
  77. }
  78. else
  79. {
  80. $interbreadcrumb[] = array ('url' => '../admin/user_list.php', 'name' => get_lang('UserList'));
  81. }
  82. }
  83. api_block_anonymous_users();
  84. if(empty($_SESSION['is_allowedCreateCourse']) && !api_is_coach() && $_user['status']!=DRH && $_user['status']!=SESSIONADMIN){
  85. api_not_allowed(true);
  86. }
  87. Display :: display_header($nameTools);
  88. /*
  89. * ======================================================================================
  90. * FUNCTIONS
  91. * ======================================================================================
  92. */
  93. function calculHours($seconds)
  94. {
  95. //How many hours ?
  96. $hours = floor($seconds / 3600);
  97. //How many minutes ?
  98. $min = floor(($seconds - ($hours * 3600)) / 60);
  99. if ($min < 10)
  100. $min = "0".$min;
  101. //How many seconds
  102. $sec = $seconds - ($hours * 3600) - ($min * 60);
  103. if ($sec < 10)
  104. $sec = "0".$sec;
  105. return $hours."h".$min."m".$sec."s" ;
  106. }
  107. function is_teacher($course_code){
  108. global $_user;
  109. $tbl_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
  110. $sql="SELECT 1 FROM $tbl_course_user WHERE user_id='".$_user["user_id"]."' AND course_code='".$course_code."' AND status='1'";
  111. $result=api_sql_query($sql,__FILE__,__LINE__);
  112. if(Database::result($result)!=1)
  113. {
  114. return true;
  115. }
  116. else{
  117. return false;
  118. }
  119. }
  120. /*
  121. *===============================================================================
  122. * MAIN CODE
  123. *===============================================================================
  124. */
  125. // Database Table Definitions
  126. $tbl_user = Database :: get_main_table(TABLE_MAIN_USER);
  127. $tbl_session_user = Database :: get_main_table(TABLE_MAIN_SESSION_USER);
  128. $tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION);
  129. $tbl_session_course = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE);
  130. $tbl_session_course_user = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
  131. $tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE);
  132. $tbl_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
  133. $tbl_stats_exercices = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);
  134. $tbl_stats_exercices_attempts = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
  135. //$tbl_course_lp_view = Database :: get_course_table('lp_view');
  136. //$tbl_course_lp_view_item = Database :: get_course_table('lp_item_view');
  137. //$tbl_course_lp_item = Database :: get_course_table('lp_item');
  138. $tbl_course_lp_view = 'lp_view';
  139. $tbl_course_lp_view_item = 'lp_item_view';
  140. $tbl_course_lp_item = 'lp_item';
  141. $tbl_course_lp = 'lp';
  142. $tbl_course_quiz = 'quiz';
  143. $course_quiz_question = 'quiz_question';
  144. $course_quiz_rel_question = 'quiz_rel_question';
  145. $course_quiz_answer = 'quiz_answer';
  146. $course_student_publication = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
  147. if(isset($_GET["user_id"]) && $_GET["user_id"]!="")
  148. {
  149. $i_user_id=(int)$_GET["user_id"];
  150. }
  151. else
  152. {
  153. $i_user_id =$_user['user_id'];
  154. }
  155. if(!empty($_GET['student']))
  156. {
  157. $student_id = intval($_GET['student']);
  158. // infos about user
  159. $a_infosUser = UserManager::get_user_info_by_id($student_id);
  160. if($_user['status']==DRH && $a_infosUser['hr_dept_id']!=$_user['user_id'])
  161. {
  162. api_not_allowed();
  163. }
  164. $a_infosUser['name'] = $a_infosUser['firstname'].' '.$a_infosUser['lastname'];
  165. echo '<div class="actions">
  166. <a href="#" onclick="window.print()"><img src="../img/printmgr.gif">&nbsp;'.get_lang('Print').'</a>
  167. <a href="'.api_get_self().'?'.$_SERVER['QUERY_STRING'].'&export=csv"><img src="../img/excel.gif">&nbsp;'.get_lang('ExportAsCSV').'</a>
  168. </div>';
  169. // is the user online ?
  170. $statistics_database = Database :: get_statistic_database();
  171. $a_usersOnline = WhoIsOnline($_GET['student'], $statistics_database, 30);
  172. foreach($a_usersOnline as $a_online)
  173. {
  174. if(in_array($_GET['student'],$a_online))
  175. {
  176. $online = get_lang('Yes');
  177. break;
  178. }
  179. else
  180. {
  181. $online = get_lang('No');
  182. }
  183. }
  184. $avg_student_progress = $avg_student_score = $nb_courses = 0;
  185. $sql = 'SELECT course_code FROM '.$tbl_course_user.' WHERE user_id='.$a_infosUser['user_id'];
  186. $rs = api_sql_query($sql, __FILE__, __LINE__);
  187. $a_courses = array();
  188. while($row = Database :: fetch_array($rs))
  189. {
  190. $a_courses[$row['course_code']] = $row['course_code'];
  191. }
  192. // get the list of sessions where the user is subscribed as student
  193. $sql = 'SELECT DISTINCT course_code FROM '.Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER).' WHERE id_user='.intval($a_infosUser['user_id']);
  194. $rs = api_sql_query($sql, __FILE__, __LINE__);
  195. while($row = Database :: fetch_array($rs))
  196. {
  197. $a_courses[$row['course_code']] = $row['course_code'];
  198. }
  199. foreach ($a_courses as $key=>$course_code)
  200. {
  201. if(!CourseManager::is_user_subscribed_in_course($a_infosUser['user_id'], $course_code, true))
  202. {
  203. unset($a_courses[$key]);
  204. }
  205. else
  206. {
  207. $nb_courses++;
  208. $avg_student_progress += Tracking :: get_avg_student_progress($a_infosUser['user_id'],$course_code);
  209. //the score inside the Reporting table
  210. $avg_student_score += Tracking :: get_avg_student_score($a_infosUser['user_id'],$course_code);
  211. }
  212. }
  213. $avg_student_progress = round($avg_student_progress / $nb_courses,2);
  214. $avg_student_score = round($avg_student_score / $nb_courses,2);
  215. $first_connection_date = Tracking::get_first_connection_date($a_infosUser['user_id']);
  216. if($first_connection_date==''){
  217. $first_connection_date=get_lang('NoConnexion');
  218. }
  219. $last_connection_date = Tracking::get_last_connection_date($a_infosUser['user_id'],true);
  220. if($last_connection_date==''){
  221. $last_connection_date=get_lang('NoConnexion');
  222. }
  223. $time_spent_on_the_platform = api_time_to_hms(Tracking::get_time_spent_on_the_platform($a_infosUser['user_id']));
  224. // cvs informations
  225. $csv_content[] = array(get_lang('Informations'));
  226. $csv_content[] = array(get_lang('Name'), get_lang('Email'), get_lang('Tel'));
  227. $csv_content[] = array($a_infosUser['name'], $a_infosUser['email'],$a_infosUser['phone']);
  228. $csv_content[] = array();
  229. // csv tracking
  230. $csv_content[] = array(get_lang('Tracking'));
  231. $csv_content[] = array(get_lang('FirstLogin'),get_lang('LatestLogin'), get_lang('TimeSpentOnThePlatform'), get_lang('Progress'), get_lang('Score'));
  232. $csv_content[] = array(strip_tags($first_connection_date),strip_tags($last_connection_date), $time_spent_on_the_platform , $avg_student_progress.' %',$avg_student_score.' %');
  233. ?>
  234. <a name="infosStudent"></a>
  235. <table width="100%" border="0" >
  236. <tr>
  237. <?php
  238. $image_array=UserManager::get_user_picture_path_by_id($a_infosUser['user_id'],'web',false, true);
  239. echo '<td class="borderRight" width="10%" valign="top">';
  240. echo '<img src="'.$image_array['dir'].$image_array['file'].'" border="1">';
  241. echo '</td>';
  242. ?>
  243. <td width="40%" valign="top">
  244. <table width="100%" class="data_table">
  245. <tr>
  246. <th>
  247. <?php echo get_lang('Informations'); ?>
  248. </th>
  249. </tr>
  250. <tr>
  251. <td>
  252. <?php
  253. echo get_lang('Name').' : ';
  254. echo $a_infosUser['name'];
  255. ?>
  256. </td>
  257. </tr>
  258. <tr>
  259. <td>
  260. <?php
  261. echo get_lang('Email').' : ';
  262. if(!empty($a_infosUser['email']))
  263. {
  264. echo '<a href="mailto:'.$a_infosUser['email'].'">'.$a_infosUser['email'].'</a>';
  265. }
  266. else
  267. {
  268. echo get_lang('NoEmail');
  269. }
  270. ?>
  271. </td>
  272. </tr>
  273. <tr>
  274. <td>
  275. <?php
  276. echo get_lang('Tel').'. ';
  277. if(!empty($a_infosUser['phone']))
  278. {
  279. echo $a_infosUser['phone'];
  280. }
  281. else
  282. {
  283. echo get_lang('NoTel');
  284. }
  285. ?>
  286. </td>
  287. </tr>
  288. <tr>
  289. <td>
  290. <?php
  291. echo get_lang('OfficialCode').' : ';
  292. if(!empty($a_infosUser['official_code']))
  293. {
  294. echo $a_infosUser['official_code'];
  295. }
  296. else
  297. {
  298. echo get_lang('NoOfficialCode');
  299. }
  300. ?>
  301. </td>
  302. </tr>
  303. <tr>
  304. <td>
  305. <?php
  306. echo get_lang('OnLine').' : ';
  307. echo $online;
  308. ?>
  309. </td>
  310. </tr>
  311. </table>
  312. </td>
  313. <td class="borderLeft" width="35%" valign="top">
  314. <table width="100%" class="data_table">
  315. <tr>
  316. <th colspan="2">
  317. <?php echo get_lang('Tracking'); ?>
  318. </th>
  319. </tr>
  320. <tr>
  321. <td align="right">
  322. <?php echo get_lang('FirstLogin') ?>
  323. </td>
  324. <td align="left">
  325. <?php echo $first_connection_date ?>
  326. </td>
  327. </tr>
  328. <tr>
  329. <td align="right">
  330. <?php echo get_lang('LatestLogin') ?>
  331. </td>
  332. <td align="left">
  333. <?php echo $last_connection_date ?>
  334. </td>
  335. </tr>
  336. <tr>
  337. <td align="right">
  338. <?php echo get_lang('TimeSpentOnThePlatform') ?>
  339. </td>
  340. <td align="left">
  341. <?php echo $time_spent_on_the_platform ?>
  342. </td>
  343. </tr>
  344. <tr>
  345. <td align="right">
  346. <?php echo get_lang('Progress') ?>
  347. </td>
  348. <td align="left">
  349. <?php echo $avg_student_progress.' %' ?>
  350. </td>
  351. </tr>
  352. <tr>
  353. <td align="right">
  354. <?php
  355. echo get_lang('Score');
  356. Display :: display_icon('info2.gif',get_lang('ScormAndLPTestTotalAverage') , array ('style' => 'margin-bottom:-5px;'));
  357. ?>
  358. </td>
  359. <td align="left">
  360. <?php echo $avg_student_score.' %' ?>
  361. </td>
  362. </tr>
  363. </table>
  364. </td>
  365. <?php
  366. $sendMail = Display::encrypted_mailto_link($a_infosUser['email'], ' '.get_lang('SendMail'));
  367. ?>
  368. <td class="borderLeft" width="15%" valign="top">
  369. <table width="100%" class="data_table">
  370. <tr>
  371. <th>
  372. <?php echo get_lang('Actions'); ?>
  373. </th>
  374. </tr>
  375. <tr>
  376. <?php
  377. if(!empty($a_infosUser['email']))
  378. {
  379. echo "<td class='none'>";
  380. echo '<img src="../img/send_mail.gif">&nbsp;'.$sendMail;
  381. echo "</td>";
  382. }
  383. else
  384. {
  385. echo "<td class='noLink none'>";
  386. echo '<img src="../img/send_mail.gif">&nbsp; <strong> > '.get_lang('SendMail').'</strong>';
  387. echo "</td>";
  388. }
  389. ?>
  390. </tr>
  391. <?php
  392. if(!empty($_GET['student']) && !empty($_GET['course']))
  393. { //only show link to connection details if course and student were defined in the URL
  394. echo '<tr>';
  395. echo '<td class="noLink none">';
  396. echo '<img src="../img/statistics.gif">&nbsp; <strong> <a href="access_details.php?student='.$_GET['student'].'&course='.$_GET['course'].'">'.get_lang('AccessDetails').'</a> </strong>';
  397. echo '</td>';
  398. echo '</tr>';
  399. }
  400. ?>
  401. </table>
  402. </td>
  403. </tr>
  404. </table>
  405. <table class="data_table">
  406. <tr>
  407. <td colspan="5" style="border-width: 0px;">&nbsp;</td>
  408. </tr>
  409. <?php
  410. if(!empty($_GET['details']))
  411. {
  412. $a_infosCours = CourseManager :: get_course_information($_GET['course']);
  413. //get coach and session_name if there is one and if session_mode is activated
  414. if(api_get_setting('use_session_mode')=='true')
  415. {
  416. $tbl_user = Database :: get_main_table(TABLE_MAIN_USER);
  417. $tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION);
  418. $tbl_session_course = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE);
  419. $tbl_session_course_user = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
  420. $sql = 'SELECT id_session
  421. FROM '.$tbl_session_course_user.' session_course_user
  422. WHERE session_course_user.id_user = '.intval($a_infosUser['user_id']).'
  423. AND session_course_user.course_code = "'.Database::escape_string($_GET['course']).'"
  424. ORDER BY id_session DESC';
  425. $rs = api_sql_query($sql,__FILE__,__LINE__);
  426. $num_row=Database::num_rows($rs);
  427. if ($num_row > 0)
  428. {
  429. $le_session_id = intval(Database::result($rs,0,0));
  430. if($le_session_id>0)
  431. {
  432. // get session name and coach of the session
  433. $sql = 'SELECT name, id_coach FROM '.$tbl_session.'
  434. WHERE id='.$le_session_id;
  435. $rs = api_sql_query($sql,__FILE__,__LINE__);
  436. $session_name = Database::result($rs,0,'name');
  437. $session_coach_id = intval(Database::result($rs,0,'id_coach'));
  438. // get coach of the course in the session
  439. $sql = 'SELECT id_coach FROM '.$tbl_session_course.'
  440. WHERE id_session='.$le_session_id.'
  441. AND course_code = "'.Database::escape_string($_GET['course']).'"';
  442. $rs = api_sql_query($sql,__FILE__,__LINE__);
  443. $session_course_coach_id = intval(Database::result($rs,0,0));
  444. if($session_course_coach_id!=0)
  445. {
  446. $coach_infos = UserManager :: get_user_info_by_id($session_course_coach_id);
  447. $a_infosCours['tutor_name'] = $coach_infos['firstname'].' '.$coach_infos['lastname'];
  448. }
  449. else if($session_coach_id!=0)
  450. {
  451. $coach_infos = UserManager :: get_user_info_by_id($session_coach_id);
  452. $a_infosCours['tutor_name'] = $coach_infos['firstname'].' '.$coach_infos['lastname'];
  453. }
  454. }
  455. }
  456. } // end if(api_get_setting('use_session_mode')=='true')
  457. $date_start = '';
  458. if(!empty($a_infosCours['date_start']))
  459. {
  460. $a_date_start = explode('-',$a_infosCours['date_start']);
  461. $date_start = $a_date_start[2].'/'.$a_date_start[1].'/'.$a_date_start[0];
  462. }
  463. $date_end = '';
  464. if(!empty($a_infosCours['date_end']))
  465. {
  466. $a_date_end = explode('-',$a_infosCours['date_end']);
  467. $date_end = $a_date_end[2].'/'.$a_date_end[1].'/'.$a_date_end[0];
  468. }
  469. $dateSession = get_lang('From').' '.$date_start.' '.get_lang('To').' '.$date_end;
  470. $nb_login = Tracking :: count_login_per_student($a_infosUser['user_id'], $_GET['course']);
  471. $tableTitle = $a_infosCours['title'].'&nbsp;|&nbsp;'.get_lang('CountToolAccess').' : '.$nb_login.'&nbsp; | &nbsp;'.get_lang('Tutor').' : '.stripslashes($a_infosCours['tutor_name']).((!empty($session_name)) ? ' | '.get_lang('Session').' : '.$session_name : '');
  472. $csv_content[] = array();
  473. $csv_content[] = array(str_replace('&nbsp;','',$tableTitle));
  474. ?>
  475. <tr>
  476. <td colspan="6">
  477. <strong><?php echo $tableTitle; ?></strong>
  478. </td>
  479. </tr>
  480. </table>
  481. <!-- line about learnpaths -->
  482. <table class="data_table">
  483. <tr>
  484. <th>
  485. <?php echo get_lang('Learnpaths'); ?>
  486. </th>
  487. <th>
  488. <?php echo get_lang('Time'); ?>
  489. </th>
  490. <th>
  491. <?php
  492. echo get_lang('Score');
  493. Display :: display_icon('info3.gif',get_lang('LPTestScore') , array ('style' => 'margin-bottom:-5px;'));
  494. ?>
  495. </th>
  496. <th>
  497. <?php echo get_lang('Progress'); ?>
  498. </th>
  499. <th>
  500. <?php echo get_lang('LastConnexion'); ?>
  501. </th>
  502. <th>
  503. <?php echo get_lang('Details'); ?>
  504. </th>
  505. </tr>
  506. <?php
  507. $a_headerLearnpath = array(get_lang('Learnpath'),get_lang('Time'),get_lang('Progress'),get_lang('LastConnexion'));
  508. $t_lp = Database::get_course_table(TABLE_LP_MAIN,$a_infosCours['db_name']);
  509. $t_lpi = Database::get_course_table(TABLE_LP_ITEM,$a_infosCours['db_name']);
  510. $t_lpv = Database::get_course_table(TABLE_LP_VIEW,$a_infosCours['db_name']);
  511. $t_lpiv = Database::get_course_table(TABLE_LP_ITEM_VIEW,$a_infosCours['db_name']);
  512. $tbl_stats_exercices = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);
  513. $tbl_stats_attempts= Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
  514. $tbl_quiz_questions= Database :: get_course_table(TABLE_QUIZ_QUESTION,$a_infosCours['db_name']);
  515. $sqlLearnpath = "SELECT lp.name,lp.id
  516. FROM $t_lp AS lp ORDER BY lp.name ASC
  517. ";
  518. $resultLearnpath = api_sql_query($sqlLearnpath,__FILE__,__LINE__);
  519. $csv_content[] = array();
  520. $csv_content[] = array(get_lang('Learnpath'),get_lang('Time'),get_lang('Score'),get_lang('Progress'),get_lang('LastConnexion'));
  521. if(Database::num_rows($resultLearnpath)>0)
  522. {
  523. $i = 0;
  524. while($a_learnpath = Database::fetch_array($resultLearnpath))
  525. {
  526. $any_result = false;
  527. $progress = learnpath :: get_db_progress($a_learnpath['id'],$student_id, '%',$a_infosCours['db_name'],true);
  528. if($progress === null)
  529. {
  530. $progress = '0%';
  531. }
  532. else
  533. {
  534. $any_result = true;
  535. }
  536. // calculates time
  537. $sql = 'SELECT SUM(total_time)
  538. FROM '.$t_lpiv.' AS item_view
  539. INNER JOIN '.$t_lpv.' AS view
  540. ON item_view.lp_view_id = view.id
  541. AND view.lp_id = '.$a_learnpath['id'].'
  542. AND view.user_id = '.intval($_GET['student']);
  543. $rs = api_sql_query($sql, __FILE__, __LINE__);
  544. $total_time = 0;
  545. if(Database::num_rows($rs)>0)
  546. {
  547. $total_time = Database::result($rs, 0, 0);
  548. if($total_time>0) $any_result = true;
  549. }
  550. // calculates last connection time
  551. $sql = 'SELECT MAX(start_time)
  552. FROM '.$t_lpiv.' AS item_view
  553. INNER JOIN '.$t_lpv.' AS view
  554. ON item_view.lp_view_id = view.id
  555. AND view.lp_id = '.$a_learnpath['id'].'
  556. AND view.user_id = '.intval($_GET['student']);
  557. $rs = api_sql_query($sql, __FILE__, __LINE__);
  558. $start_time = null;
  559. if(Database::num_rows($rs)>0)
  560. {
  561. $start_time = Database::result($rs, 0, 0);
  562. if($start_time > 0) $any_result = true;
  563. }
  564. //QUIZZ IN LP
  565. //Path is the exercise id we need this to search the last attempt
  566. $sql = 'SELECT id as item_id, path,max_score
  567. FROM '.$t_lpi.' AS lp_item
  568. WHERE lp_id='.$a_learnpath['id'].'
  569. AND item_type="quiz"';
  570. $rsItems = api_sql_query($sql, __FILE__, __LINE__);
  571. //We get the last view id of this LP
  572. $sql='SELECT max(id) as id FROM '.$t_lpv.' WHERE lp_id='.$a_learnpath['id'].' AND user_id="'.intval($_GET['student']).'"';
  573. $rs_last_lp_view_id = api_sql_query($sql, __FILE__, __LINE__);
  574. $lp_view_id = 0;
  575. if(Database::num_rows($rs_last_lp_view_id)>0)
  576. {
  577. $lp_view_id = Database::result($rs_last_lp_view_id,0,'id');
  578. if($lp_view_id > 0) $any_result = true;
  579. }
  580. $total_score = $total_weighting = 0;
  581. if($lp_view_id)
  582. {
  583. while($item = Database :: fetch_array($rsItems, 'ASSOC'))
  584. {
  585. $sql = 'SELECT score as student_score
  586. FROM '.$t_lpiv.' as lp_view_item
  587. WHERE lp_view_item.lp_item_id = '.$item['item_id'].'
  588. AND lp_view_id = "'.$lp_view_id.'"';
  589. $rsScores = api_sql_query($sql, __FILE__, __LINE__);
  590. // Real max score we search into the stats
  591. $sql_last_attempt = 'SELECT exe_id FROM '. $tbl_stats_exercices. ' ' .
  592. 'WHERE exe_exo_id="' .$item['path']. '" AND exe_user_id="' . $student_id . '" AND exe_cours_id="' . $course_code . '" ORDER BY exe_date DESC limit 1';
  593. $resultLastAttempt = api_sql_query($sql_last_attempt, __FILE__, __LINE__);
  594. $num = Database :: num_rows($resultLastAttempt);
  595. if ($num > 0){
  596. if ($num > 1){
  597. while ($rowLA = Database :: fetch_row($resultLastAttempt)) {
  598. $id_last_attempt = $rowLA[0];
  599. }
  600. } else {
  601. $id_last_attempt = Database :: result($resultLastAttempt, 0, 0);
  602. }
  603. }
  604. $sql = "SELECT SUM(t.ponderation) as maxscore from ( SELECT distinct question_id, marks,ponderation FROM $tbl_stats_attempts as at " .
  605. "INNER JOIN $tbl_quiz_questions as q on(q.id = at.question_id) where exe_id ='$id_last_attempt' ) as t";
  606. $result = api_sql_query($sql, __FILE__, __LINE__);
  607. $row_max_score = Database :: fetch_array($result);
  608. $maxscore = $row_max_score['maxscore'];
  609. if ($maxscore=='')
  610. {
  611. $maxscore = $item['max_score'];
  612. }
  613. if (Database::num_rows($rsScores) > 0)
  614. {
  615. $total_score += Database::result($rsScores, 0, 0);
  616. }
  617. //$total_weighting += $item['max_score'];
  618. $total_weighting += $maxscore;
  619. }
  620. $any_result = true;
  621. }
  622. $sql = 'SELECT id, max_score
  623. FROM '.$t_lpi.' AS lp_item
  624. WHERE lp_id='.$a_learnpath['id'].'
  625. AND item_type="sco" LIMIT 1';
  626. $rs_lp_item_id_scorm = api_sql_query($sql, __FILE__, __LINE__);
  627. if(Database::num_rows($rs_lp_item_id_scorm)>0){
  628. $lp_item_id = Database::result($rs_lp_item_id_scorm,0,'id');
  629. $lp_item__max_score = Database::result($rs_lp_item_id_scorm,0,'max_score');
  630. $total_weighting+=$lp_item__max_score;
  631. //We get the last view id of this LP
  632. $sql='SELECT max(id) as id FROM '.$t_lpv.' WHERE lp_id='.$a_learnpath['id'].' AND user_id="'.intval($_GET['student']).'"';
  633. $rs_last_lp_view_id = api_sql_query($sql, __FILE__, __LINE__);
  634. $lp_view_id = Database::result($rs_last_lp_view_id,0,'id');
  635. // this will get the FINAL SCORE
  636. $sql='SELECT SUM(score)/count(lp_item_id) as score FROM '.$t_lpiv.' WHERE lp_view_id="'.$lp_view_id.'" GROUP BY lp_view_id';
  637. $rs_score = api_sql_query($sql, __FILE__, __LINE__);
  638. if(Database::num_rows($rs_score)>0)
  639. {
  640. $lp_scorm_score = Database::result($rs_score,0,'score');
  641. $total_score+=$lp_scorm_score;
  642. $any_result = true;
  643. }
  644. }
  645. $score = 0;
  646. if($total_weighting != 0)
  647. {
  648. $score = round($total_score / $total_weighting * 100,2);
  649. }
  650. if($i%2==0){
  651. $s_css_class="row_odd";
  652. }
  653. else{
  654. $s_css_class="row_even";
  655. }
  656. $i++;
  657. $csv_content[] = array(html_entity_decode(stripslashes($a_learnpath['name']),ENT_QUOTES,$charset),api_time_to_hms($total_time),$score.'%',$progress,date('Y-m-d',$start_time));
  658. ?>
  659. <tr class="<?php echo $s_css_class;?>">
  660. <td>
  661. <?php echo stripslashes($a_learnpath['name']); ?>
  662. </td>
  663. <td align="right">
  664. <?php echo api_time_to_hms($total_time) ?>
  665. </td>
  666. <td align="right">
  667. <?php echo $total_weighting>0 ? $score.'%' : '-' ?>
  668. </td>
  669. <td align="right">
  670. <?php echo $progress ?>
  671. </td>
  672. <td align="center">
  673. <?php if($start_time!='' && $start_time>0) echo format_locale_date(get_lang('DateFormatLongWithoutDay'),$start_time); else echo '-'; ?>
  674. </td>
  675. <td align="center">
  676. <?php
  677. if($any_result === true)
  678. {
  679. ?>
  680. <a href="lp_tracking.php?course=<?php echo $_GET['course'] ?>&origin=<?php echo $_GET['origin'] ?>&lp_id=<?php echo $a_learnpath['id']?>&student_id=<?php echo $a_infosUser['user_id'] ?>">
  681. <img src="../img/2rightarrow.gif" border="0" />
  682. </a>
  683. <?php
  684. }
  685. ?>
  686. </td>
  687. </tr>
  688. <?php
  689. $dataLearnpath[$i][] = $a_learnpath['name'];
  690. $dataLearnpath[$i][] = $progress.'%';
  691. $i++;
  692. }
  693. }
  694. else
  695. {
  696. echo " <tr>
  697. <td colspan='6'>
  698. ".get_lang('NoLearnpath')."
  699. </td>
  700. </tr>
  701. ";
  702. }
  703. ?>
  704. </table>
  705. <!-- line about exercises -->
  706. <table class="data_table">
  707. <tr>
  708. <th>
  709. <?php echo get_lang('Exercices'); ?>
  710. </th>
  711. <th>
  712. <?php echo get_lang('Score') ?>
  713. </th>
  714. <th>
  715. <?php echo get_lang('Attempts'); ?>
  716. </th>
  717. <th>
  718. <?php echo get_lang('CorrectTest'); ?>
  719. </th>
  720. </tr>
  721. <?php
  722. $csv_content[] = array();
  723. $csv_content[] = array(get_lang('Exercices'),get_lang('Score'),get_lang('Attempts'));
  724. $a_infosCours = CourseManager :: get_course_information($_GET['course']);
  725. $t_tool = Database::get_course_table(TABLE_TOOL_LIST,$a_infosCours['db_name']);
  726. $sql='SELECT visibility FROM '.$t_tool.' WHERE name="quiz"';
  727. $resultVisibilityQuizz = api_sql_query($sql,__FILE__,__LINE__);
  728. $t_quiz = Database::get_course_table(TABLE_QUIZ_TEST,$a_infosCours['db_name']);
  729. if(Database::result($resultVisibilityQuizz,0,'visibility')==1){
  730. $sqlExercices = " SELECT quiz.title,id
  731. FROM ".$t_quiz." AS quiz
  732. WHERE active='1' ORDER BY quiz.title ASC
  733. ";
  734. $resultExercices = api_sql_query($sqlExercices,__FILE__,__LINE__);
  735. $i = 0;
  736. if(Database::num_rows($resultExercices)>0)
  737. {
  738. while($a_exercices = Database::fetch_array($resultExercices))
  739. {
  740. $sqlEssais = " SELECT COUNT(ex.exe_id) as essais
  741. FROM $tbl_stats_exercices AS ex
  742. WHERE ex.exe_cours_id = '".$a_infosCours['code']."'
  743. AND ex.exe_exo_id = ".$a_exercices['id']."
  744. AND exe_user_id='".$_GET["student"]."'"
  745. ;
  746. $resultEssais = api_sql_query($sqlEssais,__FILE__,__LINE__);
  747. $a_essais = Database::fetch_array($resultEssais);
  748. $sqlScore = "SELECT exe_id, exe_result,exe_weighting
  749. FROM $tbl_stats_exercices
  750. WHERE exe_user_id = ".$_GET['student']."
  751. AND exe_cours_id = '".$a_infosCours['code']."'
  752. AND exe_exo_id = ".$a_exercices['id']."
  753. ORDER BY exe_date DESC LIMIT 1";
  754. $resultScore = api_sql_query($sqlScore,__FILE__,__LINE__);
  755. $score = 0;
  756. while($a_score = Database::fetch_array($resultScore))
  757. {
  758. $score = $score + $a_score['exe_result'];
  759. $weighting = $weighting + $a_score['exe_weighting'];
  760. $exe_id = $a_score['exe_id'];
  761. }
  762. $pourcentageScore = 0;
  763. if($weighting!=0)
  764. {
  765. $pourcentageScore = round(($score*100)/$weighting);
  766. }
  767. $weighting = 0;
  768. $csv_content[] = array($a_exercices['title'], $pourcentageScore.' %', $a_essais['essais']);
  769. if($i%2==0){
  770. $s_css_class="row_odd";
  771. }
  772. else{
  773. $s_css_class="row_even";
  774. }
  775. $i++;
  776. echo '<tr class="'.$s_css_class.'">
  777. <td>
  778. ';
  779. echo $a_exercices['title'];
  780. echo " </td>
  781. ";
  782. echo " <td align='right'>
  783. ";
  784. echo $pourcentageScore.' %';
  785. echo " </td>
  786. <td align='right'>
  787. ";
  788. echo $a_essais['essais'];
  789. echo " </td>
  790. <td align='center'>
  791. ";
  792. $sql_last_attempt='SELECT exe_id FROM '.$tbl_stats_exercices.' WHERE exe_exo_id="'.$a_exercices['id'].'" AND exe_user_id="'.$_GET['student'].'" AND exe_cours_id="'.$a_infosCours['code'].'" ORDER BY exe_date DESC LIMIT 1';
  793. $resultLastAttempt = api_sql_query($sql_last_attempt,__FILE__,__LINE__);
  794. if(Database::num_rows($resultLastAttempt)>0)
  795. {
  796. $id_last_attempt=Database::result($resultLastAttempt,0,0);
  797. if($a_essais['essais']>0)
  798. echo '<a href="../exercice/exercise_show.php?id='.$id_last_attempt.'&cidReq='.$a_infosCours['code'].'&student='.$_GET['student'].'&origin='.(empty($_GET['origin']) ? 'tracking' : $_GET['origin']).'"> <img src="'.api_get_path(WEB_IMG_PATH).'quiz.gif" border="0"> </a>';
  799. }
  800. echo " </td>
  801. </tr>
  802. ";
  803. $dataExercices[$i][] = $a_exercices['title'];
  804. $dataExercices[$i][] = $pourcentageScore.'%';
  805. $dataExercices[$i][] = $a_essais['essais'];
  806. //$dataExercices[$i][] = corrections;
  807. $i++;
  808. }
  809. }
  810. else
  811. {
  812. echo " <tr>
  813. <td colspan='6'>
  814. ".get_lang('NoExercise')."
  815. </td>
  816. </tr>
  817. ";
  818. }
  819. }
  820. else
  821. {
  822. echo " <tr>
  823. <td colspan='6'>
  824. ".get_lang('NoExercise')."
  825. </td>
  826. </tr>
  827. ";
  828. }
  829. ?>
  830. </table>
  831. <!-- line about other tools -->
  832. <table class="data_table">
  833. <tr>
  834. <td>
  835. <?php
  836. $csv_content[] = array();
  837. $nb_assignments = Tracking :: count_student_assignments($a_infosUser['user_id'], $a_infosCours['code']);
  838. $messages = Tracking :: count_student_messages($a_infosUser['user_id'], $a_infosCours['code']);
  839. $links = Tracking :: count_student_visited_links($a_infosUser['user_id'], $a_infosCours['code']);
  840. $documents = Tracking :: count_student_downloaded_documents($a_infosUser['user_id'], $a_infosCours['code']);
  841. $csv_content[] = array(get_lang('Student_publication'), $nb_assignments);
  842. $csv_content[] = array(get_lang('Messages'), $messages);
  843. $csv_content[] = array(get_lang('LinksDetails'), $links);
  844. $csv_content[] = array(get_lang('DocumentsDetails'), $documents);
  845. ?>
  846. <tr>
  847. <th colspan="2">
  848. <?php echo get_lang('OtherTools'); ?>
  849. </th>
  850. </tr>
  851. <tr><!-- assignments -->
  852. <td width="40%">
  853. <?php echo get_lang('Student_publication') ?>
  854. </td>
  855. <td>
  856. <?php echo $nb_assignments ?>
  857. </td>
  858. </tr>
  859. <tr><!-- messages -->
  860. <td>
  861. <?php echo get_lang('Messages') ?>
  862. </td>
  863. <td>
  864. <?php echo $messages ?>
  865. </td>
  866. </tr>
  867. <tr><!-- links -->
  868. <td>
  869. <?php echo get_lang('LinksDetails') ?>
  870. </td>
  871. <td>
  872. <?php echo $links ?>
  873. </td>
  874. </tr>
  875. <tr><!-- documents -->
  876. <td>
  877. <?php echo get_lang('DocumentsDetails') ?>
  878. </td>
  879. <td>
  880. <?php echo $documents ?>
  881. </td>
  882. </tr>
  883. </table>
  884. </td>
  885. </tr>
  886. </table>
  887. <?php
  888. }
  889. else
  890. {
  891. ?>
  892. <tr>
  893. <th>
  894. <?php echo get_lang('Course'); ?>
  895. </th>
  896. <th>
  897. <?php echo get_lang('Time'); ?>
  898. </th>
  899. <th>
  900. <?php echo get_lang('Progress'); ?>
  901. </th>
  902. <th>
  903. <?php echo get_lang('Score'); ?>
  904. </th>
  905. <th>
  906. <?php echo get_lang('Details'); ?>
  907. </th>
  908. </tr>
  909. <?php
  910. if(!api_is_platform_admin(true) && $_user['status']!=DRH){
  911. // courses followed by user where we are coach
  912. if(!isset($_GET['id_coach'])){
  913. $a_courses = Tracking :: get_courses_followed_by_coach($_user['user_id']);
  914. }
  915. else{
  916. $a_courses = Tracking :: get_courses_followed_by_coach($_GET['id_coach']);
  917. }
  918. }
  919. if(count($a_courses)>0)
  920. {
  921. $csv_content[] = array();
  922. $csv_content[] = array(get_lang('Course'),get_lang('Time'),get_lang('Progress'),get_lang('Score'));
  923. foreach($a_courses as $course_code)
  924. {
  925. if(CourseManager :: is_user_subscribed_in_course($student_id,$course_code, true)){
  926. $course_infos = CourseManager :: get_course_information($course_code);
  927. $time_spent_on_course = api_time_to_hms(Tracking :: get_time_spent_on_the_course($a_infosUser['user_id'], $course_code));
  928. $progress = Tracking :: get_avg_student_progress($a_infosUser['user_id'], $course_code).' %';
  929. $score = Tracking :: get_avg_student_score($a_infosUser['user_id'], $course_code).' %';
  930. $csv_content[] = array($course_infos['title'], $time_spent_on_course, $progress, $score);
  931. echo '
  932. <tr>
  933. <td align="right">
  934. '.$course_infos['title'].'
  935. </td>
  936. <td align="right">
  937. '.$time_spent_on_course.'
  938. </td>
  939. <td align="right">
  940. '.$progress.'
  941. </td>
  942. <td align="right">
  943. '.$score.'
  944. </td>';
  945. if(isset($_GET['id_coach']) && intval($_GET['id_coach'])!=0){
  946. echo '<td align="center" width="10">
  947. <a href="'.api_get_self().'?student='.$a_infosUser['user_id'].'&details=true&course='.$course_infos['code'].'&id_coach='.$_GET['id_coach'].'#infosStudent"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a>
  948. </td>';
  949. }
  950. else{
  951. echo '<td align="center" width="10">
  952. <a href="'.api_get_self().'?student='.$a_infosUser['user_id'].'&details=true&course='.$course_infos['code'].'#infosStudent"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a>
  953. </td>';
  954. }
  955. echo '</tr>';
  956. }
  957. }
  958. }
  959. else
  960. {
  961. echo "<tr>
  962. <td colspan='5'>
  963. ".get_lang('NoCourse')."
  964. </td>
  965. </tr>
  966. ";
  967. }
  968. }//end of else !empty($details)
  969. ?>
  970. </table>
  971. <br />
  972. <?php
  973. if(!empty($_GET['details']) && $_GET['origin'] != 'tracking_course' && $_GET['origin'] != 'user_course')
  974. {
  975. ?>
  976. <br /><br />
  977. <?php
  978. }
  979. if(!empty($_GET['exe_id']))
  980. {
  981. $t_q = Database::get_course_table(TABLE_QUIZ_TEST,$a_infosCours['db_name']);
  982. $t_qq = Database::get_course_table(TABLE_QUIZ_QUESTION,$a_infosCours['db_name']);
  983. $t_qa = Database::get_course_table(TABLE_QUIZ_ANSWER,$a_infosCours['db_name']);
  984. $t_qtq = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION,$a_infosCours['db_name']);
  985. $sqlExerciceDetails = " SELECT qq.question, qq.ponderation, qq.id
  986. FROM ".$t_qq." as qq
  987. INNER JOIN ".$t_qtq." as qrq
  988. ON qrq.question_id = qq.id
  989. AND qrq.exercice_id = ".intval($_GET['exe_id']);
  990. $resultExerciceDetails = api_sql_query($sqlExerciceDetails,__FILE__,__LINE__);
  991. $sqlExName = " SELECT quiz.title
  992. FROM ".$t_q." AS quiz
  993. WHERE quiz.id = ".intval($_GET['exe_id']);
  994. ;
  995. $resultExName = api_sql_query($sqlExName,__FILE__,__LINE__);
  996. $a_exName = Database::fetch_array($resultExName);
  997. echo "<table class='data_table'>
  998. <tr>
  999. <th colspan='2'>
  1000. ".$a_exName['title']."
  1001. </th>
  1002. </tr>
  1003. ";
  1004. while($a_exerciceDetails = Database::fetch_array($resultExerciceDetails))
  1005. {
  1006. $sqlAnswer = " SELECT qa.comment, qa.answer
  1007. FROM ".$t_qa." as qa
  1008. WHERE qa.question_id = ".$a_exerciceDetails['id']
  1009. ;
  1010. $resultAnswer = api_sql_query($sqlAnswer,__FILE__,__LINE__);
  1011. echo "<a name='infosExe'></a>";
  1012. echo"
  1013. <tr>
  1014. <td colspan='2'>
  1015. <strong>".$a_exerciceDetails['question'].' /'.$a_exerciceDetails['ponderation']."</strong>
  1016. </td>
  1017. </tr>
  1018. ";
  1019. while($a_answer = Database::fetch_array($resultAnswer))
  1020. {
  1021. echo"
  1022. <tr>
  1023. <td>
  1024. ".$a_answer['answer']."
  1025. </td>
  1026. <td>
  1027. ";
  1028. if(!empty($a_answer['comment']))
  1029. echo $a_answer['comment'];
  1030. else
  1031. echo get_lang('NoComment');
  1032. echo "
  1033. </td>
  1034. </tr>
  1035. ";
  1036. }
  1037. }
  1038. echo "</table>";
  1039. }
  1040. //YW - commented out because it doesn't seem to be used
  1041. //$a_header = array_merge($a_headerLearnpath,$a_headerExercices,$a_headerProductions);
  1042. }
  1043. if($export_csv)
  1044. {
  1045. ob_end_clean();
  1046. Export :: export_table_csv($csv_content, 'reporting_student');
  1047. }
  1048. /*
  1049. ==============================================================================
  1050. FOOTER
  1051. ==============================================================================
  1052. */
  1053. Display::display_footer();
  1054. ?>