Browse Source

Minor - format code

jmontoyaa 7 years ago
parent
commit
4caceedf6c
3 changed files with 11 additions and 30 deletions
  1. 10 27
      main/lp/learnpathItem.class.php
  2. 0 1
      main/lp/lp_edit_item_prereq.php
  3. 1 2
      main/mySpace/myStudents.php

+ 10 - 27
main/lp/learnpathItem.class.php

@@ -103,10 +103,8 @@ class learnpathItem
             $user_id = api_get_user_id();
         }
         if (self::DEBUG > 0) {
-            error_log(
-                "learnpathItem constructor: id: $id user_id: ".
-                "$user_id course_id: $course_id item_content: ".print_r($item_content, 1)
-            );
+            error_log("learnpathItem constructor: id: $id user_id: $user_id course_id: $course_id");
+            error_log("item_content: ".print_r($item_content, 1));
         }
         $id = intval($id);
         if (empty($item_content)) {
@@ -1989,8 +1987,8 @@ class learnpathItem
         }
         $restart = 1;
         $mystatus = $this->get_status(true);
-        if ($this->get_prevent_reinit() > 0
-        ) { // If prevent_reinit == 1 (or more)
+        if ($this->get_prevent_reinit() > 0) {
+            // If prevent_reinit == 1 (or more)
             // If status is not attempted or incomplete, authorize retaking (of the same) anyway. Otherwise:
             if ($mystatus != $this->possible_status[0] && $mystatus != $this->possible_status[1]) {
                 $restart = -1;
@@ -2197,7 +2195,6 @@ class learnpathItem
                 }
             } else {
                 // No ORs found, now look for ANDs.
-
                 if (self::DEBUG > 1) {
                     error_log('New LP - Didnt find any AND, looking for =', 0);
                 }
@@ -2586,12 +2583,8 @@ class learnpathItem
 
                                         if ($returnstatus && $this->prevent_reinit == 1) {
                                             // I would prefer check in the database.
-                                            $lp_item_view = Database::get_course_table(
-                                                TABLE_LP_ITEM_VIEW
-                                            );
-                                            $lp_view = Database::get_course_table(
-                                                TABLE_LP_VIEW
-                                            );
+                                            $lp_item_view = Database::get_course_table(TABLE_LP_ITEM_VIEW);
+                                            $lp_view = Database::get_course_table(TABLE_LP_VIEW);
 
                                             $sql = 'SELECT iid FROM '.$lp_view.'
                                                     WHERE
@@ -2601,9 +2594,7 @@ class learnpathItem
                                                         session_id = '.$sessionId.'
                                                     LIMIT 0, 1';
                                             $rs_lp = Database::query($sql);
-                                            $lp_id = Database::fetch_row(
-                                                $rs_lp
-                                            );
+                                            $lp_id = Database::fetch_row($rs_lp);
                                             $my_lp_id = $lp_id[0];
 
                                             $sql = 'SELECT status FROM '.$lp_item_view.'
@@ -2618,23 +2609,15 @@ class learnpathItem
 
                                             $returnstatus = ($status == $this->possible_status[2]) || ($status == $this->possible_status[3]);
                                             if (!$returnstatus && empty($this->prereq_alert)) {
-                                                $this->prereq_alert = get_lang(
-                                                    'LearnpathPrereqNotCompleted'
-                                                );
+                                                $this->prereq_alert = get_lang('LearnpathPrereqNotCompleted');
                                             }
                                             if (!$returnstatus) {
                                                 if (self::DEBUG > 1) {
-                                                    error_log(
-                                                        'New LP - Prerequisite '.$prereqs_string.' not complete',
-                                                        0
-                                                    );
+                                                    error_log('New LP - Prerequisite '.$prereqs_string.' not complete');
                                                 }
                                             } else {
                                                 if (self::DEBUG > 1) {
-                                                    error_log(
-                                                        'New LP - Prerequisite '.$prereqs_string.' complete',
-                                                        0
-                                                    );
+                                                    error_log('New LP - Prerequisite '.$prereqs_string.' complete');
                                                 }
                                             }
                                         }

+ 0 - 1
main/lp/lp_edit_item_prereq.php

@@ -19,7 +19,6 @@ api_protect_course_script();
 
 /* Constants and variables */
 $is_allowed_to_edit = api_is_allowed_to_edit(null, true);
-
 $isStudentView = isset($_REQUEST['isStudentView']) ? (int) $_REQUEST['isStudentView'] : null;
 $learnpath_id = isset($_REQUEST['lp_id']) ? (int) $_REQUEST['lp_id'] : null;
 $submit = isset($_POST['submit_button']) ? $_POST['submit_button'] : null;

+ 1 - 2
main/mySpace/myStudents.php

@@ -675,7 +675,7 @@ $userGroups = $userGroupManager->getNameListByUser(
             ?>
             <tr>
                 <td align="right"><?php echo get_lang('TimeSpentInTheCourse'); ?></td>
-                <td align="left"><?php echo  $time_spent_on_the_course; ?></td>
+                <td align="left"><?php echo $time_spent_on_the_course; ?></td>
             </tr>
             <tr>
                 <td align="right">
@@ -1086,7 +1086,6 @@ if (empty($details)) {
                 foreach ($flat_list as $learnpath) {
                     $lp_id = $learnpath['lp_old_id'];
                     $lp_name = $learnpath['lp_name'];
-
                     $any_result = false;
 
                     // Get progress in lp