myStudents.php 38 KB

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