Completed
Push — 1.11.x ( ca7787...41c0f2 )
by José
31:51
created
main/admin/course_export.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 api_protect_admin_script();
15 15
 
16 16
 $tool_name = get_lang('ExportCourses');
17
-$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
17
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
18 18
 
19 19
 set_time_limit(0);
20 20
 
@@ -64,17 +64,17 @@  discard block
 block discarded – undo
64 64
         $dataToExport = [];
65 65
 
66 66
         foreach ($courses as $course) {
67
-            $dataToExport['code'] = str_replace(';',',',$course['code']);
68
-            $dataToExport['title'] = str_replace(';',',',$course['title']);
69
-            $dataToExport['category_code'] = str_replace(';',',',$course['category_code']);
67
+            $dataToExport['code'] = str_replace(';', ',', $course['code']);
68
+            $dataToExport['title'] = str_replace(';', ',', $course['title']);
69
+            $dataToExport['category_code'] = str_replace(';', ',', $course['category_code']);
70 70
             $categoryInfo = CourseCategory::getCategory($course['category_code']);
71 71
             if ($categoryInfo) {
72
-                $dataToExport['category_name'] = str_replace(';',',',$categoryInfo['name']);
72
+                $dataToExport['category_name'] = str_replace(';', ',', $categoryInfo['name']);
73 73
             } else {
74 74
                 $dataToExport['category_name'] = '';
75 75
             }
76
-            $dataToExport['tutor_name'] = str_replace(';',',',$course['tutor_name']);
77
-            $dataToExport['course_language'] = str_replace(';',',',$course['course_language']);
76
+            $dataToExport['tutor_name'] = str_replace(';', ',', $course['tutor_name']);
77
+            $dataToExport['course_language'] = str_replace(';', ',', $course['course_language']);
78 78
 
79 79
             $dataToExport['students'] = '';
80 80
             $dataToExport['teachers'] = '';
@@ -84,9 +84,9 @@  discard block
 block discarded – undo
84 84
             if (is_array($usersInCourse) && !empty($usersInCourse)) {
85 85
                 foreach ($usersInCourse as $user) {
86 86
                     if ($user['status_rel'] == COURSEMANAGER) {
87
-                        $dataToExport['teachers'] .= $user['username'] . '|';
87
+                        $dataToExport['teachers'] .= $user['username'].'|';
88 88
                     } else {
89
-                        $dataToExport['students'] .= $user['username'] . '|';
89
+                        $dataToExport['students'] .= $user['username'].'|';
90 90
                     }
91 91
                 }
92 92
             }
@@ -158,8 +158,8 @@  discard block
 block discarded – undo
158 158
 	$form->addHtml('</div>');
159 159
 }
160 160
 
161
-$form->addElement('radio', 'file_type', get_lang('OutputFileType'), 'CSV' , 'csv', null);
162
-$form->addElement('radio', 'file_type', '' , 'XLS' , 'xls', null);
161
+$form->addElement('radio', 'file_type', get_lang('OutputFileType'), 'CSV', 'csv', null);
162
+$form->addElement('radio', 'file_type', '', 'XLS', 'xls', null);
163 163
 $form->addElement('radio', 'file_type', null, 'XML', 'xml', null, array('id' => 'file_type_xml'));
164 164
 
165 165
 $form->setDefaults(['select_type' => '1', 'file_type' => 'csv']);
Please login to merge, or discard this patch.
main/admin/careers.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -83,9 +83,9 @@  discard block
 block discarded – undo
83 83
 
84 84
 //With this function we can add actions to the jgrid (edit, delete, etc)
85 85
 $action_links = 'function action_formatter(cellvalue, options, rowObject) {
86
-    return \'<a href="?action=edit&id=\'+options.rowId+\'">'.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>'.
87
-    '&nbsp;<a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."\'".')) return false;"  href="?sec_token='.$token.'&action=copy&id=\'+options.rowId+\'">'.Display::return_icon('copy.png',get_lang('Copy'),'',ICON_SIZE_SMALL).'</a>'.
88
-    '&nbsp;<a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."\'".')) return false;"  href="?sec_token='.$token.'&action=delete&id=\'+options.rowId+\'">'.Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'.
86
+    return \'<a href="?action=edit&id=\'+options.rowId+\'">'.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>'.
87
+    '&nbsp;<a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES))."\'".')) return false;"  href="?sec_token='.$token.'&action=copy&id=\'+options.rowId+\'">'.Display::return_icon('copy.png', get_lang('Copy'), '', ICON_SIZE_SMALL).'</a>'.
88
+    '&nbsp;<a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES))."\'".')) return false;"  href="?sec_token='.$token.'&action=delete&id=\'+options.rowId+\'">'.Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'.
89 89
     '\';
90 90
 }';
91 91
 ?>
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
         break;
134 134
     case 'edit':
135 135
         // Action handling: Editing
136
-        $url  = api_get_self() . '?action=' . Security::remove_XSS($_GET['action']) . '&id=' . intval($_GET['id']);
136
+        $url  = api_get_self().'?action='.Security::remove_XSS($_GET['action']).'&id='.intval($_GET['id']);
137 137
         $form = $career->return_form($url, 'edit');
