@@ -63,19 +63,19 @@ discard block |
||
63 | 63 | $content = $this->get_content_html(); |
64 | 64 | $html = ' |
65 | 65 | <div class="panel panel-default" id="intro"> |
66 | - <div class="panel-heading">' . get_lang('CoursesInformation') . ' |
|
66 | + <div class="panel-heading">' . get_lang('CoursesInformation').' |
|
67 | 67 | <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\'' . addslashes( |
68 | 68 | api_htmlentities( |
69 | 69 | get_lang('ConfirmYourChoice'), |
70 | 70 | ENT_QUOTES, |
71 | 71 | $charset |
72 | 72 | ) |
73 | - ) . '\')) return false;" href="index.php?action=disable_block&path=' . $this->path . '"> |
|
73 | + ).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'"> |
|
74 | 74 | <em class="fa fa-times"></em> |
75 | 75 | </a></div> |
76 | 76 | </div> |
77 | 77 | <div class="panel-body"> |
78 | - ' . $content . ' |
|
78 | + ' . $content.' |
|
79 | 79 | </div> |
80 | 80 | </div> |
81 | 81 | '; |
@@ -93,17 +93,17 @@ discard block |
||
93 | 93 | { |
94 | 94 | $course_data = $this->get_course_information_data(); |
95 | 95 | //$content = '<div style="margin:10px;">'; |
96 | - $content = '<h4>' . get_lang( |
|
96 | + $content = '<h4>'.get_lang( |
|
97 | 97 | 'YourCourseList' |
98 | - ) . '</h4>'; |
|
98 | + ).'</h4>'; |
|
99 | 99 | $data_table = null; |
100 | 100 | if (!empty($course_data)) { |
101 | 101 | $data_table .= '<table class="data_table" width:"95%">'; |
102 | 102 | $data_table .= '<tr> |
103 | - <th>' . get_lang('CourseTitle') . '</th> |
|
104 | - <th width="20%">' . get_lang('NbStudents') . '</th> |
|
105 | - <th width="20%">' . get_lang('AvgTimeSpentInTheCourse') . '</th> |
|
106 | - <th width="20%">' . get_lang('ThematicAdvance') . '</th> |
|
103 | + <th>' . get_lang('CourseTitle').'</th> |
|
104 | + <th width="20%">' . get_lang('NbStudents').'</th> |
|
105 | + <th width="20%">' . get_lang('AvgTimeSpentInTheCourse').'</th> |
|
106 | + <th width="20%">' . get_lang('ThematicAdvance').'</th> |
|
107 | 107 | </tr>'; |
108 | 108 | $i = 1; |
109 | 109 | foreach ($course_data as $course) { |
@@ -112,12 +112,12 @@ discard block |
||
112 | 112 | } else { |
113 | 113 | $class_tr = 'row_even'; |
114 | 114 | } |
115 | - $data_table .= '<tr class="' . $class_tr . '">'; |
|
115 | + $data_table .= '<tr class="'.$class_tr.'">'; |
|
116 | 116 | if (!isset($course[2])) { |
117 | 117 | $course[2] = '0:00:00'; |
118 | 118 | } |
119 | 119 | foreach ($course as $cell) { |
120 | - $data_table .= '<td align="right">' . $cell . '</td>'; |
|
120 | + $data_table .= '<td align="right">'.$cell.'</td>'; |
|
121 | 121 | } |
122 | 122 | $data_table .= '</tr>'; |
123 | 123 | $i++; |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | } |
129 | 129 | $content .= $data_table; |
130 | 130 | if (!empty($course_data)) { |
131 | - $content .= '<div style="text-align:right;margin-top:10px;"><a href="' . api_get_path(WEB_CODE_PATH) . 'mySpace/course.php?follow">' . get_lang('SeeMore') . '</a></div>'; |
|
131 | + $content .= '<div style="text-align:right;margin-top:10px;"><a href="'.api_get_path(WEB_CODE_PATH).'mySpace/course.php?follow">'.get_lang('SeeMore').'</a></div>'; |
|
132 | 132 | } |
133 | 133 | //$content .= '</div>'; |
134 | 134 | |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | |
164 | 164 | // students directly subscribed to the course |
165 | 165 | $sql = "SELECT user_id FROM $tbl_course_user as course_rel_user |
166 | - WHERE course_rel_user.status=" . STUDENT . " AND course_rel_user.c_id='$courseId'"; |
|
166 | + WHERE course_rel_user.status=".STUDENT." AND course_rel_user.c_id='$courseId'"; |
|
167 | 167 | $rs = Database::query($sql); |
168 | 168 | $users = array(); |
169 | 169 | while ($row = Database::fetch_array($rs)) { |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | ); |
183 | 183 | |
184 | 184 | if (!empty($tematic_advance)) { |
185 | - $tematic_advance_progress = '<a title="' . get_lang('GoToThematicAdvance') . '" href="' . api_get_path(WEB_CODE_PATH) . 'course_progress/index.php?cidReq=' . $course_code . '&action=thematic_details">' . $tematic_advance . '%</a>'; |
|
185 | + $tematic_advance_progress = '<a title="'.get_lang('GoToThematicAdvance').'" href="'.api_get_path(WEB_CODE_PATH).'course_progress/index.php?cidReq='.$course_code.'&action=thematic_details">'.$tematic_advance.'%</a>'; |
|
186 | 186 | } else { |
187 | 187 | $tematic_advance_progress = '0%'; |
188 | 188 | } |
@@ -22,40 +22,40 @@ discard block |
||
22 | 22 | { |
23 | 23 | |
24 | 24 | private $user_id; |
25 | - private $students; |
|
26 | - private $path; |
|
27 | - private $permission = array(DRH); |
|
25 | + private $students; |
|
26 | + private $path; |
|
27 | + private $permission = array(DRH); |
|
28 | 28 | |
29 | - /** |
|
30 | - * Constructor |
|
31 | - */ |
|
29 | + /** |
|
30 | + * Constructor |
|
31 | + */ |
|
32 | 32 | public function __construct ($user_id) |
33 | 33 | { |
34 | - $this->user_id = $user_id; |
|
35 | - $this->path = 'block_student_graph'; |
|
36 | - if ($this->is_block_visible_for_user($user_id)) { |
|
37 | - /*if (api_is_platform_admin()) { |
|
34 | + $this->user_id = $user_id; |
|
35 | + $this->path = 'block_student_graph'; |
|
36 | + if ($this->is_block_visible_for_user($user_id)) { |
|
37 | + /*if (api_is_platform_admin()) { |
|
38 | 38 | $this->students = UserManager::get_user_list(array('status' => STUDENT)); |
39 | 39 | } else if (api_is_drh()) {*/ |
40 | - $this->students = UserManager::get_users_followed_by_drh($user_id, STUDENT); |
|
41 | - //} |
|
42 | - } |
|
40 | + $this->students = UserManager::get_users_followed_by_drh($user_id, STUDENT); |
|
41 | + //} |
|
42 | + } |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
46 | - * This method check if a user is allowed to see the block inside dashboard interface |
|
47 | - * @param int User id |
|
48 | - * @return bool Is block visible for user |
|
49 | - */ |
|
46 | + * This method check if a user is allowed to see the block inside dashboard interface |
|
47 | + * @param int User id |
|
48 | + * @return bool Is block visible for user |
|
49 | + */ |
|
50 | 50 | public function is_block_visible_for_user($user_id) |
51 | 51 | { |
52 | - $user_info = api_get_user_info($user_id); |
|
53 | - $user_status = $user_info['status']; |
|
54 | - $is_block_visible_for_user = false; |
|
55 | - if (UserManager::is_admin($user_id) || in_array($user_status, $this->permission)) { |
|
56 | - $is_block_visible_for_user = true; |
|
57 | - } |
|
58 | - return $is_block_visible_for_user; |
|
52 | + $user_info = api_get_user_info($user_id); |
|
53 | + $user_status = $user_info['status']; |
|
54 | + $is_block_visible_for_user = false; |
|
55 | + if (UserManager::is_admin($user_id) || in_array($user_status, $this->permission)) { |
|
56 | + $is_block_visible_for_user = true; |
|
57 | + } |
|
58 | + return $is_block_visible_for_user; |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
@@ -67,12 +67,12 @@ discard block |
||
67 | 67 | public function get_block() |
68 | 68 | { |
69 | 69 | |
70 | - global $charset; |
|
71 | - $column = 1; |
|
72 | - $data = array(); |
|
73 | - $students_attendance_graph = $this->get_students_attendance_graph(); |
|
70 | + global $charset; |
|
71 | + $column = 1; |
|
72 | + $data = array(); |
|
73 | + $students_attendance_graph = $this->get_students_attendance_graph(); |
|
74 | 74 | |
75 | - $html = '<div class="panel panel-default" id="intro"> |
|
75 | + $html = '<div class="panel panel-default" id="intro"> |
|
76 | 76 | <div class="panel-heading"> |
77 | 77 | '.get_lang('StudentsInformationsGraph').' |
78 | 78 | <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'"> |
@@ -84,51 +84,51 @@ discard block |
||
84 | 84 | '.$students_attendance_graph.' |
85 | 85 | </div> |
86 | 86 | </div>'; |
87 | - $data['column'] = $column; |
|
88 | - $data['content_html'] = $html; |
|
89 | - return $data; |
|
87 | + $data['column'] = $column; |
|
88 | + $data['content_html'] = $html; |
|
89 | + return $data; |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | /** |
93 | - * This method return a graph containing information about students evaluation, |
|
93 | + * This method return a graph containing information about students evaluation, |
|
94 | 94 | * it's used inside get_block method for showing it inside dashboard interface |
95 | - * @return string img html |
|
96 | - */ |
|
95 | + * @return string img html |
|
96 | + */ |
|
97 | 97 | public function get_students_attendance_graph() |
98 | 98 | { |
99 | 99 | |
100 | - $students = $this->students; |
|
101 | - $attendance = new Attendance(); |
|
102 | - |
|
103 | - // get data |
|
104 | - $attendances_faults_avg = array(); |
|
105 | - if (is_array($students) && count($students) > 0) { |
|
106 | - foreach ($students as $student) { |
|
107 | - $student_id = $student['user_id']; |
|
108 | - //$student_info = api_get_user_info($student_id); |
|
109 | - // get average of faults in attendances by student |
|
110 | - $results_faults_avg = $attendance->get_faults_average_inside_courses($student_id); |
|
111 | - |
|
112 | - if (!empty($results_faults_avg)) { |
|
113 | - $attendances_faults_avg[$student['lastname']] = $results_faults_avg['porcent']; |
|
114 | - } else { |
|
115 | - $attendances_faults_avg[$student['lastname']] = 0; |
|
116 | - } |
|
117 | - } |
|
118 | - } |
|
100 | + $students = $this->students; |
|
101 | + $attendance = new Attendance(); |
|
102 | + |
|
103 | + // get data |
|
104 | + $attendances_faults_avg = array(); |
|
105 | + if (is_array($students) && count($students) > 0) { |
|
106 | + foreach ($students as $student) { |
|
107 | + $student_id = $student['user_id']; |
|
108 | + //$student_info = api_get_user_info($student_id); |
|
109 | + // get average of faults in attendances by student |
|
110 | + $results_faults_avg = $attendance->get_faults_average_inside_courses($student_id); |
|
111 | + |
|
112 | + if (!empty($results_faults_avg)) { |
|
113 | + $attendances_faults_avg[$student['lastname']] = $results_faults_avg['porcent']; |
|
114 | + } else { |
|
115 | + $attendances_faults_avg[$student['lastname']] = 0; |
|
116 | + } |
|
117 | + } |
|
118 | + } |
|
119 | 119 | |
120 | - arsort($attendances_faults_avg); |
|
121 | - $usernames = array_keys($attendances_faults_avg); |
|
120 | + arsort($attendances_faults_avg); |
|
121 | + $usernames = array_keys($attendances_faults_avg); |
|
122 | 122 | |
123 | - $faults = array(); |
|
124 | - foreach ($usernames as $username) { |
|
125 | - $faults[] = $attendances_faults_avg[$username]; |
|
126 | - } |
|
123 | + $faults = array(); |
|
124 | + foreach ($usernames as $username) { |
|
125 | + $faults[] = $attendances_faults_avg[$username]; |
|
126 | + } |
|
127 | 127 | |
128 | - $graph = ''; |
|
129 | - $img_file = ''; |
|
128 | + $graph = ''; |
|
129 | + $img_file = ''; |
|
130 | 130 | |
131 | - if (is_array($usernames) && count($usernames) > 0) { |
|
131 | + if (is_array($usernames) && count($usernames) > 0) { |
|
132 | 132 | |
133 | 133 | // Defining data |
134 | 134 | $dataSet = new pData(); |
@@ -233,19 +233,19 @@ discard block |
||
233 | 233 | $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash; |
234 | 234 | } |
235 | 235 | $graph = '<img src="' . $imgPath . '" >'; |
236 | - } else { |
|
237 | - $graph = '<p>'.api_convert_encoding(get_lang('GraphicNotAvailable'),'UTF-8').'</p>'; |
|
238 | - } |
|
236 | + } else { |
|
237 | + $graph = '<p>'.api_convert_encoding(get_lang('GraphicNotAvailable'),'UTF-8').'</p>'; |
|
238 | + } |
|
239 | 239 | |
240 | - return $graph; |
|
241 | - } |
|
240 | + return $graph; |
|
241 | + } |
|
242 | 242 | |
243 | 243 | /** |
244 | - * Get number of students |
|
245 | - * @return int |
|
246 | - */ |
|
247 | - function get_number_of_students() |
|
244 | + * Get number of students |
|
245 | + * @return int |
|
246 | + */ |
|
247 | + function get_number_of_students() |
|
248 | 248 | { |
249 | - return count($this->students); |
|
250 | - } |
|
249 | + return count($this->students); |
|
250 | + } |
|
251 | 251 | } |
@@ -29,15 +29,15 @@ discard block |
||
29 | 29 | /** |
30 | 30 | * Constructor |
31 | 31 | */ |
32 | - public function __construct ($user_id) |
|
32 | + public function __construct($user_id) |
|
33 | 33 | { |
34 | - $this->user_id = $user_id; |
|
35 | - $this->path = 'block_student_graph'; |
|
34 | + $this->user_id = $user_id; |
|
35 | + $this->path = 'block_student_graph'; |
|
36 | 36 | if ($this->is_block_visible_for_user($user_id)) { |
37 | 37 | /*if (api_is_platform_admin()) { |
38 | 38 | $this->students = UserManager::get_user_list(array('status' => STUDENT)); |
39 | 39 | } else if (api_is_drh()) {*/ |
40 | - $this->students = UserManager::get_users_followed_by_drh($user_id, STUDENT); |
|
40 | + $this->students = UserManager::get_users_followed_by_drh($user_id, STUDENT); |
|
41 | 41 | //} |
42 | 42 | } |
43 | 43 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | $html = '<div class="panel panel-default" id="intro"> |
76 | 76 | <div class="panel-heading"> |
77 | 77 | '.get_lang('StudentsInformationsGraph').' |
78 | - <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'"> |
|
78 | + <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'"> |
|
79 | 79 | <em class="fa fa-times"></em> |
80 | 80 | </a></div> |
81 | 81 | </div> |
@@ -155,9 +155,9 @@ discard block |
||
155 | 155 | $myCache = new pCache(array('CacheFolder' => substr($cachePath, 0, strlen($cachePath) - 1))); |
156 | 156 | $chartHash = $myCache->getHash($dataSet); |
157 | 157 | if ($myCache->isInCache($chartHash)) { |
158 | - $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash; |
|
158 | + $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash; |
|
159 | 159 | $myCache->saveFromCache($chartHash, $imgPath); |
160 | - $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash; |
|
160 | + $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash; |
|
161 | 161 | } else { |
162 | 162 | |
163 | 163 | $maxCounts = max(count($usernames), count($faults)); |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | /* Set the default font */ |
183 | 183 | $myPicture->setFontProperties( |
184 | 184 | array( |
185 | - 'FontName' => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf', |
|
185 | + 'FontName' => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf', |
|
186 | 186 | 'FontSize' => 10 |
187 | 187 | ) |
188 | 188 | ); |
@@ -228,13 +228,13 @@ discard block |
||
228 | 228 | |
229 | 229 | /* Write and save into cache */ |
230 | 230 | $myCache->writeToCache($chartHash, $myPicture); |
231 | - $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash; |
|
231 | + $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash; |
|
232 | 232 | $myCache->saveFromCache($chartHash, $imgPath); |
233 | - $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash; |
|
233 | + $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash; |
|
234 | 234 | } |
235 | - $graph = '<img src="' . $imgPath . '" >'; |
|
235 | + $graph = '<img src="'.$imgPath.'" >'; |
|
236 | 236 | } else { |
237 | - $graph = '<p>'.api_convert_encoding(get_lang('GraphicNotAvailable'),'UTF-8').'</p>'; |
|
237 | + $graph = '<p>'.api_convert_encoding(get_lang('GraphicNotAvailable'), 'UTF-8').'</p>'; |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | return $graph; |
@@ -27,10 +27,10 @@ discard block |
||
27 | 27 | /** |
28 | 28 | * Controller |
29 | 29 | */ |
30 | - public function __construct ($user_id) |
|
30 | + public function __construct($user_id) |
|
31 | 31 | { |
32 | - $this->user_id = $user_id; |
|
33 | - $this->path = 'block_teacher'; |
|
32 | + $this->user_id = $user_id; |
|
33 | + $this->path = 'block_teacher'; |
|
34 | 34 | if ($this->is_block_visible_for_user($user_id)) { |
35 | 35 | $this->teachers = UserManager::get_users_followed_by_drh($user_id, COURSEMANAGER); |
36 | 36 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | <div class="panel panel-default" id="intro"> |
70 | 70 | <div class="panel-heading"> |
71 | 71 | '.get_lang('TeachersInformationsList').' |
72 | - <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'"> |
|
72 | + <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'"> |
|
73 | 73 | <em class="fa fa-times"></em> |
74 | 74 | </a></div> |
75 | 75 | </div> |
@@ -112,18 +112,18 @@ discard block |
||
112 | 112 | |
113 | 113 | $teacher_id = $teacher['user_id']; |
114 | 114 | $firstname = $teacher['firstname']; |
115 | - $lastname = $teacher['lastname']; |
|
116 | - $username = $teacher['username']; |
|
115 | + $lastname = $teacher['lastname']; |
|
116 | + $username = $teacher['username']; |
|
117 | 117 | |
118 | 118 | $time_on_platform = api_time_to_hms(Tracking :: get_time_spent_on_the_platform($teacher_id)); |
119 | 119 | $last_connection = Tracking :: get_last_connection_date($teacher_id); |
120 | 120 | |
121 | - if ($i%2 == 0) $class_tr = 'row_odd'; |
|
121 | + if ($i % 2 == 0) $class_tr = 'row_odd'; |
|
122 | 122 | else $class_tr = 'row_even'; |
123 | 123 | |
124 | 124 | $teachers_table .= ' |
125 | 125 | <tr class="'.$class_tr.'"> |
126 | - <td>'.api_get_person_name($firstname,$lastname).' ('.$username.')</td> |
|
126 | + <td>'.api_get_person_name($firstname, $lastname).' ('.$username.')</td> |
|
127 | 127 | <td align="right">'.$time_on_platform.'</td> |
128 | 128 | <td align="right">'.$last_connection.'</td> |
129 | 129 | </tr> |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $teachers_table = null; |
156 | 156 | if (count($teachers) > 0) { |
157 | 157 | $a_last_week = get_last_week(); |
158 | - $last_week = date('Y-m-d',$a_last_week[0]).' '.get_lang('To').' '.date('Y-m-d', $a_last_week[6]); |
|
158 | + $last_week = date('Y-m-d', $a_last_week[0]).' '.get_lang('To').' '.date('Y-m-d', $a_last_week[6]); |
|
159 | 159 | |
160 | 160 | $teachers_table .= '<table class="data_table" width:"95%">'; |
161 | 161 | $teachers_table .= ' |
@@ -171,13 +171,13 @@ discard block |
||
171 | 171 | $teacher_id = $teacher['user_id']; |
172 | 172 | $firstname = $teacher['firstname']; |
173 | 173 | $lastname = $teacher['lastname']; |
174 | - $username = $teacher['username']; |
|
175 | - $time_on_platform = api_time_to_hms(Tracking :: get_time_spent_on_the_platform($teacher_id,true)); |
|
174 | + $username = $teacher['username']; |
|
175 | + $time_on_platform = api_time_to_hms(Tracking :: get_time_spent_on_the_platform($teacher_id, true)); |
|
176 | 176 | |
177 | - if ($i%2 == 0) $class_tr = 'row_odd'; |
|
177 | + if ($i % 2 == 0) $class_tr = 'row_odd'; |
|
178 | 178 | else $class_tr = 'row_even'; |
179 | 179 | $teachers_table .= '<tr class="'.$class_tr.'"> |
180 | - <td>'.api_get_person_name($firstname,$lastname).' ('.$username.')</td> |
|
180 | + <td>'.api_get_person_name($firstname, $lastname).' ('.$username.')</td> |
|
181 | 181 | <td align="right">'.$time_on_platform.'</td> |
182 | 182 | </tr>'; |
183 | 183 |
@@ -118,8 +118,11 @@ discard block |
||
118 | 118 | $time_on_platform = api_time_to_hms(Tracking :: get_time_spent_on_the_platform($teacher_id)); |
119 | 119 | $last_connection = Tracking :: get_last_connection_date($teacher_id); |
120 | 120 | |
121 | - if ($i%2 == 0) $class_tr = 'row_odd'; |
|
122 | - else $class_tr = 'row_even'; |
|
121 | + if ($i%2 == 0) { |
|
122 | + $class_tr = 'row_odd'; |
|
123 | + } else { |
|
124 | + $class_tr = 'row_even'; |
|
125 | + } |
|
123 | 126 | |
124 | 127 | $teachers_table .= ' |
125 | 128 | <tr class="'.$class_tr.'"> |
@@ -174,8 +177,11 @@ discard block |
||
174 | 177 | $username = $teacher['username']; |
175 | 178 | $time_on_platform = api_time_to_hms(Tracking :: get_time_spent_on_the_platform($teacher_id,true)); |
176 | 179 | |
177 | - if ($i%2 == 0) $class_tr = 'row_odd'; |
|
178 | - else $class_tr = 'row_even'; |
|
180 | + if ($i%2 == 0) { |
|
181 | + $class_tr = 'row_odd'; |
|
182 | + } else { |
|
183 | + $class_tr = 'row_even'; |
|
184 | + } |
|
179 | 185 | $teachers_table .= '<tr class="'.$class_tr.'"> |
180 | 186 | <td>'.api_get_person_name($firstname,$lastname).' ('.$username.')</td> |
181 | 187 | <td align="right">'.$time_on_platform.'</td> |
@@ -24,32 +24,32 @@ discard block |
||
24 | 24 | private $path; |
25 | 25 | private $permission = array(DRH); |
26 | 26 | |
27 | - /** |
|
28 | - * Controller |
|
29 | - */ |
|
27 | + /** |
|
28 | + * Controller |
|
29 | + */ |
|
30 | 30 | public function __construct ($user_id) |
31 | 31 | { |
32 | - $this->user_id = $user_id; |
|
33 | - $this->path = 'block_teacher'; |
|
34 | - if ($this->is_block_visible_for_user($user_id)) { |
|
35 | - $this->teachers = UserManager::get_users_followed_by_drh($user_id, COURSEMANAGER); |
|
36 | - } |
|
32 | + $this->user_id = $user_id; |
|
33 | + $this->path = 'block_teacher'; |
|
34 | + if ($this->is_block_visible_for_user($user_id)) { |
|
35 | + $this->teachers = UserManager::get_users_followed_by_drh($user_id, COURSEMANAGER); |
|
36 | + } |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
40 | - * This method check if a user is allowed to see the block inside dashboard interface |
|
41 | - * @param int User id |
|
42 | - * @return bool Is block visible for user |
|
43 | - */ |
|
40 | + * This method check if a user is allowed to see the block inside dashboard interface |
|
41 | + * @param int User id |
|
42 | + * @return bool Is block visible for user |
|
43 | + */ |
|
44 | 44 | public function is_block_visible_for_user($user_id) |
45 | 45 | { |
46 | - $user_info = api_get_user_info($user_id); |
|
47 | - $user_status = $user_info['status']; |
|
48 | - $is_block_visible_for_user = false; |
|
49 | - if (UserManager::is_admin($user_id) || in_array($user_status, $this->permission)) { |
|
50 | - $is_block_visible_for_user = true; |
|
51 | - } |
|
52 | - return $is_block_visible_for_user; |
|
46 | + $user_info = api_get_user_info($user_id); |
|
47 | + $user_status = $user_info['status']; |
|
48 | + $is_block_visible_for_user = false; |
|
49 | + if (UserManager::is_admin($user_id) || in_array($user_status, $this->permission)) { |
|
50 | + $is_block_visible_for_user = true; |
|
51 | + } |
|
52 | + return $is_block_visible_for_user; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -60,12 +60,12 @@ discard block |
||
60 | 60 | public function get_block() |
61 | 61 | { |
62 | 62 | |
63 | - global $charset; |
|
64 | - $column = 1; |
|
65 | - $data = array(); |
|
66 | - $teacher_content_html = $this->get_teachers_content_html_for_drh(); |
|
63 | + global $charset; |
|
64 | + $column = 1; |
|
65 | + $data = array(); |
|
66 | + $teacher_content_html = $this->get_teachers_content_html_for_drh(); |
|
67 | 67 | |
68 | - $html = ' |
|
68 | + $html = ' |
|
69 | 69 | <div class="panel panel-default" id="intro"> |
70 | 70 | <div class="panel-heading"> |
71 | 71 | '.get_lang('TeachersInformationsList').' |
@@ -79,27 +79,27 @@ discard block |
||
79 | 79 | </div> |
80 | 80 | '; |
81 | 81 | |
82 | - $data['column'] = $column; |
|
83 | - $data['content_html'] = $html; |
|
82 | + $data['column'] = $column; |
|
83 | + $data['content_html'] = $html; |
|
84 | 84 | |
85 | - return $data; |
|
85 | + return $data; |
|
86 | 86 | |
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
90 | - * This method return a content html, it's used inside get_block method for showing it inside dashboard interface |
|
91 | - * @return string content html |
|
92 | - */ |
|
90 | + * This method return a content html, it's used inside get_block method for showing it inside dashboard interface |
|
91 | + * @return string content html |
|
92 | + */ |
|
93 | 93 | public function get_teachers_content_html_for_platform_admin() |
94 | 94 | { |
95 | - $teachers = $this->teachers; |
|
96 | - //$content = '<div style="margin:10px;">'; |
|
97 | - $content = '<h4>'.get_lang('YourTeachers').'</h4>'; |
|
95 | + $teachers = $this->teachers; |
|
96 | + //$content = '<div style="margin:10px;">'; |
|
97 | + $content = '<h4>'.get_lang('YourTeachers').'</h4>'; |
|
98 | 98 | |
99 | 99 | $teachers_table = null; |
100 | - if (count($teachers) > 0) { |
|
101 | - $teachers_table .= '<table class="data_table" width:"95%">'; |
|
102 | - $teachers_table .= ' |
|
100 | + if (count($teachers) > 0) { |
|
101 | + $teachers_table .= '<table class="data_table" width:"95%">'; |
|
102 | + $teachers_table .= ' |
|
103 | 103 | <tr> |
104 | 104 | <th>'.get_lang('User').'</th> |
105 | 105 | <th>'.get_lang('TimeSpentOnThePlatform').'</th> |
@@ -107,103 +107,103 @@ discard block |
||
107 | 107 | </tr> |
108 | 108 | '; |
109 | 109 | |
110 | - $i = 1; |
|
111 | - foreach ($teachers as $teacher) { |
|
110 | + $i = 1; |
|
111 | + foreach ($teachers as $teacher) { |
|
112 | 112 | |
113 | - $teacher_id = $teacher['user_id']; |
|
114 | - $firstname = $teacher['firstname']; |
|
115 | - $lastname = $teacher['lastname']; |
|
116 | - $username = $teacher['username']; |
|
113 | + $teacher_id = $teacher['user_id']; |
|
114 | + $firstname = $teacher['firstname']; |
|
115 | + $lastname = $teacher['lastname']; |
|
116 | + $username = $teacher['username']; |
|
117 | 117 | |
118 | - $time_on_platform = api_time_to_hms(Tracking :: get_time_spent_on_the_platform($teacher_id)); |
|
119 | - $last_connection = Tracking :: get_last_connection_date($teacher_id); |
|
118 | + $time_on_platform = api_time_to_hms(Tracking :: get_time_spent_on_the_platform($teacher_id)); |
|
119 | + $last_connection = Tracking :: get_last_connection_date($teacher_id); |
|
120 | 120 | |
121 | - if ($i%2 == 0) $class_tr = 'row_odd'; |
|
122 | - else $class_tr = 'row_even'; |
|
121 | + if ($i%2 == 0) $class_tr = 'row_odd'; |
|
122 | + else $class_tr = 'row_even'; |
|
123 | 123 | |
124 | - $teachers_table .= ' |
|
124 | + $teachers_table .= ' |
|
125 | 125 | <tr class="'.$class_tr.'"> |
126 | 126 | <td>'.api_get_person_name($firstname,$lastname).' ('.$username.')</td> |
127 | 127 | <td align="right">'.$time_on_platform.'</td> |
128 | 128 | <td align="right">'.$last_connection.'</td> |
129 | 129 | </tr> |
130 | 130 | '; |
131 | - $i++; |
|
132 | - } |
|
133 | - $teachers_table .= '</table>'; |
|
134 | - } else { |
|
135 | - $teachers_table .= get_lang('ThereIsNoInformationAboutYourTeachers'); |
|
136 | - } |
|
131 | + $i++; |
|
132 | + } |
|
133 | + $teachers_table .= '</table>'; |
|
134 | + } else { |
|
135 | + $teachers_table .= get_lang('ThereIsNoInformationAboutYourTeachers'); |
|
136 | + } |
|
137 | 137 | |
138 | - $content .= $teachers_table; |
|
138 | + $content .= $teachers_table; |
|
139 | 139 | |
140 | - if (count($teachers) > 0) { |
|
141 | - $content .= '<div style="text-align:right;margin-top:10px;"> |
|
140 | + if (count($teachers) > 0) { |
|
141 | + $content .= '<div style="text-align:right;margin-top:10px;"> |
|
142 | 142 | <a href="'.api_get_path(WEB_CODE_PATH).'mySpace/index.php?view=admin">'.get_lang('SeeMore').'</a></div>'; |
143 | - } |
|
143 | + } |
|
144 | 144 | |
145 | - //$content .= '</div>'; |
|
145 | + //$content .= '</div>'; |
|
146 | 146 | |
147 | - return $content; |
|
148 | - } |
|
147 | + return $content; |
|
148 | + } |
|
149 | 149 | |
150 | - public function get_teachers_content_html_for_drh() |
|
150 | + public function get_teachers_content_html_for_drh() |
|
151 | 151 | { |
152 | - $teachers = $this->teachers; |
|
153 | - //$content = '<div style="margin:10px;">'; |
|
154 | - $content = '<h4>'.get_lang('YourTeachers').'</h4>'; |
|
152 | + $teachers = $this->teachers; |
|
153 | + //$content = '<div style="margin:10px;">'; |
|
154 | + $content = '<h4>'.get_lang('YourTeachers').'</h4>'; |
|
155 | 155 | $teachers_table = null; |
156 | - if (count($teachers) > 0) { |
|
157 | - $a_last_week = get_last_week(); |
|
158 | - $last_week = date('Y-m-d',$a_last_week[0]).' '.get_lang('To').' '.date('Y-m-d', $a_last_week[6]); |
|
156 | + if (count($teachers) > 0) { |
|
157 | + $a_last_week = get_last_week(); |
|
158 | + $last_week = date('Y-m-d',$a_last_week[0]).' '.get_lang('To').' '.date('Y-m-d', $a_last_week[6]); |
|
159 | 159 | |
160 | - $teachers_table .= '<table class="data_table" width:"95%">'; |
|
161 | - $teachers_table .= ' |
|
160 | + $teachers_table .= '<table class="data_table" width:"95%">'; |
|
161 | + $teachers_table .= ' |
|
162 | 162 | <tr> |
163 | 163 | <th>'.get_lang('User').'</th> |
164 | 164 | <th>'.get_lang('TimeSpentLastWeek').'<br />'.$last_week.'</th> |
165 | 165 | </tr> |
166 | 166 | '; |
167 | 167 | |
168 | - $i = 1; |
|
169 | - foreach ($teachers as $teacher) { |
|
168 | + $i = 1; |
|
169 | + foreach ($teachers as $teacher) { |
|
170 | 170 | |
171 | - $teacher_id = $teacher['user_id']; |
|
172 | - $firstname = $teacher['firstname']; |
|
173 | - $lastname = $teacher['lastname']; |
|
174 | - $username = $teacher['username']; |
|
175 | - $time_on_platform = api_time_to_hms(Tracking :: get_time_spent_on_the_platform($teacher_id,true)); |
|
171 | + $teacher_id = $teacher['user_id']; |
|
172 | + $firstname = $teacher['firstname']; |
|
173 | + $lastname = $teacher['lastname']; |
|
174 | + $username = $teacher['username']; |
|
175 | + $time_on_platform = api_time_to_hms(Tracking :: get_time_spent_on_the_platform($teacher_id,true)); |
|
176 | 176 | |
177 | - if ($i%2 == 0) $class_tr = 'row_odd'; |
|
178 | - else $class_tr = 'row_even'; |
|
179 | - $teachers_table .= '<tr class="'.$class_tr.'"> |
|
177 | + if ($i%2 == 0) $class_tr = 'row_odd'; |
|
178 | + else $class_tr = 'row_even'; |
|
179 | + $teachers_table .= '<tr class="'.$class_tr.'"> |
|
180 | 180 | <td>'.api_get_person_name($firstname,$lastname).' ('.$username.')</td> |
181 | 181 | <td align="right">'.$time_on_platform.'</td> |
182 | 182 | </tr>'; |
183 | 183 | |
184 | - $i++; |
|
185 | - } |
|
186 | - $teachers_table .= '</table>'; |
|
187 | - } else { |
|
188 | - $teachers_table .= get_lang('ThereIsNoInformationAboutYourTeachers'); |
|
189 | - } |
|
184 | + $i++; |
|
185 | + } |
|
186 | + $teachers_table .= '</table>'; |
|
187 | + } else { |
|
188 | + $teachers_table .= get_lang('ThereIsNoInformationAboutYourTeachers'); |
|
189 | + } |
|
190 | 190 | |
191 | - $content .= $teachers_table; |
|
191 | + $content .= $teachers_table; |
|
192 | 192 | |
193 | - if (count($teachers) > 0) { |
|
194 | - $content .= '<div style="text-align:right;margin-top:10px;"><a href="'.api_get_path(WEB_CODE_PATH).'mySpace/teachers.php">'.get_lang('SeeMore').'</a></div>'; |
|
195 | - } |
|
196 | - //$content .= '</div>'; |
|
193 | + if (count($teachers) > 0) { |
|
194 | + $content .= '<div style="text-align:right;margin-top:10px;"><a href="'.api_get_path(WEB_CODE_PATH).'mySpace/teachers.php">'.get_lang('SeeMore').'</a></div>'; |
|
195 | + } |
|
196 | + //$content .= '</div>'; |
|
197 | 197 | |
198 | - return $content; |
|
199 | - } |
|
198 | + return $content; |
|
199 | + } |
|
200 | 200 | |
201 | 201 | /** |
202 | - * Get number of teachers |
|
203 | - * @return int |
|
204 | - */ |
|
205 | - function get_number_of_teachers() |
|
202 | + * Get number of teachers |
|
203 | + * @return int |
|
204 | + */ |
|
205 | + function get_number_of_teachers() |
|
206 | 206 | { |
207 | - return count($this->teachers); |
|
208 | - } |
|
207 | + return count($this->teachers); |
|
208 | + } |
|
209 | 209 | } |
@@ -21,12 +21,12 @@ discard block |
||
21 | 21 | /** |
22 | 22 | * Constructor |
23 | 23 | */ |
24 | - public function __construct ($user_id) |
|
24 | + public function __construct($user_id) |
|
25 | 25 | { |
26 | - $this->user_id = $user_id; |
|
27 | - $this->path = 'block_student'; |
|
26 | + $this->user_id = $user_id; |
|
27 | + $this->path = 'block_student'; |
|
28 | 28 | if ($this->is_block_visible_for_user($user_id)) { |
29 | - $this->students = UserManager::get_users_followed_by_drh($user_id, STUDENT); |
|
29 | + $this->students = UserManager::get_users_followed_by_drh($user_id, STUDENT); |
|
30 | 30 | } |
31 | 31 | } |
32 | 32 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $html = '<div class="panel panel-default" id="intro"> |
62 | 62 | <div class="panel-heading"> |
63 | 63 | '.get_lang('StudentsInformationsList').' |
64 | - <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'"> |
|
64 | + <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'"> |
|
65 | 65 | <em class="fa fa-times"></em> |
66 | 66 | </a> |
67 | 67 | </div> |
@@ -102,9 +102,9 @@ discard block |
||
102 | 102 | |
103 | 103 | $courses_by_user = CourseManager::get_courses_list_by_user_id($student['user_id'], true); |
104 | 104 | $count_courses = count($courses_by_user); |
105 | - $rowspan = $count_courses?$count_courses+1:2; |
|
105 | + $rowspan = $count_courses ? $count_courses + 1 : 2; |
|
106 | 106 | |
107 | - if ($i%2 == 0) { |
|
107 | + if ($i % 2 == 0) { |
|
108 | 108 | $style = ' style="background-color:#F2F2F2" '; |
109 | 109 | } else { |
110 | 110 | $style = ' style="background-color:#FFF" '; |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | $student_id = $student['user_id']; |
170 | 170 | $firstname = $student['firstname']; |
171 | 171 | $lastname = $student['lastname']; |
172 | - $username = $student['username']; |
|
172 | + $username = $student['username']; |
|
173 | 173 | |
174 | 174 | |
175 | 175 | // get average of faults in attendances by student |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | $cats = Category::load(null, null, $course_code, null, null, null, false); |
189 | 189 | $scoretotal = array(); |
190 | 190 | if (isset($cats) && isset($cats[0])) { |
191 | - $scoretotal= $cats[0]->calc_score($student_id, null, $course_code); |
|
191 | + $scoretotal = $cats[0]->calc_score($student_id, null, $course_code); |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | if (!empty($scoretotal)) { |
@@ -198,10 +198,10 @@ discard block |
||
198 | 198 | } |
199 | 199 | |
200 | 200 | if (!empty($weight)) { |
201 | - $evaluations_avg = '<a title="'.get_lang('GoToStudentDetails').'" href="'.api_get_path(WEB_CODE_PATH).'mySpace/myStudents.php?student='.$student_id.'">'.round($score,2).'/'.round($weight,2).'('.round(($score / $weight) * 100,2) . ' %)</a>'; |
|
201 | + $evaluations_avg = '<a title="'.get_lang('GoToStudentDetails').'" href="'.api_get_path(WEB_CODE_PATH).'mySpace/myStudents.php?student='.$student_id.'">'.round($score, 2).'/'.round($weight, 2).'('.round(($score / $weight) * 100, 2).' %)</a>'; |
|
202 | 202 | } |
203 | 203 | |
204 | - if ($i%2 == 0) { |
|
204 | + if ($i % 2 == 0) { |
|
205 | 205 | $class_tr = 'row_odd'; |
206 | 206 | } else { |
207 | 207 | $class_tr = 'row_even'; |
@@ -14,36 +14,36 @@ discard block |
||
14 | 14 | class BlockStudent extends Block |
15 | 15 | { |
16 | 16 | private $user_id; |
17 | - private $students; |
|
18 | - private $path; |
|
19 | - private $permission = array(DRH); |
|
17 | + private $students; |
|
18 | + private $path; |
|
19 | + private $permission = array(DRH); |
|
20 | 20 | |
21 | - /** |
|
22 | - * Constructor |
|
23 | - */ |
|
21 | + /** |
|
22 | + * Constructor |
|
23 | + */ |
|
24 | 24 | public function __construct ($user_id) |
25 | 25 | { |
26 | - $this->user_id = $user_id; |
|
27 | - $this->path = 'block_student'; |
|
28 | - if ($this->is_block_visible_for_user($user_id)) { |
|
26 | + $this->user_id = $user_id; |
|
27 | + $this->path = 'block_student'; |
|
28 | + if ($this->is_block_visible_for_user($user_id)) { |
|
29 | 29 | $this->students = UserManager::get_users_followed_by_drh($user_id, STUDENT); |
30 | - } |
|
30 | + } |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
34 | - * This method check if a user is allowed to see the block inside dashboard interface |
|
35 | - * @param int User id |
|
36 | - * @return bool Is block visible for user |
|
37 | - */ |
|
34 | + * This method check if a user is allowed to see the block inside dashboard interface |
|
35 | + * @param int User id |
|
36 | + * @return bool Is block visible for user |
|
37 | + */ |
|
38 | 38 | public function is_block_visible_for_user($user_id) |
39 | 39 | { |
40 | - $user_info = api_get_user_info($user_id); |
|
41 | - $user_status = $user_info['status']; |
|
42 | - $is_block_visible_for_user = false; |
|
43 | - if (UserManager::is_admin($user_id) || in_array($user_status, $this->permission)) { |
|
44 | - $is_block_visible_for_user = true; |
|
45 | - } |
|
46 | - return $is_block_visible_for_user; |
|
40 | + $user_info = api_get_user_info($user_id); |
|
41 | + $user_status = $user_info['status']; |
|
42 | + $is_block_visible_for_user = false; |
|
43 | + if (UserManager::is_admin($user_id) || in_array($user_status, $this->permission)) { |
|
44 | + $is_block_visible_for_user = true; |
|
45 | + } |
|
46 | + return $is_block_visible_for_user; |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
@@ -53,12 +53,12 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function get_block() |
55 | 55 | { |
56 | - global $charset; |
|
57 | - $column = 1; |
|
58 | - $data = array(); |
|
56 | + global $charset; |
|
57 | + $column = 1; |
|
58 | + $data = array(); |
|
59 | 59 | |
60 | 60 | $student_content_html = $this->get_students_content_html_for_drh(); |
61 | - $html = '<div class="panel panel-default" id="intro"> |
|
61 | + $html = '<div class="panel panel-default" id="intro"> |
|
62 | 62 | <div class="panel-heading"> |
63 | 63 | '.get_lang('StudentsInformationsList').' |
64 | 64 | <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'"> |
@@ -70,24 +70,24 @@ discard block |
||
70 | 70 | '.$student_content_html.' |
71 | 71 | </div> |
72 | 72 | </div>'; |
73 | - $data['column'] = $column; |
|
74 | - $data['content_html'] = $html; |
|
75 | - return $data; |
|
73 | + $data['column'] = $column; |
|
74 | + $data['content_html'] = $html; |
|
75 | + return $data; |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
79 | - * This method return a content html, it's used inside get_block method for showing it inside dashboard interface |
|
80 | - * @return string content html |
|
81 | - */ |
|
79 | + * This method return a content html, it's used inside get_block method for showing it inside dashboard interface |
|
80 | + * @return string content html |
|
81 | + */ |
|
82 | 82 | public function get_students_content_html_for_platform_admin() |
83 | 83 | { |
84 | - $students = $this->students; |
|
85 | - //$content = '<div style="margin:10px;">'; |
|
86 | - $content = '<h4>'.get_lang('YourStudents').'</h4>'; |
|
84 | + $students = $this->students; |
|
85 | + //$content = '<div style="margin:10px;">'; |
|
86 | + $content = '<h4>'.get_lang('YourStudents').'</h4>'; |
|
87 | 87 | $students_table = null; |
88 | - if (count($students) > 0) { |
|
89 | - $students_table .= '<table class="data_table">'; |
|
90 | - $students_table .= '<tr> |
|
88 | + if (count($students) > 0) { |
|
89 | + $students_table .= '<table class="data_table">'; |
|
90 | + $students_table .= '<tr> |
|
91 | 91 | <th width="10%" rowspan="2">'.get_lang('FirstName').'</th> |
92 | 92 | <th width="10%" rowspan="2">'.get_lang('LastName').'</th> |
93 | 93 | <th width="30%" colspan="2">'.get_lang('CourseInformation').'</th> |
@@ -97,146 +97,146 @@ discard block |
||
97 | 97 | <th width="10%">'.get_lang('Time').'</th> |
98 | 98 | </tr>'; |
99 | 99 | |
100 | - $i = 1; |
|
101 | - foreach ($students as $student) { |
|
100 | + $i = 1; |
|
101 | + foreach ($students as $student) { |
|
102 | 102 | |
103 | - $courses_by_user = CourseManager::get_courses_list_by_user_id($student['user_id'], true); |
|
104 | - $count_courses = count($courses_by_user); |
|
105 | - $rowspan = $count_courses?$count_courses+1:2; |
|
103 | + $courses_by_user = CourseManager::get_courses_list_by_user_id($student['user_id'], true); |
|
104 | + $count_courses = count($courses_by_user); |
|
105 | + $rowspan = $count_courses?$count_courses+1:2; |
|
106 | 106 | |
107 | - if ($i%2 == 0) { |
|
107 | + if ($i%2 == 0) { |
|
108 | 108 | $style = ' style="background-color:#F2F2F2" '; |
109 | 109 | } else { |
110 | 110 | $style = ' style="background-color:#FFF" '; |
111 | 111 | } |
112 | 112 | |
113 | - $students_table .= '<tr '.$style.'> |
|
113 | + $students_table .= '<tr '.$style.'> |
|
114 | 114 | <td rowspan="'.$rowspan.'">'.$student['firstname'].'</td> |
115 | 115 | <td rowspan="'.$rowspan.'">'.$student['lastname'].'</td> |
116 | 116 | </tr>'; |
117 | 117 | |
118 | - // courses information about the student |
|
119 | - if (!empty($courses_by_user)) { |
|
120 | - foreach ($courses_by_user as $course) { |
|
121 | - $course_code = $course['code']; |
|
122 | - $courseInfo = api_get_course_info($course_code); |
|
123 | - $courseId = $courseInfo['real_id']; |
|
124 | - $course_title = $course['title']; |
|
125 | - $time = api_time_to_hms(Tracking :: get_time_spent_on_the_course($student['user_id'], $courseId)); |
|
126 | - $students_table .= '<tr '.$style.'> |
|
118 | + // courses information about the student |
|
119 | + if (!empty($courses_by_user)) { |
|
120 | + foreach ($courses_by_user as $course) { |
|
121 | + $course_code = $course['code']; |
|
122 | + $courseInfo = api_get_course_info($course_code); |
|
123 | + $courseId = $courseInfo['real_id']; |
|
124 | + $course_title = $course['title']; |
|
125 | + $time = api_time_to_hms(Tracking :: get_time_spent_on_the_course($student['user_id'], $courseId)); |
|
126 | + $students_table .= '<tr '.$style.'> |
|
127 | 127 | <td align="right">'.$course_title.'</td> |
128 | 128 | <td align="right">'.$time.'</td> |
129 | 129 | </tr>'; |
130 | - } |
|
131 | - } else { |
|
132 | - $students_table .= '<tr '.$style.'> |
|
130 | + } |
|
131 | + } else { |
|
132 | + $students_table .= '<tr '.$style.'> |
|
133 | 133 | <td align="center" colspan="2"><i>'.get_lang('Empty').'</i></td> |
134 | 134 | </tr>'; |
135 | - } |
|
136 | - $i++; |
|
137 | - } |
|
138 | - $students_table .= '</table>'; |
|
139 | - } else { |
|
140 | - $students_table .= get_lang('ThereIsNoInformationAboutYourStudents'); |
|
141 | - } |
|
142 | - |
|
143 | - $content .= $students_table; |
|
144 | - |
|
145 | - if (count($students) > 0) { |
|
146 | - $content .= '<div style="text-align:right;margin-top:10px;"><a href="'.api_get_path(WEB_CODE_PATH).'mySpace/index.php?view=admin&display=useroverview">'.get_lang('SeeMore').'</a></div>'; |
|
147 | - } |
|
148 | - //$content .= '</div>'; |
|
149 | - |
|
150 | - return $content; |
|
151 | - } |
|
152 | - |
|
153 | - public function get_students_content_html_for_drh() { |
|
154 | - $attendance = new Attendance(); |
|
155 | - $students = $this->students; |
|
156 | - //$content = '<div style="margin:5px;">'; |
|
157 | - $content = '<h4>'.get_lang('YourStudents').'</h4>'; |
|
135 | + } |
|
136 | + $i++; |
|
137 | + } |
|
138 | + $students_table .= '</table>'; |
|
139 | + } else { |
|
140 | + $students_table .= get_lang('ThereIsNoInformationAboutYourStudents'); |
|
141 | + } |
|
142 | + |
|
143 | + $content .= $students_table; |
|
144 | + |
|
145 | + if (count($students) > 0) { |
|
146 | + $content .= '<div style="text-align:right;margin-top:10px;"><a href="'.api_get_path(WEB_CODE_PATH).'mySpace/index.php?view=admin&display=useroverview">'.get_lang('SeeMore').'</a></div>'; |
|
147 | + } |
|
148 | + //$content .= '</div>'; |
|
149 | + |
|
150 | + return $content; |
|
151 | + } |
|
152 | + |
|
153 | + public function get_students_content_html_for_drh() { |
|
154 | + $attendance = new Attendance(); |
|
155 | + $students = $this->students; |
|
156 | + //$content = '<div style="margin:5px;">'; |
|
157 | + $content = '<h4>'.get_lang('YourStudents').'</h4>'; |
|
158 | 158 | $students_table = null; |
159 | - if (count($students) > 0) { |
|
160 | - $students_table .= '<table class="data_table">'; |
|
161 | - $students_table .= '<tr> |
|
159 | + if (count($students) > 0) { |
|
160 | + $students_table .= '<table class="data_table">'; |
|
161 | + $students_table .= '<tr> |
|
162 | 162 | <th>'.get_lang('User').'</th> |
163 | 163 | <th>'.get_lang('AttendancesFaults').'</th> |
164 | 164 | <th>'.get_lang('Evaluations').'</th> |
165 | 165 | </tr>'; |
166 | - $i = 1; |
|
167 | - foreach ($students as $student) { |
|
168 | - |
|
169 | - $student_id = $student['user_id']; |
|
170 | - $firstname = $student['firstname']; |
|
171 | - $lastname = $student['lastname']; |
|
172 | - $username = $student['username']; |
|
173 | - |
|
174 | - |
|
175 | - // get average of faults in attendances by student |
|
176 | - $results_faults_avg = $attendance->get_faults_average_inside_courses($student_id); |
|
177 | - if (!empty($results_faults_avg)) { |
|
178 | - $attendances_faults_avg = '<a title="'.get_lang('GoToStudentDetails').'" href="'.api_get_path(WEB_CODE_PATH).'mySpace/myStudents.php?student='.$student_id.'">'.$results_faults_avg['faults'].'/'.$results_faults_avg['total'].' ('.$results_faults_avg['porcent'].'%)</a>'; |
|
179 | - } else { |
|
180 | - $attendances_faults_avg = '0%'; |
|
181 | - } |
|
182 | - |
|
183 | - $courses_by_user = CourseManager::get_courses_list_by_user_id($student_id, true); |
|
184 | - $evaluations_avg = 0; |
|
185 | - $score = $weight = 0; |
|
186 | - foreach ($courses_by_user as $course) { |
|
187 | - $course_code = $course['code']; |
|
188 | - $cats = Category::load(null, null, $course_code, null, null, null, false); |
|
189 | - $scoretotal = array(); |
|
190 | - if (isset($cats) && isset($cats[0])) { |
|
191 | - $scoretotal= $cats[0]->calc_score($student_id, null, $course_code); |
|
192 | - } |
|
193 | - |
|
194 | - if (!empty($scoretotal)) { |
|
195 | - $score += $scoretotal[0]; |
|
196 | - $weight += $scoretotal[1]; |
|
197 | - } |
|
198 | - } |
|
199 | - |
|
200 | - if (!empty($weight)) { |
|
201 | - $evaluations_avg = '<a title="'.get_lang('GoToStudentDetails').'" href="'.api_get_path(WEB_CODE_PATH).'mySpace/myStudents.php?student='.$student_id.'">'.round($score,2).'/'.round($weight,2).'('.round(($score / $weight) * 100,2) . ' %)</a>'; |
|
202 | - } |
|
203 | - |
|
204 | - if ($i%2 == 0) { |
|
166 | + $i = 1; |
|
167 | + foreach ($students as $student) { |
|
168 | + |
|
169 | + $student_id = $student['user_id']; |
|
170 | + $firstname = $student['firstname']; |
|
171 | + $lastname = $student['lastname']; |
|
172 | + $username = $student['username']; |
|
173 | + |
|
174 | + |
|
175 | + // get average of faults in attendances by student |
|
176 | + $results_faults_avg = $attendance->get_faults_average_inside_courses($student_id); |
|
177 | + if (!empty($results_faults_avg)) { |
|
178 | + $attendances_faults_avg = '<a title="'.get_lang('GoToStudentDetails').'" href="'.api_get_path(WEB_CODE_PATH).'mySpace/myStudents.php?student='.$student_id.'">'.$results_faults_avg['faults'].'/'.$results_faults_avg['total'].' ('.$results_faults_avg['porcent'].'%)</a>'; |
|
179 | + } else { |
|
180 | + $attendances_faults_avg = '0%'; |
|
181 | + } |
|
182 | + |
|
183 | + $courses_by_user = CourseManager::get_courses_list_by_user_id($student_id, true); |
|
184 | + $evaluations_avg = 0; |
|
185 | + $score = $weight = 0; |
|
186 | + foreach ($courses_by_user as $course) { |
|
187 | + $course_code = $course['code']; |
|
188 | + $cats = Category::load(null, null, $course_code, null, null, null, false); |
|
189 | + $scoretotal = array(); |
|
190 | + if (isset($cats) && isset($cats[0])) { |
|
191 | + $scoretotal= $cats[0]->calc_score($student_id, null, $course_code); |
|
192 | + } |
|
193 | + |
|
194 | + if (!empty($scoretotal)) { |
|
195 | + $score += $scoretotal[0]; |
|
196 | + $weight += $scoretotal[1]; |
|
197 | + } |
|
198 | + } |
|
199 | + |
|
200 | + if (!empty($weight)) { |
|
201 | + $evaluations_avg = '<a title="'.get_lang('GoToStudentDetails').'" href="'.api_get_path(WEB_CODE_PATH).'mySpace/myStudents.php?student='.$student_id.'">'.round($score,2).'/'.round($weight,2).'('.round(($score / $weight) * 100,2) . ' %)</a>'; |
|
202 | + } |
|
203 | + |
|
204 | + if ($i%2 == 0) { |
|
205 | 205 | $class_tr = 'row_odd'; |
206 | 206 | } else { |
207 | 207 | $class_tr = 'row_even'; |
208 | 208 | } |
209 | - $students_table .= '<tr class="'.$class_tr.'"> |
|
209 | + $students_table .= '<tr class="'.$class_tr.'"> |
|
210 | 210 | <td>'.api_get_person_name($firstname, $lastname).' ('.$username.')</td> |
211 | 211 | <td>'.$attendances_faults_avg.'</td> |
212 | 212 | <td>'.$evaluations_avg.'</td> |
213 | 213 | </tr>'; |
214 | 214 | |
215 | - $i++; |
|
216 | - } |
|
217 | - $students_table .= '</table>'; |
|
218 | - } else { |
|
219 | - $students_table .= get_lang('ThereIsNoInformationAboutYourStudents'); |
|
220 | - } |
|
215 | + $i++; |
|
216 | + } |
|
217 | + $students_table .= '</table>'; |
|
218 | + } else { |
|
219 | + $students_table .= get_lang('ThereIsNoInformationAboutYourStudents'); |
|
220 | + } |
|
221 | 221 | |
222 | - $content .= $students_table; |
|
222 | + $content .= $students_table; |
|
223 | 223 | |
224 | - if (count($students) > 0) { |
|
225 | - $content .= '<div style="text-align:right;margin-top:10px;"> |
|
224 | + if (count($students) > 0) { |
|
225 | + $content .= '<div style="text-align:right;margin-top:10px;"> |
|
226 | 226 | <a href="'.api_get_path(WEB_CODE_PATH).'mySpace/index.php?view=admin&display=yourstudents">'.get_lang('SeeMore').'</a> |
227 | 227 | </div>'; |
228 | - } |
|
229 | - //$content .= '</div>'; |
|
228 | + } |
|
229 | + //$content .= '</div>'; |
|
230 | 230 | |
231 | - return $content; |
|
232 | - } |
|
231 | + return $content; |
|
232 | + } |
|
233 | 233 | |
234 | 234 | /** |
235 | - * Get number of students |
|
236 | - * @return int |
|
237 | - */ |
|
238 | - function get_number_of_students() |
|
235 | + * Get number of students |
|
236 | + * @return int |
|
237 | + */ |
|
238 | + function get_number_of_students() |
|
239 | 239 | { |
240 | - return count($this->students); |
|
241 | - } |
|
240 | + return count($this->students); |
|
241 | + } |
|
242 | 242 | } |
@@ -23,42 +23,42 @@ discard block |
||
23 | 23 | class BlockEvaluationGraph extends Block |
24 | 24 | { |
25 | 25 | private $user_id; |
26 | - private $courses; |
|
27 | - private $sessions; |
|
28 | - private $path; |
|
29 | - private $permission = array(DRH, SESSIONADMIN); |
|
30 | - |
|
31 | - /** |
|
32 | - * Constructor |
|
33 | - */ |
|
26 | + private $courses; |
|
27 | + private $sessions; |
|
28 | + private $path; |
|
29 | + private $permission = array(DRH, SESSIONADMIN); |
|
30 | + |
|
31 | + /** |
|
32 | + * Constructor |
|
33 | + */ |
|
34 | 34 | public function __construct($user_id) |
35 | 35 | { |
36 | - $this->path = 'block_evaluation_graph'; |
|
37 | - $this->user_id = $user_id; |
|
38 | - $this->bg_width = 450; |
|
39 | - $this->bg_height = 350; |
|
40 | - if ($this->is_block_visible_for_user($user_id)) { |
|
36 | + $this->path = 'block_evaluation_graph'; |
|
37 | + $this->user_id = $user_id; |
|
38 | + $this->bg_width = 450; |
|
39 | + $this->bg_height = 350; |
|
40 | + if ($this->is_block_visible_for_user($user_id)) { |
|
41 | 41 | if (!api_is_session_admin()) { |
42 | 42 | $this->courses = CourseManager::get_courses_followed_by_drh($user_id); |
43 | 43 | } |
44 | 44 | $this->sessions = SessionManager::get_sessions_followed_by_drh($user_id); |
45 | - } |
|
45 | + } |
|
46 | 46 | } |
47 | 47 | |
48 | - /** |
|
49 | - * This method check if a user is allowed to see the block inside dashboard interface |
|
50 | - * @param int User id |
|
51 | - * @return bool Is block visible for user |
|
52 | - */ |
|
48 | + /** |
|
49 | + * This method check if a user is allowed to see the block inside dashboard interface |
|
50 | + * @param int User id |
|
51 | + * @return bool Is block visible for user |
|
52 | + */ |
|
53 | 53 | public function is_block_visible_for_user($user_id) |
54 | 54 | { |
55 | - $user_info = api_get_user_info($user_id); |
|
56 | - $user_status = $user_info['status']; |
|
57 | - $is_block_visible_for_user = false; |
|
58 | - if (UserManager::is_admin($user_id) || in_array($user_status, $this->permission)) { |
|
59 | - $is_block_visible_for_user = true; |
|
60 | - } |
|
61 | - return $is_block_visible_for_user; |
|
55 | + $user_info = api_get_user_info($user_id); |
|
56 | + $user_status = $user_info['status']; |
|
57 | + $is_block_visible_for_user = false; |
|
58 | + if (UserManager::is_admin($user_id) || in_array($user_status, $this->permission)) { |
|
59 | + $is_block_visible_for_user = true; |
|
60 | + } |
|
61 | + return $is_block_visible_for_user; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
@@ -68,14 +68,14 @@ discard block |
||
68 | 68 | */ |
69 | 69 | public function get_block() |
70 | 70 | { |
71 | - global $charset; |
|
72 | - $column = 1; |
|
73 | - $data = array(); |
|
71 | + global $charset; |
|
72 | + $column = 1; |
|
73 | + $data = array(); |
|
74 | 74 | |
75 | - $evaluations_base_courses_graph = $this->get_evaluations_base_courses_graph(); |
|
76 | - $evaluations_courses_in_sessions_graph = $this->get_evaluations_courses_in_sessions_graph(); |
|
75 | + $evaluations_base_courses_graph = $this->get_evaluations_base_courses_graph(); |
|
76 | + $evaluations_courses_in_sessions_graph = $this->get_evaluations_courses_in_sessions_graph(); |
|
77 | 77 | |
78 | - $html = '<div class="panel panel-default" id="intro"> |
|
78 | + $html = '<div class="panel panel-default" id="intro"> |
|
79 | 79 | <div class="panel-heading"> |
80 | 80 | '.get_lang('EvaluationsGraph').' |
81 | 81 | <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'"> |
@@ -105,43 +105,43 @@ discard block |
||
105 | 105 | } |
106 | 106 | } |
107 | 107 | } |
108 | - $html .= '</div> |
|
108 | + $html .= '</div> |
|
109 | 109 | </div>'; |
110 | 110 | |
111 | - $data['column'] = $column; |
|
112 | - $data['content_html'] = $html; |
|
111 | + $data['column'] = $column; |
|
112 | + $data['content_html'] = $html; |
|
113 | 113 | |
114 | - return $data; |
|
115 | - } |
|
114 | + return $data; |
|
115 | + } |
|
116 | 116 | |
117 | 117 | /** |
118 | - * This method return a graph containing informations about evaluations |
|
118 | + * This method return a graph containing informations about evaluations |
|
119 | 119 | * inside base courses, it's used inside get_block method for showing |
120 | 120 | * it inside dashboard interface |
121 | - * @return string img html |
|
122 | - */ |
|
121 | + * @return string img html |
|
122 | + */ |
|
123 | 123 | public function get_evaluations_base_courses_graph() |
124 | 124 | { |
125 | - $graphs = array(); |
|
126 | - if (!empty($this->courses)) { |
|
127 | - $courses_code = array_keys($this->courses); |
|
128 | - foreach ($courses_code as $course_code) { |
|
129 | - $cats = Category::load(null, null, $course_code, null, null, null, false); |
|
130 | - |
|
131 | - if (isset($cats) && isset($cats[0])) { |
|
132 | - $alleval = $cats[0]->get_evaluations(null, true, $course_code); |
|
133 | - $alllinks = $cats[0]->get_links(null, true); |
|
134 | - $users = GradebookUtils::get_all_users($alleval, $alllinks); |
|
135 | - $datagen = new FlatViewDataGenerator ($users, $alleval, $alllinks); |
|
136 | - $evaluation_sumary = $datagen->get_evaluation_sumary_results(); |
|
137 | - if (!empty($evaluation_sumary)) { |
|
138 | - $items = array_keys($evaluation_sumary); |
|
139 | - $max = $min = $avg = array(); |
|
140 | - foreach ($evaluation_sumary as $evaluation) { |
|
141 | - $max[] = $evaluation['max']; |
|
125 | + $graphs = array(); |
|
126 | + if (!empty($this->courses)) { |
|
127 | + $courses_code = array_keys($this->courses); |
|
128 | + foreach ($courses_code as $course_code) { |
|
129 | + $cats = Category::load(null, null, $course_code, null, null, null, false); |
|
130 | + |
|
131 | + if (isset($cats) && isset($cats[0])) { |
|
132 | + $alleval = $cats[0]->get_evaluations(null, true, $course_code); |
|
133 | + $alllinks = $cats[0]->get_links(null, true); |
|
134 | + $users = GradebookUtils::get_all_users($alleval, $alllinks); |
|
135 | + $datagen = new FlatViewDataGenerator ($users, $alleval, $alllinks); |
|
136 | + $evaluation_sumary = $datagen->get_evaluation_sumary_results(); |
|
137 | + if (!empty($evaluation_sumary)) { |
|
138 | + $items = array_keys($evaluation_sumary); |
|
139 | + $max = $min = $avg = array(); |
|
140 | + foreach ($evaluation_sumary as $evaluation) { |
|
141 | + $max[] = $evaluation['max']; |
|
142 | 142 | $min[] = !empty($evaluation['min']) ? $evaluation['min'] : 0; |
143 | - $avg[] = $evaluation['avg']; |
|
144 | - } |
|
143 | + $avg[] = $evaluation['avg']; |
|
144 | + } |
|
145 | 145 | // Dataset definition |
146 | 146 | $dataSet = new pData(); |
147 | 147 | $dataSet->addPoints($min, 'Serie3'); |
@@ -283,43 +283,43 @@ discard block |
||
283 | 283 | if (!empty($imgPath)) { |
284 | 284 | $courses_graph[$course_code] = '<img src="' . $imgPath . '">'; |
285 | 285 | } |
286 | - } |
|
287 | - } |
|
288 | - } // end for |
|
289 | - } |
|
290 | - return $graphs; |
|
291 | - } |
|
292 | - |
|
293 | - /** |
|
294 | - * This method return a graph containing information about evaluations |
|
286 | + } |
|
287 | + } |
|
288 | + } // end for |
|
289 | + } |
|
290 | + return $graphs; |
|
291 | + } |
|
292 | + |
|
293 | + /** |
|
294 | + * This method return a graph containing information about evaluations |
|
295 | 295 | * inside courses in sessions, it's used inside get_block method for |
296 | 296 | * showing it inside dashboard interface |
297 | - * @return string img html |
|
298 | - */ |
|
297 | + * @return string img html |
|
298 | + */ |
|
299 | 299 | public function get_evaluations_courses_in_sessions_graph() |
300 | 300 | { |
301 | - $graphs = array(); |
|
302 | - if (!empty($this->sessions)) { |
|
303 | - $session_ids = array_keys($this->sessions); |
|
304 | - foreach ($session_ids as $session_id) { |
|
305 | - $courses_code = array_keys(Tracking::get_courses_list_from_session($session_id)); |
|
306 | - $courses_graph = array(); |
|
307 | - foreach ($courses_code as $course_code) { |
|
308 | - $cats = Category::load(null, null, $course_code, null, null, $session_id); |
|
309 | - if (isset($cats) && isset($cats[0])) { |
|
310 | - $alleval = $cats[0]->get_evaluations(null, true, $course_code); |
|
311 | - $alllinks = $cats[0]->get_links(null, true); |
|
312 | - $users = GradebookUtils::get_all_users($alleval, $alllinks); |
|
313 | - $datagen = new FlatViewDataGenerator ($users, $alleval, $alllinks); |
|
314 | - $evaluation_sumary = $datagen->get_evaluation_sumary_results(); |
|
315 | - if (!empty($evaluation_sumary)) { |
|
316 | - $items = array_keys($evaluation_sumary); |
|
317 | - $max = $min = $avg = array(); |
|
318 | - foreach ($evaluation_sumary as $evaluation) { |
|
319 | - $max[] = $evaluation['max']; |
|
320 | - $min[] = $evaluation['min']; |
|
321 | - $avg[] = $evaluation['avg']; |
|
322 | - } |
|
301 | + $graphs = array(); |
|
302 | + if (!empty($this->sessions)) { |
|
303 | + $session_ids = array_keys($this->sessions); |
|
304 | + foreach ($session_ids as $session_id) { |
|
305 | + $courses_code = array_keys(Tracking::get_courses_list_from_session($session_id)); |
|
306 | + $courses_graph = array(); |
|
307 | + foreach ($courses_code as $course_code) { |
|
308 | + $cats = Category::load(null, null, $course_code, null, null, $session_id); |
|
309 | + if (isset($cats) && isset($cats[0])) { |
|
310 | + $alleval = $cats[0]->get_evaluations(null, true, $course_code); |
|
311 | + $alllinks = $cats[0]->get_links(null, true); |
|
312 | + $users = GradebookUtils::get_all_users($alleval, $alllinks); |
|
313 | + $datagen = new FlatViewDataGenerator ($users, $alleval, $alllinks); |
|
314 | + $evaluation_sumary = $datagen->get_evaluation_sumary_results(); |
|
315 | + if (!empty($evaluation_sumary)) { |
|
316 | + $items = array_keys($evaluation_sumary); |
|
317 | + $max = $min = $avg = array(); |
|
318 | + foreach ($evaluation_sumary as $evaluation) { |
|
319 | + $max[] = $evaluation['max']; |
|
320 | + $min[] = $evaluation['min']; |
|
321 | + $avg[] = $evaluation['avg']; |
|
322 | + } |
|
323 | 323 | // Dataset definition |
324 | 324 | $dataSet = new pData(); |
325 | 325 | $dataSet->addPoints($min, 'Serie3'); |
@@ -455,14 +455,14 @@ discard block |
||
455 | 455 | if (!empty($imgPath)) { |
456 | 456 | $courses_graph[$course_code] = '<img src="' . $imgPath . '">'; |
457 | 457 | } |
458 | - } |
|
459 | - } |
|
460 | - } |
|
461 | - if (!empty($courses_graph)) { |
|
462 | - $graphs[$session_id] = $courses_graph; |
|
463 | - } |
|
464 | - } |
|
465 | - } |
|
466 | - return $graphs; |
|
467 | - } |
|
458 | + } |
|
459 | + } |
|
460 | + } |
|
461 | + if (!empty($courses_graph)) { |
|
462 | + $graphs[$session_id] = $courses_graph; |
|
463 | + } |
|
464 | + } |
|
465 | + } |
|
466 | + return $graphs; |
|
467 | + } |
|
468 | 468 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $this->bg_height = 350; |
40 | 40 | if ($this->is_block_visible_for_user($user_id)) { |
41 | 41 | if (!api_is_session_admin()) { |
42 | - $this->courses = CourseManager::get_courses_followed_by_drh($user_id); |
|
42 | + $this->courses = CourseManager::get_courses_followed_by_drh($user_id); |
|
43 | 43 | } |
44 | 44 | $this->sessions = SessionManager::get_sessions_followed_by_drh($user_id); |
45 | 45 | } |
@@ -78,13 +78,13 @@ discard block |
||
78 | 78 | $html = '<div class="panel panel-default" id="intro"> |
79 | 79 | <div class="panel-heading"> |
80 | 80 | '.get_lang('EvaluationsGraph').' |
81 | - <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'"> |
|
81 | + <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'"> |
|
82 | 82 | <em class="fa fa-times"></em> |
83 | 83 | </a></div> |
84 | 84 | </div> |
85 | 85 | <div class="panel-body">'; |
86 | 86 | if (empty($evaluations_base_courses_graph) && empty($evaluations_courses_in_sessions_graph)) { |
87 | - $html .= '<p>'.api_convert_encoding(get_lang('GraphicNotAvailable'),'UTF-8').'</p>'; |
|
87 | + $html .= '<p>'.api_convert_encoding(get_lang('GraphicNotAvailable'), 'UTF-8').'</p>'; |
|
88 | 88 | } else { |
89 | 89 | // display evaluations base courses graph |
90 | 90 | if (!empty($evaluations_base_courses_graph)) { |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | $alleval = $cats[0]->get_evaluations(null, true, $course_code); |
133 | 133 | $alllinks = $cats[0]->get_links(null, true); |
134 | 134 | $users = GradebookUtils::get_all_users($alleval, $alllinks); |
135 | - $datagen = new FlatViewDataGenerator ($users, $alleval, $alllinks); |
|
135 | + $datagen = new FlatViewDataGenerator($users, $alleval, $alllinks); |
|
136 | 136 | $evaluation_sumary = $datagen->get_evaluation_sumary_results(); |
137 | 137 | if (!empty($evaluation_sumary)) { |
138 | 138 | $items = array_keys($evaluation_sumary); |
@@ -158,16 +158,16 @@ discard block |
||
158 | 158 | |
159 | 159 | $dataSet->normalize(100, '%'); |
160 | 160 | |
161 | - $dataSet->loadPalette(api_get_path(SYS_CODE_PATH) . 'palettes/pchart/default.color', true); |
|
161 | + $dataSet->loadPalette(api_get_path(SYS_CODE_PATH).'palettes/pchart/default.color', true); |
|
162 | 162 | |
163 | 163 | // Cache definition |
164 | 164 | $cachePath = api_get_path(SYS_ARCHIVE_PATH); |
165 | 165 | $myCache = new pCache(array('CacheFolder' => substr($cachePath, 0, strlen($cachePath) - 1))); |
166 | 166 | $chartHash = $myCache->getHash($dataSet); |
167 | 167 | if ($myCache->isInCache($chartHash)) { |
168 | - $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash; |
|
168 | + $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash; |
|
169 | 169 | $myCache->saveFromCache($chartHash, $imgPath); |
170 | - $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash; |
|
170 | + $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash; |
|
171 | 171 | } else { |
172 | 172 | /* Create the pChart object */ |
173 | 173 | $widthSize = $this->bg_width; |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | /* Set the default font */ |
197 | 197 | $myPicture->setFontProperties( |
198 | 198 | array( |
199 | - 'FontName' => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf', |
|
199 | + 'FontName' => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf', |
|
200 | 200 | 'FontSize' => 10 |
201 | 201 | ) |
202 | 202 | ); |
@@ -276,12 +276,12 @@ discard block |
||
276 | 276 | /* Write and save into cache */ |
277 | 277 | |
278 | 278 | $myCache->writeToCache($chartHash, $myPicture); |
279 | - $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash; |
|
279 | + $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash; |
|
280 | 280 | $myCache->saveFromCache($chartHash, $imgPath); |
281 | - $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash; |
|
281 | + $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash; |
|
282 | 282 | } |
283 | 283 | if (!empty($imgPath)) { |
284 | - $courses_graph[$course_code] = '<img src="' . $imgPath . '">'; |
|
284 | + $courses_graph[$course_code] = '<img src="'.$imgPath.'">'; |
|
285 | 285 | } |
286 | 286 | } |
287 | 287 | } |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | $alleval = $cats[0]->get_evaluations(null, true, $course_code); |
311 | 311 | $alllinks = $cats[0]->get_links(null, true); |
312 | 312 | $users = GradebookUtils::get_all_users($alleval, $alllinks); |
313 | - $datagen = new FlatViewDataGenerator ($users, $alleval, $alllinks); |
|
313 | + $datagen = new FlatViewDataGenerator($users, $alleval, $alllinks); |
|
314 | 314 | $evaluation_sumary = $datagen->get_evaluation_sumary_results(); |
315 | 315 | if (!empty($evaluation_sumary)) { |
316 | 316 | $items = array_keys($evaluation_sumary); |
@@ -336,16 +336,16 @@ discard block |
||
336 | 336 | |
337 | 337 | $dataSet->normalize(100, '%'); |
338 | 338 | |
339 | - $dataSet->loadPalette(api_get_path(SYS_CODE_PATH) . 'palettes/pchart/default.color', true); |
|
339 | + $dataSet->loadPalette(api_get_path(SYS_CODE_PATH).'palettes/pchart/default.color', true); |
|
340 | 340 | |
341 | 341 | // Cache definition |
342 | 342 | $cachePath = api_get_path(SYS_ARCHIVE_PATH); |
343 | 343 | $myCache = new pCache(array('CacheFolder' => substr($cachePath, 0, strlen($cachePath) - 1))); |
344 | 344 | $chartHash = $myCache->getHash($dataSet); |
345 | 345 | if ($myCache->isInCache($chartHash)) { |
346 | - $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash; |
|
346 | + $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash; |
|
347 | 347 | $myCache->saveFromCache($chartHash, $imgPath); |
348 | - $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash; |
|
348 | + $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash; |
|
349 | 349 | } else { |
350 | 350 | /* Create the pChart object */ |
351 | 351 | $widthSize = $this->bg_width; |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | /* Set the default font */ |
375 | 375 | $myPicture->setFontProperties( |
376 | 376 | array( |
377 | - 'FontName' => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf', |
|
377 | + 'FontName' => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf', |
|
378 | 378 | 'FontSize' => 10 |
379 | 379 | ) |
380 | 380 | ); |
@@ -448,12 +448,12 @@ discard block |
||
448 | 448 | |
449 | 449 | /* Write and save into cache */ |
450 | 450 | $myCache->writeToCache($chartHash, $myPicture); |
451 | - $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash; |
|
451 | + $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash; |
|
452 | 452 | $myCache->saveFromCache($chartHash, $imgPath); |
453 | - $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash; |
|
453 | + $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash; |
|
454 | 454 | } |
455 | 455 | if (!empty($imgPath)) { |
456 | - $courses_graph[$course_code] = '<img src="' . $imgPath . '">'; |
|
456 | + $courses_graph[$course_code] = '<img src="'.$imgPath.'">'; |
|
457 | 457 | } |
458 | 458 | } |
459 | 459 | } |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | /** |
23 | 23 | * Constructor |
24 | 24 | */ |
25 | - public function __construct ($user_id) |
|
25 | + public function __construct($user_id) |
|
26 | 26 | { |
27 | - $this->user_id = $user_id; |
|
27 | + $this->user_id = $user_id; |
|
28 | 28 | $this->path = 'block_session'; |
29 | 29 | if ($this->is_block_visible_for_user($user_id)) { |
30 | 30 | $this->sessions = SessionManager::get_sessions_followed_by_drh($user_id); |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | <div class="panel panel-default" id="intro"> |
67 | 67 | <div class="panel-heading"> |
68 | 68 | '.get_lang('SessionsInformation').' |
69 | - <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'"> |
|
69 | + <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'"> |
|
70 | 70 | <em class="fa fa-times"></em> |
71 | 71 | </a></div> |
72 | 72 | </div> |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | |
117 | 117 | $count_courses_in_session = count(Tracking::get_courses_list_from_session($session_id)); |
118 | 118 | |
119 | - if ($i%2 == 0) $class_tr = 'row_odd'; |
|
119 | + if ($i % 2 == 0) $class_tr = 'row_odd'; |
|
120 | 120 | else $class_tr = 'row_even'; |
121 | 121 | |
122 | 122 | $sessions_table .= '<tr class="'.$class_tr.'"> |
@@ -116,8 +116,11 @@ |
||
116 | 116 | |
117 | 117 | $count_courses_in_session = count(Tracking::get_courses_list_from_session($session_id)); |
118 | 118 | |
119 | - if ($i%2 == 0) $class_tr = 'row_odd'; |
|
120 | - else $class_tr = 'row_even'; |
|
119 | + if ($i%2 == 0) { |
|
120 | + $class_tr = 'row_odd'; |
|
121 | + } else { |
|
122 | + $class_tr = 'row_even'; |
|
123 | + } |
|
121 | 124 | |
122 | 125 | $sessions_table .= '<tr class="'.$class_tr.'"> |
123 | 126 | <td>'.$title.'</td> |
@@ -15,36 +15,36 @@ discard block |
||
15 | 15 | class BlockSession extends Block |
16 | 16 | { |
17 | 17 | private $user_id; |
18 | - private $sessions; |
|
19 | - private $path; |
|
20 | - private $permission = array(DRH, SESSIONADMIN); |
|
18 | + private $sessions; |
|
19 | + private $path; |
|
20 | + private $permission = array(DRH, SESSIONADMIN); |
|
21 | 21 | |
22 | - /** |
|
23 | - * Constructor |
|
24 | - */ |
|
22 | + /** |
|
23 | + * Constructor |
|
24 | + */ |
|
25 | 25 | public function __construct ($user_id) |
26 | 26 | { |
27 | - $this->user_id = $user_id; |
|
28 | - $this->path = 'block_session'; |
|
29 | - if ($this->is_block_visible_for_user($user_id)) { |
|
27 | + $this->user_id = $user_id; |
|
28 | + $this->path = 'block_session'; |
|
29 | + if ($this->is_block_visible_for_user($user_id)) { |
|
30 | 30 | $this->sessions = SessionManager::get_sessions_followed_by_drh($user_id); |
31 | - } |
|
31 | + } |
|
32 | 32 | } |
33 | 33 | |
34 | - /** |
|
35 | - * This method check if a user is allowed to see the block inside dashboard interface |
|
36 | - * @param int User id |
|
37 | - * @return bool Is block visible for user |
|
38 | - */ |
|
34 | + /** |
|
35 | + * This method check if a user is allowed to see the block inside dashboard interface |
|
36 | + * @param int User id |
|
37 | + * @return bool Is block visible for user |
|
38 | + */ |
|
39 | 39 | public function is_block_visible_for_user($user_id) |
40 | 40 | { |
41 | - $user_info = api_get_user_info($user_id); |
|
42 | - $user_status = $user_info['status']; |
|
43 | - $is_block_visible_for_user = false; |
|
44 | - if (UserManager::is_admin($user_id) || in_array($user_status, $this->permission)) { |
|
45 | - $is_block_visible_for_user = true; |
|
46 | - } |
|
47 | - return $is_block_visible_for_user; |
|
41 | + $user_info = api_get_user_info($user_id); |
|
42 | + $user_status = $user_info['status']; |
|
43 | + $is_block_visible_for_user = false; |
|
44 | + if (UserManager::is_admin($user_id) || in_array($user_status, $this->permission)) { |
|
45 | + $is_block_visible_for_user = true; |
|
46 | + } |
|
47 | + return $is_block_visible_for_user; |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
@@ -55,14 +55,14 @@ discard block |
||
55 | 55 | public function get_block() |
56 | 56 | { |
57 | 57 | |
58 | - global $charset; |
|
58 | + global $charset; |
|
59 | 59 | |
60 | - $column = 2; |
|
61 | - $data = array(); |
|
60 | + $column = 2; |
|
61 | + $data = array(); |
|
62 | 62 | |
63 | - $content = $this->get_content_html(); |
|
63 | + $content = $this->get_content_html(); |
|
64 | 64 | |
65 | - $content_html = ' |
|
65 | + $content_html = ' |
|
66 | 66 | <div class="panel panel-default" id="intro"> |
67 | 67 | <div class="panel-heading"> |
68 | 68 | '.get_lang('SessionsInformation').' |
@@ -76,78 +76,78 @@ discard block |
||
76 | 76 | </div> |
77 | 77 | '; |
78 | 78 | |
79 | - $data['column'] = $column; |
|
80 | - $data['content_html'] = $content_html; |
|
79 | + $data['column'] = $column; |
|
80 | + $data['content_html'] = $content_html; |
|
81 | 81 | |
82 | - return $data; |
|
82 | + return $data; |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
86 | - * This method return a content html, it's used inside get_block method for showing it inside dashboard interface |
|
87 | - * @return string content html |
|
88 | - */ |
|
86 | + * This method return a content html, it's used inside get_block method for showing it inside dashboard interface |
|
87 | + * @return string content html |
|
88 | + */ |
|
89 | 89 | public function get_content_html() |
90 | 90 | { |
91 | 91 | |
92 | - $content = ''; |
|
93 | - $sessions = $this->sessions; |
|
92 | + $content = ''; |
|
93 | + $sessions = $this->sessions; |
|
94 | 94 | |
95 | - //$content = '<div style="margin:10px;">'; |
|
96 | - $content .= '<h4>'.get_lang('YourSessionsList').'</h4>'; |
|
95 | + //$content = '<div style="margin:10px;">'; |
|
96 | + $content .= '<h4>'.get_lang('YourSessionsList').'</h4>'; |
|
97 | 97 | |
98 | - if (count($sessions) > 0) { |
|
99 | - $sessions_table = '<table class="data_table" width:"95%">'; |
|
100 | - $sessions_table .= '<tr> |
|
98 | + if (count($sessions) > 0) { |
|
99 | + $sessions_table = '<table class="data_table" width:"95%">'; |
|
100 | + $sessions_table .= '<tr> |
|
101 | 101 | <th >'.get_lang('Title').'</th> |
102 | 102 | <th >'.get_lang('Date').'</th> |
103 | 103 | <th width="100px">'.get_lang('NbCoursesPerSession').'</th> |
104 | 104 | </tr>'; |
105 | - $i = 1; |
|
106 | - foreach ($sessions as $session) { |
|
105 | + $i = 1; |
|
106 | + foreach ($sessions as $session) { |
|
107 | 107 | |
108 | - $session_id = intval($session['id']); |
|
109 | - $title = $session['name']; |
|
108 | + $session_id = intval($session['id']); |
|
109 | + $title = $session['name']; |
|
110 | 110 | |
111 | - if ($session['access_start_date'] != '0000-00-00 00:00:00' && $session['access_end_date'] != '0000-00-00 00:00:00') { |
|
112 | - $date = get_lang('From').' '.api_convert_and_format_date($session['access_start_date'], DATE_FORMAT_SHORT, date_default_timezone_get()).' '.get_lang('To').' '.api_convert_and_format_date($session['access_end_date'], DATE_FORMAT_SHORT, date_default_timezone_get()); |
|
113 | - } else { |
|
114 | - $date = ' - '; |
|
115 | - } |
|
111 | + if ($session['access_start_date'] != '0000-00-00 00:00:00' && $session['access_end_date'] != '0000-00-00 00:00:00') { |
|
112 | + $date = get_lang('From').' '.api_convert_and_format_date($session['access_start_date'], DATE_FORMAT_SHORT, date_default_timezone_get()).' '.get_lang('To').' '.api_convert_and_format_date($session['access_end_date'], DATE_FORMAT_SHORT, date_default_timezone_get()); |
|
113 | + } else { |
|
114 | + $date = ' - '; |
|
115 | + } |
|
116 | 116 | |
117 | - $count_courses_in_session = count(Tracking::get_courses_list_from_session($session_id)); |
|
117 | + $count_courses_in_session = count(Tracking::get_courses_list_from_session($session_id)); |
|
118 | 118 | |
119 | - if ($i%2 == 0) $class_tr = 'row_odd'; |
|
120 | - else $class_tr = 'row_even'; |
|
119 | + if ($i%2 == 0) $class_tr = 'row_odd'; |
|
120 | + else $class_tr = 'row_even'; |
|
121 | 121 | |
122 | - $sessions_table .= '<tr class="'.$class_tr.'"> |
|
122 | + $sessions_table .= '<tr class="'.$class_tr.'"> |
|
123 | 123 | <td>'.$title.'</td> |
124 | 124 | <td align="center">'.$date.'</td> |
125 | 125 | <td align="center">'.$count_courses_in_session.'</td> |
126 | 126 | </tr>'; |
127 | - $i++; |
|
128 | - } |
|
129 | - $sessions_table .= '</table>'; |
|
130 | - $content .= $sessions_table; |
|
131 | - } else { |
|
132 | - $content .= get_lang('ThereIsNoInformationAboutYourSessions'); |
|
133 | - } |
|
127 | + $i++; |
|
128 | + } |
|
129 | + $sessions_table .= '</table>'; |
|
130 | + $content .= $sessions_table; |
|
131 | + } else { |
|
132 | + $content .= get_lang('ThereIsNoInformationAboutYourSessions'); |
|
133 | + } |
|
134 | 134 | |
135 | - if (count($sessions) > 0) { |
|
136 | - $content .= '<div style="text-align:right;margin-top:10px;"><a href="'.api_get_path(WEB_CODE_PATH).'mySpace/session.php">'.get_lang('SeeMore').'</a></div>'; |
|
137 | - } |
|
135 | + if (count($sessions) > 0) { |
|
136 | + $content .= '<div style="text-align:right;margin-top:10px;"><a href="'.api_get_path(WEB_CODE_PATH).'mySpace/session.php">'.get_lang('SeeMore').'</a></div>'; |
|
137 | + } |
|
138 | 138 | |
139 | - //$content .= '</div>'; |
|
139 | + //$content .= '</div>'; |
|
140 | 140 | |
141 | - return $content; |
|
142 | - } |
|
141 | + return $content; |
|
142 | + } |
|
143 | 143 | |
144 | 144 | /** |
145 | - * Get number of sessions |
|
146 | - * @return int |
|
147 | - */ |
|
148 | - function get_number_of_sessions() |
|
145 | + * Get number of sessions |
|
146 | + * @return int |
|
147 | + */ |
|
148 | + function get_number_of_sessions() |
|
149 | 149 | { |
150 | - return count($this->sessions); |
|
151 | - } |
|
150 | + return count($this->sessions); |
|
151 | + } |
|
152 | 152 | |
153 | 153 | } |
@@ -45,13 +45,13 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public function is_block_visible_for_user($user_id) |
47 | 47 | { |
48 | - $user_info = api_get_user_info($user_id); |
|
49 | - $user_status = $user_info['status']; |
|
50 | - $is_block_visible_for_user = false; |
|
51 | - if (UserManager::is_admin($user_id) || in_array($user_status, $this->permission)) { |
|
52 | - $is_block_visible_for_user = true; |
|
53 | - } |
|
54 | - return $is_block_visible_for_user; |
|
48 | + $user_info = api_get_user_info($user_id); |
|
49 | + $user_status = $user_info['status']; |
|
50 | + $is_block_visible_for_user = false; |
|
51 | + if (UserManager::is_admin($user_id) || in_array($user_status, $this->permission)) { |
|
52 | + $is_block_visible_for_user = true; |
|
53 | + } |
|
54 | + return $is_block_visible_for_user; |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | |
@@ -62,11 +62,11 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function get_block() |
64 | 64 | { |
65 | - global $charset; |
|
66 | - $column = 2; |
|
67 | - $data = array(); |
|
65 | + global $charset; |
|
66 | + $column = 2; |
|
67 | + $data = array(); |
|
68 | 68 | $content = $this->get_content_html(); |
69 | - $html = ' |
|
69 | + $html = ' |
|
70 | 70 | <div class="panel panel-default" id="intro"> |
71 | 71 | <div class="panel-heading">'.get_lang('GlobalPlatformInformation').' |
72 | 72 | <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'"> |
@@ -78,46 +78,46 @@ discard block |
||
78 | 78 | </div> |
79 | 79 | </div> |
80 | 80 | '; |
81 | - $data['column'] = $column; |
|
82 | - $data['content_html'] = $html; |
|
81 | + $data['column'] = $column; |
|
82 | + $data['content_html'] = $html; |
|
83 | 83 | |
84 | - return $data; |
|
84 | + return $data; |
|
85 | 85 | } |
86 | 86 | |
87 | - /** |
|
88 | - * This method return a content html, it's used inside get_block method for showing it inside dashboard interface |
|
89 | - * @return string content html |
|
90 | - */ |
|
91 | - public function get_content_html() |
|
92 | - { |
|
93 | - $global_data = $this->get_global_information_data(); |
|
94 | - //$content = '<div style="margin:10px;">'; |
|
95 | - $content = '<h4>'.get_lang('GlobalPlatformInformation').'</h4>'; |
|
96 | - $data_table = null; |
|
97 | - if (!empty($global_data)) { |
|
98 | - $data_table = '<table class="table table-bordered" width:"95%">'; |
|
99 | - $i = 1; |
|
100 | - foreach ($global_data as $data) { |
|
101 | - if ($i%2 == 0) { |
|
102 | - $class_tr = 'row_odd'; |
|
103 | - } else { |
|
104 | - $class_tr = 'row_even'; |
|
105 | - } |
|
106 | - $data_table .= '<tr class="'.$class_tr.'">'; |
|
107 | - foreach ($data as $cell) { |
|
108 | - $data_table .= '<td align="right">'.$cell.'</td>'; |
|
109 | - } |
|
110 | - $data_table .= '</tr>'; |
|
111 | - $i++; |
|
112 | - } |
|
113 | - $data_table .= '</table>'; |
|
114 | - } else { |
|
115 | - $data_table .= get_lang('ThereIsNoInformationAboutThePlatform'); |
|
116 | - } |
|
117 | - $content .= $data_table; |
|
118 | - //$content .= '</div>'; |
|
87 | + /** |
|
88 | + * This method return a content html, it's used inside get_block method for showing it inside dashboard interface |
|
89 | + * @return string content html |
|
90 | + */ |
|
91 | + public function get_content_html() |
|
92 | + { |
|
93 | + $global_data = $this->get_global_information_data(); |
|
94 | + //$content = '<div style="margin:10px;">'; |
|
95 | + $content = '<h4>'.get_lang('GlobalPlatformInformation').'</h4>'; |
|
96 | + $data_table = null; |
|
97 | + if (!empty($global_data)) { |
|
98 | + $data_table = '<table class="table table-bordered" width:"95%">'; |
|
99 | + $i = 1; |
|
100 | + foreach ($global_data as $data) { |
|
101 | + if ($i%2 == 0) { |
|
102 | + $class_tr = 'row_odd'; |
|
103 | + } else { |
|
104 | + $class_tr = 'row_even'; |
|
105 | + } |
|
106 | + $data_table .= '<tr class="'.$class_tr.'">'; |
|
107 | + foreach ($data as $cell) { |
|
108 | + $data_table .= '<td align="right">'.$cell.'</td>'; |
|
109 | + } |
|
110 | + $data_table .= '</tr>'; |
|
111 | + $i++; |
|
112 | + } |
|
113 | + $data_table .= '</table>'; |
|
114 | + } else { |
|
115 | + $data_table .= get_lang('ThereIsNoInformationAboutThePlatform'); |
|
116 | + } |
|
117 | + $content .= $data_table; |
|
118 | + //$content .= '</div>'; |
|
119 | 119 | |
120 | - return $content; |
|
120 | + return $content; |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | /** |
@@ -29,10 +29,10 @@ discard block |
||
29 | 29 | /** |
30 | 30 | * Constructor |
31 | 31 | */ |
32 | - public function __construct ($user_id) |
|
32 | + public function __construct($user_id) |
|
33 | 33 | { |
34 | - $this->user_id = $user_id; |
|
35 | - $this->path = 'block_global_info'; |
|
34 | + $this->user_id = $user_id; |
|
35 | + $this->path = 'block_global_info'; |
|
36 | 36 | if ($this->is_block_visible_for_user($user_id)) { |
37 | 37 | //$this->courses = CourseManager::get_courses_followed_by_drh($user_id); |
38 | 38 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $html = ' |
70 | 70 | <div class="panel panel-default" id="intro"> |
71 | 71 | <div class="panel-heading">'.get_lang('GlobalPlatformInformation').' |
72 | - <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'"> |
|
72 | + <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'"> |
|
73 | 73 | <em class="fa fa-times"></em> |
74 | 74 | </a></div> |
75 | 75 | </div> |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $data_table = '<table class="table table-bordered" width:"95%">'; |
99 | 99 | $i = 1; |
100 | 100 | foreach ($global_data as $data) { |
101 | - if ($i%2 == 0) { |
|
101 | + if ($i % 2 == 0) { |
|
102 | 102 | $class_tr = 'row_odd'; |
103 | 103 | } else { |
104 | 104 | $class_tr = 'row_even'; |
@@ -29,10 +29,10 @@ discard block |
||
29 | 29 | /** |
30 | 30 | * Controller |
31 | 31 | */ |
32 | - public function __construct ($user_id) |
|
32 | + public function __construct($user_id) |
|
33 | 33 | { |
34 | - $this->user_id = $user_id; |
|
35 | - $this->path = 'block_teacher_graph'; |
|
34 | + $this->user_id = $user_id; |
|
35 | + $this->path = 'block_teacher_graph'; |
|
36 | 36 | if ($this->is_block_visible_for_user($user_id)) { |
37 | 37 | $this->teachers = UserManager::get_users_followed_by_drh($user_id, COURSEMANAGER); |
38 | 38 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $html = ' |
69 | 69 | <div class="panel panel-default" id="intro"> |
70 | 70 | <div class="panel-heading">'.get_lang('TeachersInformationsGraph').' |
71 | - <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'"> |
|
71 | + <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'"> |
|
72 | 72 | <em class="fa fa-times"></em> |
73 | 73 | </a></div> |
74 | 74 | </div> |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | foreach ($a_last_week as $day) { |
108 | 108 | // day is received as y-m-d 12:00:00 |
109 | 109 | $start_date = api_get_utc_datetime($day); |
110 | - $end_date = api_get_utc_datetime($day+(3600*24-1)); |
|
110 | + $end_date = api_get_utc_datetime($day + (3600 * 24 - 1)); |
|
111 | 111 | |
112 | 112 | $time_on_platform_by_day = Tracking::get_time_spent_on_the_platform($user_id, 'custom', $start_date, $end_date); |
113 | 113 | $hours = floor($time_on_platform_by_day / 3600); |
@@ -117,26 +117,26 @@ discard block |
||
117 | 117 | $dataSet->addPoints($time_by_days, $username); |
118 | 118 | } |
119 | 119 | |
120 | - $last_week = date('Y-m-d',$a_last_week[0]).' '.get_lang('To').' '.date('Y-m-d', $a_last_week[6]); |
|
120 | + $last_week = date('Y-m-d', $a_last_week[0]).' '.get_lang('To').' '.date('Y-m-d', $a_last_week[6]); |
|
121 | 121 | $days_on_week = array(); |
122 | 122 | foreach ($a_last_week as $weekday) { |
123 | - $days_on_week[] = date('d/m',$weekday); |
|
123 | + $days_on_week[] = date('d/m', $weekday); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | $dataSet->addPoints($days_on_week, 'Days'); |
127 | 127 | $dataSet->setAbscissaName($last_week); |
128 | 128 | $dataSet->setAxisName(0, get_lang('Minutes')); |
129 | 129 | $dataSet->setAbscissa('Days'); |
130 | - $dataSet->loadPalette(api_get_path(SYS_CODE_PATH) . 'palettes/pchart/default.color', true); |
|
130 | + $dataSet->loadPalette(api_get_path(SYS_CODE_PATH).'palettes/pchart/default.color', true); |
|
131 | 131 | |
132 | 132 | // Cache definition |
133 | 133 | $cachePath = api_get_path(SYS_ARCHIVE_PATH); |
134 | 134 | $myCache = new pCache(array('CacheFolder' => substr($cachePath, 0, strlen($cachePath) - 1))); |
135 | 135 | $chartHash = $myCache->getHash($dataSet); |
136 | 136 | if ($myCache->isInCache($chartHash)) { |
137 | - $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash; |
|
137 | + $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash; |
|
138 | 138 | $myCache->saveFromCache($chartHash, $imgPath); |
139 | - $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash; |
|
139 | + $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash; |
|
140 | 140 | } else { |
141 | 141 | |
142 | 142 | /* Create the pChart object */ |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $myPicture->drawRectangle(0, 0, $widthSize - 1, $heightSize - 1, array('R' => 0, 'G' => 0, 'B' => 0)); |
154 | 154 | |
155 | 155 | /* Set the default font */ |
156 | - $myPicture->setFontProperties(array('FontName' => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf', 'FontSize' => 10)); |
|
156 | + $myPicture->setFontProperties(array('FontName' => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf', 'FontSize' => 10)); |
|
157 | 157 | |
158 | 158 | /* Do NOT Write the chart title */ |
159 | 159 | |
@@ -189,11 +189,11 @@ discard block |
||
189 | 189 | |
190 | 190 | /* Write and save into cache */ |
191 | 191 | $myCache->writeToCache($chartHash, $myPicture); |
192 | - $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash; |
|
192 | + $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash; |
|
193 | 193 | $myCache->saveFromCache($chartHash, $imgPath); |
194 | - $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash; |
|
194 | + $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash; |
|
195 | 195 | } |
196 | - $graph = '<img src="' . $imgPath . '" >'; |
|
196 | + $graph = '<img src="'.$imgPath.'" >'; |
|
197 | 197 | } else { |
198 | 198 | $graph = '<p>'.api_convert_encoding(get_lang('GraphicNotAvailable'), 'UTF-8').'</p>'; |
199 | 199 | } |
@@ -26,32 +26,32 @@ discard block |
||
26 | 26 | private $path; |
27 | 27 | private $permission = array(DRH); |
28 | 28 | |
29 | - /** |
|
30 | - * Controller |
|
31 | - */ |
|
29 | + /** |
|
30 | + * Controller |
|
31 | + */ |
|
32 | 32 | public function __construct ($user_id) |
33 | 33 | { |
34 | - $this->user_id = $user_id; |
|
35 | - $this->path = 'block_teacher_graph'; |
|
36 | - if ($this->is_block_visible_for_user($user_id)) { |
|
34 | + $this->user_id = $user_id; |
|
35 | + $this->path = 'block_teacher_graph'; |
|
36 | + if ($this->is_block_visible_for_user($user_id)) { |
|
37 | 37 | $this->teachers = UserManager::get_users_followed_by_drh($user_id, COURSEMANAGER); |
38 | - } |
|
38 | + } |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
42 | - * This method check if a user is allowed to see the block inside dashboard interface |
|
43 | - * @param int User id |
|
44 | - * @return bool Is block visible for user |
|
45 | - */ |
|
42 | + * This method check if a user is allowed to see the block inside dashboard interface |
|
43 | + * @param int User id |
|
44 | + * @return bool Is block visible for user |
|
45 | + */ |
|
46 | 46 | public function is_block_visible_for_user($user_id) |
47 | 47 | { |
48 | - $user_info = api_get_user_info($user_id); |
|
49 | - $user_status = $user_info['status']; |
|
50 | - $is_block_visible_for_user = false; |
|
51 | - if (UserManager::is_admin($user_id) || in_array($user_status, $this->permission)) { |
|
52 | - $is_block_visible_for_user = true; |
|
53 | - } |
|
54 | - return $is_block_visible_for_user; |
|
48 | + $user_info = api_get_user_info($user_id); |
|
49 | + $user_status = $user_info['status']; |
|
50 | + $is_block_visible_for_user = false; |
|
51 | + if (UserManager::is_admin($user_id) || in_array($user_status, $this->permission)) { |
|
52 | + $is_block_visible_for_user = true; |
|
53 | + } |
|
54 | + return $is_block_visible_for_user; |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
@@ -61,11 +61,11 @@ discard block |
||
61 | 61 | */ |
62 | 62 | public function get_block() |
63 | 63 | { |
64 | - global $charset; |
|
65 | - $column = 1; |
|
66 | - $data = array(); |
|
67 | - $teacher_information_graph = $this->get_teachers_information_graph(); |
|
68 | - $html = ' |
|
64 | + global $charset; |
|
65 | + $column = 1; |
|
66 | + $data = array(); |
|
67 | + $teacher_information_graph = $this->get_teachers_information_graph(); |
|
68 | + $html = ' |
|
69 | 69 | <div class="panel panel-default" id="intro"> |
70 | 70 | <div class="panel-heading">'.get_lang('TeachersInformationsGraph').' |
71 | 71 | <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'"> |
@@ -79,53 +79,53 @@ discard block |
||
79 | 79 | </div> |
80 | 80 | '; |
81 | 81 | |
82 | - $data['column'] = $column; |
|
83 | - $data['content_html'] = $html; |
|
82 | + $data['column'] = $column; |
|
83 | + $data['content_html'] = $html; |
|
84 | 84 | |
85 | - return $data; |
|
85 | + return $data; |
|
86 | 86 | |
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
90 | - * This method return a content html, it's used inside get_block method for showing it inside dashboard interface |
|
91 | - * @return string content html |
|
92 | - */ |
|
90 | + * This method return a content html, it's used inside get_block method for showing it inside dashboard interface |
|
91 | + * @return string content html |
|
92 | + */ |
|
93 | 93 | public function get_teachers_information_graph() |
94 | 94 | { |
95 | - $teachers = $this->teachers; |
|
96 | - $graph = ''; |
|
97 | - |
|
98 | - $user_ids = array_keys($teachers); |
|
99 | - $a_last_week = get_last_week(); |
|
100 | - |
|
101 | - if (is_array($user_ids) && count($user_ids) > 0) { |
|
102 | - $dataSet = new pData; |
|
103 | - foreach ($user_ids as $user_id) { |
|
104 | - $teacher_info = api_get_user_info($user_id); |
|
105 | - $username = $teacher_info['username']; |
|
106 | - $time_by_days = array(); |
|
107 | - foreach ($a_last_week as $day) { |
|
108 | - // day is received as y-m-d 12:00:00 |
|
109 | - $start_date = api_get_utc_datetime($day); |
|
110 | - $end_date = api_get_utc_datetime($day+(3600*24-1)); |
|
111 | - |
|
112 | - $time_on_platform_by_day = Tracking::get_time_spent_on_the_platform($user_id, 'custom', $start_date, $end_date); |
|
113 | - $hours = floor($time_on_platform_by_day / 3600); |
|
114 | - $min = floor(($time_on_platform_by_day - ($hours * 3600)) / 60); |
|
115 | - $time_by_days[] = $min; |
|
116 | - } |
|
117 | - $dataSet->addPoints($time_by_days, $username); |
|
118 | - } |
|
119 | - |
|
120 | - $last_week = date('Y-m-d',$a_last_week[0]).' '.get_lang('To').' '.date('Y-m-d', $a_last_week[6]); |
|
121 | - $days_on_week = array(); |
|
122 | - foreach ($a_last_week as $weekday) { |
|
123 | - $days_on_week[] = date('d/m',$weekday); |
|
124 | - } |
|
125 | - |
|
126 | - $dataSet->addPoints($days_on_week, 'Days'); |
|
127 | - $dataSet->setAbscissaName($last_week); |
|
128 | - $dataSet->setAxisName(0, get_lang('Minutes')); |
|
95 | + $teachers = $this->teachers; |
|
96 | + $graph = ''; |
|
97 | + |
|
98 | + $user_ids = array_keys($teachers); |
|
99 | + $a_last_week = get_last_week(); |
|
100 | + |
|
101 | + if (is_array($user_ids) && count($user_ids) > 0) { |
|
102 | + $dataSet = new pData; |
|
103 | + foreach ($user_ids as $user_id) { |
|
104 | + $teacher_info = api_get_user_info($user_id); |
|
105 | + $username = $teacher_info['username']; |
|
106 | + $time_by_days = array(); |
|
107 | + foreach ($a_last_week as $day) { |
|
108 | + // day is received as y-m-d 12:00:00 |
|
109 | + $start_date = api_get_utc_datetime($day); |
|
110 | + $end_date = api_get_utc_datetime($day+(3600*24-1)); |
|
111 | + |
|
112 | + $time_on_platform_by_day = Tracking::get_time_spent_on_the_platform($user_id, 'custom', $start_date, $end_date); |
|
113 | + $hours = floor($time_on_platform_by_day / 3600); |
|
114 | + $min = floor(($time_on_platform_by_day - ($hours * 3600)) / 60); |
|
115 | + $time_by_days[] = $min; |
|
116 | + } |
|
117 | + $dataSet->addPoints($time_by_days, $username); |
|
118 | + } |
|
119 | + |
|
120 | + $last_week = date('Y-m-d',$a_last_week[0]).' '.get_lang('To').' '.date('Y-m-d', $a_last_week[6]); |
|
121 | + $days_on_week = array(); |
|
122 | + foreach ($a_last_week as $weekday) { |
|
123 | + $days_on_week[] = date('d/m',$weekday); |
|
124 | + } |
|
125 | + |
|
126 | + $dataSet->addPoints($days_on_week, 'Days'); |
|
127 | + $dataSet->setAbscissaName($last_week); |
|
128 | + $dataSet->setAxisName(0, get_lang('Minutes')); |
|
129 | 129 | $dataSet->setAbscissa('Days'); |
130 | 130 | $dataSet->loadPalette(api_get_path(SYS_CODE_PATH) . 'palettes/pchart/default.color', true); |
131 | 131 | |
@@ -194,20 +194,20 @@ discard block |
||
194 | 194 | $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash; |
195 | 195 | } |
196 | 196 | $graph = '<img src="' . $imgPath . '" >'; |
197 | - } else { |
|
198 | - $graph = '<p>'.api_convert_encoding(get_lang('GraphicNotAvailable'), 'UTF-8').'</p>'; |
|
199 | - } |
|
197 | + } else { |
|
198 | + $graph = '<p>'.api_convert_encoding(get_lang('GraphicNotAvailable'), 'UTF-8').'</p>'; |
|
199 | + } |
|
200 | 200 | |
201 | - return $graph; |
|
202 | - } |
|
201 | + return $graph; |
|
202 | + } |
|
203 | 203 | |
204 | 204 | /** |
205 | - * Get number of teachers |
|
206 | - * @return int |
|
207 | - */ |
|
208 | - function get_number_of_teachers() |
|
205 | + * Get number of teachers |
|
206 | + * @return int |
|
207 | + */ |
|
208 | + function get_number_of_teachers() |
|
209 | 209 | { |
210 | - return count($this->teachers); |
|
211 | - } |
|
210 | + return count($this->teachers); |
|
211 | + } |
|
212 | 212 | |
213 | 213 | } |
@@ -72,19 +72,19 @@ discard block |
||
72 | 72 | $data = array(); |
73 | 73 | $content = $this->get_content_html(); |
74 | 74 | $html = '<div class="panel panel-default" id="intro"> |
75 | - <div class="panel-heading">' . get_lang('GradebookAndAttendances') . ' |
|
75 | + <div class="panel-heading">' . get_lang('GradebookAndAttendances').' |
|
76 | 76 | <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\'' . addslashes( |
77 | 77 | api_htmlentities( |
78 | 78 | get_lang('ConfirmYourChoice'), |
79 | 79 | ENT_QUOTES, |
80 | 80 | $charset |
81 | 81 | ) |
82 | - ) . '\')) return false;" href="index.php?action=disable_block&path=' . $this->path . '"> |
|
82 | + ).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'"> |
|
83 | 83 | <em class="fa fa-times"></em> |
84 | 84 | </a></div> |
85 | 85 | </div> |
86 | 86 | <div class="panel-body"> |
87 | - ' . $content . ' |
|
87 | + ' . $content.' |
|
88 | 88 | </div> |
89 | 89 | </div> |
90 | 90 | '; |
@@ -102,17 +102,17 @@ discard block |
||
102 | 102 | { |
103 | 103 | $course_data = $this->get_course_information_data(); |
104 | 104 | //$content = '<div style="margin:10px;">'; |
105 | - $content = '<h4>' . get_lang( |
|
105 | + $content = '<h4>'.get_lang( |
|
106 | 106 | 'YourCourseList' |
107 | - ) . '</h4>'; |
|
107 | + ).'</h4>'; |
|
108 | 108 | $data_table = null; |
109 | 109 | if (!empty($course_data)) { |
110 | 110 | $data_table .= '<table class="data_table" width:"95%">'; |
111 | 111 | $data_table .= '<tr> |
112 | - <th>' . get_lang('CourseTitle') . '</th> |
|
113 | - <th width="20%">' . get_lang('NbStudents') . '</th> |
|
114 | - <th width="20%">' . get_lang('Evaluation') . '</th> |
|
115 | - <th width="20%">' . get_lang('ToolAttendance') . '</th> |
|
112 | + <th>' . get_lang('CourseTitle').'</th> |
|
113 | + <th width="20%">' . get_lang('NbStudents').'</th> |
|
114 | + <th width="20%">' . get_lang('Evaluation').'</th> |
|
115 | + <th width="20%">' . get_lang('ToolAttendance').'</th> |
|
116 | 116 | </tr>'; |
117 | 117 | $i = 1; |
118 | 118 | foreach ($course_data as $course) { |
@@ -121,12 +121,12 @@ discard block |
||
121 | 121 | } else { |
122 | 122 | $class_tr = 'row_even'; |
123 | 123 | } |
124 | - $data_table .= '<tr class="' . $class_tr . '">'; |
|
124 | + $data_table .= '<tr class="'.$class_tr.'">'; |
|
125 | 125 | if (!isset($course[3])) { |
126 | 126 | $course[3] = get_lang('NotAvailable'); |
127 | 127 | } |
128 | 128 | foreach ($course as $cell) { |
129 | - $data_table .= '<td align="right">' . $cell . '</td>'; |
|
129 | + $data_table .= '<td align="right">'.$cell.'</td>'; |
|
130 | 130 | } |
131 | 131 | $data_table .= '</tr>'; |
132 | 132 | $i++; |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $content .= $data_table; |
139 | 139 | if (!empty($course_data)) { |
140 | 140 | $content .= '<div style="text-align:right;margin-top:10px;"> |
141 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'mySpace/course.php">' . get_lang('SeeMore') . '</a></div>'; |
|
141 | + <a href="' . api_get_path(WEB_CODE_PATH).'mySpace/course.php">'.get_lang('SeeMore').'</a></div>'; |
|
142 | 142 | } |
143 | 143 | //$content .= '</div>'; |
144 | 144 | return $content; |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | $table_course = Database::get_course_table(TABLE_ATTENDANCE); |
177 | 177 | |
178 | 178 | $sql = "SELECT id, name, attendance_qualify_max FROM $table_course |
179 | - WHERE c_id = " . $course_info['real_id'] . " AND active = 1 AND session_id = 0"; |
|
179 | + WHERE c_id = ".$course_info['real_id']." AND active = 1 AND session_id = 0"; |
|
180 | 180 | $rs = Database::query($sql); |
181 | 181 | $attendance = array(); |
182 | 182 | $attendances = array(); |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | $attendance['course_code'] = $course_info['code']; |
189 | 189 | |
190 | 190 | if ($attendance['done'] != '0') { |
191 | - $attendances[] = '<a href="' . api_get_path(WEB_PATH).'main/attendance/index.php?cidReq=' . $attendance['course_code'] . '&action=attendance_sheet_print&attendance_id=' . $attendance['id']. '">' . Display::return_icon('printmgr.gif', get_lang('Print')).'</a>'; |
|
191 | + $attendances[] = '<a href="'.api_get_path(WEB_PATH).'main/attendance/index.php?cidReq='.$attendance['course_code'].'&action=attendance_sheet_print&attendance_id='.$attendance['id'].'">'.Display::return_icon('printmgr.gif', get_lang('Print')).'</a>'; |
|
192 | 192 | } else { |
193 | 193 | $attendances[] = get_lang("NotAvailable"); |
194 | 194 | } |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | // Number of students |
201 | 201 | |
202 | 202 | $sql = "SELECT user_id FROM $tbl_course_user as course_rel_user |
203 | - WHERE course_rel_user.status=" . STUDENT . " AND course_rel_user.c_id=$courseId"; |
|
203 | + WHERE course_rel_user.status=".STUDENT." AND course_rel_user.c_id=$courseId"; |
|
204 | 204 | $rs = Database::query($sql); |
205 | 205 | $users = array(); |
206 | 206 | while ($row = Database::fetch_array($rs)) { |
@@ -211,11 +211,11 @@ discard block |
||
211 | 211 | } |
212 | 212 | |
213 | 213 | if (!empty($tematic_advance)) { |
214 | - $tematic_advance_progress = '<a title="' . get_lang( |
|
214 | + $tematic_advance_progress = '<a title="'.get_lang( |
|
215 | 215 | 'GoToThematicAdvance' |
216 | - ) . '" href="' . api_get_path( |
|
216 | + ).'" href="'.api_get_path( |
|
217 | 217 | WEB_CODE_PATH |
218 | - ) . 'attendance/index.php?cidReq=' . $course_code . '&action=attendance_sheet_print&attendance_id=">' . $tematic_advance . '%</a>'; |
|
218 | + ).'attendance/index.php?cidReq='.$course_code.'&action=attendance_sheet_print&attendance_id=">'.$tematic_advance.'%</a>'; |
|
219 | 219 | } else { |
220 | 220 | $tematic_advance_progress = '0%'; |
221 | 221 | } |
@@ -224,8 +224,8 @@ discard block |
||
224 | 224 | $tbl_grade_categories = Database :: get_main_table( |
225 | 225 | TABLE_MAIN_GRADEBOOK_CATEGORY |
226 | 226 | ); |
227 | - $sql = "SELECT id from " . $tbl_grade_categories . " |
|
228 | - WHERE course_code ='" . $course_code . "'"; |
|
227 | + $sql = "SELECT id from ".$tbl_grade_categories." |
|
228 | + WHERE course_code ='" . $course_code."'"; |
|
229 | 229 | $rs = Database::query($sql); |
230 | 230 | $category = null; |
231 | 231 | while ($row = Database::fetch_array($rs)) { |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | if (count($eval) > 0) { |
239 | 239 | $i = 0; |
240 | 240 | foreach ($eval as $item) { |
241 | - $score .= '<a href="' . api_get_path(WEB_PATH).'main/gradebook/gradebook_view_result.php?export=pdf&cat_code=' . $cat[0]->get_id() . '&official_code=' . $cat[0]->get_course_code() . '&selecteval=' . $item->get_id(). '">' . $item->get_name() . '</a>'; |
|
241 | + $score .= '<a href="'.api_get_path(WEB_PATH).'main/gradebook/gradebook_view_result.php?export=pdf&cat_code='.$cat[0]->get_id().'&official_code='.$cat[0]->get_course_code().'&selecteval='.$item->get_id().'">'.$item->get_name().'</a>'; |
|
242 | 242 | if (count($eval) - 1 != $i) { |
243 | 243 | $score .= ', '; |
244 | 244 | } |