Completed
Push — 1.11.x ( db9766...f61bdf )
by José
49:38 queued 25:09
created
main/exercise/exercise_submit.php 1 patch
Indentation   +188 added lines, -188 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
     if (!$objExercise->read($exerciseId) ||
124 124
         (!$objExercise->selectStatus() && !$is_allowedToEdit && $origin != 'learnpath')
125 125
     ) {
126
-    	if ($debug) {error_log('1.1. Error while reading the exercise'); };
126
+        if ($debug) {error_log('1.1. Error while reading the exercise'); };
127 127
         unset ($objExercise);
128 128
         $error = get_lang('ExerciseNotFound');
129 129
     } else {
@@ -136,13 +136,13 @@  discard block
 block discarded – undo
136 136
 }
137 137
 //2. Checking if $objExercise is set
138 138
 if (!isset($objExercise) && isset($exerciseInSession)) {
139
-	if ($debug) { error_log('2. Loading $objExercise from session'); };
139
+    if ($debug) { error_log('2. Loading $objExercise from session'); };
140 140
     $objExercise = $exerciseInSession;
141 141
 }
142 142
 
143 143
 //3. $objExercise is not set, then return to the exercise list
144 144
 if (!is_object($objExercise)) {
145
-	if ($debug) {error_log('3. $objExercise was not set, kill the script'); };
145
+    if ($debug) {error_log('3. $objExercise was not set, kill the script'); };
146 146
     header('Location: exercise.php');
147 147
     exit;
148 148
 }
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 
165 165
 $time_control = false;
166 166
 if ($objExercise->expired_time != 0) {
167
-	$time_control = true;
167
+    $time_control = true;
168 168
 }
169 169
 
170 170
 // Generating the time control key for the user
@@ -173,14 +173,14 @@  discard block
 block discarded – undo
173 173
 $_SESSION['duration_time'][$current_expired_time_key] = $current_timestamp;
174 174
 
175 175
 if ($time_control) {
176
-	// Get the expired time of the current exercise in track_e_exercises
177
-	$total_seconds = $objExercise->expired_time*60;
176
+    // Get the expired time of the current exercise in track_e_exercises
177
+    $total_seconds = $objExercise->expired_time*60;
178 178
 }
179 179
 
180 180
 $show_clock = true;
181 181
 $user_id = api_get_user_id();
182 182
 if ($objExercise->selectAttempts() > 0) {
183
-	$attempt_html = '';
183
+    $attempt_html = '';
184 184
     $attempt_count = Event::get_attempt_count(
185 185
         $user_id,
186 186
         $exerciseId,
@@ -189,9 +189,9 @@  discard block
 block discarded – undo
189 189
         $learnpath_item_view_id
190 190
     );
191 191
 
192
-	if ($attempt_count >= $objExercise->selectAttempts()) {
193
-		$show_clock = false;
194
-		if (!api_is_allowed_to_edit(null,true)) {
192
+    if ($attempt_count >= $objExercise->selectAttempts()) {
193
+        $show_clock = false;
194
+        if (!api_is_allowed_to_edit(null,true)) {
195 195
             if ($objExercise->results_disabled == 0 && $origin != 'learnpath') {
196 196
 
197 197
                 // Showing latest attempt according with task BT#1628
@@ -230,31 +230,31 @@  discard block
 block discarded – undo
230 230
                             $attempt_html .= Display::div(get_lang('Score').' '.$marks, array('id'=>'question_question_titlescore'));
231 231
                         }
232 232
                     }
233
-					$score =  ExerciseLib::show_score($last_attempt_info['exe_result'], $last_attempt_info['exe_weighting']);
234
-					$attempt_html .= Display::div(get_lang('YourTotalScore').' '.$score, array('id'=>'question_score'));
235
-				} else {
236
-					$attempt_html .= Display::return_message(sprintf(get_lang('ReachedMaxAttempts'), $exercise_title, $objExercise->selectAttempts()), 'warning', false);
237
-				}
238
-			} else {
239
-				$attempt_html .= Display::return_message(sprintf(get_lang('ReachedMaxAttempts'), $exercise_title, $objExercise->selectAttempts()), 'warning', false);
240
-			}
241
-		} else {
242
-			$attempt_html .= Display :: return_message(sprintf(get_lang('ReachedMaxAttempts'), $exercise_title, $objExercise->selectAttempts()), 'warning', false);
243
-		}
233
+                    $score =  ExerciseLib::show_score($last_attempt_info['exe_result'], $last_attempt_info['exe_weighting']);
234
+                    $attempt_html .= Display::div(get_lang('YourTotalScore').' '.$score, array('id'=>'question_score'));
235
+                } else {
236
+                    $attempt_html .= Display::return_message(sprintf(get_lang('ReachedMaxAttempts'), $exercise_title, $objExercise->selectAttempts()), 'warning', false);
237
+                }
238
+            } else {
239
+                $attempt_html .= Display::return_message(sprintf(get_lang('ReachedMaxAttempts'), $exercise_title, $objExercise->selectAttempts()), 'warning', false);
240
+            }
241
+        } else {
242
+            $attempt_html .= Display :: return_message(sprintf(get_lang('ReachedMaxAttempts'), $exercise_title, $objExercise->selectAttempts()), 'warning', false);
243
+        }
244 244
 
245
-		if ($origin == 'learnpath') {
246
-			Display :: display_reduced_header();
247
-		} else {
248
-			Display :: display_header(get_lang('Exercises'));
249
-		}
245
+        if ($origin == 'learnpath') {
246
+            Display :: display_reduced_header();
247
+        } else {
248
+            Display :: display_header(get_lang('Exercises'));
249
+        }
250 250
 
251
-		echo $attempt_html;
251
+        echo $attempt_html;
252 252
 
253 253
         if ($origin != 'learnpath') {
254 254
             Display:: display_footer();
255 255
         }
256
-		exit;
257
-	}
256
+        exit;
257
+    }
258 258
 }
259 259
 
