@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | |
93 | 93 | $result = Database::query($sql); |
94 | 94 | |
95 | - $cats=array(); |
|
95 | + $cats = array(); |
|
96 | 96 | while ($data = Database::fetch_array($result)) { |
97 | 97 | $cats[] = array($data['id'], $data['url']); |
98 | 98 | } |
@@ -135,9 +135,9 @@ discard block |
||
135 | 135 | if (empty($work_name)) { |
136 | 136 | $work_name = basename($data->getUrl()); |
137 | 137 | } |
138 | - $cats[] = array ($data->getId(), $work_name); |
|
138 | + $cats[] = array($data->getId(), $work_name); |
|
139 | 139 | } |
140 | - $cats=isset($cats) ? $cats : array(); |
|
140 | + $cats = isset($cats) ? $cats : array(); |
|
141 | 141 | return $cats; |
142 | 142 | } |
143 | 143 | |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | ]; |
264 | 264 | } |
265 | 265 | |
266 | - $students = array(); // user list, needed to make sure we only |
|
266 | + $students = array(); // user list, needed to make sure we only |
|
267 | 267 | // take first attempts into account |
268 | 268 | $rescount = 0; |
269 | 269 | $sum = 0; |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | return array($bestResult, $weight); |
297 | 297 | break; |
298 | 298 | case 'average': |
299 | - return array($sumResult/$rescount, $weight); |
|
299 | + return array($sumResult / $rescount, $weight); |
|
300 | 300 | break; |
301 | 301 | case 'ranking': |
302 | 302 | return AbstractLink::getCurrentUserRanking($stud_id, $students); |
@@ -24,13 +24,13 @@ discard block |
||
24 | 24 | { |
25 | 25 | $return = array(); |
26 | 26 | $TBL_USER = Database::get_main_table(TABLE_MAIN_USER); |
27 | - $TBL_TRACK_HOTPOTATOES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES); |
|
27 | + $TBL_TRACK_HOTPOTATOES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES); |
|
28 | 28 | |
29 | 29 | $cid = api_get_course_id(); |
30 | 30 | $course_id = api_get_course_int_id(); |
31 | 31 | //$user_id = intval($user_id); |
32 | 32 | $user_id = null; |
33 | - $session_id_and = ' AND te.session_id = ' . api_get_session_id() . ' '; |
|
33 | + $session_id_and = ' AND te.session_id = '.api_get_session_id().' '; |
|
34 | 34 | $hotpotato_name = Database::escape_string($hotpotato_name); |
35 | 35 | |
36 | 36 | if (!empty($exercise_id)) { |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | } |
39 | 39 | |
40 | 40 | if (empty($user_id)) { |
41 | - $sql="SELECT firstname as userpart1, lastname as userpart2 , |
|
41 | + $sql = "SELECT firstname as userpart1, lastname as userpart2 , |
|
42 | 42 | email, |
43 | 43 | tth.exe_name, |
44 | 44 | tth.exe_result, |
@@ -50,13 +50,13 @@ discard block |
||
50 | 50 | tth.exe_name = '$hotpotato_name' |
51 | 51 | ORDER BY tth.c_id ASC, tth.exe_date ASC"; |
52 | 52 | } else { |
53 | - $user_id_and = ' AND te.exe_user_id = ' . api_get_user_id() . ' '; |
|
53 | + $user_id_and = ' AND te.exe_user_id = '.api_get_user_id().' '; |
|
54 | 54 | // get only this user's results |
55 | 55 | |
56 | 56 | $sql = "SELECT '', exe_name, exe_result , exe_weighting, exe_date |
57 | 57 | FROM $TBL_TRACK_HOTPOTATOES |
58 | 58 | WHERE |
59 | - exe_user_id = '" . $user_id . "' AND |
|
59 | + exe_user_id = '".$user_id."' AND |
|
60 | 60 | c_id = $course_id AND |
61 | 61 | tth.exe_name = '$hotpotato_name' |
62 | 62 | ORDER BY c_id ASC, exe_date ASC"; |
@@ -65,13 +65,13 @@ discard block |
||
65 | 65 | $results = array(); |
66 | 66 | |
67 | 67 | $resx = Database::query($sql); |
68 | - while ($rowx = Database::fetch_array($resx,'ASSOC')) { |
|
68 | + while ($rowx = Database::fetch_array($resx, 'ASSOC')) { |
|
69 | 69 | $results[] = $rowx; |
70 | 70 | } |
71 | 71 | |
72 | 72 | $hpresults = array(); |
73 | 73 | $resx = Database::query($sql); |
74 | - while ($rowx = Database::fetch_array($resx,'ASSOC')) { |
|
74 | + while ($rowx = Database::fetch_array($resx, 'ASSOC')) { |
|
75 | 75 | $hpresults[] = $rowx; |
76 | 76 | } |
77 | 77 | |
@@ -90,19 +90,19 @@ discard block |
||
90 | 90 | |
91 | 91 | // Print the Result of Hotpotatoes Tests |
92 | 92 | if (is_array($hpresults)) { |
93 | - for($i = 0; $i < sizeof($hpresults); $i++) { |
|
93 | + for ($i = 0; $i < sizeof($hpresults); $i++) { |
|
94 | 94 | $return[$i] = array(); |
95 | 95 | $title = GetQuizName($hpresults[$i]['exe_name'], $document_path); |
96 | - if ($title =='') { |
|
96 | + if ($title == '') { |
|
97 | 97 | $title = basename($hpresults[$i]['exe_name']); |
98 | 98 | } |
99 | - if(empty($user_id)) { |
|
99 | + if (empty($user_id)) { |
|
100 | 100 | $return[$i]['email'] = $hpresults[$i]['email']; |
101 | 101 | $return[$i]['first_name'] = $hpresults[$i]['userpart1']; |
102 | 102 | $return[$i]['last_name'] = $hpresults[$i]['userpart2']; |
103 | 103 | } |
104 | 104 | $return[$i]['title'] = $title; |
105 | - $return[$i]['exe_date'] = $hpresults[$i]['exe_date']; |
|
105 | + $return[$i]['exe_date'] = $hpresults[$i]['exe_date']; |
|
106 | 106 | |
107 | 107 | $return[$i]['result'] = $hpresults[$i]['exe_result']; |
108 | 108 | $return[$i]['max'] = $hpresults[$i]['exe_weighting']; |
@@ -132,17 +132,17 @@ discard block |
||
132 | 132 | $data = ''; |
133 | 133 | |
134 | 134 | if (api_is_western_name_order()) { |
135 | - if(!empty($this->results[0]['first_name'])) { |
|
135 | + if (!empty($this->results[0]['first_name'])) { |
|
136 | 136 | $data .= get_lang('FirstName').';'; |
137 | 137 | } |
138 | - if(!empty($this->results[0]['last_name'])) { |
|
138 | + if (!empty($this->results[0]['last_name'])) { |
|
139 | 139 | $data .= get_lang('LastName').';'; |
140 | 140 | } |
141 | 141 | } else { |
142 | - if(!empty($this->results[0]['last_name'])) { |
|
142 | + if (!empty($this->results[0]['last_name'])) { |
|
143 | 143 | $data .= get_lang('LastName').';'; |
144 | 144 | } |
145 | - if(!empty($this->results[0]['first_name'])) { |
|
145 | + if (!empty($this->results[0]['first_name'])) { |
|
146 | 146 | $data .= get_lang('FirstName').';'; |
147 | 147 | } |
148 | 148 | } |
@@ -164,16 +164,16 @@ discard block |
||
164 | 164 | $data .= "\n"; |
165 | 165 | |
166 | 166 | //results |
167 | - foreach($this->results as $row) { |
|
167 | + foreach ($this->results as $row) { |
|
168 | 168 | if (api_is_western_name_order()) { |
169 | - $data .= str_replace("\r\n",' ',api_html_entity_decode(strip_tags($row['first_name']), ENT_QUOTES, $charset)).';'; |
|
170 | - $data .= str_replace("\r\n",' ',api_html_entity_decode(strip_tags($row['last_name']), ENT_QUOTES, $charset)).';'; |
|
169 | + $data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($row['first_name']), ENT_QUOTES, $charset)).';'; |
|
170 | + $data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($row['last_name']), ENT_QUOTES, $charset)).';'; |
|
171 | 171 | } else { |
172 | - $data .= str_replace("\r\n",' ',api_html_entity_decode(strip_tags($row['last_name']), ENT_QUOTES, $charset)).';'; |
|
173 | - $data .= str_replace("\r\n",' ',api_html_entity_decode(strip_tags($row['first_name']), ENT_QUOTES, $charset)).';'; |
|
172 | + $data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($row['last_name']), ENT_QUOTES, $charset)).';'; |
|
173 | + $data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($row['first_name']), ENT_QUOTES, $charset)).';'; |
|
174 | 174 | } |
175 | 175 | |
176 | - $data .= str_replace("\r\n",' ',api_html_entity_decode(strip_tags($row['email']), ENT_QUOTES, $charset)).';'; |
|
176 | + $data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($row['email']), ENT_QUOTES, $charset)).';'; |
|
177 | 177 | |
178 | 178 | /*if ($export_user_fields) { |
179 | 179 | //show user fields data, if any, for this user |
@@ -183,10 +183,10 @@ discard block |
||
183 | 183 | } |
184 | 184 | }*/ |
185 | 185 | |
186 | - $data .= str_replace("\r\n",' ',api_html_entity_decode(strip_tags($row['title']), ENT_QUOTES, $charset)).';'; |
|
187 | - $data .= str_replace("\r\n",' ',$row['exe_date']).';'; |
|
188 | - $data .= str_replace("\r\n",' ',$row['result']).';'; |
|
189 | - $data .= str_replace("\r\n",' ',$row['max']).';'; |
|
186 | + $data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($row['title']), ENT_QUOTES, $charset)).';'; |
|
187 | + $data .= str_replace("\r\n", ' ', $row['exe_date']).';'; |
|
188 | + $data .= str_replace("\r\n", ' ', $row['result']).';'; |
|
189 | + $data .= str_replace("\r\n", ' ', $row['max']).';'; |
|
190 | 190 | $data .= "\n"; |
191 | 191 | } |
192 | 192 | |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | header('Content-Description: '.$filename); |
209 | 209 | header('Content-transfer-encoding: binary'); |
210 | 210 | // @todo add this utf-8 header for all csv files |
211 | - echo "\xEF\xBB\xBF"; // force utf-8 header of csv file |
|
211 | + echo "\xEF\xBB\xBF"; // force utf-8 header of csv file |
|
212 | 212 | echo $data; |
213 | 213 | return true; |
214 | 214 | } |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | |
268 | 268 | if ($export_user_fields) { |
269 | 269 | //show user fields section with a big th colspan that spans over all fields |
270 | - $extra_user_fields = UserManager::get_extra_fields(0,1000,5,'ASC',false, 1); |
|
270 | + $extra_user_fields = UserManager::get_extra_fields(0, 1000, 5, 'ASC', false, 1); |
|
271 | 271 | |
272 | 272 | //show the fields names for user fields |
273 | 273 | foreach ($extra_user_fields as $field) { |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | $column++; |
316 | 316 | |
317 | 317 | if (api_is_western_name_order()) { |
318 | - $worksheet->setCellValueByColumnAndRow($column, $line,api_html_entity_decode(strip_tags($row['first_name']), ENT_QUOTES, $charset)); |
|
318 | + $worksheet->setCellValueByColumnAndRow($column, $line, api_html_entity_decode(strip_tags($row['first_name']), ENT_QUOTES, $charset)); |
|
319 | 319 | $column++; |
320 | 320 | $worksheet->setCellValueByColumnAndRow($column, $line, api_html_entity_decode(strip_tags($row['last_name']), ENT_QUOTES, $charset)); |
321 | 321 | $column++; |
@@ -329,8 +329,8 @@ discard block |
||
329 | 329 | |
330 | 330 | if ($export_user_fields) { |
331 | 331 | //show user fields data, if any, for this user |
332 | - $user_fields_values = UserManager::get_extra_user_data($row['user_id'],false,false, false, true); |
|
333 | - foreach($user_fields_values as $value) { |
|
332 | + $user_fields_values = UserManager::get_extra_user_data($row['user_id'], false, false, false, true); |
|
333 | + foreach ($user_fields_values as $value) { |
|
334 | 334 | $worksheet->setCellValueByColumnAndRow($column, $line, api_html_entity_decode(strip_tags($value), ENT_QUOTES, $charset)); |
335 | 335 | $column++; |
336 | 336 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | if (!$exportToXLS) { |
82 | 82 | Display :: display_header(get_lang('Reporting')); |
83 | - $actionsLeft = $actionsRight =''; |
|
83 | + $actionsLeft = $actionsRight = ''; |
|
84 | 84 | if ($global) { |
85 | 85 | $actionsLeft .= '<a href="'.api_get_path(WEB_CODE_PATH).'auth/my_progress.php">'. |
86 | 86 | Display::return_icon('stats.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM); |
@@ -93,9 +93,9 @@ discard block |
||
93 | 93 | } |
94 | 94 | |
95 | 95 | $actionsRight .= '<a href="'.api_get_self().'?export=1&score='.$filter_score.'&exercise_id='.$exerciseId.'&'.$courseLink.'">'. |
96 | - Display::return_icon('export_excel.png',get_lang('ExportAsXLS'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
96 | + Display::return_icon('export_excel.png', get_lang('ExportAsXLS'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
97 | 97 | $actionsRight .= '<a href="javascript: void(0);" onclick="javascript: window.print()">'. |
98 | - Display::return_icon('printer.png',get_lang('Print'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
98 | + Display::return_icon('printer.png', get_lang('Print'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
99 | 99 | |
100 | 100 | $menuItems[] = Display::url( |
101 | 101 | Display::return_icon('teacher.png', get_lang('TeacherInterface'), array(), 32), |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | $countExercises = Database::store_result($result); |
200 | 200 | $exerciseSessionCount = $countExercises[0]['count']; |
201 | 201 | |
202 | - $exerciseCount = $exerciseCount + $exerciseCount * count($newSessionList) + $exerciseSessionCount; |
|
202 | + $exerciseCount = $exerciseCount + $exerciseCount * count($newSessionList) + $exerciseSessionCount; |
|
203 | 203 | |
204 | 204 | // Add course and session list. |
205 | 205 | if ($exerciseCount == 0) { |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | $column++; |
417 | 417 | $worksheet->setCellValueByColumnAndRow($column, $line, get_lang('ExamNotTaken')); |
418 | 418 | $column++; |
419 | - $worksheet->setCellValueByColumnAndRow($column, $line, sprintf(get_lang('ExamPassX'), $filter_score) . '%'); |
|
419 | + $worksheet->setCellValueByColumnAndRow($column, $line, sprintf(get_lang('ExamPassX'), $filter_score).'%'); |
|
420 | 420 | $column++; |
421 | 421 | $worksheet->setCellValueByColumnAndRow($column, $line, get_lang('ExamFail')); |
422 | 422 | $column++; |
@@ -593,10 +593,10 @@ discard block |
||
593 | 593 | $percentageScore = 0; |
594 | 594 | |
595 | 595 | if ($weighting != 0) { |
596 | - $percentageScore = round(($score*100)/$weighting); |
|
596 | + $percentageScore = round(($score * 100) / $weighting); |
|
597 | 597 | } |
598 | 598 | |
599 | - if ($attempts['count'] > 0 ) { |
|
599 | + if ($attempts['count'] > 0) { |
|
600 | 600 | $taken++; |
601 | 601 | } |
602 | 602 | |
@@ -639,7 +639,7 @@ discard block |
||
639 | 639 | } else { |
640 | 640 | $score = '-'; |
641 | 641 | $userRow .= '<td>'; |
642 | - $userRow .= '-'; |
|
642 | + $userRow .= '-'; |
|
643 | 643 | $tempArray[] = '-'; |
644 | 644 | $userRow .= '</td>'; |
645 | 645 | |
@@ -693,13 +693,13 @@ discard block |
||
693 | 693 | // Exam taken |
694 | 694 | $html .= '<td>'; |
695 | 695 | $html .= $taken; |
696 | - $globalRow[]= $taken; |
|
696 | + $globalRow[] = $taken; |
|
697 | 697 | $html .= '</td>'; |
698 | 698 | |
699 | 699 | // Exam NOT taken |
700 | 700 | $html .= '<td>'; |
701 | 701 | $html .= $not_taken = $totalStudents - $taken; |
702 | - $globalRow[]= $not_taken; |
|
702 | + $globalRow[] = $not_taken; |
|
703 | 703 | $html .= '</td>'; |
704 | 704 | |
705 | 705 | // Exam pass |
@@ -710,19 +710,19 @@ discard block |
||
710 | 710 | } |
711 | 711 | |
712 | 712 | $html .= $total_with_parameter_score; |
713 | - $globalRow[]= $total_with_parameter_score; |
|
713 | + $globalRow[] = $total_with_parameter_score; |
|
714 | 714 | $html .= '</td>'; |
715 | 715 | |
716 | 716 | // Exam fail |
717 | 717 | $html .= '<td>'; |
718 | 718 | |
719 | 719 | $html .= $fail = $taken - $total_with_parameter_score; |
720 | - $globalRow[]= $fail; |
|
720 | + $globalRow[] = $fail; |
|
721 | 721 | $html .= '</td>'; |
722 | 722 | |
723 | 723 | $html .= '<td>'; |
724 | 724 | $html .= $totalStudents; |
725 | - $globalRow[]= $totalStudents; |
|
725 | + $globalRow[] = $totalStudents; |
|
726 | 726 | |
727 | 727 | $html .= '</td>'; |
728 | 728 |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | function send() { |
57 | 57 | if (document.formulaire.access_url_id.value!=0) { |
58 | 58 | document.formulaire.form_sent.value=0; |
59 | - document.formulaire.add_type.value=\'' . $add_type . '\'; |
|
59 | + document.formulaire.add_type.value=\'' . $add_type.'\'; |
|
60 | 60 | document.formulaire.submit(); |
61 | 61 | } |
62 | 62 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | echo '<div class="actions">'; |
103 | 103 | echo Display::url( |
104 | 104 | Display::return_icon('view_more_stats.gif', get_lang('AddUserGroupToURL'), ''), |
105 | - api_get_path(WEB_CODE_PATH) . 'admin/access_url_add_usergroup_to_url.php' |
|
105 | + api_get_path(WEB_CODE_PATH).'admin/access_url_add_usergroup_to_url.php' |
|
106 | 106 | ); |
107 | 107 | echo '</div>'; |
108 | 108 | |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | <?php |
141 | 141 | echo Display::toolbarButton( |
142 | 142 | get_lang('SessionAddTypeUnique'), |
143 | - api_get_self() . '?' . http_build_query([ |
|
143 | + api_get_self().'?'.http_build_query([ |
|
144 | 144 | 'add_type' => 'unique', |
145 | 145 | 'access_url_id' => $access_url_id |
146 | 146 | ]), |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | ); |
151 | 151 | echo Display::toolbarButton( |
152 | 152 | get_lang('SessionAddTypeMultiple'), |
153 | - api_get_self() . '?' . http_build_query([ |
|
153 | + api_get_self().'?'.http_build_query([ |
|
154 | 154 | 'add_type' => 'multiple', |
155 | 155 | 'access_url_id' => $access_url_id |
156 | 156 | ]), |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | if (!api_is_allowed_to_edit(null, true)) { |
54 | 54 | api_not_allowed(true); |
55 | 55 | } |
56 | - $tool_name = get_lang('Add'); |
|
56 | + $tool_name = get_lang('Add'); |
|
57 | 57 | $form = new FormValidator( |
58 | 58 | 'glossary', |
59 | 59 | 'post', |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | if (!api_is_allowed_to_edit(null, true)) { |
191 | 191 | api_not_allowed(true); |
192 | 192 | } |
193 | - $tool_name = get_lang('ImportGlossary'); |
|
193 | + $tool_name = get_lang('ImportGlossary'); |
|
194 | 194 | $form = new FormValidator( |
195 | 195 | 'glossary', |
196 | 196 | 'post', |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | foreach (GlossaryManager::get_glossary_terms() as $term) { |
219 | 219 | if (!GlossaryManager::delete_glossary($term['id'], false)) { |
220 | 220 | Display::addFlash( |
221 | - Display::return_message(get_lang("CannotDeleteGlossary") . ':' . $term['id'], 'error') |
|
221 | + Display::return_message(get_lang("CannotDeleteGlossary").':'.$term['id'], 'error') |
|
222 | 222 | ); |
223 | 223 | } else { |
224 | 224 | $termsDeleted[] = $term['name']; |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | if (count($badList) > 0) { |
316 | 316 | Display::addFlash( |
317 | 317 | Display::return_message( |
318 | - get_lang("GlossaryTermAlreadyExists").': ' . implode(', ', $badList), |
|
318 | + get_lang("GlossaryTermAlreadyExists").': '.implode(', ', $badList), |
|
319 | 319 | 'error' |
320 | 320 | ) |
321 | 321 | ); |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | GlossaryManager::export_to_pdf(); |
359 | 359 | break; |
360 | 360 | case 'changeview': |
361 | - if (in_array($_GET['view'], array('list','table'))) { |
|
361 | + if (in_array($_GET['view'], array('list', 'table'))) { |
|
362 | 362 | Session::write('glossary_view', $_GET['view']); |
363 | 363 | } else { |
364 | 364 | $view = Session::read('glossary_view'); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | $doc_url = str_replace(' ', '+', $doc_url); |
29 | 29 | $doc_url = str_replace('/..', '', $doc_url); //echo $doc_url; |
30 | 30 | |
31 | -if (strpos($doc_url,'../') OR strpos($doc_url,'/..')) { |
|
31 | +if (strpos($doc_url, '../') OR strpos($doc_url, '/..')) { |
|
32 | 32 | $doc_url = ''; |
33 | 33 | } |
34 | 34 | |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | //remove last slash if present |
44 | 44 | //$doc_url = ($doc_url{strlen($doc_url)-1}=='/')?substr($doc_url,0,strlen($doc_url)-1):$doc_url; |
45 | 45 | //mod_rewrite can change /some/path/ to /some/path// in some cases, so clean them all off (René) |
46 | - while ($doc_url{$dul = strlen($doc_url)-1}=='/') $doc_url = substr($doc_url,0,$dul); |
|
46 | + while ($doc_url{$dul = strlen($doc_url) - 1} == '/') $doc_url = substr($doc_url, 0, $dul); |
|
47 | 47 | //create the path |
48 | 48 | $document_explorer = api_get_path(WEB_COURSE_PATH).api_get_course_path(); // home course path |
49 | 49 | //redirect |
@@ -64,10 +64,10 @@ discard block |
||
64 | 64 | |
65 | 65 | $result = Database::query($sql); |
66 | 66 | if (Database::num_rows($result) > 0) { |
67 | - $row= Database::fetch_array($result); |
|
68 | - $title = str_replace(' ','_', $row['filename']); |
|
67 | + $row = Database::fetch_array($result); |
|
68 | + $title = str_replace(' ', '_', $row['filename']); |
|
69 | 69 | if (Security::check_abs_path($full_file_name, |
70 | - api_get_path(SYS_COURSE_PATH) . api_get_course_path() . '/upload/announcements/') |
|
70 | + api_get_path(SYS_COURSE_PATH).api_get_course_path().'/upload/announcements/') |
|
71 | 71 | ) { |
72 | 72 | $result = DocumentManager::file_send_for_download($full_file_name, true, $title); |
73 | 73 | if ($result === false) { |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | |
100 | 100 | if (!empty($gradebook) && $gradebook == 'view') { |
101 | 101 | $interbreadcrumb[] = array( |
102 | - 'url' => '../gradebook/' . $_SESSION['gradebook_dest'], |
|
102 | + 'url' => '../gradebook/'.$_SESSION['gradebook_dest'], |
|
103 | 103 | 'name' => get_lang('ToolGradebook') |
104 | 104 | ); |
105 | 105 | } |
@@ -741,7 +741,7 @@ discard block |
||
741 | 741 | ); |
742 | 742 | |
743 | 743 | // Exercise results |
744 | - $actions .='<a href="exercise_report.php?'.api_get_cidreq().'&exerciseId='.$row['id'].'">'. |
|
744 | + $actions .= '<a href="exercise_report.php?'.api_get_cidreq().'&exerciseId='.$row['id'].'">'. |
|
745 | 745 | Display :: return_icon('test_results.png', get_lang('Results'), '', ICON_SIZE_SMALL).'</a>'; |
746 | 746 | |
747 | 747 | // Export |
@@ -805,7 +805,7 @@ discard block |
||
805 | 805 | } |
806 | 806 | } |
807 | 807 | |
808 | - $actions .='<a href="exercise_report.php?'.api_get_cidreq().'&exerciseId='.$row['id'].'">'. |
|
808 | + $actions .= '<a href="exercise_report.php?'.api_get_cidreq().'&exerciseId='.$row['id'].'">'. |
|
809 | 809 | Display :: return_icon('test_results.png', get_lang('Results'), '', ICON_SIZE_SMALL).'</a>'; |
810 | 810 | $actions .= Display::url(Display::return_icon('cd.gif', get_lang('CopyExercise')), '', array('onclick' => "javascript:if(!confirm('".addslashes(api_htmlentities(get_lang('AreYouSureToCopy'), ENT_QUOTES, $charset))." ".addslashes($row['title'])."?"."')) return false;", 'href' => 'exercise.php?'.api_get_cidreq().'&choice=copy_exercise&sec_token='.$token.'&exerciseId='.$row['id'])); |
811 | 811 | } |
@@ -1004,7 +1004,7 @@ discard block |
||
1004 | 1004 | $item .= Display::tag('td', $actions, array('class' => 'td_actions')); |
1005 | 1005 | } else { |
1006 | 1006 | if ($isDrhOfCourse) { |
1007 | - $actions ='<a href="exercise_report.php?'.api_get_cidreq().'&exerciseId='.$row['id'].'">'. |
|
1007 | + $actions = '<a href="exercise_report.php?'.api_get_cidreq().'&exerciseId='.$row['id'].'">'. |
|
1008 | 1008 | Display :: return_icon('test_results.png', get_lang('Results'), '', ICON_SIZE_SMALL).'</a>'; |
1009 | 1009 | $item .= Display::tag('td', $actions, array('class' => 'td_actions')); |
1010 | 1010 | } |
@@ -1014,7 +1014,7 @@ discard block |
||
1014 | 1014 | 'tr', |
1015 | 1015 | $item, |
1016 | 1016 | array( |
1017 | - 'id' => 'exercise_list_' . $my_exercise_id, |
|
1017 | + 'id' => 'exercise_list_'.$my_exercise_id, |
|
1018 | 1018 | ) |
1019 | 1019 | ); |
1020 | 1020 | } |
@@ -1078,7 +1078,7 @@ discard block |
||
1078 | 1078 | Display::return_icon('hotpotatoes_s.png', "HotPotatoes"), |
1079 | 1079 | Display::url( |
1080 | 1080 | $title, |
1081 | - 'showinframes.php?' . api_get_cidreq() . '&' . http_build_query([ |
|
1081 | + 'showinframes.php?'.api_get_cidreq().'&'.http_build_query([ |
|
1082 | 1082 | 'file' => $path, |
1083 | 1083 | 'uid' => $userId |
1084 | 1084 | ]), |
@@ -1093,7 +1093,7 @@ discard block |
||
1093 | 1093 | 'adminhp.php?'.api_get_cidreq().'&hotpotatoesName='.$path |
1094 | 1094 | ); |
1095 | 1095 | |
1096 | - $actions .='<a href="hotpotatoes_exercise_report.php?'.api_get_cidreq().'&path='.$path.'">'. |
|
1096 | + $actions .= '<a href="hotpotatoes_exercise_report.php?'.api_get_cidreq().'&path='.$path.'">'. |
|
1097 | 1097 | Display :: return_icon('test_results.png', get_lang('Results'), '', ICON_SIZE_SMALL).'</a>'; |
1098 | 1098 | |
1099 | 1099 | // if active |
@@ -1102,7 +1102,7 @@ discard block |
||
1102 | 1102 | $actions .= ' <a href="'.$exercisePath.'?'.api_get_cidreq().'&hpchoice=disable&page='.$page.'&file='.$path.'">'. |
1103 | 1103 | Display::return_icon('visible.png', get_lang('Deactivate'), '', ICON_SIZE_SMALL).'</a>'; |
1104 | 1104 | } else { // else if not active |
1105 | - $actions .=' <a href="'.$exercisePath.'?'.api_get_cidreq().'&hpchoice=enable&page='.$page.'&file='.$path.'">'. |
|
1105 | + $actions .= ' <a href="'.$exercisePath.'?'.api_get_cidreq().'&hpchoice=enable&page='.$page.'&file='.$path.'">'. |
|
1106 | 1106 | Display::return_icon('invisible.png', get_lang('Activate'), '', ICON_SIZE_SMALL).'</a>'; |
1107 | 1107 | } |
1108 | 1108 | $actions .= '<a href="'.$exercisePath.'?'.api_get_cidreq().'&hpchoice=delete&file='.$path.'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('AreYouSureToDeleteJS'), ENT_QUOTES, $charset).' '.$title."?").'\')) return false;">'. |
@@ -1124,7 +1124,7 @@ discard block |
||
1124 | 1124 | 'td', |
1125 | 1125 | Display::url( |
1126 | 1126 | $title, |
1127 | - 'showinframes.php?' . api_get_cidreq() . '&' . http_build_query([ |
|
1127 | + 'showinframes.php?'.api_get_cidreq().'&'.http_build_query([ |
|
1128 | 1128 | 'file' => $path, |
1129 | 1129 | 'cid' => api_get_course_id(), |
1130 | 1130 | 'uid' => $userId |
@@ -1145,7 +1145,7 @@ discard block |
||
1145 | 1145 | $item .= Display::tag('td', $attemptText); |
1146 | 1146 | |
1147 | 1147 | if ($isDrhOfCourse) { |
1148 | - $actions ='<a href="hotpotatoes_exercise_report.php?'.api_get_cidreq().'&path='.$path.'">'. |
|
1148 | + $actions = '<a href="hotpotatoes_exercise_report.php?'.api_get_cidreq().'&path='.$path.'">'. |
|
1149 | 1149 | Display :: return_icon('test_results.png', get_lang('Results'), '', ICON_SIZE_SMALL).'</a>'; |
1150 | 1150 | |
1151 | 1151 | $item .= Display::tag('td', $actions, array('class' => 'td_actions')); |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | |
153 | 153 | if (!api_is_allowed_to_edit(null, true) && |
154 | 154 | ( |
155 | - ($current_forum_category && $current_forum_category['locked'] <> 0 ) || |
|
155 | + ($current_forum_category && $current_forum_category['locked'] <> 0) || |
|
156 | 156 | $current_forum['locked'] <> 0 || |
157 | 157 | $current_thread['locked'] <> 0 |
158 | 158 | ) |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | echo '<h1>'; |
205 | 205 | echo Display::url( |
206 | 206 | prepare4display($current_forum['forum_title']), |
207 | - 'viewforum.php?' . api_get_cidreq() . '&' . http_build_query([ |
|
207 | + 'viewforum.php?'.api_get_cidreq().'&'.http_build_query([ |
|
208 | 208 | 'origin' => $origin, |
209 | 209 | 'forum' => $current_forum['forum_id'] |
210 | 210 | ]), |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | ini_set('log_errors', '1'); |
12 | 12 | error_reporting(-1); |
13 | 13 | |
14 | -require_once __DIR__ . '/../../vendor/autoload.php'; |
|
14 | +require_once __DIR__.'/../../vendor/autoload.php'; |
|
15 | 15 | |
16 | 16 | define('SYSTEM_INSTALLATION', 1); |
17 | 17 | define('INSTALL_TYPE_UPDATE', 'update'); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | session_start(); |
26 | 26 | |
27 | -require_once api_get_path(LIBRARY_PATH) . 'database.constants.inc.php'; |
|
27 | +require_once api_get_path(LIBRARY_PATH).'database.constants.inc.php'; |
|
28 | 28 | require_once 'install.lib.php'; |
29 | 29 | |
30 | 30 | $action = isset($_POST['a']) ? $_POST['a'] : null; |