index.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Session view
  5. * @package chamilo.session
  6. * @author Julio Montoya <gugli100@gmail.com> Beeznest
  7. */
  8. /**
  9. * Code
  10. */
  11. use \ChamiloSession as Session;
  12. // Language files that should be included.
  13. $language_file = array('learnpath', 'courses', 'index','tracking','exercice', 'admin');
  14. $cidReset = true;
  15. require_once '../inc/global.inc.php';
  16. require_once api_get_path(SYS_CODE_PATH).'newscorm/learnpathList.class.php';
  17. require_once api_get_path(SYS_CODE_PATH).'exercice/exercise.lib.php';
  18. require_once api_get_path(SYS_CODE_PATH).'exercice/exercise.class.php';
  19. // Only users who are logged in can proceed.
  20. api_block_anonymous_users();
  21. $this_section = SECTION_COURSES;
  22. $htmlHeadXtra[] = api_get_jqgrid_js();
  23. if (empty($_GET['session_id'])) {
  24. api_not_allowed();
  25. }
  26. $session_id = isset($_GET['session_id']) ? intval($_GET['session_id']): null;
  27. $course_id = isset($_GET['course_id']) ? intval($_GET['course_id']) : null;
  28. $_SESSION['id_session'] = $session_id;
  29. // Clear the exercise session just in case
  30. if (isset($_SESSION['objExercise'])) {
  31. Session::erase('objExercise');
  32. }
  33. $session_info = SessionManager::fetch($session_id);
  34. $session_list = SessionManager::get_sessions_by_coach(api_get_user_id());
  35. $course_list = SessionManager::get_course_list_by_session_id($session_id);
  36. // Getting all sessions where I'm subscribed
  37. $new_session_list = UserManager::get_personal_session_course_list(api_get_user_id());
  38. $user_course_list = array();
  39. foreach ($new_session_list as $session_item) {
  40. $user_course_list[] = $session_item['code'];
  41. }
  42. $my_session_list = array();
  43. $final_array = array();
  44. if (!empty($new_session_list)) {
  45. foreach ($new_session_list as $item) {
  46. $my_session_id = isset($item['id_session']) ? $item['id_session'] : null;
  47. if (isset($my_session_id) && !in_array($my_session_id, $my_session_list) && $session_id == $my_session_id) {
  48. $final_array[$my_session_id]['name'] = $item['session_name'];
  49. //Get all courses by session where I'm subscribed
  50. $my_course_list = UserManager::get_courses_list_by_session(api_get_user_id(), $my_session_id);
  51. foreach ($my_course_list as $my_course) {
  52. $course = array();
  53. $course_info = api_get_course_info($my_course['code']);
  54. // Getting all visible exercises from the current course
  55. $exercise_list = get_all_exercises(
  56. $course_info,
  57. $my_session_id,
  58. true,
  59. null,
  60. false,
  61. 1
  62. );
  63. $course['name'] = $course_info['name'];
  64. $course['id'] = $course_info['real_id'];
  65. if (!empty($exercise_list)) {
  66. foreach ($exercise_list as $exercise_item) {
  67. //Loading the exercise
  68. $exercise = new Exercise($course_info['real_id']);
  69. $exercise->read($exercise_item['id']);
  70. $visible_return = $exercise->is_visible();
  71. if ($visible_return['value'] != false) {
  72. // Reading all Exercise results by user, exercise_id, code, and session.
  73. $user_results = get_exercise_results_by_user(
  74. api_get_user_id(),
  75. $exercise_item['id'],
  76. $my_course['code'],
  77. $my_session_id
  78. );
  79. $course['exercises'][$exercise_item['id']]['data']['exercise_data'] = $exercise;
  80. $course['exercises'][$exercise_item['id']]['data']['results'] = $user_results;
  81. }
  82. }
  83. $final_array[$my_session_id]['data'][$my_course['code']] = $course;
  84. }
  85. }
  86. }
  87. $my_session_list[] = $my_session_id;
  88. }
  89. }
  90. $new_course_list = array();
  91. if (!empty($course_list)) {
  92. foreach ($course_list as $course_data) {
  93. if (in_array($course_data['code'], $user_course_list)) {
  94. $course_data['title'] = Display::url(
  95. $course_data['title'],
  96. api_get_course_url($course_data['code'], $session_id)
  97. );
  98. } else {
  99. continue;
  100. }
  101. $list = new LearnpathList(
  102. api_get_user_id(),
  103. $course_data['code'],
  104. $session_id,
  105. 'publicated_on ASC',
  106. true
  107. );
  108. $lp_list = $list->get_flat_list();
  109. $lp_count = 0;
  110. if (!empty($lp_list)) {
  111. foreach ($lp_list as $valLp) {
  112. if ($valLp['lp_visibility']) {
  113. $lp_count++;
  114. }
  115. }
  116. }
  117. $course_info = api_get_course_info($course_data['code']);
  118. $exercise_count = count(
  119. get_all_exercises(
  120. $course_info,
  121. $session_id,
  122. true,
  123. null,
  124. false,
  125. 1
  126. )
  127. );
  128. $max_mutation_date = '';
  129. $last_date = Tracking::get_last_connection_date_on_the_course(
  130. api_get_user_id(),
  131. $course_data['code'],
  132. $session_id,
  133. false
  134. );
  135. $icons = '';
  136. foreach ($lp_list as $item) {
  137. if ($item['modified_on'] == '0000-00-00 00:00:00' || empty($item['modified_on'])) {
  138. $lp_date_original = $item['created_on'];
  139. $image = 'new.gif';
  140. $label = get_lang('LearnpathAdded');
  141. } else {
  142. $lp_date_original = $item['modified_on'];
  143. $image = 'moderator_star.png';
  144. $label = get_lang('LearnpathUpdated');
  145. }
  146. $mutation_date = api_strtotime($item['publicated_on']) > api_strtotime($lp_date_original) ? $item['publicated_on'] : $lp_date_original;
  147. if (api_strtotime($mutation_date) > api_strtotime($max_mutation_date)) {
  148. $max_mutation_date = $mutation_date;
  149. }
  150. if (strtotime($last_date) < strtotime($lp_date_original)) {
  151. if (empty($icons)) {
  152. $icons .= ' '.Display::return_icon(
  153. $image,
  154. get_lang('TitleNotification').': '.$label.' - '.$lp_date_original
  155. ).' ';
  156. }
  157. }
  158. }
  159. $new_course_list[] = array(
  160. 'title'=> $course_data['title'].$icons,
  161. // 'recent_lps' => $icons,
  162. //'max_mutation_date' => substr(api_get_local_time($max_mutation_date),0,10),
  163. 'exercise_count' => $exercise_count,
  164. 'lp_count' => $lp_count
  165. );
  166. }
  167. }
  168. // If the requested session does not exist in my list we stop the script
  169. if (!api_is_platform_admin()) {
  170. if (!in_array($session_id, $my_session_list)) {
  171. api_not_allowed(true);
  172. }
  173. }
  174. //If session is not active we stop de script
  175. if (!api_is_allowed_to_session_edit()) {
  176. //api_not_allowed();
  177. }
  178. Display::display_header(get_lang('Session'));
  179. $session_select = array();
  180. foreach ($session_list as $item) {
  181. $session_select[$item['id']] = $item['name'];
  182. }
  183. // Session list form
  184. if (count($session_select) > 1) {
  185. $form = new FormValidator('exercise_admin', 'get', api_get_self().'?session_id='.$session_id);
  186. $form->addElement('select', 'session_id', get_lang('SessionList'), $session_select, 'onchange="javascript:change_session()"');
  187. $defaults['session_id'] = $session_id;
  188. $form->setDefaults($defaults);
  189. $form->display();
  190. }
  191. if (empty($session_id)) {
  192. $user_list = UserManager::get_user_list();
  193. } else {
  194. $user_list = SessionManager::get_users_by_session($session_id);
  195. }
  196. //Final data to be show
  197. $my_real_array = $new_exercises = array();
  198. $now = time();
  199. foreach ($final_array as $session_data) {
  200. $my_course_list = isset($session_data['data']) ? $session_data['data']: array();
  201. if (!empty($my_course_list)) {
  202. foreach ($my_course_list as $my_course_code=>$course_data) {
  203. if (isset($course_id) && !empty($course_id)) {
  204. if ($course_id != $course_data['id']) {
  205. continue;
  206. }
  207. }
  208. if (!empty($course_data['exercises'])) {
  209. // Exercises
  210. foreach ($course_data['exercises'] as $my_exercise_id => $exercise_data) {
  211. $best_score_data = get_best_attempt_in_course($my_exercise_id, $my_course_code, $session_id);
  212. $best_score = '';
  213. if (!empty($best_score_data)) {
  214. $best_score = show_score($best_score_data['exe_result'], $best_score_data['exe_weighting']);
  215. }
  216. // Exercise results
  217. $counter = 1;
  218. foreach ($exercise_data as $exercise_item) {
  219. $result_list = $exercise_item['results'];
  220. $exercise_info = $exercise_item['exercise_data'];
  221. if ($exercise_info->start_time == '0000-00-00 00:00:00') {
  222. $start_date = '-';
  223. } else {
  224. $start_date = $exercise_info->start_time;
  225. }
  226. if (!empty($result_list)) {
  227. foreach ($result_list as $exercise_result) {
  228. $platform_score = show_score($exercise_result['exe_result'], $exercise_result['exe_weighting']);
  229. $my_score = 0;
  230. if(!empty($exercise_result['exe_weighting']) && intval($exercise_result['exe_weighting']) != 0) {
  231. $my_score = $exercise_result['exe_result']/$exercise_result['exe_weighting'];
  232. }
  233. $position = get_exercise_result_ranking(
  234. $my_score,
  235. $exercise_result['exe_id'],
  236. $my_exercise_id,
  237. $my_course_code,
  238. $session_id,
  239. $user_list
  240. );
  241. $exercise_info->exercise = Display::url(
  242. $exercise_info->exercise,
  243. api_get_path(WEB_CODE_PATH)."exercice/result.php?cidReq=$my_course_code&id={$exercise_result['exe_id']}&id_session=$session_id&show_headers=1",
  244. array('target'=>SESSION_LINK_TARGET,'class'=>'exercise-result-link')
  245. );
  246. $my_real_array[]= array(
  247. 'status' => Display::return_icon('quiz.gif', get_lang('Attempted'),'', ICON_SIZE_SMALL),
  248. 'date' => $start_date,
  249. 'course' => $course_data['name'],
  250. 'exercise' => $exercise_info->exercise,
  251. 'attempt' => $counter,
  252. 'result' => $platform_score,
  253. 'best_result' => $best_score,
  254. 'position' => $position
  255. );
  256. $counter++;
  257. }
  258. } else {
  259. // We check the date validation of the exercise if the user can make it
  260. if ($exercise_info->start_time != '0000-00-00 00:00:00') {
  261. $allowed_time = api_strtotime($exercise_info->start_time, 'UTC');
  262. if ($now < $allowed_time) {
  263. continue;
  264. }
  265. }
  266. $exercise_info->exercise = Display::url(
  267. $exercise_info->exercise,
  268. api_get_path(WEB_CODE_PATH)."exercice/overview.php?cidReq=$my_course_code&exerciseId={$exercise_info->id}&id_session=$session_id",
  269. array('target'=>SESSION_LINK_TARGET)
  270. );
  271. $new_exercises[]= array(
  272. 'status' => Display::return_icon('star.png', get_lang('New'), array('width'=>ICON_SIZE_SMALL)),
  273. 'date' => $start_date,
  274. 'course' => $course_data['name'],
  275. 'exercise' => $exercise_info->exercise,
  276. 'attempt' => '-',
  277. 'result' => '-',
  278. 'best_result' => '-',
  279. 'position' => '-'
  280. );
  281. }
  282. }
  283. }
  284. }
  285. }
  286. }
  287. }
  288. $my_real_array = msort($my_real_array, 'date', 'asc');
  289. if (!empty($new_exercises)) {
  290. $my_real_array = array_merge($new_exercises, $my_real_array);
  291. }
  292. $start = $end = $start_only = $end_only ='';
  293. if (!empty($session_info['date_start']) && $session_info['date_start'] != '0000-00-00') {
  294. $start = api_convert_and_format_date($session_info['date_start'], DATE_FORMAT_SHORT);
  295. $start_only = get_lang('From').' '.$session_info['date_start'];
  296. }
  297. if (!empty($session_info['date_start']) && $session_info['date_end'] != '0000-00-00') {
  298. $end = api_convert_and_format_date($session_info['date_end'], DATE_FORMAT_SHORT);
  299. $end_only = get_lang('Until').' '.$session_info['date_end'];
  300. }
  301. if (!empty($start) && !empty($end)) {
  302. $dates = Display::tag('i', sprintf(get_lang('FromDateXToDateY'), $start, $end));
  303. } else {
  304. $dates = Display::tag('i', $start_only.' '.$end_only);
  305. }
  306. echo Display::tag('h1', $session_info['name']);
  307. echo $dates.'<br />';
  308. // All Learnpaths grid settings (First tab, first subtab)
  309. $columns_courses = array(
  310. get_lang('Title'), get_lang('NumberOfPublishedExercises'), get_lang('NumberOfPublishedLps')
  311. );
  312. $column_model_courses = array(
  313. array('name'=>'title', 'index'=>'title', 'width'=>'400px', 'align'=>'left', 'sortable'=>'true'),
  314. //array('name'=>'recent_lps', 'index'=>'recent_lps', 'width'=>'10px', 'align'=>'left', 'sortable'=>'false'),
  315. // array('name'=>'max_mutation_date', 'index'=>'max_mutation_date', 'width'=>'120px', 'align'=>'left', 'sortable'=>'true'),
  316. array('name'=>'exercise_count', 'index'=>'exercise_count', 'width'=>'180px', 'align'=>'left', 'sortable'=>'true'),
  317. array('name'=>'lp_count', 'index'=>'lp_count', 'width'=>'180px', 'align'=>'left', 'sortable'=>'true')
  318. );
  319. $extra_params_courses['height'] = '100%';
  320. $extra_params_courses['autowidth'] = 'true'; //use the width of the parent
  321. //$extra_params_courses['gridview'] = "false";
  322. /*$extra_params_courses['rowNum'] = 9000;
  323. $extra_params_courses['height'] = "100%";
  324. $extra_params_courses['autowidth'] = 'false'; //use the width of the parent
  325. $extra_params_courses['recordtext'] = '';
  326. $extra_params_courses['pgtext'] = '';
  327. $extra_params_courses['pgbuttons'] = false;*/
  328. //$extra_params_courses['width'] = '50%';
  329. //$extra_params_courses['autowidth'] = 'true';
  330. $url = api_get_path(WEB_AJAX_PATH).'course_home.ajax.php?a=session_courses_lp_default&session_id='.$session_id.'&course_id='.$course_id;
  331. $columns = array(
  332. get_lang('PublicationDate'),
  333. get_lang('Course'),
  334. get_lang('LearningPaths')
  335. );
  336. $column_model = array(
  337. array('name'=>'date', 'index'=>'date', 'width'=>'120', 'align'=>'left', 'sortable'=>'true'),
  338. array('name'=>'course', 'index'=>'course', 'width'=>'300', 'align'=>'left', 'sortable'=>'true', 'wrap_cell' => 'true'),
  339. array('name'=>'lp', 'index'=>'lp', 'width'=>'440', 'align'=>'left', 'sortable'=>'true')
  340. );
  341. $extra_params = array();
  342. /*
  343. $extra_params['sortname'] = 'date';
  344. $extra_params['sortorder'] = 'asc';
  345. $extra_params['pgbuttons'] = false;
  346. $extra_params['recordtext'] = '';
  347. $extra_params['pgtext'] = '';
  348. $extra_params['height'] = "100%";
  349. */
  350. //$extra_params['autowidth'] = 'true'; //use the width of the parent
  351. //$extra_params['width'] = '90%';
  352. //$extra_params['autowidth'] = 'true'; //use the width of the parent
  353. //$extra_params['forceFit'] = 'true'; //use the width of the parent
  354. //$extra_params['altRows'] = 'true'; //zebra style
  355. $extra_params['height'] = '100%';
  356. $extra_params['autowidth'] = 'true'; //use the width of the parent
  357. //Per course grid settings
  358. $url_by_course = api_get_path(WEB_AJAX_PATH).'course_home.ajax.php?a=session_courses_lp_by_course&session_id='.$session_id.'&course_id='.$course_id;
  359. $extra_params_course = array();
  360. $extra_params_course['grouping'] = 'true';
  361. $extra_params_course['groupingView'] = array(
  362. 'groupCollapse' => false,
  363. 'groupField' => array('course'),
  364. 'groupColumnShow' => array('false'),
  365. 'groupText' => array('<b>'.get_lang('Course').' {0}</b>')
  366. );
  367. $extra_params_course['autowidth'] = 'true'; //use the width of the parent
  368. $extra_params_course['height'] = "100%";
  369. //Per Week grid
  370. $url_week = api_get_path(WEB_AJAX_PATH).'course_home.ajax.php?a=session_courses_lp_by_week&session_id='.$session_id.'&course_id='.$course_id;
  371. $column_week = array(
  372. get_lang('PeriodWeek'),
  373. get_lang('PublicationDate'),
  374. get_lang('Course'),
  375. get_lang('LearningPaths')
  376. );
  377. $column_week_model = array(
  378. array('name'=>'week', 'index'=>'week', 'width'=>'40', 'align'=>'left', 'sortable'=>'false'),
  379. array('name'=>'date', 'index'=>'date', 'width'=>'120', 'align'=>'left', 'sortable'=>'false'),
  380. array('name'=>'course', 'index'=>'course', 'width'=>'300', 'align'=>'left', 'sortable'=>'true', 'wrap_cell' => 'true'),
  381. array('name'=>'lp', 'index'=>'lp', 'width'=>'440', 'align'=>'left', 'sortable'=>'true')
  382. );
  383. $extra_params_week = array();
  384. $extra_params_week['grouping'] = 'true';
  385. //For more details see http://www.trirand.com/jqgridwiki/doku.php?id=wiki:grouping
  386. $extra_params_week['groupingView'] = array(
  387. 'groupCollapse' => false,
  388. 'groupDataSorted' => false,
  389. 'groupField' => array('week'),
  390. 'groupOrder' => array('desc'),
  391. 'groupColumnShow' => 'false',
  392. 'groupText' => array('<b>' . get_lang('PeriodWeek') . ' {0}</b>')
  393. );
  394. $extra_params_week['autowidth'] = 'true'; //use the width of the parent
  395. $extra_params_week['height'] = '100%';
  396. // MyQCM grid
  397. $column_exercise = array(
  398. get_lang('Status'),
  399. get_lang('ExerciseStartDate'),
  400. get_lang('Course'),
  401. get_lang('Exercise'),
  402. get_lang('Attempts'),
  403. get_lang('Result'),
  404. get_lang('BestResultInCourse'),
  405. get_lang('Ranking')
  406. );
  407. $column_exercise_model = array(
  408. array('name'=>'status', 'index'=>'status', 'width'=>'40', 'align'=>'left', 'sortable'=>'false'),
  409. array('name'=>'date', 'index'=>'date', 'width'=>'130','align'=>'left', 'sortable'=>'true'),
  410. array('name'=>'course', 'index'=>'course', 'width'=>'200','align'=>'left', 'sortable'=>'true', 'wrap_cell' => 'true'),
  411. array('name'=>'exercise', 'index'=>'exercise', 'width'=>'200','align'=>'left', 'sortable'=>'false'),
  412. array('name'=>'attempt', 'index'=>'attempt', 'width'=>'60', 'align'=>'center', 'sortable'=>'true'),
  413. array('name'=>'result', 'index'=>'result', 'width'=>'120','align'=>'center', 'sortable'=>'true'),
  414. array('name'=>'best_result','index'=>'best_result','width'=>'140','align'=>'center', 'sortable'=>'true'),
  415. array('name'=>'position', 'index'=>'position', 'width'=>'55', 'align'=>'center', 'sortable'=>'true')
  416. );
  417. $extra_params_exercise['height'] = '100%';
  418. $extra_params_exercise['autowidth'] = 'true';
  419. //$extra_params_exercise['sortname'] = 'status';
  420. //$extra_params_exercise['sortorder'] = 'desc';
  421. //$extra_params_exercise['grouping'] = 'true';
  422. //$extra_params_exercise['groupingView'] = array('groupField'=>array('course'),'groupColumnShow'=>'false','groupText' => array('<b>'.get_lang('Course').' {0}</b>'));
  423. //$extra_params_exercise['groupingView'] = array('groupField'=>array('course'),'groupColumnShow'=>'false','groupText' => array('<b>'.get_lang('Course').' {0} - {1} Item(s)</b>'));
  424. ?>
  425. <br />
  426. <script>
  427. function change_session() {
  428. document.exercise_admin.submit();
  429. }
  430. $(function() {
  431. //js used when generating images on the fly see function Tracking::show_course_detail()
  432. $(".dialog").dialog("destroy");
  433. $(".dialog").dialog({
  434. autoOpen: false,
  435. show: "blind",
  436. resizable: false,
  437. height:300,
  438. width:550,
  439. modal: true
  440. });
  441. $(".opener").click(function() {
  442. var my_id = $(this).attr('id');
  443. var big_image = '#main_graph_' + my_id;
  444. $( big_image ).dialog("open");
  445. return false;
  446. });
  447. /* Binds a tab id in the url */
  448. $("#tabs").bind('tabsselect', function(event, ui) {
  449. window.location.href=ui.tab;
  450. });
  451. <?php
  452. //Displays js code to use a jqgrid
  453. echo Display::grid_js('courses', '', $columns_courses, $column_model_courses, $extra_params_courses, $new_course_list);
  454. echo Display::grid_js('list_default', $url, $columns, $column_model,$extra_params,array(), '');
  455. echo Display::grid_js('list_course', $url_by_course, $columns, $column_model,$extra_params_course,array(),'');
  456. echo Display::grid_js('list_week', $url_week, $column_week, $column_week_model, $extra_params_week,array(),'');
  457. echo Display::grid_js('exercises', '', $column_exercise, $column_exercise_model, $extra_params_exercise, $my_real_array);
  458. ?>
  459. // Generate tabs with jquery-ui
  460. $('#tabs').tabs();
  461. $( "#sub_tab" ).tabs();
  462. });
  463. </script>
  464. <?php
  465. $courseCode = isset($_GET['course']) ? $_GET['course'] : null;
  466. $my_reporting = Tracking::show_user_progress(api_get_user_id(), $session_id, '#tabs-4', false, false);
  467. if (!empty($my_reporting)) {
  468. $my_reporting .= '<br />'.Tracking::show_course_detail(api_get_user_id(), $courseCode, $session_id);
  469. }
  470. if (empty($my_reporting)) {
  471. $my_reporting = Display::return_message(get_lang('NoDataAvailable'), 'warning');
  472. }
  473. // Main headers
  474. $headers = array(
  475. get_lang('Courses'),
  476. get_lang('LearningPaths'),
  477. get_lang('MyQCM'),
  478. get_lang('MyStatistics')
  479. );
  480. // Sub headers
  481. $sub_header = array(
  482. get_lang('AllLearningPaths'),
  483. get_lang('PerWeek'),
  484. get_lang('ByCourse')
  485. );
  486. // Sub headers data
  487. $lp_tabs = Display::tabs(
  488. $sub_header,
  489. array(
  490. Display::grid_html('list_default'),
  491. Display::grid_html('list_week'),
  492. Display::grid_html('list_course')
  493. ),
  494. 'sub_tab'
  495. );
  496. $courses_tab = Display::grid_html('courses');
  497. // Main headers data
  498. echo Display::tabs(
  499. $headers,
  500. array(
  501. $courses_tab,
  502. $lp_tabs,
  503. Display::grid_html('exercises'),
  504. $my_reporting
  505. )
  506. );
  507. Display::display_footer();