138 138
 
139 139
         // The validation or display
Please login to merge, or discard this patch.
main/admin/add_sessions_to_usergroup.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -21,16 +21,16 @@  discard block
 block discarded – undo
21 21
 api_protect_admin_script(true);
22 22
 
23 23
 // setting breadcrumbs
24
-$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
25
-$interbreadcrumb[]=array('url' => 'usergroups.php','name' => get_lang('Classes'));
24
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
25
+$interbreadcrumb[] = array('url' => 'usergroups.php', 'name' => get_lang('Classes'));
26 26
 
27 27
 // Database Table Definitions
28 28
 
29 29
 // setting the name of the tool
30
-$tool_name=get_lang('SubscribeClassToSessions');
30
+$tool_name = get_lang('SubscribeClassToSessions');
31 31
 
32 32
 $add_type = 'multiple';
33
-if(isset($_REQUEST['add_type']) && $_REQUEST['add_type']!=''){
33
+if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') {
34 34
     $add_type = Security::remove_XSS($_REQUEST['add_type']);
35 35
 }
36 36
 
@@ -65,10 +65,10 @@  discard block
 block discarded – undo
65 65
 function display_advanced_search () {
66 66
         if ($("#advancedSearch").css("display") == "none") {
67 67
                 $("#advancedSearch").css("display","block");
68
-                $("#img_plus_and_minus").html(\'&nbsp;'.Display::return_icon('div_hide.gif',get_lang('Hide'),array('style'=>'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedSearch').'\');
68
+                $("#img_plus_and_minus").html(\'&nbsp;'.Display::return_icon('div_hide.gif', get_lang('Hide'), array('style'=>'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedSearch').'\');
69 69
         } else {
70 70
                 $("#advancedSearch").css("display","none");
71
-                $("#img_plus_and_minus").html(\'&nbsp;'.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedSearch').'\');
71
+                $("#img_plus_and_minus").html(\'&nbsp;'.Display::return_icon('div_show.gif', get_lang('Show'), array('style'=>'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedSearch').'\');
72 72
         }
73 73
 }
74 74
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
 $form_sent  = 0;
84 84
 $errorMsg   = '';
85
-$sessions=array();
85
+$sessions = array();
86 86
 $usergroup = new UserGroup();
87 87
 $id = intval($_GET['id']);
88 88
 if (isset($_POST['form_sent']) && $_POST['form_sent']) {
@@ -103,10 +103,10 @@  discard block
 block discarded – undo
103 103
 $session_list       = SessionManager::get_sessions_list(array(), array('name'));
104 104
 
105 105
 //api_display_tool_title($tool_name.' ('.$session_info['name'].')');
106
-$elements_not_in = $elements_in= array();
106
+$elements_not_in = $elements_in = array();
107 107
 
108 108
 if (!empty($session_list)) {
109
-    foreach($session_list as $session) {
109
+    foreach ($session_list as $session) {
110 110
         if (in_array($session['id'], $session_list_in)) {
111 111
             $elements_in[$session['id']] = $session['name'];
112 112
         } else {
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 
120 120
 //checking for extra field with filter on
121 121
 
122
-function search_usergroup_sessions($needle,$type) {
122
+function search_usergroup_sessions($needle, $type) {
123 123
     global $elements_in;
124 124
     $xajax_response = new xajaxResponse();
125 125
     $return = '';
@@ -134,17 +134,17 @@  discard block
 block discarded – undo
134 134
                 array('s.name' => array('operator' => 'LIKE', 'value' => "$needle%"))
135 135
             );
136 136
         }
137
-        $i=0;
137
+        $i = 0;
138 138
         if ($type != 'single') {
139 139
             $return .= '<select id="elements_not_in" name="elements_not_in_name[]" multiple="multiple" size="15" style="width:360px;">';
140 140
 
141
-            foreach ($session_list as $row ) {
141
+            foreach ($session_list as $row) {
142 142
                 if (!in_array($row['id'], array_keys($elements_in))) {
143 143
                     $return .= '<option value="'.$row['id'].'">'.$row['name'].'</option>';
144 144
                 }
145 145
             }
146 146
             $return .= '</select>';
147
-            $xajax_response -> addAssign('ajax_list_multiple','innerHTML',api_utf8_encode($return));
147
+            $xajax_response -> addAssign('ajax_list_multiple', 'innerHTML', api_utf8_encode($return));
148 148
         }
149 149
     }
150 150
 
@@ -156,30 +156,30 @@  discard block
 block discarded – undo
156 156
 
157 157
 $add = (empty($_GET['add']) ? '' : Security::remove_XSS($_GET['add']));
158 158
 if ($add_type == 'multiple') {
159
-    $link_add_type_unique = '<a href="' . api_get_self() . '?add=' . $add . '&add_type=unique">'.
159
+    $link_add_type_unique = '<a href="'.api_get_self().'?add='.$add.'&add_type=unique">'.
160 160
         Display::return_icon('single.gif').get_lang('SessionAddTypeUnique').'</a>';
161 161
     $link_add_type_multiple = Display::return_icon('multiple.gif').get_lang('SessionAddTypeMultiple');
162 162
 } else {
163 163
     $link_add_type_unique = Display::return_icon('single.gif').get_lang('SessionAddTypeUnique');
164
-    $link_add_type_multiple = '<a href="' . api_get_self() . '?add=' . $add . '&add_type=multiple">'.
164
+    $link_add_type_multiple = '<a href="'.api_get_self().'?add='.$add.'&add_type=multiple">'.
165 165
         Display::return_icon('multiple.gif').get_lang('SessionAddTypeMultiple').'</a>';
166 166
 }
167 167
 
168 168
 echo '<div class="actions">';
169
-echo '<a href="usergroups.php">'.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>';
169
+echo '<a href="usergroups.php">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
170 170
 echo '<a href="javascript://" class="advanced_parameters" style="margin-top: 8px" onclick="display_advanced_search();"><span id="img_plus_and_minus">&nbsp;'.
171
-    Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedSearch').'</span></a>';
171
+    Display::return_icon('div_show.gif', get_lang('Show'), array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedSearch').'</span></a>';
172 172
 echo '</div>';
173
-echo '<div id="advancedSearch" style="display: none">'. get_lang('SearchSessions'); ?> :
173
+echo '<div id="advancedSearch" style="display: none">'.get_lang('SearchSessions'); ?> :
174 174
      <input name="SearchSession" onchange = "xajax_search_usergroup_sessions(this.value,'searchbox')" onkeyup="this.onchange()">
175 175
      </div>
176
-<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>>
176
+<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if (!empty($_GET['add'])) echo '&add=true'; ?>" style="margin:0px;" <?php if ($ajax_search) {echo ' onsubmit="valide();"'; }?>>
177 177
 <?php
178 178
 echo '<legend>'.$data['name'].': '.$tool_name.'</legend>';
179
-echo Display::input('hidden','id',$id);
180
-echo Display::input('hidden','form_sent','1');
181
-echo Display::input('hidden','add_type',null);
182
-if(!empty($errorMsg)) {
179
+echo Display::input('hidden', 'id', $id);
180
+echo Display::input('hidden', 'form_sent', '1');
181
+echo Display::input('hidden', 'add_type', null);
182
+if (!empty($errorMsg)) {
183 183
     Display::display_normal_message($errorMsg); //main API
184 184
 }
185 185
 ?>
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
   <td align="center"><b><?php echo get_lang('SessionsInGroup') ?> :</b></td>
193 193
 </tr>
194 194
 
195
-<?php if ($add_type=='multiple') { ?>
195
+<?php if ($add_type == 'multiple') { ?>
196 196
 <tr>
197 197
 <td align="center">
198 198
 <?php echo get_lang('FirstLetterSessions'); ?> :
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
   <td align="center">
212 212
   <div id="content_source">
213 213
       <?php
214
-      if (!($add_type=='multiple')) {
214
+      if (!($add_type == 'multiple')) {
215 215
         ?>
216 216
         <input type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single')" />
217 217
         <div id="ajax_list_users_single"></div>
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
       } else {
220 220
       ?>
221 221
       <div id="ajax_list_multiple">
222
-        <?php echo Display::select('elements_not_in_name',$elements_not_in, '',array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'elements_not_in','size'=>'15px'),false); ?>
222
+        <?php echo Display::select('elements_not_in_name', $elements_not_in, '', array('style'=>'width:360px', 'multiple'=>'multiple', 'id'=>'elements_not_in', 'size'=>'15px'), false); ?>
223 223
       </div>
224 224
     <?php
225 225
       }
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
   </td>
251 251
   <td align="center">
252 252
 <?php
253
-    echo Display::select('elements_in_name[]', $elements_in, '', array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'elements_in','size'=>'15px'),false );
253
+    echo Display::select('elements_in_name[]', $elements_in, '', array('style'=>'width:360px', 'multiple'=>'multiple', 'id'=>'elements_in', 'size'=>'15px'), false);
254 254
     unset($sessionUsersList);
255 255
 ?>
256 256
  </td>
Please login to merge, or discard this patch.
main/exercise/export/scorm/scorm_classes.php 1 patch
Spacing   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
 		$question->type = $qst->type;
44 44
 		$question->question = $qst->question;
45 45
 		$question->description = $qst->description;
46
-		$question->weighting=$qst->weighting;
47
-		$question->position=$qst->position;
48
-		$question->picture=$qst->picture;
46
+		$question->weighting = $qst->weighting;
47
+		$question->position = $qst->position;
48
+		$question->picture = $qst->picture;
49 49
 		$assessmentItem = new ScormAssessmentItem($question, $standalone);
50 50
 
51 51
 		return $assessmentItem->export();
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 					<input name="'.$identifier.'" id="'.$identifier.'" value="'.$i.'" type="checkbox" />
228 228
 					</td>
229 229
 					<td width="95%">
230
-					<label for="'.$identifier.'">' . Security::remove_XSS($this->answer[$i]) . '</label>
230
+					<label for="'.$identifier.'">'.Security::remove_XSS($this->answer[$i]).'</label>
231 231
 					</td>
232 232
 					</tr>';
233 233
 
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
                 $jstmpw .= 'questions_answers_correct['.$this->questionJSId.']['.$i.'] = '.$this->correct[$i].';';
240 240
 				$id++;
241 241
 			}
242
-			$js .= 'questions_answers['.$this->questionJSId.'] = new Array('.substr($jstmp,0,-1).');'."\n";
242
+			$js .= 'questions_answers['.$this->questionJSId.'] = new Array('.substr($jstmp, 0, -1).');'."\n";
243 243
             $js .= 'questions_types['.$this->questionJSId.'] = \'mcma\';'."\n";
244 244
 			$js .= $jstmpw;
245 245
 		} elseif ($type == MULTIPLE_ANSWER_COMBINATION) {
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 					<input name="'.$identifier.'" id="'.$identifier.'" value="'.$i.'" type="checkbox" />
256 256
 					</td>
257 257
 					<td width="95%">
258
-					<label for="'.$identifier.'">' . Security::remove_XSS($this->answer[$i]) . '</label>
258
+					<label for="'.$identifier.'">'.Security::remove_XSS($this->answer[$i]).'</label>
259 259
 					</td>
260 260
 					</tr>';
261 261
 
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
                 $jstmpw .= 'questions_answers_correct['.$this->questionJSId.']['.$i.'] = '.$this->correct[$i].";";
268 268
                 $id++;
269 269
             }
270
-            $js .= 'questions_answers['.$this->questionJSId.'] = new Array('.substr($jstmp,0,-1).');';
270
+            $js .= 'questions_answers['.$this->questionJSId.'] = new Array('.substr($jstmp, 0, -1).');';
271 271
             $js .= 'questions_types['.$this->questionJSId.'] = "exact";';
272 272
             $js .= $jstmpw;
273 273
 		} else {
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 					<input name="'.$identifier_name.'" id="'.$identifier.'" value="'.$i.'" type="checkbox"/>
284 284
 					</td>
285 285
 					<td width="95%">
286
-					<label for="'.$identifier.'">' . Security::remove_XSS($this->answer[$i]) . '</label>
286
+					<label for="'.$identifier.'">'.Security::remove_XSS($this->answer[$i]).'</label>
287 287
 					</td>
288 288
 					</tr>';
289 289
 				$jstmp .= $i.',';
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
                 $jstmpw .= 'questions_answers_correct['.$this->questionJSId.']['.$i.'] = '.$this->correct[$i].';';
295 295
 				$id++;
296 296
 			}
297
-			$js .= 'questions_answers['.$this->questionJSId.'] = new Array('.substr($jstmp,0,-1).');';
297
+			$js .= 'questions_answers['.$this->questionJSId.'] = new Array('.substr($jstmp, 0, -1).');';
298 298
 			$js .= 'questions_types['.$this->questionJSId.'] = \'mcua\';';
299 299
 			$js .= $jstmpw;
300 300
 		}
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 				<input name="'.$identifier_true.'" id="'.$identifier_true.'" value="'.$this->trueGrade.'" type="radio" />
330 330
 				</td>
331 331
 				<td width="95%">
332
-				<label for="'.$identifier_true.'">' . get_lang('True') . '</label>
332
+				<label for="'.$identifier_true.'">'.get_lang('True').'</label>
333 333
 				</td>
334 334
 				</tr>';
335 335
 		$html .=
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 			<input name="'.$identifier_false.'" id="'.$identifier_false.'" value="'.$this->falseGrade.'" type="radio" />
339 339
 			</td>
340 340
 			<td width="95%">
341
-			<label for="'.$identifier_false.'">' . get_lang('False') . '</label>
341
+			<label for="'.$identifier_false.'">'.get_lang('False').'</label>
342 342
 			</td>
343 343
 			</tr></table></td></tr>';
344 344
 		$js .= 'questions_answers['.$this->questionJSId.'] = new Array(\'true\',\'false\');'."\n";
@@ -383,30 +383,30 @@  discard block
 block discarded – undo
383 383
 		}
384 384
 
385 385
 		// splits text and weightings that are joined with the character '::'
386
-		list($answer,$weight)=explode('::',$answer);
387
-		$weights = explode(',',$weight);
386
+		list($answer, $weight) = explode('::', $answer);
387
+		$weights = explode(',', $weight);
388 388
 		// because [] is parsed here we follow this procedure:
389 389
 		// 1. find everything between the [ and ] tags
390
-		$i=1;
390
+		$i = 1;
391 391
 		$jstmp = '';
392 392
 		$jstmpc = '';
393 393
 		$jstmpw = 'questions_answers_ponderation['.$this->questionJSId.'] = new Array();'."\n";
394 394
 		$jstmpw .= 'questions_answers_ponderation['.$this->questionJSId.'][0] = 0;'."\n";
395
-		$startlocations=api_strpos($answer,'[');
396
-		$endlocations=api_strpos($answer,']');
395
+		$startlocations = api_strpos($answer, '[');
396
+		$endlocations = api_strpos($answer, ']');
397 397
 		while ($startlocations !== false && $endlocations !== false) {
398
-			$texstring = api_substr($answer,$startlocations,($endlocations-$startlocations)+1);
398
+			$texstring = api_substr($answer, $startlocations, ($endlocations - $startlocations) + 1);
399 399
 			$answer = api_substr_replace(
400 400
                 $answer,
401 401
                 '<input type="text" name="question_'.$this->questionJSId.'_fib_'.$i.'" id="question_'.$this->questionJSId.'_fib_'.$i.'" size="10" value="" />',
402 402
                 $startlocations,
403
-                ($endlocations-$startlocations)+1
403
+                ($endlocations - $startlocations) + 1
404 404
             );
405 405
             $jstmp .= $i.',';
406 406
 			if (!empty($texstring)) {
407 407
 				$sub = api_substr($texstring, 1, -1);
408 408
 				if (!empty($sub)) {
409
-					$jstmpc .= "'" . api_htmlentities($sub, ENT_QUOTES, $charset) . "',";
409
+					$jstmpc .= "'".api_htmlentities($sub, ENT_QUOTES, $charset)."',";
410 410
 				}
411 411
 			}
412 412
             $my_weight = explode('@', $weights[$i - 1]);
@@ -426,12 +426,12 @@  discard block
 block discarded – undo
426 426
 			'.$answer.'
427 427
 			</td>
428 428
 			</tr></table></td></tr>';
429
-		$js .= 'questions_answers['.$this->questionJSId.'] = new Array('.api_substr($jstmp,0,-1).');'."\n";
430
-		$js .= 'questions_answers_correct['.$this->questionJSId.'] = new Array('.api_substr($jstmpc,0,-1).');'."\n";
429
+		$js .= 'questions_answers['.$this->questionJSId.'] = new Array('.api_substr($jstmp, 0, -1).');'."\n";
430
+		$js .= 'questions_answers_correct['.$this->questionJSId.'] = new Array('.api_substr($jstmpc, 0, -1).');'."\n";
431 431
 		$js .= 'questions_types['.$this->questionJSId.'] = \'fib\';'."\n";
432 432
 		$js .= $jstmpw;
433 433
 
434
-		return array($js,$html);
434
+		return array($js, $html);
435 435
 	}
436 436
 }
437 437
 
@@ -457,8 +457,8 @@  discard block
 block discarded – undo
457 457
 		// get max length of displayed array
458 458
 
459 459
 		$nbrAnswers = $this->selectNbrAnswers();
460
-		$cpt1='A';
461
-		$cpt2=1;
460
+		$cpt1 = 'A';
461
+		$cpt2 = 1;
462 462
 		$Select = array();
463 463
 		$qId = $this->questionJSId;
464 464
 		$s = '';
@@ -467,37 +467,37 @@  discard block
 block discarded – undo
467 467
 		$jstmpw = 'questions_answers_ponderation['.$this->questionJSId.'] = new Array();'."\n";
468 468
 		$jstmpw .= 'questions_answers_ponderation['.$this->questionJSId.'][0] = 0;'."\n";
469 469
 
470
-		for ($answerId=1;$answerId <= $nbrAnswers;$answerId++) {
470
+		for ($answerId = 1; $answerId <= $nbrAnswers; $answerId++) {
471 471
 			$identifier = 'question_'.$qId.'_matching_';
472
-			$answer=$this->selectAnswer($answerId);
473
-			$answerCorrect=$this->isCorrect($answerId);
474
-			$weight=$this->selectWeighting($answerId);
472
+			$answer = $this->selectAnswer($answerId);
473
+			$answerCorrect = $this->isCorrect($answerId);
474
+			$weight = $this->selectWeighting($answerId);
475 475
 			$jstmp .= $answerId.',';
476 476
 
477 477
 			if (!$answerCorrect) {
478 478
 				// options (A, B, C, ...) that will be put into the list-box
479
-				$Select[$answerId]['Lettre']=$cpt1;
479
+				$Select[$answerId]['Lettre'] = $cpt1;
480 480
 				// answers that will be shown at the right side
481 481
 				$Select[$answerId]['Reponse'] = $answer;
482 482
 				$cpt1++;
483 483
 			} else {
484
-				$s.='<tr>';
485
-				$s.='<td width="40%" valign="top"><b>'.$cpt2.'</b>.&nbsp;'.$answer."</td>";
486
-				$s.='<td width="20%" align="center">&nbsp;&nbsp;<select name="'.$identifier.$cpt2.'" id="'.$identifier.$cpt2.'">';
487
-				$s.=' <option value="0">--</option>';
484
+				$s .= '<tr>';
485
+				$s .= '<td width="40%" valign="top"><b>'.$cpt2.'</b>.&nbsp;'.$answer."</td>";
486
+				$s .= '<td width="20%" align="center">&nbsp;&nbsp;<select name="'.$identifier.$cpt2.'" id="'.$identifier.$cpt2.'">';
487
+				$s .= ' <option value="0">--</option>';
488 488
 				// fills the list-box
489 489
                 foreach ($Select as $key => $val) {
490 490
                     $s .= '<option value="'.$key.'">'.$val['Lettre'].'</option>';
491 491
                 }  // end foreach()
492 492
 
493
-				$s.='</select>&nbsp;&nbsp;</td>';
494
-				$s.='<td width="40%" valign="top">';
493
+				$s .= '</select>&nbsp;&nbsp;</td>';
494
+				$s .= '<td width="40%" valign="top">';
495 495
                 if (isset($Select[$cpt2])) {
496 496
                     $s .= '<b>'.$Select[$cpt2]['Lettre'].'.</b> '.$Select[$cpt2]['Reponse'];
497 497
                 } else {
498 498
                     $s .= '&nbsp;';
499 499
                 }
500
-				$s.="</td></tr>";
500
+				$s .= "</td></tr>";
501 501
 
502 502
 				$jstmpc .= '['.$answerCorrect.','.$cpt2.'],';
503 503
 
@@ -514,22 +514,22 @@  discard block
 block discarded – undo
514 514
 				if ($answerId == $nbrAnswers) {
515 515
 					// if there remain answers to be shown on the right side
516 516
 					while (isset($Select[$cpt2])) {
517
-						$s.= '<tr>';
518
-						$s.= '<td width="60%" colspan="2">&nbsp;</td>';
519
-						$s.= '<td width="40%" valign="top">';
520
-						$s.= '<b>'.$Select[$cpt2]['Lettre'].'.</b> '.$Select[$cpt2]['Reponse'];
521
-						$s.= "</td></tr>";
517
+						$s .= '<tr>';
518
+						$s .= '<td width="60%" colspan="2">&nbsp;</td>';
519
+						$s .= '<td width="40%" valign="top">';
520
+						$s .= '<b>'.$Select[$cpt2]['Lettre'].'.</b> '.$Select[$cpt2]['Reponse'];
521
+						$s .= "</td></tr>";
522 522
 						$cpt2++;
523 523
 					}	// end while()
524 524
 				}  // end if()
525 525
 			}
526 526
 		}
527
-		$js .= 'questions_answers['.$this->questionJSId.'] = new Array('.substr($jstmp,0,-1).');'."\n";
528
-		$js .= 'questions_answers_correct['.$this->questionJSId.'] = new Array('.substr($jstmpc,0,-1).');'."\n";
527
+		$js .= 'questions_answers['.$this->questionJSId.'] = new Array('.substr($jstmp, 0, -1).');'."\n";
528
+		$js .= 'questions_answers_correct['.$this->questionJSId.'] = new Array('.substr($jstmpc, 0, -1).');'."\n";
529 529
 		$js .= 'questions_types['.$this->questionJSId.'] = \'matching\';'."\n";
530 530
 		$js .= $jstmpw;
531 531
 		$html .= $s;
532
-		$html .= '</table></td></tr>' . "\n";
532
+		$html .= '</table></td></tr>'."\n";
533 533
 
534 534
 		return array($js, $html);
535 535
 	}
@@ -634,7 +634,7 @@  discard block
 block discarded – undo
634 634
 		$html .= '';
635 635
 
636 636
 		// Get the answers, make a list
637
-		$nbrAnswers=$this->selectNbrAnswers();
637
+		$nbrAnswers = $this->selectNbrAnswers();
638 638
 
639 639
 		$answer_list = '<div style="padding: 10px; margin-left: -8px; border: 1px solid #4271b5; height: 448px; width: 200px;"><b>'.get_lang('HotspotZones').'</b><ol>';
640 640
         for ($answerId = 1; $answerId <= $nbrAnswers; $answerId++) {
@@ -698,7 +698,7 @@  discard block
 block discarded – undo
698 698
 	{
699 699
 		$this->question = $question;
700 700
 		$this->question->setAnswer();
701
-		$this->questionIdent = "QST_" . $question->id ;
701
+		$this->questionIdent = "QST_".$question->id;
702 702
 		$this->standalone = $standalone;
703 703
 	}
704 704
 
@@ -798,7 +798,7 @@  discard block
 block discarded – undo
798 798
 		$js .= 'var questions_answers = new Array();';
799 799
 		$js .= 'var questions_answers_correct = new Array();';
800 800
 		$js .= 'var questions_types = new Array();';
801
-		$js .= "\n" .
801
+		$js .= "\n".
802 802
 			'/**
803 803
              * Assigns any event handler to any element
804 804
              * @param	object	Element on which the event is added
@@ -1018,11 +1018,11 @@  discard block
 block discarded – undo
1018 1018
 	{
1019 1019
 		$js = file_get_contents('../inc/lib/javascript/hotspot/js/hotspot.js');
1020 1020
 
1021
-		$js .= 'var questions = new Array();' . "\n";
1022
-		$js .= 'var questions_answers = new Array();' . "\n";
1023
-		$js .= 'var questions_answers_correct = new Array();' . "\n";
1024
-		$js .= 'var questions_types = new Array();' . "\n";
1025
-		$js .= "\n" .
1021
+		$js .= 'var questions = new Array();'."\n";
1022
+		$js .= 'var questions_answers = new Array();'."\n";
1023
+		$js .= 'var questions_answers_correct = new Array();'."\n";
1024
+		$js .= 'var questions_types = new Array();'."\n";
1025
+		$js .= "\n".
1026 1026
 			'/**
1027 1027
              * Assigns any event handler to any element
1028 1028
              * @param	object	Element on which the event is added
@@ -1067,7 +1067,7 @@  discard block
 block discarded – undo
1067 1067
 
1068 1068
 		$js .= '';
1069 1069
 		$js .= 'addEvent(window,\'load\',addListeners,false);'."\n";
1070
-		return $js. "\n";
1070
+		return $js."\n";
1071 1071
 	}
1072 1072
 
1073 1073
 	/**
@@ -1114,8 +1114,8 @@  discard block
 block discarded – undo
1114 1114
 
1115 1115
 		$head = '';
1116 1116
 		if ($this->standalone) {
1117
-			$head = '<?xml version = "1.0" encoding = "' . $charset . '" standalone = "no"?>' . "\n"
1118
-				. '<!DOCTYPE questestinterop SYSTEM "ims_qtiasiv2p1.dtd">' . "\n";
1117
+			$head = '<?xml version = "1.0" encoding = "'.$charset.'" standalone = "no"?>'."\n"
1118
+				. '<!DOCTYPE questestinterop SYSTEM "ims_qtiasiv2p1.dtd">'."\n";
1119 1119
 		}
1120 1120
 
1121 1121
 		list($js, $html) = $this->export_questions();
@@ -1157,7 +1157,7 @@  discard block
 block discarded – undo
1157 1157
 		$js = $html = "";
1158 1158
 		$js_id = 0;
1159 1159
 		foreach ($this->exercise->selectQuestionList() as $q) {
1160
-			list($jstmp, $htmltmp)= ScormQuestion::export_question($q, false, $js_id);
1160
+			list($jstmp, $htmltmp) = ScormQuestion::export_question($q, false, $js_id);
1161 1161
 			$js .= $jstmp."\n";
1162 1162
 			$html .= $htmltmp."\n";
1163 1163
 			++$js_id;
Please login to merge, or discard this patch.
main/exercise/hotspot_savescore.inc.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 $objExercise = Session::read('objExercise');
17 17
 $exerciseId = $objExercise->selectId();
18 18
 // Save clicking order
19
-$answerOrderId = count($_SESSION['exerciseResult'][$questionId]['ids'])+1;
19
+$answerOrderId = count($_SESSION['exerciseResult'][$questionId]['ids']) + 1;
20 20
 if ($_GET['answerId'] == "0") {
21 21
     // click is NOT on a hotspot
22 22
     $hit = 0;
@@ -24,18 +24,18 @@  discard block
 block discarded – undo
24 24
 } else {
25 25
     // user clicked ON a hotspot
26 26
     $hit = 1;
27
-    $answerId = api_substr($_GET['answerId'],22,2);
27
+    $answerId = api_substr($_GET['answerId'], 22, 2);
28 28
 	// Save into session
29 29
 	$_SESSION['exerciseResult'][$questionId][$answerId] = $hit;
30 30
 }
31 31
 //round-up the coordinates
32
-$coords = explode('/',$coordinates);
32
+$coords = explode('/', $coordinates);
33 33
 $coordinates = '';
34 34
 foreach ($coords as $coord) {
35
-    list($x,$y) = explode(';',$coord);
35
+    list($x, $y) = explode(';', $coord);
36 36
     $coordinates .= round($x).';'.round($y).'/';
37 37
 }
38
-$coordinates = substr($coordinates,0,-1);
38
+$coordinates = substr($coordinates, 0, -1);
39 39
 
40 40
 $TBL_TRACK_E_HOTSPOT = Database::get_main_table(TABLE_STATISTIC_TRACK_E_HOTSPOT);
41 41
 // Save into db
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     'quiz_id' => $exerciseId,
46 46
     'question_id' => $questionId,
47 47
     'answer_id' =>  $answerId,
48
-    'correct' => $hit ,
48
+    'correct' => $hit,
49 49
     'coordinate' => $coordinates
50 50
 ];
51 51
 // Save insert id into session if users changes answer.
Please login to merge, or discard this patch.
main/exercise/hotspot_updatescore.inc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,13 +33,13 @@
 block discarded – undo
33 33
 }
34 34
 
35 35
 //round-up the coordinates
36
-$coords = explode('/',$coordinates);
36
+$coords = explode('/', $coordinates);
37 37
 $coordinates = '';
38 38
 foreach ($coords as $coord) {
39
-    list($x,$y) = explode(';',$coord);
39
+    list($x, $y) = explode(';', $coord);
40 40
     $coordinates .= round($x).';'.round($y).'/';
41 41
 }
42
-$coordinates = substr($coordinates,0,-1);
42
+$coordinates = substr($coordinates, 0, -1);
43 43
 
44 44
 $TBL_TRACK_E_HOTSPOT = Database::get_main_table(TABLE_STATISTIC_TRACK_E_HOTSPOT);
45 45
 
Please login to merge, or discard this patch.
main/exercise/exercise_reminder.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 // notice for unauthorized people.
18 18
 api_protect_course_script(true);
19 19
 
20
-if ($debug>0) {
20
+if ($debug > 0) {
21 21
     error_log('Entered exercise_result.php: '.print_r($_POST, 1));
22 22
 }
23 23
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 if (isset($_SESSION['exe_id'])) {
98 98
     $exe_id = intval($_SESSION['exe_id']);
99 99
 }
100
-$exercise_stat_info	= $objExercise->get_stat_track_exercise_info_by_exe_id($exe_id);
100
+$exercise_stat_info = $objExercise->get_stat_track_exercise_info_by_exe_id($exe_id);
101 101
 if (!empty($exercise_stat_info['data_tracking'])) {
102 102
     $question_list = explode(',', $exercise_stat_info['data_tracking']);
103 103
 }
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
     Display::url(
250 250
         get_lang('ReviewQuestions'),
251 251
         'javascript://',
252
-        array('onclick'=>'review_questions();','class'=>'btn btn-success')
252
+        array('onclick'=>'review_questions();', 'class'=>'btn btn-success')
253 253
     );
254 254
 
255 255
 echo Display::div('', array('class'=>'clear'));
Please login to merge, or discard this patch.
main/mySpace/course.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 $sessionId = isset($_GET['session_id']) ? intval($_GET['session_id']) : null;
16 16
 
17 17
 api_block_anonymous_users();
18
-$interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('MySpace'));
18
+$interbreadcrumb[] = array("url" => "index.php", "name" => get_lang('MySpace'));
19 19
 
20 20
 if (isset($_GET["id_session"]) && $_GET["id_session"] != "") {
21 21
     $interbreadcrumb[] = array("url" => "session.php", "name" => get_lang('Sessions'));
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
             $user_id = intval($_GET['user_id']);
67 67
             $user_info = api_get_user_info($user_id);
68 68
             $title = get_lang('AssignedCoursesTo').' '.api_get_person_name($user_info['firstname'], $user_info['lastname']);
69
-            $courses  = CourseManager::get_course_list_of_user_as_course_admin($user_id);
69
+            $courses = CourseManager::get_course_list_of_user_as_course_admin($user_id);
70 70
         } else {
71 71
             $title = get_lang('YourCourseList');
72 72
             $courses = CourseManager::get_courses_followed_by_drh(api_get_user_id());
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 
82 82
     if (!api_is_session_admin()) {
83 83
         $menu_items[] = Display::url(
84
-            Display::return_icon('stats.png', get_lang('MyStats'),'',ICON_SIZE_MEDIUM),
84
+            Display::return_icon('stats.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM),
85 85
             api_get_path(WEB_CODE_PATH)."auth/my_progress.php"
86 86
         );
87 87
         $menu_items[] = Display::url(
Please login to merge, or discard this patch.
main/lp/lp_admin_view.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
27 27
 $tbl_lp = Database::get_course_table(TABLE_LP_MAIN);
28 28
 $tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM);
29 29
 
30
-$isStudentView = isset($_REQUEST['isStudentView']) ? (int)$_REQUEST['isStudentView'] : null;
31
-$learnpath_id = (int)$_REQUEST['lp_id'];
30
+$isStudentView = isset($_REQUEST['isStudentView']) ? (int) $_REQUEST['isStudentView'] : null;
31
+$learnpath_id = (int) $_REQUEST['lp_id'];
32 32
 $submit = isset($_POST['submit_button']) ? $_POST['submit_button'] : null;
33 33
 $_course = api_get_course_info();
34 34
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 }
56 56
 
57 57
 if (!empty($gradebook) && $gradebook == 'view') {
58
-    $interbreadcrumb[] = array (
58
+    $interbreadcrumb[] = array(
59 59
         'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
60 60
         'name' => get_lang('ToolGradebook')
61 61
     );
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
             $in = implode(',', $lp_items_to_remove_audio);
97 97
         }
98 98
     }
99
-    if (count($lp_items_to_remove_audio)>0) {
99
+    if (count($lp_items_to_remove_audio) > 0) {
100 100
         $sql = "UPDATE $tbl_lp_item SET audio = '' 
101 101
                 WHERE c_id = $course_id AND id IN (".$in.")";
102 102
         $result = Database::query($sql);
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
                 // Adding something random to prevent overwriting.
132 132
                 $filename_components[count($filename_components) - 1] = time();
133 133
                 // Reconstructing the new filename.
134
-                $clean_name = implode($filename_components) .'.'.$file_extension;
134
+                $clean_name = implode($filename_components).'.'.$file_extension;
135 135
                 // Using the new name in the $_FILES superglobal.
136 136
                 $_FILES[$key]['name'] = $clean_name;
137 137
             }
Please login to merge, or discard this patch.