index.php 22 KB

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