260 260
 if ($debug) {
@@ -278,26 +278,26 @@  discard block
 block discarded – undo
278 278
 
279 279
 if (empty($exercise_stat_info)) {
280 280
     if ($debug)  error_log('5  $exercise_stat_info is empty ');
281
-	$total_weight = 0;
282
-	$questionList = $objExercise->get_validated_question_list();
283
-	foreach ($questionListUncompressed as $question_id) {
284
-		$objQuestionTmp = Question::read($question_id);
285
-		$total_weight += floatval($objQuestionTmp->weighting);
286
-	}
281
+    $total_weight = 0;
282
+    $questionList = $objExercise->get_validated_question_list();
283
+    foreach ($questionListUncompressed as $question_id) {
284
+        $objQuestionTmp = Question::read($question_id);
285
+        $total_weight += floatval($objQuestionTmp->weighting);
286
+    }
287 287
 
288
-	if ($time_control) {
289
-		$expected_time = $current_timestamp + $total_seconds;
288
+    if ($time_control) {
289
+        $expected_time = $current_timestamp + $total_seconds;
290 290
 
291
-		if ($debug)  error_log('5.1. $current_timestamp '.$current_timestamp);
292
-		if ($debug)  error_log('5.2. $expected_time '.$expected_time);
291
+        if ($debug)  error_log('5.1. $current_timestamp '.$current_timestamp);
292
+        if ($debug)  error_log('5.2. $expected_time '.$expected_time);
293 293
 
294
-		$clock_expired_time 	= api_get_utc_datetime($expected_time);
295
-		if ($debug) error_log('5.3. $expected_time '.$clock_expired_time);
294
+        $clock_expired_time 	= api_get_utc_datetime($expected_time);
295
+        if ($debug) error_log('5.3. $expected_time '.$clock_expired_time);
296 296
 
297
-		//Sessions  that contain the expired time
298
-		$_SESSION['expired_time'][$current_expired_time_key] 	 = $clock_expired_time;
299
-		if ($debug) { error_log('5.4. Setting the $_SESSION[expired_time]: '.$_SESSION['expired_time'][$current_expired_time_key] ); };
300
-	}
297
+        //Sessions  that contain the expired time
298
+        $_SESSION['expired_time'][$current_expired_time_key] 	 = $clock_expired_time;
299
+        if ($debug) { error_log('5.4. Setting the $_SESSION[expired_time]: '.$_SESSION['expired_time'][$current_expired_time_key] ); };
300
+    }
301 301
 
302 302
     $exe_id = $objExercise->save_stat_track_exercise_info(
303 303
         $clock_expired_time,
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
     );
315 315
     if ($debug)  error_log("5.5  exercise_stat_info[] exists getting exe_id $exe_id");
316 316
 } else {
317
-	$exe_id = $exercise_stat_info['exe_id'];
317
+    $exe_id = $exercise_stat_info['exe_id'];
318 318
     // Remember last question id position.
319 319
     $isFirstTime = Session::read('firstTime');
320 320
     if ($isFirstTime && $objExercise->type == ONE_PER_PAGE) {
@@ -373,9 +373,9 @@  discard block
 block discarded – undo
373 373
 if ($debug) { error_log('6. $objExercise->get_stat_track_exercise_info function called::  '.print_r($exercise_stat_info, 1)); };
374 374
 
375 375
 if (!empty($exercise_stat_info['questions_to_check'])) {
376
-	$my_remind_list = $exercise_stat_info['questions_to_check'];
377
-	$my_remind_list = explode(',', $my_remind_list);
378
-	$my_remind_list = array_filter($my_remind_list);
376
+    $my_remind_list = $exercise_stat_info['questions_to_check'];
377
+    $my_remind_list = explode(',', $my_remind_list);
378
+    $my_remind_list = array_filter($my_remind_list);
379 379
 }
380 380
 
381 381
 $params = "exe_id=$exe_id&exerciseId=$exerciseId&origin=$origin&learnpath_id=$learnpath_id&learnpath_item_id=$learnpath_item_id&learnpath_item_view_id=$learnpath_item_view_id&".api_get_cidreq();
@@ -383,8 +383,8 @@  discard block
 block discarded – undo
383 383
 
384 384
 if ($reminder == 2 && empty($my_remind_list)) {
385 385
     if ($debug) { error_log("6.2 calling the exercise_reminder.php "); };
386
-	header('Location: exercise_reminder.php?'.$params);
387
-	exit;
386
+    header('Location: exercise_reminder.php?'.$params);
387
+    exit;
388 388
 }
389 389
 
390 390
 /*
@@ -392,56 +392,56 @@  discard block
 block discarded – undo
392 392
  * If the expired time is major that zero(0) then the expired time is compute on this time.
393 393
  */
394 394
 if ($time_control) {
395
-	if ($debug) error_log('7.1. Time control is enabled');
396
-	if ($debug) error_log('7.2. $current_expired_time_key  '.$current_expired_time_key);
397
-	if ($debug) error_log('7.3. $_SESSION[expired_time][$current_expired_time_key]  '.$_SESSION['expired_time'][$current_expired_time_key]);
395
+    if ($debug) error_log('7.1. Time control is enabled');
396
+    if ($debug) error_log('7.2. $current_expired_time_key  '.$current_expired_time_key);
397
+    if ($debug) error_log('7.3. $_SESSION[expired_time][$current_expired_time_key]  '.$_SESSION['expired_time'][$current_expired_time_key]);
398 398
 
399 399
     if (!isset($_SESSION['expired_time'][$current_expired_time_key])) {
400 400
         //Timer - Get expired_time for a student
401 401
         if (!empty($exercise_stat_info)) {
402
-        	if ($debug) {error_log('7.4 Seems that the session ends and the user want to retake the exam'); };
403
-	        $expired_time_of_this_attempt = $exercise_stat_info['expired_time_control'];
404
-			if ($debug) {error_log('7.5 $expired_time_of_this_attempt: '.$expired_time_of_this_attempt); }
405
-	        // Get the last attempt of an exercise
406
-	    	$last_attempt_date = Event::getLastAttemptDateOfExercise($exercise_stat_info['exe_id']);
402
+            if ($debug) {error_log('7.4 Seems that the session ends and the user want to retake the exam'); };
403
+            $expired_time_of_this_attempt = $exercise_stat_info['expired_time_control'];
404
+            if ($debug) {error_log('7.5 $expired_time_of_this_attempt: '.$expired_time_of_this_attempt); }
405
+            // Get the last attempt of an exercise
406
+            $last_attempt_date = Event::getLastAttemptDateOfExercise($exercise_stat_info['exe_id']);
407 407
 
408
-	    	/* This means that the user enters the exam but do not answer the
408
+            /* This means that the user enters the exam but do not answer the
409 409
 	    	   first question we get the date from the track_e_exercises not from
410 410
 	    	   the track_et_attempt see #2069 */
411
-	    	if (empty($last_attempt_date)) {
412
-	    		$diff = $current_timestamp - api_strtotime($exercise_stat_info['start_date'], 'UTC');
413
-	    		$last_attempt_date = api_get_utc_datetime(api_strtotime($exercise_stat_info['start_date'],'UTC') + $diff);
414
-	    	} else {
415
-	    		//Recalculate the time control due #2069
416
-	    		$diff = $current_timestamp - api_strtotime($last_attempt_date,'UTC');
417
-	    		$last_attempt_date = api_get_utc_datetime(api_strtotime($last_attempt_date,'UTC') + $diff);
418
-	    	}
419
-	        if ($debug) {error_log('7.6. $last_attempt_date: '.$last_attempt_date); }
420
-
421
-	        //New expired time - it is due to the possible closure of session
422
-	        $new_expired_time_in_seconds = api_strtotime($expired_time_of_this_attempt, 'UTC') - api_strtotime($last_attempt_date,'UTC');
423
-	        if ($debug) {error_log('7.7. $new_expired_time_in_seconds: '.$new_expired_time_in_seconds); }
424
-
425
-	        $expected_time	= $current_timestamp + $new_expired_time_in_seconds;
426
-	        if ($debug) {error_log('7.8. $expected_time1: '.$expected_time); }
427
-
428
-	        $clock_expired_time  = api_get_utc_datetime($expected_time);
429
-	        if ($debug) {error_log('7.9. $clock_expired_time: '.$clock_expired_time); }
430
-
431
-			// First we update the attempt to today
432
-			/* How the expired time is changed into "track_e_exercises" table,
411
+            if (empty($last_attempt_date)) {
412
+                $diff = $current_timestamp - api_strtotime($exercise_stat_info['start_date'], 'UTC');
413
+                $last_attempt_date = api_get_utc_datetime(api_strtotime($exercise_stat_info['start_date'],'UTC') + $diff);
414
+            } else {
415
+                //Recalculate the time control due #2069
416
+                $diff = $current_timestamp - api_strtotime($last_attempt_date,'UTC');
417
+                $last_attempt_date = api_get_utc_datetime(api_strtotime($last_attempt_date,'UTC') + $diff);
418
+            }
419
+            if ($debug) {error_log('7.6. $last_attempt_date: '.$last_attempt_date); }
420
+
421
+            //New expired time - it is due to the possible closure of session
422
+            $new_expired_time_in_seconds = api_strtotime($expired_time_of_this_attempt, 'UTC') - api_strtotime($last_attempt_date,'UTC');
423
+            if ($debug) {error_log('7.7. $new_expired_time_in_seconds: '.$new_expired_time_in_seconds); }
424
+
425
+            $expected_time	= $current_timestamp + $new_expired_time_in_seconds;
426
+            if ($debug) {error_log('7.8. $expected_time1: '.$expected_time); }
427
+
428
+            $clock_expired_time  = api_get_utc_datetime($expected_time);
429
+            if ($debug) {error_log('7.9. $clock_expired_time: '.$clock_expired_time); }
430
+
431
+            // First we update the attempt to today
432
+            /* How the expired time is changed into "track_e_exercises" table,
433 433
                then the last attempt for this student should be changed too */
434
-	        $sql = "UPDATE $exercise_attempt_table SET
434
+            $sql = "UPDATE $exercise_attempt_table SET
435 435
 	                tms = '".api_get_utc_datetime()."'
436 436
 	                WHERE
437 437
 	                    exe_id = '".$exercise_stat_info['exe_id']."' AND
438 438
 	                    tms = '".$last_attempt_date."' ";
439
-	        if ($debug) {error_log('7.10. $sql: '.$sql); }
440
-	        Database::query($sql);
439
+            if ($debug) {error_log('7.10. $sql: '.$sql); }
440
+            Database::query($sql);
441 441
 
442
-	        //Sessions  that contain the expired time
443
-	        $_SESSION['expired_time'][$current_expired_time_key] = $clock_expired_time;
444
-	        if ($debug) {error_log('7.11. Setting the $_SESSION[expired_time]: '.$_SESSION['expired_time'][$current_expired_time_key] ); };
442
+            //Sessions  that contain the expired time
443
+            $_SESSION['expired_time'][$current_expired_time_key] = $clock_expired_time;
444
+            if ($debug) {error_log('7.11. Setting the $_SESSION[expired_time]: '.$_SESSION['expired_time'][$current_expired_time_key] ); };
445 445
         }
446 446
     } else {
447 447
         $clock_expired_time =  $_SESSION['expired_time'][$current_expired_time_key];
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
  * for more details of how it works see this link : http://eric.garside.name/docs.html?p=epiclock
459 459
  */
460 460
 if ($time_control) { //Sends the exercise form when the expired time is finished
461
-	$htmlHeadXtra[] = $objExercise->show_time_control_js($time_left);
461
+    $htmlHeadXtra[] = $objExercise->show_time_control_js($time_left);
462 462
 }
463 463
 
464 464
 // if the user has submitted the form
@@ -471,14 +471,14 @@  discard block
 block discarded – undo
471 471
     // selects the list of question ID
472 472
     $questionList = $objExercise->get_validated_question_list();
473 473
     if ($objExercise->isRandom() && !empty($exercise_stat_info['data_tracking'])) {
474
-    	$questionList = explode(',', $exercise_stat_info['data_tracking']);
474
+        $questionList = explode(',', $exercise_stat_info['data_tracking']);
475 475
     }
476 476
     Session::write('questionList', $questionList);
477 477
     if ($debug > 0) { error_log('$_SESSION[questionList] was set'); }
478 478
 } else {
479
-	if (isset($objExercise) && isset($_SESSION['objExercise'])) {
480
-    	$questionList = $_SESSION['questionList'];
481
-	}
479
+    if (isset($objExercise) && isset($_SESSION['objExercise'])) {
480
+        $questionList = $_SESSION['questionList'];
481
+    }
482 482
 }
483 483
 
484 484
 if ($debug) error_log('8. Question list loaded '.print_r($questionList, 1));
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
 //Real question count
487 487
 $question_count = 0;
488 488
 if (!empty($questionList)) {
489
-	$question_count = count($questionList);
489
+    $question_count = count($questionList);
490 490
 }
491 491
 
492 492
 if ($current_question > $question_count) {
@@ -532,11 +532,11 @@  discard block
 block discarded – undo
532 532
                 //saving each question
533 533
                 if ($objExercise->feedback_type != EXERCISE_FEEDBACK_TYPE_DIRECT) {
534 534
                     $nro_question = $current_question; // - 1;
535
-                 	$questionId = $key;
535
+                        $questionId = $key;
536 536
                     // gets the student choice for this question
537 537
                     $choice = $exerciseResult[$questionId];
538 538
                     if (isset($exe_id)) {
539
-                    	// Manage the question and answer attempts
539
+                        // Manage the question and answer attempts
540 540
                         if ($debug) {
541 541
                             error_log('8.3. manage_answer exe_id: '.$exe_id.' - $questionId: '.$questionId.' Choice'.print_r($choice,1));
542 542
                         }
@@ -627,58 +627,58 @@  discard block
 block discarded – undo
627 627
 }
628 628
 
629 629
 if ($question_count != 0) {
630
-	if (($objExercise->type == ALL_ON_ONE_PAGE ||
630
+    if (($objExercise->type == ALL_ON_ONE_PAGE ||
631 631
         $current_question > $question_count)
632 632
     ) {
633
-	    if (api_is_allowed_to_session_edit()) {
634
-	        // goes to the script that will show the result of the exercise
635
-	        if ($objExercise->type == ALL_ON_ONE_PAGE) {
636
-	            if ($debug) { error_log('12. Exercise ALL_ON_ONE_PAGE -> Redirecting to exercise_result.php'); }
637
-
638
-	            //We check if the user attempts before sending to the exercise_result.php
639
-	            if ($objExercise->selectAttempts() > 0) {
640
-	                $attempt_count = Event::get_attempt_count(
633
+        if (api_is_allowed_to_session_edit()) {
634
+            // goes to the script that will show the result of the exercise
635
+            if ($objExercise->type == ALL_ON_ONE_PAGE) {
636
+                if ($debug) { error_log('12. Exercise ALL_ON_ONE_PAGE -> Redirecting to exercise_result.php'); }
637
+
638
+                //We check if the user attempts before sending to the exercise_result.php
639
+                if ($objExercise->selectAttempts() > 0) {
640
+                    $attempt_count = Event::get_attempt_count(
641 641
                         api_get_user_id(),
642 642
                         $exerciseId,
643 643
                         $learnpath_id,
644 644
                         $learnpath_item_id,
645 645
                         $learnpath_item_view_id
646 646
                     );
647
-	                if ($attempt_count >= $objExercise->selectAttempts()) {
648
-	                    Display :: display_warning_message(
647
+                    if ($attempt_count >= $objExercise->selectAttempts()) {
648
+                        Display :: display_warning_message(
649 649
                             sprintf(get_lang('ReachedMaxAttempts'), $exercise_title, $objExercise->selectAttempts()),
650 650
                             false
651 651
                         );
652
-	                    if ($origin != 'learnpath') {
653
-	                        //so we are not in learnpath tool
654
-	                        echo '</div>'; //End glossary div
655
-	                        Display :: display_footer();
656
-	                    } else {
657
-	                        echo '</body></html>';
658
-	                    }
659
-	                    exit;
660
-	                }
661
-	            }
662
-	        } else {
663
-	            if ($objExercise->review_answers) {
664
-	            	header('Location: exercise_reminder.php?'.$params);
665
-	            	exit;
666
-	            } else {
652
+                        if ($origin != 'learnpath') {
653
+                            //so we are not in learnpath tool
654
+                            echo '</div>'; //End glossary div
655
+                            Display :: display_footer();
656
+                        } else {
657
+                            echo '</body></html>';
658
+                        }
659
+                        exit;
660
+                    }
661
+                }
662
+            } else {
663
+                if ($objExercise->review_answers) {
664
+                    header('Location: exercise_reminder.php?'.$params);
665
+                    exit;
666
+                } else {
667 667
                     header("Location: exercise_result.php?".api_get_cidreq()."&exe_id=$exe_id&origin=$origin&learnpath_id=$learnpath_id&learnpath_item_id=$learnpath_item_id&learnpath_item_view_id=$learnpath_item_view_id");
668 668
                     exit;
669
-	            }
670
-	        }
671
-	    } else {
672
-	        if ($debug) { error_log('Redirecting to exercise_submit.php'); }
673
-	        exit;
674
-	    }
675
-	}
669
+                }
670
+            }
671
+        } else {
672
+            if ($debug) { error_log('Redirecting to exercise_submit.php'); }
673
+            exit;
674
+        }
675
+    }
676 676
 } else {
677
-	$error = get_lang('ThereAreNoQuestionsForThisExercise');
678
-	// if we are in the case where user select random by category, but didn't choose the number of random question
679
-	if ($objExercise->selectRandomByCat() > 0 && $objExercise->random <= 0) {
680
-		$error .= "<br/>".get_lang('PleaseSelectSomeRandomQuestion');
681
-	}
677
+    $error = get_lang('ThereAreNoQuestionsForThisExercise');
678
+    // if we are in the case where user select random by category, but didn't choose the number of random question
679
+    if ($objExercise->selectRandomByCat() > 0 && $objExercise->random <= 0) {
680
+        $error .= "<br/>".get_lang('PleaseSelectSomeRandomQuestion');
681
+    }
682 682
 }
683 683
 
684 684
 if (!empty ($_GET['gradebook']) && $_GET['gradebook'] == 'view') {
@@ -717,9 +717,9 @@  discard block
 block discarded – undo
717 717
 if (api_is_course_admin() && $origin != 'learnpath') {
718 718
     echo '<div class="actions">';
719 719
     if ($show_quiz_edition == false) {
720
-    	echo '<a href="exercise_admin.php?' . api_get_cidreq() . '&modifyExercise=yes&exerciseId=' . $objExercise->id . '">'.Display :: return_icon('settings.png', get_lang('ModifyExercise'),'',ICON_SIZE_MEDIUM).'</a>';
720
+        echo '<a href="exercise_admin.php?' . api_get_cidreq() . '&modifyExercise=yes&exerciseId=' . $objExercise->id . '">'.Display :: return_icon('settings.png', get_lang('ModifyExercise'),'',ICON_SIZE_MEDIUM).'</a>';
721 721
     } else {
722
-    	echo '<a href="#">'.Display::return_icon('settings_na.png', get_lang('ModifyExercise'),'',ICON_SIZE_MEDIUM).'</a>';
722
+        echo '<a href="#">'.Display::return_icon('settings_na.png', get_lang('ModifyExercise'),'',ICON_SIZE_MEDIUM).'</a>';
723 723
     }
724 724
     echo '</div>';
725 725
 }
@@ -762,7 +762,7 @@  discard block
 block discarded – undo
762 762
             $message_warning = $permission_to_start ? get_lang('ReachedTimeLimit') : get_lang('ExerciseNoStartedYet');
763 763
             Display :: display_warning_message(sprintf($message_warning, $exercise_title, $objExercise->selectAttempts()));
764 764
             if ($origin != 'learnpath') {
765
-            	Display :: display_footer();
765
+                Display :: display_footer();
766 766
             }
767 767
             exit;
768 768
         } else {
@@ -777,7 +777,7 @@  discard block
 block discarded – undo
777 777
 if (isset($_custom['exercises_hidden_when_no_start_date']) &&
778 778
     $_custom['exercises_hidden_when_no_start_date']
779 779
 ) {
780
-	if (empty($objExercise->start_time)) {
780
+    if (empty($objExercise->start_time)) {
781 781
         Display:: display_warning_message(
782 782
             sprintf(
783 783
                 get_lang('ExerciseNoStartedYet'),
@@ -785,20 +785,20 @@  discard block
 block discarded – undo
785 785
                 $objExercise->selectAttempts()
786 786
             )
787 787
         );
788
-		if ($origin != 'learnpath') {
789
-			Display :: display_footer();
790
-		}
791
-	}
788
+        if ($origin != 'learnpath') {
789
+            Display :: display_footer();
790
+        }
791
+    }
792 792
 }
793 793
 
794 794
 //Timer control
795 795
 if ($time_control) {
796 796
     echo $objExercise->return_time_left_div();
797
-	echo '<div style="display:none" class="warning-message" id="expired-message-id">'.get_lang('ExerciseExpiredTimeMessage').'</div>';
797
+    echo '<div style="display:none" class="warning-message" id="expired-message-id">'.get_lang('ExerciseExpiredTimeMessage').'</div>';
798 798
 }
799 799
 
800 800
 if ($origin != 'learnpath') {
801
-   echo '<div id="highlight-plugin" class="glossary-content">';
801
+    echo '<div id="highlight-plugin" class="glossary-content">';
802 802
 }
803 803
 
804 804
 if ($reminder == 2)  {
@@ -810,53 +810,53 @@  discard block
 block discarded – undo
810 810
     $current_question = 1; //set by default the 1st question
811 811
 
812 812
     if (!empty($my_remind_list)) {
813
-    	//Checking which questions we are going to call from the remind list
814
-		for ($i = 0; $i < count($data_tracking); $i++) {
815
-			for($j = 0; $j < count($my_remind_list); $j++) {
816
-
817
-				if (!empty($remind_question_id)) {
818
-					if ($remind_question_id == $my_remind_list[$j]) {
819
-
820
-			        	if ($remind_question_id == $data_tracking[$i]) {
821
-			        		if (isset($my_remind_list[$j+1])) {
822
-			        			$remind_question_id = $my_remind_list[$j+1];
823
-			        			$current_question = $i + 1;
824
-			        		} else {
813
+        //Checking which questions we are going to call from the remind list
814
+        for ($i = 0; $i < count($data_tracking); $i++) {
815
+            for($j = 0; $j < count($my_remind_list); $j++) {
816
+
817
+                if (!empty($remind_question_id)) {
818
+                    if ($remind_question_id == $my_remind_list[$j]) {
819
+
820
+                        if ($remind_question_id == $data_tracking[$i]) {
821
+                            if (isset($my_remind_list[$j+1])) {
822
+                                $remind_question_id = $my_remind_list[$j+1];
823
+                                $current_question = $i + 1;
824
+                            } else {
825 825
                                 // We end the remind list we go to the exercise_reminder.php please
826
-			        			$remind_question_id = -1;
827
-			        			$current_question = $i + 1; // last question
828
-			        		}
829
-			        		break 2;
830
-			            }
831
-					}
832
-				} else {
833
-					if ($my_remind_list[$j] == $data_tracking[$i]) {
834
-						if (isset($my_remind_list[$j+1])) {
835
-							$remind_question_id = $my_remind_list[$j+1];
836
-							$current_question = $i + 1; // last question
837
-						} else {
826
+                                $remind_question_id = -1;
827
+                                $current_question = $i + 1; // last question
828
+                            }
829
+                            break 2;
830
+                        }
831
+                    }
832
+                } else {
833
+                    if ($my_remind_list[$j] == $data_tracking[$i]) {
834
+                        if (isset($my_remind_list[$j+1])) {
835
+                            $remind_question_id = $my_remind_list[$j+1];
836
+                            $current_question = $i + 1; // last question
837
+                        } else {
838 838
                             // We end the remind list we go to the exercise_reminder.php please
839
-							$remind_question_id = -1;
840
-							$current_question = $i + 1; // last question
841
-						}
842
-						break 2;
843
-					}
844
-				}
845
-			}
839
+                            $remind_question_id = -1;
840
+                            $current_question = $i + 1; // last question
841
+                        }
842
+                        break 2;
843
+                    }
844
+                }
845
+            }
846 846
         }
847 847
     } else {
848
-    	if ($objExercise->review_answers) {
848
+        if ($objExercise->review_answers) {
849 849
             if ($debug) { error_log('. redirecting to exercise_reminder.php '); }
850
-	    	header("Location: exercise_reminder.php?$params");
851
-	    	exit;
852
-    	}
850
+            header("Location: exercise_reminder.php?$params");
851
+            exit;
852
+        }
853 853
     }
854 854
 }
855 855
 
856 856
 if ($objExercise->review_answers) {
857
-	$script_php = 'exercise_reminder.php';
857
+    $script_php = 'exercise_reminder.php';
858 858
 } else {
859
-	$script_php = 'exercise_result.php';
859
+    $script_php = 'exercise_result.php';
860 860
 }
861 861
 
862 862
 if (!empty($error)) {
@@ -1096,7 +1096,7 @@  discard block
 block discarded – undo
1096 1096
          <input type="hidden" name="learnpath_item_id" 		value="'.$learnpath_item_id . '" />
1097 1097
          <input type="hidden" name="learnpath_item_view_id" value="'.$learnpath_item_view_id . '" />';
1098 1098
 
1099
-	// Show list of questions
1099
+    // Show list of questions
1100 1100
     $i = 1;
1101 1101
     $attempt_list = array();
1102 1102
     if (isset($exe_id)) {
@@ -1156,10 +1156,10 @@  discard block
 block discarded – undo
1156 1156
 
1157 1157
         $attributes = array('id' =>'remind_list['.$questionId.']');
1158 1158
         if (in_array($questionId, $remind_list)) {
1159
-        	$is_remind_on = true;
1160
-        	$attributes['checked'] = 1;
1161
-        	$remind_question = true;
1162
-        	$remind_highlight = ' remind_highlight ';
1159
+            $is_remind_on = true;
1160
+            $attributes['checked'] = 1;
1161
+            $remind_question = true;
1162
+            $remind_highlight = ' remind_highlight ';
1163 1163
         }
1164 1164
 
1165 1165
         // Showing the exercise description
@@ -1233,8 +1233,8 @@  discard block
 block discarded – undo
1233 1233
     }
1234 1234
     // end foreach()
1235 1235
     if ($objExercise->type == ALL_ON_ONE_PAGE) {
1236
-    	$exercise_actions =  $objExercise->show_button($questionId, $current_question);
1237
-    	echo Display::div($exercise_actions, array('class'=>'exercise_actions'));
1236
+        $exercise_actions =  $objExercise->show_button($questionId, $current_question);
1237
+        echo Display::div($exercise_actions, array('class'=>'exercise_actions'));
1238 1238
         echo '<br>';
1239 1239
     }
1240 1240
     echo '</form>';
Please login to merge, or discard this patch.
main/inc/lib/online.inc.php 1 patch
Indentation   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -299,8 +299,8 @@  discard block
 block discarded – undo
299 299
         }
300 300
     }
301 301
 
302
-	//This query will show all registered users. Only for dev purposes.
303
-	/*$query = "SELECT DISTINCT u.id as login_user_id, login_date
302
+    //This query will show all registered users. Only for dev purposes.
303
+    /*$query = "SELECT DISTINCT u.id as login_user_id, login_date
304 304
 	        FROM $track_online_table e, $table_user u
305 305
             GROUP by u.id
306 306
             ORDER BY $column $direction
@@ -327,15 +327,15 @@  discard block
 block discarded – undo
327 327
     } else {
328 328
         $time_limit = intval($time_limit);
329 329
     }
330
-	$track_online_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE);
331
-	$friend_user_table = Database::get_main_table(TABLE_MAIN_USER_REL_USER);
332
-	$table_user = Database::get_main_table(TABLE_MAIN_USER);
333
-	$online_time = time() - $time_limit * 60;
334
-	$current_date = api_get_utc_datetime($online_time);
335
-
336
-	if ($friends) {
337
-		// 	who friends from social network is online
338
-		$query = "SELECT DISTINCT count(login_user_id) as count
330
+    $track_online_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE);
331
+    $friend_user_table = Database::get_main_table(TABLE_MAIN_USER_REL_USER);
332
+    $table_user = Database::get_main_table(TABLE_MAIN_USER);
333
+    $online_time = time() - $time_limit * 60;
334
+    $current_date = api_get_utc_datetime($online_time);
335
+
336
+    if ($friends) {
337
+        // 	who friends from social network is online
338
+        $query = "SELECT DISTINCT count(login_user_id) as count
339 339
 				  FROM $track_online_table INNER JOIN $friend_user_table
340 340
                   ON (friend_user_id = login_user_id)
341 341
 				  WHERE
@@ -343,20 +343,20 @@  discard block
 block discarded – undo
343 343
 				        friend_user_id <> '".api_get_user_id()."' AND
344 344
 				        relation_type='".USER_RELATION_TYPE_FRIEND."' AND
345 345
 				        user_id = '".api_get_user_id()."' ";
346
-	} else {
347
-		// All users online
348
-		$query = "SELECT count(login_id) as count
346
+    } else {
347
+        // All users online
348
+        $query = "SELECT count(login_id) as count
349 349
                   FROM $track_online_table track INNER JOIN $table_user u
350 350
                   ON (u.id=track.login_user_id)
351 351
                   WHERE u.status != ".ANONYMOUS." AND login_date >= '$current_date'  ";
352
-	}
353
-
354
-	if (api_get_multiple_access_url()) {
355
-		$access_url_id = api_get_current_access_url_id();
356
-		if ($access_url_id != -1) {
357
-			if ($friends) {
358
-				// 	friends from social network is online
359
-				$query = "SELECT DISTINCT count(login_user_id) as count
352
+    }
353
+
354
+    if (api_get_multiple_access_url()) {
355
+        $access_url_id = api_get_current_access_url_id();
356
+        if ($access_url_id != -1) {
357
+            if ($friends) {
358
+                // 	friends from social network is online
359
+                $query = "SELECT DISTINCT count(login_user_id) as count
360 360
 							FROM $track_online_table track
361 361
 							INNER JOIN $friend_user_table ON (friend_user_id = login_user_id)
362 362
 							WHERE
@@ -364,29 +364,29 @@  discard block
 block discarded – undo
364 364
 							    login_date >= '".$current_date."' AND
365 365
 							    friend_user_id <> '".api_get_user_id()."' AND
366 366
 							    relation_type='".USER_RELATION_TYPE_FRIEND."'  ";
367
-			} else {
368
-				// all users online
369
-				$query = "SELECT count(login_id) as count FROM $track_online_table  track
367
+            } else {
368
+                // all users online
369
+                $query = "SELECT count(login_id) as count FROM $track_online_table  track
370 370
                           INNER JOIN $table_user u ON (u.id=track.login_user_id)
371 371
 						  WHERE
372 372
 						    u.status != ".ANONYMOUS." AND
373 373
 						    track.access_url_id =  $access_url_id AND
374 374
 						    login_date >= '$current_date' ";
375
-			}
376
-		}
377
-	}
375
+            }
376
+        }
377
+    }
378 378
 
379 379
     // Dev purposes show all users online
380 380
     /*$table_user = Database::get_main_table(TABLE_MAIN_USER);
381 381
     $query = "SELECT count(*)  as count FROM ".$table_user;*/
382 382
 
383
-	$result = Database::query($query);
384
-	if (Database::num_rows($result) > 0) {
385
-		$row = Database::fetch_array($result);
386
-		return $row['count'];
387
-	} else {
388
-		return false;
389
-	}
383
+    $result = Database::query($query);
384
+    if (Database::num_rows($result) > 0) {
385
+        $row = Database::fetch_array($result);
386
+        return $row['count'];
387
+    } else {
388
+        return false;
389
+    }
390 390
 }
391 391
 
392 392
 
@@ -414,52 +414,52 @@  discard block
 block discarded – undo
414 414
     $track_online_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE);
415 415
     $course_code = Database::escape_string($course_code);
416 416
     $courseInfo = api_get_course_info($course_code);
417
-	$courseId = $courseInfo['real_id'];
417
+    $courseId = $courseInfo['real_id'];
418 418
 
419 419
     $from = intval($from);
420 420
     $number_of_items = intval($number_of_items);
421 421
 
422
-	$query = "SELECT login_user_id, login_date FROM $track_online_table
422
+    $query = "SELECT login_user_id, login_date FROM $track_online_table
423 423
               WHERE login_user_id <> 2 AND c_id = $courseId AND login_date >= '$current_date'
424 424
               LIMIT $from, $number_of_items ";
425 425
 
426
-	$result = Database::query($query);
427
-	if ($result) {
428
-		$users_online = array();
426
+    $result = Database::query($query);
427
+    if ($result) {
428
+        $users_online = array();
429 429
 
430
-		while(list($login_user_id, $login_date) = Database::fetch_row($result)) {
430
+        while(list($login_user_id, $login_date) = Database::fetch_row($result)) {
431 431
             $users_online[] = $login_user_id;
432
-		}
433
-		return $users_online;
434
-	} else {
435
-		return false;
436
-	}
432
+        }
433
+        return $users_online;
434
+    } else {
435
+        return false;
436
+    }
437 437
 }
438 438
 
439 439
 function who_is_online_in_this_course_count($uid, $time_limit, $coursecode=null)
440 440
 {
441
-	if (empty($coursecode)) {
442
-		return false;
443
-	}
444
-	$track_online_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE);
445
-	$time_limit = Database::escape_string($time_limit);
441
+    if (empty($coursecode)) {
442
+        return false;
443
+    }
444
+    $track_online_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE);
445
+    $time_limit = Database::escape_string($time_limit);
446 446
 
447 447
     $online_time = time() - $time_limit * 60;
448 448
     $current_date = api_get_utc_datetime($online_time);
449
-	$courseId = api_get_course_int_id($coursecode);
449
+    $courseId = api_get_course_int_id($coursecode);
450 450
 
451
-	if (empty($courseId)) {
452
-		return false;
453
-	}
451
+    if (empty($courseId)) {
452
+        return false;
453
+    }
454 454
 
455
-	$query = "SELECT count(login_user_id) as count
455
+    $query = "SELECT count(login_user_id) as count
456 456
               FROM $track_online_table
457 457
               WHERE login_user_id <> 2 AND c_id = $courseId AND login_date >= '$current_date' ";
458
-	$result = Database::query($query);
459
-	if (Database::num_rows($result) > 0) {
460
-		$row = Database::fetch_array($result);
461
-		return $row['count'];
462
-	} else {
463
-		return false;
464
-	}
458
+    $result = Database::query($query);
459
+    if (Database::num_rows($result) > 0) {
460
+        $row = Database::fetch_array($result);
461
+        return $row['count'];
462
+    } else {
463
+        return false;
464
+    }
465 465
 }
Please login to merge, or discard this patch.
main/admin/grade_models.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -110,8 +110,8 @@
 block discarded – undo
110 110
 //With this function we can add actions to the jgrid (edit, delete, etc)
111 111
 $action_links = 'function action_formatter(cellvalue, options, rowObject) {
112 112
      return \'<a href="?action=edit&id=\'+options.rowId+\'">'.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>'.
113
-     '&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>'.
114
-     '\';
113
+        '&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>'.
114
+        '\';
115 115
 }';
116 116
 ?>
117 117
 <script>
Please login to merge, or discard this patch.
main/inc/lib/api.lib.php 1 patch
Indentation   +1 added lines, -3 removed lines patch added patch discarded remove patch
@@ -626,7 +626,6 @@  discard block
 block discarded – undo
626 626
  * Also, this function provides conversion between path types, in this case the input path points inside the Chamilo area too.
627 627
  *
628 628
  * See $_configuration['course_folder'] in the configuration.php to alter the WEB_COURSE_PATH and SYS_COURSE_PATH parameters.
629
-
630 629
  * @param string $path (optional)   A path which type is to be converted. Also, it may be a defined constant for a path.
631 630
  * This parameter has meaning when $type parameter has one of the following values: TO_WEB, TO_SYS, TO_REL. Otherwise it is ignored.
632 631
  * @return string                   The requested path or the converted path.
@@ -1733,7 +1732,6 @@  discard block
 block discarded – undo
1733 1732
 
1734 1733
 /**
1735 1734
  * Returns the current course info array.
1736
-
1737 1735
  * Now if the course_code is given, the returned array gives info about that
1738 1736
  * particular course, not specially the current one.
1739 1737
  * @param int $id Numeric ID of the course
@@ -6210,7 +6208,7 @@  discard block
 block discarded – undo
6210 6208
 function api_get_jquery_ui_js($include_jqgrid = false) {
6211 6209
     $libraries = array();
6212 6210
     if ($include_jqgrid) {
6213
-       $libraries[]='jqgrid';
6211
+        $libraries[]='jqgrid';
6214 6212
     }
6215 6213
     return api_get_jquery_libraries_js($libraries);
6216 6214
 }
Please login to merge, or discard this patch.
main/inc/lib/TicketManager.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1464,7 +1464,7 @@  discard block
 block discarded – undo
1464 1464
         ];
1465 1465
         Database::update($table, $newParams, ['id = ? ' => $ticketId]);
1466 1466
 
1467
-         self::sendNotification(
1467
+            self::sendNotification(
1468 1468
             $ticketId,
1469 1469
             $userId,
1470 1470
             get_lang('TicketUpdated'),
@@ -1926,9 +1926,9 @@  discard block
 block discarded – undo
1926 1926
         return 0;
1927 1927
     }
1928 1928
 
1929
-     /**
1930
-     * @return array
1931
-     */
1929
+        /**
1930
+         * @return array
1931
+         */
1932 1932
     public static function getPriorityList()
1933 1933
     {
1934 1934
         $projects = Database::getManager()->getRepository('ChamiloTicketBundle:Priority')->findAll();
@@ -2343,8 +2343,8 @@  discard block
 block discarded – undo
2343 2343
     }
2344 2344
 
2345 2345
         /**
2346
-     * @return array
2347
-     */
2346
+         * @return array
2347
+         */
2348 2348
     public static function getDefaultPriorityList() {
2349 2349
         return [
2350 2350
             self::PRIORITY_NORMAL,
Please login to merge, or discard this patch.
main/notebook/index.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -38,12 +38,12 @@  discard block
 block discarded – undo
38 38
 
39 39
 // Tool name
40 40
 if ($action === 'addnote') {
41
-	$tool = 'NoteAddNew';
42
-	$interbreadcrumb[] = array('url' => 'index.php?'.api_get_cidreq(), 'name' => get_lang('ToolNotebook'));
41
+    $tool = 'NoteAddNew';
42
+    $interbreadcrumb[] = array('url' => 'index.php?'.api_get_cidreq(), 'name' => get_lang('ToolNotebook'));
43 43
 }
44 44
 if ($action === 'editnote') {
45
-	$tool = 'ModifyNote';
46
-	$interbreadcrumb[] = array('url' => 'index.php?'.api_get_cidreq(), 'name' => get_lang('ToolNotebook'));
45
+    $tool = 'ModifyNote';
46
+    $interbreadcrumb[] = array('url' => 'index.php?'.api_get_cidreq(), 'name' => get_lang('ToolNotebook'));
47 47
 }
48 48
 
49 49
 // Displaying the header
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         exit;
64 64
     }
65 65
 
66
-	$_SESSION['notebook_view'] = 'creation_date';
66
+    $_SESSION['notebook_view'] = 'creation_date';
67 67
 
68 68
     $form = new FormValidator(
69 69
         'note',
Please login to merge, or discard this patch.
main/inc/lib/banner.lib.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -55,22 +55,22 @@  discard block
 block discarded – undo
55 55
     $navigation['myprofile']['title'] = get_lang('ModifyProfile');
56 56
     $navigation['myprofile']['key'] = 'profile';
57 57
     $navigation['myprofile']['icon'] = 'profile.png';
58
-	// Link to my agenda
58
+    // Link to my agenda
59 59
     $navigation['myagenda']['url'] = api_get_path(WEB_CODE_PATH).'calendar/agenda_js.php?type=personal';
60 60
     $navigation['myagenda']['title'] = get_lang('MyAgenda');
61 61
     $navigation['myagenda']['key'] = 'agenda';
62 62
     $navigation['myagenda']['icon'] = 'agenda.png';
63 63
 
64
-	// Gradebook
65
-	if (api_get_setting('gradebook_enable') == 'true') {
64
+    // Gradebook
65
+    if (api_get_setting('gradebook_enable') == 'true') {
66 66
         $navigation['mygradebook']['url'] = api_get_path(WEB_CODE_PATH).'gradebook/gradebook.php'.(!empty($_course['path']) ? '?coursePath='.$_course['path'].'&amp;courseCode='.$_course['official_code'] : '' );
67 67
         $navigation['mygradebook']['title'] = get_lang('MyGradebook');
68 68
         $navigation['mygradebook']['key'] = 'gradebook';
69 69
         $navigation['mygradebook']['icon'] = 'gradebook.png';
70
-	}
70
+    }
71 71
 
72
-	// Reporting
73
-	if (api_is_allowed_to_create_course() || api_is_drh() || api_is_session_admin()) {
72
+    // Reporting
73
+    if (api_is_allowed_to_create_course() || api_is_drh() || api_is_session_admin()) {
74 74
         // Link to my space
75 75
         $navigation['session_my_space']['url'] = api_get_path(WEB_CODE_PATH).'mySpace/'.(api_is_drh()?'session.php':'');
76 76
         $navigation['session_my_space']['title'] = get_lang('MySpace');
@@ -97,23 +97,23 @@  discard block
 block discarded – undo
97 97
         $navigation['session_my_progress']['icon'] = 'my-progress.png';
98 98
     }
99 99
 
100
-	// Social
101
-	if (api_get_setting('allow_social_tool')=='true') {
100
+    // Social
101
+    if (api_get_setting('allow_social_tool')=='true') {
102 102
         $navigation['social']['url'] = api_get_path(WEB_CODE_PATH).'social/home.php';
103 103
         $navigation['social']['title'] = get_lang('SocialNetwork');
104 104
         $navigation['social']['key'] = 'social-network';
105 105
         $navigation['social']['icon'] = 'social-network.png';
106
-	}
106
+    }
107 107
 
108
-	// Dashboard
109
-	if (api_is_platform_admin() || api_is_drh() || api_is_session_admin()) {
108
+    // Dashboard
109
+    if (api_is_platform_admin() || api_is_drh() || api_is_session_admin()) {
110 110
         $navigation['dashboard']['url'] = api_get_path(WEB_CODE_PATH).'dashboard/index.php';
111 111
         $navigation['dashboard']['title'] = get_lang('Dashboard');
112 112
         $navigation['dashboard']['key'] = 'dashboard';
113 113
         $navigation['dashboard']['icon'] = 'dashboard.png';
114
-	}
114
+    }
115 115
 
116
-	// Reports
116
+    // Reports
117 117
     /*
118 118
 	if (api_is_platform_admin() || api_is_drh() || api_is_session_admin()) {
119 119
         $navigation['reports']['url'] = api_get_path(WEB_CODE_PATH).'reports/index.php';
@@ -136,15 +136,15 @@  discard block
 block discarded – undo
136 136
     }
137 137
     // End Custom Tabs
138 138
 
139
-	// Platform administration
140
-	if (api_is_platform_admin(true)) {
139
+    // Platform administration
140
+    if (api_is_platform_admin(true)) {
141 141
         $navigation['platform_admin']['url'] = api_get_path(WEB_CODE_PATH).'admin/';
142 142
         $navigation['platform_admin']['title'] = get_lang('PlatformAdmin');
143 143
         $navigation['platform_admin']['key'] = 'admin';
144 144
         $navigation['platform_admin']['icon'] = 'admin.png';
145
-	}
145
+    }
146 146
 
147
-	return $navigation;
147
+    return $navigation;
148 148
 }
149 149
 
150 150
 /**
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
         if ($number &&
214 214
             (api_get_setting('showonline', 'world') == 'true' && !$user_id) ||
215 215
                 (api_get_setting('showonline', 'users') == 'true' && $user_id)
216
-           )
216
+            )
217 217
         {
218 218
                 $html .= '<li><a href="'.api_get_path(WEB_PATH).'whoisonline.php" target="_self" title="'.get_lang('UsersOnline').'" >'.
219 219
                             Display::return_icon('user.png', get_lang('UsersOnline'), array(), ICON_SIZE_TINY).' '.$number.'</a></li>';
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
             }
335 335
         }
336 336
 
337
-		// Reports
337
+        // Reports
338 338
         if (!empty($possible_tabs['reports'])) {
339 339
             if (api_get_setting('show_tabs', 'reports') == 'true') {
340 340
                 if ((api_is_platform_admin() || api_is_drh() || api_is_session_admin()) && Rights::hasRight('show_tabs:reports')) {
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
         $navigation_item_my_courses['title'] = get_lang('MyCourses');
577 577
         $navigation_item_my_courses['url'] = api_get_path(WEB_PATH).'user_portal.php';
578 578
         $navigation[] = $navigation_item_my_courses;
579
-        */
579
+         */
580 580
         $navigation[] = $navigation_item;
581 581
     }
582 582
 
Please login to merge, or discard this patch.
main/inc/lib/extra_field.lib.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
         'changeable',
21 21
         'filter',
22 22
         'extra_field_type',
23
-         /* Enable this when field_loggeable is introduced as a table field (2.0)
23
+            /* Enable this when field_loggeable is introduced as a table field (2.0)
24 24
         'field_loggeable',
25 25
          */
26 26
         'created_at'
@@ -2041,7 +2041,7 @@  discard block
 block discarded – undo
2041 2041
                 'align' => 'left',
2042 2042
                 'sortable' => 'true',
2043 2043
             ),
2044
-             array(
2044
+                array(
2045 2045
                 'name' => 'visible_to_others',
2046 2046
                 'index' => 'visible_to_others',
2047 2047
                 'width' => '40',
Please login to merge, or discard this patch.
main/lp/learnpath.class.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6038,8 +6038,8 @@  discard block
 block discarded – undo
6038 6038
             $course_id = api_get_course_int_id();
6039 6039
         }
6040 6040
 
6041
-       $creatorId = empty($creatorId) ? api_get_user_id() : $creatorId;
6042
-       $sessionId = api_get_session_id();
6041
+        $creatorId = empty($creatorId) ? api_get_user_id() : $creatorId;
6042
+        $sessionId = api_get_session_id();
6043 6043
 
6044 6044
         // Generates folder
6045 6045
         $result = $this->generate_lp_folder($courseInfo);
@@ -11114,7 +11114,7 @@  discard block
 block discarded – undo
11114 11114
         $lpItemId = [];
11115 11115
         $typeListNotToVerify = self::getChapterTypes();
11116 11116
 
11117
-	    // Using get_toc() function instead $this->items because returns the correct order of the items
11117
+        // Using get_toc() function instead $this->items because returns the correct order of the items
11118 11118
         foreach ($this->get_toc() as $item) {
11119 11119
             if (!in_array($item['type'], $typeListNotToVerify)) {
11120 11120
                 $lpItemId[] = $item['id'];
Please login to merge, or discard this patch.