@@ -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; |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | |
40 | 40 | $editor_config = array('ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '125'); |
41 | 41 | //this line define how many question by default appear when creating a choice question |
42 | - $nb_answers = isset($_POST['nb_answers']) ? (int) $_POST['nb_answers'] : 3; // The previous default value was 2. See task #1759. |
|
42 | + $nb_answers = isset($_POST['nb_answers']) ? (int) $_POST['nb_answers'] : 3; // The previous default value was 2. See task #1759. |
|
43 | 43 | $nb_answers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0)); |
44 | 44 | |
45 | 45 | /* |
@@ -55,20 +55,20 @@ discard block |
||
55 | 55 | if ($obj_ex->selectFeedbackType() == 1) { |
56 | 56 | $editor_config['Width'] = '250'; |
57 | 57 | $editor_config['Height'] = '110'; |
58 | - $comment_title = '<th width="50%" >' . get_lang('Comment') . '</th>'; |
|
59 | - $feedback_title = '<th width="50%" >' . get_lang('Scenario') . '</th>'; |
|
58 | + $comment_title = '<th width="50%" >'.get_lang('Comment').'</th>'; |
|
59 | + $feedback_title = '<th width="50%" >'.get_lang('Scenario').'</th>'; |
|
60 | 60 | } else { |
61 | - $comment_title = '<th width="50%">' . get_lang('Comment') . '</th>'; |
|
61 | + $comment_title = '<th width="50%">'.get_lang('Comment').'</th>'; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | $html = '<table class="table table-striped table-hover">'; |
65 | 65 | $html .= '<thead>'; |
66 | 66 | $html .= '<tr>'; |
67 | - $html .= '<th>' . get_lang('Number') . '</th>'; |
|
68 | - $html .= '<th>' . get_lang('True') . '</th>'; |
|
69 | - $html .= '<th width="50%">' . get_lang('Answer') . '</th>'; |
|
70 | - $html .= $comment_title . $feedback_title; |
|
71 | - $html .= '<th>' . get_lang('Weighting') . '</th>'; |
|
67 | + $html .= '<th>'.get_lang('Number').'</th>'; |
|
68 | + $html .= '<th>'.get_lang('True').'</th>'; |
|
69 | + $html .= '<th width="50%">'.get_lang('Answer').'</th>'; |
|
70 | + $html .= $comment_title.$feedback_title; |
|
71 | + $html .= '<th>'.get_lang('Weighting').'</th>'; |
|
72 | 72 | $html .= '</tr>'; |
73 | 73 | $html .= '</thead>'; |
74 | 74 | $html .= '<tbody>'; |
@@ -135,9 +135,9 @@ discard block |
||
135 | 135 | $weight_result = '0'; |
136 | 136 | } |
137 | 137 | |
138 | - $defaults['answer[' . $i . ']'] = $answer_result; |
|
139 | - $defaults['comment[' . $i . ']'] = $answer->comment[$i]; |
|
140 | - $defaults['weighting[' . $i . ']'] = $weight_result; |
|
138 | + $defaults['answer['.$i.']'] = $answer_result; |
|
139 | + $defaults['comment['.$i.']'] = $answer->comment[$i]; |
|
140 | + $defaults['weighting['.$i.']'] = $weight_result; |
|
141 | 141 | |
142 | 142 | $item_list = explode('@@', $answer->destination[$i]); |
143 | 143 | |
@@ -156,10 +156,10 @@ discard block |
||
156 | 156 | else |
157 | 157 | $url_result = $url; |
158 | 158 | |
159 | - $temp_scenario['url' . $i] = $url_result; |
|
160 | - $temp_scenario['try' . $i] = $try_result; |
|
161 | - $temp_scenario['lp' . $i] = $lp; |
|
162 | - $temp_scenario['destination' . $i] = $list_dest; |
|
159 | + $temp_scenario['url'.$i] = $url_result; |
|
160 | + $temp_scenario['try'.$i] = $try_result; |
|
161 | + $temp_scenario['lp'.$i] = $lp; |
|
162 | + $temp_scenario['destination'.$i] = $list_dest; |
|
163 | 163 | } |
164 | 164 | } |
165 | 165 | |
@@ -172,30 +172,30 @@ discard block |
||
172 | 172 | ); |
173 | 173 | $renderer->setElementTemplate( |
174 | 174 | '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', |
175 | - 'counter[' . $i . ']' |
|
175 | + 'counter['.$i.']' |
|
176 | 176 | ); |
177 | 177 | $renderer->setElementTemplate( |
178 | 178 | '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', |
179 | - 'answer[' . $i . ']' |
|
179 | + 'answer['.$i.']' |
|
180 | 180 | ); |
181 | 181 | $renderer->setElementTemplate( |
182 | 182 | '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', |
183 | - 'comment[' . $i . ']' |
|
183 | + 'comment['.$i.']' |
|
184 | 184 | ); |
185 | 185 | $renderer->setElementTemplate( |
186 | 186 | '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', |
187 | - 'weighting[' . $i . ']' |
|
187 | + 'weighting['.$i.']' |
|
188 | 188 | ); |
189 | 189 | |
190 | - $answer_number = $form->addElement('text', 'counter[' . $i . ']', null, 'value="' . $i . '"'); |
|
190 | + $answer_number = $form->addElement('text', 'counter['.$i.']', null, 'value="'.$i.'"'); |
|
191 | 191 | $answer_number->freeze(); |
192 | 192 | |
193 | 193 | |
194 | 194 | $form->addElement('radio', 'correct', null, null, $i, 'class="checkbox" style="margin-left: 0em;"'); |
195 | - $form->addElement('html_editor', 'answer[' . $i . ']', null, array(), $editor_config); |
|
195 | + $form->addElement('html_editor', 'answer['.$i.']', null, array(), $editor_config); |
|
196 | 196 | |
197 | - $form->addElement('html_editor', 'comment[' . $i . ']', null, array(), $editor_config); |
|
198 | - $form->addElement('text', 'weighting[' . $i . ']', null, array('style' => 'width: 60px;', 'value' => '0')); |
|
197 | + $form->addElement('html_editor', 'comment['.$i.']', null, array(), $editor_config); |
|
198 | + $form->addElement('text', 'weighting['.$i.']', null, array('style' => 'width: 60px;', 'value' => '0')); |
|
199 | 199 | $form->addElement('html', '</tr>'); |
200 | 200 | $i++; |
201 | 201 | } |
@@ -210,8 +210,8 @@ discard block |
||
210 | 210 | $form->addHtml('<tr>'); |
211 | 211 | |
212 | 212 | $defaults["counter[$i]"] = '-'; |
213 | - $defaults['answer[' . $i . ']'] = get_lang('DontKnow'); |
|
214 | - $defaults['weighting[' . $i . ']'] = '0'; |
|
213 | + $defaults['answer['.$i.']'] = get_lang('DontKnow'); |
|
214 | + $defaults['weighting['.$i.']'] = '0'; |
|
215 | 215 | $defaults['scenario'] = $temp_scenario; |
216 | 216 | $renderer = & $form->defaultRenderer(); |
217 | 217 | |
@@ -221,32 +221,32 @@ discard block |
||
221 | 221 | ); |
222 | 222 | $renderer->setElementTemplate( |
223 | 223 | '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', |
224 | - 'counter[' . $i . ']' |
|
224 | + 'counter['.$i.']' |
|
225 | 225 | ); |
226 | 226 | $renderer->setElementTemplate( |
227 | 227 | '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', |
228 | - 'answer[' . $i . ']' |
|
228 | + 'answer['.$i.']' |
|
229 | 229 | ); |
230 | 230 | $renderer->setElementTemplate( |
231 | 231 | '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', |
232 | - 'comment[' . $i . ']' |
|
232 | + 'comment['.$i.']' |
|
233 | 233 | ); |
234 | 234 | $renderer->setElementTemplate( |
235 | 235 | '<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', |
236 | - 'weighting[' . $i . ']' |
|
236 | + 'weighting['.$i.']' |
|
237 | 237 | ); |
238 | 238 | |
239 | 239 | $form |
240 | - ->addElement('text', 'counter[' . $i . ']', null) |
|
240 | + ->addElement('text', 'counter['.$i.']', null) |
|
241 | 241 | ->freeze(); |
242 | 242 | |
243 | - $form->addElement('hidden', 'position[' . $i . ']', '666'); |
|
243 | + $form->addElement('hidden', 'position['.$i.']', '666'); |
|
244 | 244 | |
245 | 245 | $form->addElement('radio', 'correct', null, null, $i, ['class' => 'checkbox', 'disabled' => true]); |
246 | - $form->addElement('html_editor', 'answer[' . $i . ']', null, array(), $editor_config); |
|
246 | + $form->addElement('html_editor', 'answer['.$i.']', null, array(), $editor_config); |
|
247 | 247 | |
248 | - $form->addRule('answer[' . $i . ']', get_lang('ThisFieldIsRequired'), 'required'); |
|
249 | - $form->addElement('html_editor', 'comment[' . $i . ']', null, array(), $editor_config); |
|
248 | + $form->addRule('answer['.$i.']', get_lang('ThisFieldIsRequired'), 'required'); |
|
249 | + $form->addElement('html_editor', 'comment['.$i.']', null, array(), $editor_config); |
|
250 | 250 | |
251 | 251 | //$form->addElement('select', 'destination'.$i, get_lang('SelectQuestion').' : ',$select_question,'multiple'); |
252 | 252 | |
@@ -302,9 +302,9 @@ discard block |
||
302 | 302 | $minus = 0; |
303 | 303 | } |
304 | 304 | |
305 | - for ($i=1 ; $i <= $nb_answers - $minus; $i++) { |
|
306 | - $position = trim($form -> getSubmitValue('position['.$i.']')); |
|
307 | - $answer = trim($form -> getSubmitValue('answer['.$i.']')); |
|
305 | + for ($i = 1; $i <= $nb_answers - $minus; $i++) { |
|
306 | + $position = trim($form -> getSubmitValue('position['.$i.']')); |
|
307 | + $answer = trim($form -> getSubmitValue('answer['.$i.']')); |
|
308 | 308 | $comment = trim($form -> getSubmitValue('comment['.$i.']')); |
309 | 309 | $weighting = trim($form -> getSubmitValue('weighting['.$i.']')); |
310 | 310 | $scenario = $form -> getSubmitValue('scenario'); |
@@ -312,8 +312,8 @@ discard block |
||
312 | 312 | //$list_destination = $form -> getSubmitValue('destination'.$i); |
313 | 313 | //$destination_str = $form -> getSubmitValue('destination'.$i); |
314 | 314 | |
315 | - $try = $scenario['try'.$i]; |
|
316 | - $lp = $scenario['lp'.$i]; |
|
315 | + $try = $scenario['try'.$i]; |
|
316 | + $lp = $scenario['lp'.$i]; |
|
317 | 317 | $destination = $scenario['destination'.$i]; |
318 | 318 | $url = trim($scenario['url'.$i]); |
319 | 319 | |
@@ -337,34 +337,34 @@ discard block |
||
337 | 337 | $destination_str.=$destination_id.';'; |
338 | 338 | }*/ |
339 | 339 | |
340 | - $goodAnswer= ($correct == $i) ? true : false; |
|
340 | + $goodAnswer = ($correct == $i) ? true : false; |
|
341 | 341 | |
342 | 342 | if ($goodAnswer) { |
343 | 343 | $nbrGoodAnswers++; |
344 | 344 | $weighting = abs($weighting); |
345 | - if($weighting > 0) { |
|
345 | + if ($weighting > 0) { |
|
346 | 346 | $questionWeighting += $weighting; |
347 | 347 | } |
348 | 348 | } |
349 | 349 | |
350 | 350 | if (empty($try)) |
351 | - $try=0; |
|
351 | + $try = 0; |
|
352 | 352 | |
353 | 353 | if (empty($lp)) { |
354 | - $lp=0; |
|
354 | + $lp = 0; |
|
355 | 355 | } |
356 | 356 | |
357 | 357 | if (empty($destination)) { |
358 | - $destination=0; |
|
358 | + $destination = 0; |
|
359 | 359 | } |
360 | 360 | |
361 | - if ($url=='') { |
|
362 | - $url=0; |
|
361 | + if ($url == '') { |
|
362 | + $url = 0; |
|
363 | 363 | } |
364 | 364 | |
365 | 365 | //1@@1;2;@@2;4;4;@@http://www.chamilo.org |
366 | - $dest= $try.'@@'.$lp.'@@'.$destination.'@@'.$url; |
|
367 | - $objAnswer -> createAnswer($answer,$goodAnswer,$comment,$weighting,$i,NULL,NULL,$dest); |
|
366 | + $dest = $try.'@@'.$lp.'@@'.$destination.'@@'.$url; |
|
367 | + $objAnswer -> createAnswer($answer, $goodAnswer, $comment, $weighting, $i, NULL, NULL, $dest); |
|
368 | 368 | } |
369 | 369 | |
370 | 370 | //Create 666 answer |
@@ -372,10 +372,10 @@ discard block |
||
372 | 372 | $answer = trim($form -> getSubmitValue('answer['.$i.']')); |
373 | 373 | $comment = trim($form -> getSubmitValue('comment['.$i.']')); |
374 | 374 | $weighting = trim($form -> getSubmitValue('weighting['.$i.']')); |
375 | - $goodAnswer= ($correct == $i) ? true : false; |
|
375 | + $goodAnswer = ($correct == $i) ? true : false; |
|
376 | 376 | $dest = ''; |
377 | 377 | |
378 | - $objAnswer -> createAnswer($answer,$goodAnswer,$comment,$weighting,$i,NULL,NULL,$dest); |
|
378 | + $objAnswer -> createAnswer($answer, $goodAnswer, $comment, $weighting, $i, NULL, NULL, $dest); |
|
379 | 379 | |
380 | 380 | // saves the answers into the data base |
381 | 381 | $objAnswer -> save(); |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | function return_header($feedback_type = null, $counter = null, $score = null) |
389 | 389 | { |
390 | 390 | $header = parent::return_header($feedback_type, $counter, $score); |
391 | - $header .= '<table class="'.$this->question_table_class .'"> |
|
391 | + $header .= '<table class="'.$this->question_table_class.'"> |
|
392 | 392 | <tr> |
393 | 393 | <th>'.get_lang("Choice").'</th> |
394 | 394 | <th>'. get_lang("ExpectedChoice").'</th> |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | } |
73 | 73 | |
74 | 74 | if (empty($document_data)) { |
75 | - $document_id = $parent_id = 0; |
|
75 | + $document_id = $parent_id = 0; |
|
76 | 76 | $path = '/'; |
77 | 77 | } else { |
78 | 78 | $document_id = $document_data['id']; |
@@ -199,10 +199,10 @@ discard block |
||
199 | 199 | true |
200 | 200 | ); |
201 | 201 | |
202 | - $redirectUrl = api_get_self() . '?' . api_get_cidreq(); |
|
202 | + $redirectUrl = api_get_self().'?'.api_get_cidreq(); |
|
203 | 203 | |
204 | 204 | if ($document_data) { |
205 | - $redirectUrl .= '&' . http_build_query([ |
|
205 | + $redirectUrl .= '&'.http_build_query([ |
|
206 | 206 | 'id' => $document_data['iid'] |
207 | 207 | ]); |
208 | 208 | } |
@@ -217,11 +217,11 @@ discard block |
||
217 | 217 | // Actions |
218 | 218 | // Link back to the documents overview |
219 | 219 | if ($is_certificate_mode) { |
220 | - $actions = '<a href="document.php?id='.$document_id.'&selectcat=' . $selectcat.'&'.api_get_cidreq().'">'. |
|
221 | - Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('CertificateOverview'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
220 | + $actions = '<a href="document.php?id='.$document_id.'&selectcat='.$selectcat.'&'.api_get_cidreq().'">'. |
|
221 | + Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('CertificateOverview'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
222 | 222 | } else { |
223 | 223 | $actions = '<a href="document.php?id='.$document_id.'&'.api_get_cidreq().'">'. |
224 | - Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
224 | + Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | // Link to create a folder |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | $course_plugin = 'bbb'; //needed in order to load the plugin lang variables |
8 | 8 | $cidReset = true; |
9 | 9 | |
10 | -require_once __DIR__ . '/../../main/inc/global.inc.php'; |
|
10 | +require_once __DIR__.'/../../main/inc/global.inc.php'; |
|
11 | 11 | |
12 | 12 | $action = isset($_REQUEST['a']) ? $_REQUEST['a'] : null; |
13 | 13 | $meetingId = isset($_REQUEST['meeting']) ? intval($_REQUEST['meeting']) : 0; |
@@ -33,10 +33,10 @@ discard block |
||
33 | 33 | 'first' |
34 | 34 | ); |
35 | 35 | |
36 | - $url = $meetingInfo['video_url'] . '/capture.m4v'; |
|
36 | + $url = $meetingInfo['video_url'].'/capture.m4v'; |
|
37 | 37 | $link = Display::url( |
38 | 38 | Display::return_icon('save.png', get_lang('DownloadFile')), |
39 | - $meetingInfo['video_url'] . '/capture.m4v', |
|
39 | + $meetingInfo['video_url'].'/capture.m4v', |
|
40 | 40 | ['target' => '_blank'] |
41 | 41 | ); |
42 | 42 |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | .sortable({ |
137 | 137 | cursor: "move", // works? |
138 | 138 | update: function(event, ui) { |
139 | - var order = $(this).sortable("serialize") + "&a=update_question_order&exercise_id=<?php echo intval($_GET['exerciseId']);?>"; |
|
139 | + var order = $(this).sortable("serialize") + "&a=update_question_order&exercise_id=<?php echo intval($_GET['exerciseId']); ?>"; |
|
140 | 140 | $.post("<?php echo $ajax_url ?>", order, function(reponse){ |
141 | 141 | $("#message").html(reponse); |
142 | 142 | }); |
@@ -172,12 +172,12 @@ discard block |
||
172 | 172 | echo "<div class='table-responsive'>"; |
173 | 173 | echo "<table class='table table-condensed'>"; |
174 | 174 | echo "<tr>"; |
175 | - echo "<th style=\"width: 40%;\">" .get_lang('Questions'). "</th>"; |
|
176 | - echo "<th style=\"width: 10%;\">" .get_lang('Type'). "</th>"; |
|
177 | - echo "<th style=\"width: 20%;\">" .get_lang('Category'). "</th>"; |
|
178 | - echo "<th style=\"width: 10%;\">" .get_lang('Difficulty'). "</th>"; |
|
179 | - echo "<th style=\"width: 10%;\">" .get_lang('Score'). "</th>"; |
|
180 | - echo "<th style=\"width: 10%;\">" .get_lang('Actions'). "</th>"; |
|
175 | + echo "<th style=\"width: 40%;\">".get_lang('Questions')."</th>"; |
|
176 | + echo "<th style=\"width: 10%;\">".get_lang('Type')."</th>"; |
|
177 | + echo "<th style=\"width: 20%;\">".get_lang('Category')."</th>"; |
|
178 | + echo "<th style=\"width: 10%;\">".get_lang('Difficulty')."</th>"; |
|
179 | + echo "<th style=\"width: 10%;\">".get_lang('Score')."</th>"; |
|
180 | + echo "<th style=\"width: 10%;\">".get_lang('Actions')."</th>"; |
|
181 | 181 | echo "</tr>"; |
182 | 182 | echo "</table>"; |
183 | 183 | echo "</div>"; |
@@ -217,15 +217,14 @@ discard block |
||
217 | 217 | $question_class = get_class($objQuestionTmp); |
218 | 218 | |
219 | 219 | $clone_link = '<a href="'.api_get_self().'?'.api_get_cidreq().'&clone_question='.$id.'">'. |
220 | - Display::return_icon('cd.png',get_lang('Copy'), array(), ICON_SIZE_SMALL).'</a>'; |
|
220 | + Display::return_icon('cd.png', get_lang('Copy'), array(), ICON_SIZE_SMALL).'</a>'; |
|
221 | 221 | $edit_link = ($objQuestionTmp->type == CALCULATED_ANSWER && $objQuestionTmp->isAnswered()) ? |
222 | 222 | '<a>'.Display::return_icon( |
223 | 223 | 'edit_na.png', |
224 | 224 | get_lang('QuestionEditionNotAvailableBecauseItIsAlreadyAnsweredHoweverYouCanCopyItAndModifyTheCopy'), |
225 | 225 | array(), |
226 | 226 | ICON_SIZE_SMALL |
227 | - ).'</a>' : |
|
228 | - '<a href="'.api_get_self().'?'.api_get_cidreq().'&type='. |
|
227 | + ).'</a>' : '<a href="'.api_get_self().'?'.api_get_cidreq().'&type='. |
|
229 | 228 | $objQuestionTmp->selectType().'&myid=1&editQuestion='.$id.'">'. |
230 | 229 | Display::return_icon( |
231 | 230 | 'edit.png', |
@@ -235,17 +234,17 @@ discard block |
||
235 | 234 | ).'</a>'; |
236 | 235 | $delete_link = null; |
237 | 236 | if ($objExercise->edit_exercise_in_lp == true) { |
238 | - $delete_link = '<a id="delete_'.$id.'" class="opener" href="'.api_get_self().'?'.api_get_cidreq().'&exerciseId='.$exerciseId.'&deleteQuestion='.$id.'" >'.Display::return_icon('delete.png',get_lang('RemoveFromTest'), array(), ICON_SIZE_SMALL).'</a>'; |
|
237 | + $delete_link = '<a id="delete_'.$id.'" class="opener" href="'.api_get_self().'?'.api_get_cidreq().'&exerciseId='.$exerciseId.'&deleteQuestion='.$id.'" >'.Display::return_icon('delete.png', get_lang('RemoveFromTest'), array(), ICON_SIZE_SMALL).'</a>'; |
|
239 | 238 | } |
240 | 239 | |
241 | - $edit_link = Display::tag('span', $edit_link, array('class'=>'items')); |
|
242 | - $clone_link = Display::tag('span', $clone_link, array('class'=>'items')); |
|
240 | + $edit_link = Display::tag('span', $edit_link, array('class'=>'items')); |
|
241 | + $clone_link = Display::tag('span', $clone_link, array('class'=>'items')); |
|
243 | 242 | $delete_link = Display::tag('span', $delete_link, array('class'=>'items')); |
244 | - $btnActions = Display::tag('td',Display::tag( |
|
243 | + $btnActions = Display::tag('td', Display::tag( |
|
245 | 244 | 'div', |
246 | 245 | $edit_link.$clone_link.$delete_link, |
247 | 246 | array('class'=>'edition') |
248 | - ), array ('class'=>'btn-actions')); |
|
247 | + ), array('class'=>'btn-actions')); |
|
249 | 248 | |
250 | 249 | $title = Security::remove_XSS($objQuestionTmp->selectTitle()); |
251 | 250 | /* $move = Display::return_icon( |
@@ -285,7 +284,7 @@ discard block |
||
285 | 284 | $questionScore = Display::tag('td', $objQuestionTmp->selectWeighting(), array('class'=>$styleScore)); |
286 | 285 | |
287 | 286 | echo '<div id="question_id_list_'.$id.'" >'; |
288 | - echo '<div class="header_operations" data-exercise="' . $objExercise->selectId() . '" data-question="' . $id . '">'; |
|
287 | + echo '<div class="header_operations" data-exercise="'.$objExercise->selectId().'" data-question="'.$id.'">'; |
|
289 | 288 | echo "<div class='table-responsive'>"; |
290 | 289 | echo "<table class='table'>"; |
291 | 290 | echo "<tr>"; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | ' LIMIT 10'; |
52 | 52 | |
53 | 53 | if (api_is_multiple_url_enabled()) { |
54 | - $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
54 | + $tbl_user_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
55 | 55 | $access_url_id = api_get_current_access_url_id(); |
56 | 56 | if ($access_url_id != -1) { |
57 | 57 | $sql = 'SELECT username, lastname, firstname |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $return .= '<a href="javascript: void(0);" onclick="javascript: fill_coach_field(\''.$user['username'].'\')">'.api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')</a><br />'; |
77 | 77 | } |
78 | 78 | } |
79 | - $xajax_response -> addAssign('ajax_list_coachs','innerHTML', api_utf8_encode($return)); |
|
79 | + $xajax_response -> addAssign('ajax_list_coachs', 'innerHTML', api_utf8_encode($return)); |
|
80 | 80 | return $xajax_response; |
81 | 81 | } |
82 | 82 | $xajax -> processRequests(); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $form->addElement('header', $tool_name); |
138 | 138 | $result = SessionManager::setForm($form); |
139 | 139 | |
140 | -$htmlHeadXtra[] =' |
|
140 | +$htmlHeadXtra[] = ' |
|
141 | 141 | <script> |
142 | 142 | $(function() { |
143 | 143 | '.$result['js'].' |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $form->addButtonNext(get_lang('NextStep')); |
148 | 148 | |
149 | 149 | if (!$formSent) { |
150 | - $formDefaults['access_start_date'] = $formDefaults['display_start_date'] = api_get_local_time(); |
|
150 | + $formDefaults['access_start_date'] = $formDefaults['display_start_date'] = api_get_local_time(); |
|
151 | 151 | $formDefaults['coach_username'] = api_get_user_id(); |
152 | 152 | } else { |
153 | 153 | $formDefaults['name'] = api_htmlentities($name, ENT_QUOTES, $charset); |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | $id_visibility = $params['session_visibility']; |
173 | 173 | $duration = isset($params['duration']) ? $params['duration'] : null; |
174 | 174 | $description = $params['description']; |
175 | - $showDescription = isset($params['show_description']) ? 1: 0; |
|
175 | + $showDescription = isset($params['show_description']) ? 1 : 0; |
|
176 | 176 | $sendSubscriptionNotification = isset($params['send_subscription_notification']); |
177 | 177 | $isThisImageCropped = isset($params['picture_crop_result']); |
178 | 178 | |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | |
210 | 210 | if ($return == strval(intval($return))) { |
211 | 211 | // integer => no error on session creation |
212 | - header('Location: add_courses_to_session.php?id_session=' . $return . '&add=true&msg='); |
|
212 | + header('Location: add_courses_to_session.php?id_session='.$return.'&add=true&msg='); |
|
213 | 213 | exit(); |
214 | 214 | } |
215 | 215 | } |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | |
223 | 223 | echo '<div class="actions">'; |
224 | 224 | echo '<a href="../session/session_list.php">'. |
225 | - Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('PlatformAdmin'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
225 | + Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('PlatformAdmin'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
226 | 226 | echo '</div>'; |
227 | 227 | |
228 | 228 | $form->display(); |
@@ -33,17 +33,17 @@ discard block |
||
33 | 33 | |
34 | 34 | $login_date = api_get_utc_datetime(); |
35 | 35 | $access_url_id = 1; |
36 | - if (api_get_multiple_access_url() && api_get_current_access_url_id()!=-1) { |
|
36 | + if (api_get_multiple_access_url() && api_get_current_access_url_id() != -1) { |
|
37 | 37 | $access_url_id = api_get_current_access_url_id(); |
38 | 38 | } |
39 | 39 | $session_id = api_get_session_id(); |
40 | 40 | // if the $_course array exists this means we are in a course and we have to store this in the who's online table also |
41 | 41 | // to have the x users in this course feature working |
42 | - if (is_array($_course) && count($_course)>0 && !empty($_course['id'])) { |
|
43 | - $query = "REPLACE INTO ".$online_table ." (login_id,login_user_id,login_date,user_ip, c_id, session_id, access_url_id) |
|
42 | + if (is_array($_course) && count($_course) > 0 && !empty($_course['id'])) { |
|
43 | + $query = "REPLACE INTO ".$online_table." (login_id,login_user_id,login_date,user_ip, c_id, session_id, access_url_id) |
|
44 | 44 | VALUES ($uid,$uid,'$login_date','$user_ip', '".$_course['real_id']."' , '$session_id' , '$access_url_id' )"; |
45 | 45 | } else { |
46 | - $query = "REPLACE INTO ".$online_table ." (login_id,login_user_id,login_date,user_ip, c_id, session_id, access_url_id) |
|
46 | + $query = "REPLACE INTO ".$online_table." (login_id,login_user_id,login_date,user_ip, c_id, session_id, access_url_id) |
|
47 | 47 | VALUES ($uid,$uid,'$login_date','$user_ip', 0, '$session_id', '$access_url_id')"; |
48 | 48 | } |
49 | 49 | Database::query($query); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | ORDER BY login_date DESC |
118 | 118 | LIMIT 0,1"; |
119 | 119 | $q_last_connection = Database::query($sql); |
120 | - if (Database::num_rows($q_last_connection)>0) { |
|
120 | + if (Database::num_rows($q_last_connection) > 0) { |
|
121 | 121 | $i_id_last_connection = Database::result($q_last_connection, 0, "login_id"); |
122 | 122 | } |
123 | 123 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | { |
168 | 168 | $online_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE); |
169 | 169 | $user_id = intval($user_id); |
170 | - $query = "DELETE FROM " . $online_table . " WHERE login_user_id = $user_id"; |
|
170 | + $query = "DELETE FROM ".$online_table." WHERE login_user_id = $user_id"; |
|
171 | 171 | Database::query($query); |
172 | 172 | } |
173 | 173 | |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | $current_date = api_get_utc_datetime($online_time); |
249 | 249 | $track_online_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE); |
250 | 250 | $friend_user_table = Database::get_main_table(TABLE_MAIN_USER_REL_USER); |
251 | - $table_user = Database::get_main_table(TABLE_MAIN_USER); |
|
251 | + $table_user = Database::get_main_table(TABLE_MAIN_USER); |
|
252 | 252 | |
253 | 253 | if ($friends) { |
254 | 254 | // who friends from social network is online |
@@ -264,8 +264,8 @@ discard block |
||
264 | 264 | LIMIT $from, $number_of_items"; |
265 | 265 | } else { |
266 | 266 | $query = "SELECT DISTINCT login_user_id, login_date |
267 | - FROM ".$track_online_table ." e |
|
268 | - INNER JOIN ".$table_user ." u ON (u.id = e.login_user_id) |
|
267 | + FROM ".$track_online_table." e |
|
268 | + INNER JOIN ".$table_user." u ON (u.id = e.login_user_id) |
|
269 | 269 | WHERE u.status != ".ANONYMOUS." AND login_date >= '".$current_date."' |
270 | 270 | ORDER BY $column $direction |
271 | 271 | LIMIT $from, $number_of_items"; |
@@ -288,8 +288,8 @@ discard block |
||
288 | 288 | } else { |
289 | 289 | // all users online |
290 | 290 | $query = "SELECT login_user_id, login_date |
291 | - FROM ".$track_online_table ." track |
|
292 | - INNER JOIN ".$table_user ." u |
|
291 | + FROM ".$track_online_table." track |
|
292 | + INNER JOIN ".$table_user." u |
|
293 | 293 | ON (u.id=track.login_user_id) |
294 | 294 | WHERE u.status != ".ANONYMOUS." AND track.access_url_id = $access_url_id AND |
295 | 295 | login_date >= '".$current_date."' |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | if ($result) { |
427 | 427 | $users_online = array(); |
428 | 428 | |
429 | - while(list($login_user_id, $login_date) = Database::fetch_row($result)) { |
|
429 | + while (list($login_user_id, $login_date) = Database::fetch_row($result)) { |
|
430 | 430 | $users_online[] = $login_user_id; |
431 | 431 | } |
432 | 432 | return $users_online; |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | } |
436 | 436 | } |
437 | 437 | |
438 | -function who_is_online_in_this_course_count($uid, $time_limit, $coursecode=null) |
|
438 | +function who_is_online_in_this_course_count($uid, $time_limit, $coursecode = null) |
|
439 | 439 | { |
440 | 440 | if (empty($coursecode)) { |
441 | 441 | return false; |