Dokeos PHP Cross Reference Learning Management Systems

Source: /main/mySpace/lp_tracking.php - 168 lines - 5855 bytes - Summary - Text - Print

   1  <?php
   2  /* For licensing terms, see /dokeos_license.txt */
   3  
   4  /*
   5   * Created on 26 mars 07 by Eric Marguin
   6   * Script to display the tracking of the students in the learning paths.
   7   */
   8  
   9  $language_file = array ('registration', 'index', 'tracking', 'exercice', 'scorm', 'learnpath');
  10  //$cidReset = true;
  11  
  12  require  '../inc/global.inc.php';
  13  
  14  $from_myspace = false;
  15  $from_link = '';
  16  if (isset($_GET['from']) && $_GET['from'] == 'myspace') {
  17      $from_link = '&from=myspace';
  18      $this_section = "session_my_space";
  19  } else {
  20      $this_section = SECTION_COURSES;
  21  }
  22  include_once api_get_path(LIBRARY_PATH).'tracking.lib.php';
  23  include_once api_get_path(LIBRARY_PATH).'export.lib.inc.php';
  24  include_once api_get_path(LIBRARY_PATH).'course.lib.php';
  25  include_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
  26  include_once api_get_path(SYS_CODE_PATH).'newscorm/learnpath.class.php';
  27  include_once api_get_path(SYS_CODE_PATH).'newscorm/learnpathItem.class.php';
  28  require_once api_get_path(LIBRARY_PATH).'export.lib.inc.php';
  29  
  30  $export_csv = isset($_GET['export']) && $_GET['export'] == 'csv' ? true : false;
  31  if ($export_csv) {
  32      ob_start();
  33  }
  34  $csv_content = array();
  35  $user_id = intval($_GET['student_id']);
  36  
  37  if (isset($_GET['course'])) {
  38      $cidReq = Security::remove_XSS($_GET['course']);
  39  }
  40  
  41  $user_infos = UserManager :: get_user_info_by_id($user_id);
  42  $name = api_get_person_name($user_infos['firstname'], $user_infos['lastname']);
  43  
  44  if (!api_is_platform_admin(true) && !CourseManager :: is_course_teacher($_user['user_id'], $cidReq) && !Tracking :: is_allowed_to_coach_student($_user['user_id'],$_GET['student_id']) && $user_infos['hr_dept_id']!==$_user['user_id']) {
  45      Display::display_header('');
  46      api_not_allowed();
  47      Display::display_footer();
  48  }
  49  
  50  $course_exits = CourseManager::course_exists($cidReq);
  51  
  52  if (!empty($course_exits)) {
  53      $_course = CourseManager :: get_course_information($cidReq);
  54  } else {
  55      api_not_allowed();
  56  }
  57  
  58  $_course['dbNameGlu'] = $_configuration['table_prefix'] . $_course['db_name'] . $_configuration['db_glue'];
  59  
  60  if (!empty($_GET['origin']) && $_GET['origin'] == 'user_course') {
  61      $interbreadcrumb[] = array ("url" => api_get_path(WEB_COURSE_PATH).$_course['directory'], 'name' => $_course['title']);
  62      $interbreadcrumb[] = array ("url" => "../user/user.php?cidReq=".$cidReq, "name" => get_lang("Users"));
  63  } else if(!empty($_GET['origin']) && $_GET['origin'] == 'tracking_course') {
  64      $interbreadcrumb[] = array ("url" => api_get_path(WEB_COURSE_PATH).$_course['directory'], 'name' => $_course['title']);
  65      $interbreadcrumb[] = array ("url" => "../tracking/courseLog.php?cidReq=".$cidReq.'&studentlist=true&id_session='.$_SESSION['id_session'], "name" => get_lang("Tracking"));
  66  } else {
  67      $interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('MySpace'));
  68      $interbreadcrumb[] = array ("url" => "student.php", "name" => get_lang("MyStudents"));
  69       $interbreadcrumb[] = array ("url" => "myStudents.php?student=".Security::remove_XSS($_GET['student_id']), "name" => get_lang("StudentDetails"));
  70       $nameTools=get_lang("DetailsStudentInCourse");
  71  }
  72  
  73  $interbreadcrumb[] = array("url" => "myStudents.php?student=".Security::remove_XSS($_GET['student_id'])."&course=".$cidReq."&details=true&origin=".Security::remove_XSS($_GET['origin']) , "name" => get_lang("DetailsStudentInCourse"));
  74  $nameTools = get_lang('LearningPathDetails');
  75  
  76  $htmlHeadXtra[] = '
  77  <style>
  78  div.title {
  79      font-weight : bold;
  80      text-align : left;
  81  }
  82  div.mystatusfirstrow {
  83      font-weight : bold;
  84      text-align : left;
  85  }
  86  div.description {
  87      font-family : Arial, Helvetica, sans-serif;
  88      font-size: 10px;
  89      color: Silver;
  90  }
  91  
  92  .data_table {
  93      border-collapse: collapse;
  94  }
  95  .data_table th {
  96      padding-right: 0px;
  97      border: 1px  solid gray;
  98      background-color: #eef;
  99  }
 100  .data_table tr.row_odd {
 101      background-color: #fafafa;
 102  }
 103  .data_table tr.row_odd:hover, .data_table tr.row_even:hover {
 104      background-color: #f0f0f0;
 105  }
 106  .data_table tr.row_even {
 107      background-color: #fff;
 108  }
 109  .data_table td {
 110      padding: 5px;
 111      vertical-align: top;
 112      border-bottom: 1px solid #b1b1b1;
 113      border-right: 1px dotted #e1e1e1;
 114      border-left: 1px dotted #e1e1e1;
 115  }
 116  
 117  .margin_table {
 118      margin-left : 3px;
 119      width: 80%;
 120  }
 121  .margin_table td.title {
 122      background-color: #ffff99;
 123  }
 124  .margin_table td.content {
 125      background-color: #ddddff;
 126  }
 127  </style>';
 128  
 129  Display :: display_header($nameTools);
 130  
 131  $lp_id = intval($_GET['lp_id']);
 132  
 133  $sql = 'SELECT name
 134      FROM '.Database::get_course_table(TABLE_LP_MAIN, $_course['db_name']).'
 135      WHERE id='.Database::escape_string($lp_id);
 136  $rs = Database::query($sql, __FILE__, __LINE__);
 137  $lp_title = Database::result($rs, 0, 0);
 138  
 139  echo '<div class ="actions"><div align="left" style="float:left;margin-top:2px;" ><strong>'.$_course['title'].' - '.$lp_title.' - '.$name.'</strong></div>
 140        <div  align="right">
 141          <a href="javascript: void(0);" onclick="javascript: window.print();">'.Display::return_icon('pixel.gif',get_lang('Print'),array('class'=>'toolactionplaceholdericon toolactionprint32')).''.get_lang('Print').'</a>
 142              <a href="'.api_get_self().'?export=csv&'.Security::remove_XSS($_SERVER['QUERY_STRING']).'">'.Display::return_icon('pixel.gif',get_lang('ExportAsCSV'),array('class'=>'toolactionplaceholdericon toolactionexportcourse')).''.get_lang('ExportAsCSV').'</a>
 143           </div></div>
 144      <div class="clear"></div>';
 145      
 146  echo '<div id="content">';
 147  
 148  $list = learnpath :: get_flat_ordered_items_list($lp_id);
 149  $origin = 'tracking';
 150  if ($export_csv) {
 151      include_once api_get_path(SYS_CODE_PATH).'newscorm/lp_stats.php';
 152      //Export :: export_table_csv($csv_content, 'reporting_student');
 153  } else {
 154      ob_start();
 155      include_once  api_get_path(SYS_CODE_PATH).'newscorm/lp_stats.php';
 156      $tracking_content = ob_get_contents();
 157      ob_end_clean();
 158      echo api_utf8_decode($tracking_content, $charset);
 159  }
 160  
 161  // ending div#content
 162  echo '</div>';
 163  
 164  // bottom actions toolbar
 165  echo '<div class="actions">';
 166  echo '</div>';
 167  
 168  Display :: display_footer();

title

Description

title

Description

title

Description

title

title

Body