print_myStudents.php 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. require_once '../inc/global.inc.php';
  4. $allow = api_get_configuration_value('extra');
  5. if (empty($allow)) {
  6. exit;
  7. }
  8. $from_myspace = false;
  9. if (isset($_GET['from']) && $_GET['from'] == 'myspace') {
  10. $from_myspace = true;
  11. $this_section = SECTION_TRACKING;
  12. } else {
  13. $this_section = SECTION_COURSES;
  14. }
  15. //$nameTools = get_lang('StudentDetails');
  16. $cidReset = true;
  17. $get_course_code = Security:: remove_XSS($_GET['course']);
  18. if (isset($_GET['details'])) {
  19. if (!empty($_GET['origin']) && $_GET['origin'] == 'user_course') {
  20. $course_info = CourseManager:: get_course_information($get_course_code);
  21. if (empty($cidReq)) {
  22. $interbreadcrumb[] = [
  23. "url" => api_get_path(WEB_COURSE_PATH).$course_info['directory'],
  24. 'name' => $course_info['title'],
  25. ];
  26. }
  27. $interbreadcrumb[] = [
  28. "url" => "../user/user.php?cidReq=".$get_course_code,
  29. "name" => get_lang("Users"),
  30. ];
  31. } else {
  32. if (!empty($_GET['origin']) && $_GET['origin'] == 'tracking_course') {
  33. $course_info = CourseManager:: get_course_information($get_course_code);
  34. if (empty($cidReq)) {
  35. //$interbreadcrumb[] = array ("url" => api_get_path(WEB_COURSE_PATH).$course_info['directory'], 'name' => $course_info['title']);
  36. }
  37. $interbreadcrumb[] = [
  38. "url" => "../tracking/courseLog.php?cidReq=".$get_course_code.'&studentlist=true&id_session='.(empty($_SESSION['id_session']) ? '' : $_SESSION['id_session']),
  39. "name" => get_lang("Tracking"),
  40. ];
  41. } else {
  42. if (!empty($_GET['origin']) && $_GET['origin'] == 'resume_session') {
  43. $interbreadcrumb[] = [
  44. 'url' => '../admin/index.php',
  45. "name" => get_lang('PlatformAdmin'),
  46. ];
  47. $interbreadcrumb[] = [
  48. 'url' => "../admin/session_list.php",
  49. "name" => get_lang('SessionList'),
  50. ];
  51. $interbreadcrumb[] = [
  52. 'url' => "../admin/resume_session.php?id_session=".Security:: remove_XSS($_GET['id_session']),
  53. "name" => get_lang('SessionOverview'),
  54. ];
  55. } else {
  56. $interbreadcrumb[] = [
  57. "url" => "index.php",
  58. "name" => get_lang('MySpace'),
  59. ];
  60. if (isset($_GET['id_coach']) && intval($_GET['id_coach']) != 0) {
  61. $interbreadcrumb[] = [
  62. "url" => "student.php?id_coach=".Security:: remove_XSS($_GET['id_coach']),
  63. "name" => get_lang("CoachStudents"),
  64. ];
  65. $interbreadcrumb[] = [
  66. "url" => "myStudents.php?student=".Security:: remove_XSS(
  67. $_GET['student']
  68. ).'&id_coach='.Security:: remove_XSS($_GET['id_coach']),
  69. "name" => get_lang("StudentDetails"),
  70. ];
  71. } else {
  72. $interbreadcrumb[] = [
  73. "url" => "student.php",
  74. "name" => get_lang("MyStudents"),
  75. ];
  76. $interbreadcrumb[] = [
  77. "url" => "myStudents.php?student=".Security:: remove_XSS($_GET['student']),
  78. "name" => get_lang("StudentDetails"),
  79. ];
  80. }
  81. }
  82. }
  83. }
  84. $nameTools = get_lang("DetailsStudentInCourse");
  85. } else {
  86. if (!empty($_GET['origin']) && $_GET['origin'] == 'resume_session') {
  87. $interbreadcrumb[] = [
  88. 'url' => '../admin/index.php',
  89. "name" => get_lang('PlatformAdmin'),
  90. ];
  91. $interbreadcrumb[] = [
  92. 'url' => "../admin/session_list.php",
  93. "name" => get_lang('SessionList'),
  94. ];
  95. $interbreadcrumb[] = [
  96. 'url' => "../admin/resume_session.php?id_session=".Security:: remove_XSS($_GET['id_session']),
  97. "name" => get_lang('SessionOverview'),
  98. ];
  99. } else {
  100. $interbreadcrumb[] = [
  101. "url" => "index.php",
  102. "name" => get_lang('MySpace'),
  103. ];
  104. if (isset($_GET['id_coach']) && intval($_GET['id_coach']) != 0) {
  105. if (isset($_GET['id_session']) && intval($_GET['id_session']) != 0) {
  106. $interbreadcrumb[] = [
  107. "url" => "student.php?id_coach=".Security:: remove_XSS(
  108. $_GET['id_coach']
  109. )."&id_session=".$_GET['id_session'],
  110. "name" => get_lang("CoachStudents"),
  111. ];
  112. } else {
  113. $interbreadcrumb[] = [
  114. "url" => "student.php?id_coach=".Security:: remove_XSS($_GET['id_coach']),
  115. "name" => get_lang("CoachStudents"),
  116. ];
  117. }
  118. } else {
  119. $interbreadcrumb[] = [
  120. "url" => "student.php",
  121. "name" => get_lang("MyStudents"),
  122. ];
  123. }
  124. }
  125. }
  126. api_block_anonymous_users();
  127. if (!api_is_allowed_to_edit() && !api_is_coach() && !api_is_drh() && !api_is_course_tutor(
  128. ) && $_user['status'] != SESSIONADMIN && !api_is_platform_admin(true)) {
  129. api_not_allowed(true);
  130. }
  131. Display:: display_header($nameTools);
  132. $tbl_stats_exercices = Database:: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
  133. if (isset($_GET['user_id']) && $_GET['user_id'] != '') {
  134. $user_id = intval($_GET['user_id']);
  135. } else {
  136. $user_id = $_user['user_id'];
  137. }
  138. $session_id = isset($_GET['id_session']) ? intval($_GET['id_session']) : 0;
  139. $student_id = (int) $_GET['student'];
  140. // Action behaviour
  141. $check = Security::check_token('get');
  142. if (!empty($student_id)) { // infos about user
  143. $info_user = api_get_user_info($student_id);
  144. }
  145. if (api_is_drh() && !UserManager::is_user_followed_by_drh($student_id, $_user['user_id'])) {
  146. api_not_allowed();
  147. }
  148. $info_user['name'] = api_get_person_name($info_user['firstname'], $info_user['lastname']);
  149. ?>
  150. <table class='data_table'>
  151. <tr>
  152. <th colspan="6">
  153. <?php echo get_lang('result_exam_title');
  154. echo $info_user['name']; ?>
  155. </th>
  156. <tr>
  157. <th><?php echo get_lang('module_no'); ?></th>
  158. <th>
  159. <?php echo get_lang('result_exam'); ?>
  160. </th>
  161. <th>
  162. <?php echo get_lang('result_rep_1'); ?>
  163. </th>
  164. <th>
  165. <?php echo get_lang('result_rep_2'); ?>
  166. </th>
  167. <th>
  168. <?php echo get_lang('comment'); ?>
  169. </th>
  170. </tr>
  171. <?php
  172. $sqlexam = "SELECT *
  173. FROM $tbl_stats_exercices
  174. WHERE exe_user_id = $student_id
  175. AND c_id = 0 AND mod_no != '0'
  176. ORDER BY mod_no ASC";
  177. $resultexam = Database::query($sqlexam);
  178. while ($a_exam = Database::fetch_array($resultexam)) {
  179. //$ex_id = $a_exam['ex_id'];
  180. $mod_no = $a_exam['mod_no'];
  181. $score_ex = $a_exam['score_ex'];
  182. $score_rep1 = $a_exam['score_rep1'];
  183. $score_rep2 = $a_exam['score_rep2'];
  184. $coment = stripslashes($a_exam['coment']);
  185. echo "
  186. <tr>
  187. <td> ".$a_exam['mod_no']."
  188. </td>
  189. <td>
  190. ".$a_exam['score_ex']."
  191. </td>
  192. <td>
  193. ".$a_exam['score_rep1']."
  194. </td>
  195. <td>
  196. ".$a_exam['score_rep2']."
  197. </td>
  198. <td>
  199. $coment
  200. </td>
  201. </tr>
  202. ";
  203. $exe_idd = $a_exam['exe_id'];
  204. }
  205. ?>
  206. </table>
  207. </form>
  208. <strong><?php echo get_lang('imprime_sommaire'); ?> </strong>
  209. <a href="#" onclick="window.print()"><img align="absbottom" src="../img/printmgr.gif" border="0"></a>