lp_tracking.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <?php
  2. /*
  3. * Created on 26 mars 07 by Eric Marguin
  4. *
  5. * Script to display the tracking of the students in the learning paths.
  6. */
  7. $language_file = array ('registration', 'index', 'tracking', 'exercice', 'scorm');
  8. $cidReset = true;
  9. include ('../inc/global.inc.php');
  10. include_once(api_get_path(LIBRARY_PATH).'tracking.lib.php');
  11. include_once(api_get_path(LIBRARY_PATH).'export.lib.inc.php');
  12. include_once(api_get_path(LIBRARY_PATH).'course.lib.php');
  13. include_once('../newscorm/learnpath.class.php');
  14. include_once('../newscorm/learnpathItem.class.php');
  15. require_once (api_get_path(LIBRARY_PATH).'export.lib.inc.php');
  16. $export_csv = isset($_GET['export']) && $_GET['export'] == 'csv' ? true : false;
  17. if($export_csv)
  18. {
  19. ob_start();
  20. }
  21. $csv_content = array();
  22. if(!CourseManager :: is_course_teacher($_user['user_id'], $_GET['course']) && !Tracking :: is_allowed_to_coach_student($_user['user_id'],$_GET['student_id']))
  23. {
  24. Display::display_header('');
  25. api_not_allowed();
  26. Display::display_footer();
  27. }
  28. $_course = CourseManager :: get_course_information($_GET['course']);
  29. $_course['dbNameGlu'] = $_configuration['table_prefix'] . $_course['db_name'] . $_configuration['db_glue'];
  30. $cidReq = $_GET['course'];
  31. if(!empty($_GET['origin']) && $_GET['origin'] == 'user_course')
  32. {
  33. $interbreadcrumb[] = array ("url" => api_get_path(WEB_COURSE_PATH).$_course['directory'], 'name' => $_course['title']);
  34. $interbreadcrumb[] = array ("url" => "../user/user.php?cidReq=".$_GET['course'], "name" => get_lang("Users"));
  35. }
  36. else if(!empty($_GET['origin']) && $_GET['origin'] == 'tracking_course')
  37. {
  38. $interbreadcrumb[] = array ("url" => api_get_path(WEB_COURSE_PATH).$_course['directory'], 'name' => $_course['title']);
  39. $interbreadcrumb[] = array ("url" => "../tracking/courseLog.php?cidReq=".$_GET['course'].'&studentlist=true', "name" => get_lang("Tracking"));
  40. }
  41. else
  42. {
  43. $interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('MySpace'));
  44. $interbreadcrumb[] = array ("url" => "student.php", "name" => get_lang("MyStudents"));
  45. $interbreadcrumb[] = array ("url" => "myStudents.php?student=".$_GET['student_id'], "name" => get_lang("StudentDetails"));
  46. $nameTools=get_lang("DetailsStudentInCourse");
  47. }
  48. $interbreadcrumb[] = array("url" => "myStudents.php?student=".$_GET['student_id']."&course=".$_GET['course']."&details=true" , "name" => get_lang("StudentDetails"));
  49. $nameTools = get_lang('LearningPathDetails');
  50. $htmlHeadXtra[] = '
  51. <style>
  52. div.title {
  53. font-weight : bold;
  54. text-align : left;
  55. }
  56. div.mystatusfirstrow {
  57. font-weight : bold;
  58. text-align : left;
  59. }
  60. div.description {
  61. font-family : Arial, Helvetica, sans-serif;
  62. font-size: 10px;
  63. color: Silver;
  64. }
  65. .data_table
  66. {
  67. border-collapse: collapse;
  68. }
  69. .data_table th{
  70. padding-right: 0px;
  71. border: 1px solid gray;
  72. background-color: #eef;
  73. }
  74. .data_table tr.row_odd
  75. {
  76. background-color: #fafafa;
  77. }
  78. .data_table tr.row_odd:hover, .data_table tr.row_even:hover
  79. {
  80. background-color: #f0f0f0;
  81. }
  82. .data_table tr.row_even
  83. {
  84. background-color: #fff;
  85. }
  86. .data_table td
  87. {
  88. padding: 5px;
  89. vertical-align: top;
  90. border-bottom: 1px solid #b1b1b1;
  91. border-right: 1px dotted #e1e1e1;
  92. border-left: 1px dotted #e1e1e1;
  93. }
  94. .margin_table
  95. {
  96. margin-left : 3px;
  97. width: 80%;
  98. }
  99. .margin_table td.title
  100. {
  101. background-color: #ffff99;
  102. }
  103. .margin_table td.content
  104. {
  105. background-color: #ddddff;
  106. }
  107. </style>';
  108. Display :: display_header($nameTools);
  109. $user_id = intval($_GET['student_id']);
  110. $lp_id = intval($_GET['lp_id']);
  111. echo '<div align="right">
  112. <a href="#" onclick="window.print()"><img align="absbottom" src="../img/printmgr.gif">&nbsp;'.get_lang('Print').'</a>
  113. <a href="'.$_SERVER['PHP_SELF'].'?export=csv&'.$_SERVER['QUERY_STRING'].'"><img align="absbottom" src="../img/excel.gif">&nbsp;'.get_lang('ExportAsCSV').'</a>
  114. </div>';
  115. $list = learnpath :: get_flat_ordered_items_list($lp_id);
  116. $origin = 'tracking';
  117. include_once('../newscorm/lp_stats.php');
  118. Display :: display_footer();
  119. ?>