Completed
Pull Request — 1.11.x (#1688)
by José
28:44
created
main/lp/lp_ajax_save_item.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
         // Set status to completed for hotpotatoes if score > 80%.
164 164
         if ($my_type == 'hotpotatoes') {
165 165
             if ((empty($status) || $status == 'undefined' || $status == 'not attempted') && $max > 0) {
166
-                if (($score/$max) > 0.8) {
166
+                if (($score / $max) > 0.8) {
167 167
                     $myStatus = 'completed';
168 168
                     if ($debug > 1) {
169 169
                         error_log('Calling set_status('.$myStatus.') for hotpotatoes', 0);
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
                         error_log('Done calling set_status for hotpotatoes - now '.$myLPI->get_status(false), 0);
175 175
                     }
176 176
                 }
177
-            } elseif ($status == 'completed' && $max > 0 && ($score/$max) < 0.8) {
177
+            } elseif ($status == 'completed' && $max > 0 && ($score / $max) < 0.8) {
178 178
                 $myStatus = 'failed';
179 179
                 if ($debug > 1) {
180 180
                     error_log('Calling set_status('.$myStatus.') for hotpotatoes', 0);
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
             $myLPI->current_data = $suspend;
368 368
         }
369 369
 
370
-        if (isset($location) && $location != '' && $location!='undefined') {
370
+        if (isset($location) && $location != '' && $location != 'undefined') {
371 371
             $myLPI->set_lesson_location($location);
372 372
         }
373 373
 
Please login to merge, or discard this patch.
main/lp/lp_ajax_initialize.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -101,21 +101,21 @@  discard block
 block discarded – undo
101 101
 	$myobjectives = json_encode($phpobjectives);
102 102
 
103 103
     $return .=
104
-            "olms.score=".$myscore.";" .
105
-            "olms.max=".$mymax.";" .
106
-            "olms.min=".$mymin.";" .
107
-            "olms.lesson_status='".$mylesson_status."';" .
108
-            "olms.lesson_location='".$mylesson_location."';" .
109
-            "olms.session_time='".$mysession_time."';" .
110
-            "olms.suspend_data='".$mysuspend_data."';" .
111
-            "olms.total_time = '".$mytotal_time."';" .
112
-            "olms.mastery_score = '".$mymastery_score."';" .
113
-            "olms.max_time_allowed = '".$mymax_time_allowed."';" .
114
-            "olms.launch_data = '".$mylaunch_data."';" .
115
-            "olms.interactions = new Array(".$myistring.");" .
104
+            "olms.score=".$myscore.";".
105
+            "olms.max=".$mymax.";".
106
+            "olms.min=".$mymin.";".
107
+            "olms.lesson_status='".$mylesson_status."';".
108
+            "olms.lesson_location='".$mylesson_location."';".
109
+            "olms.session_time='".$mysession_time."';".
110
+            "olms.suspend_data='".$mysuspend_data."';".
111
+            "olms.total_time = '".$mytotal_time."';".
112
+            "olms.mastery_score = '".$mymastery_score."';".
113
+            "olms.max_time_allowed = '".$mymax_time_allowed."';".
114
+            "olms.launch_data = '".$mylaunch_data."';".
115
+            "olms.interactions = new Array(".$myistring.");".
116 116
             //"olms.item_objectives = new Array();" .
117
-            "olms.item_objectives = ".$myobjectives.";" .
118
-            "olms.G_lastError = 0;" .
117
+            "olms.item_objectives = ".$myobjectives.";".
118
+            "olms.G_lastError = 0;".
119 119
             "olms.G_LastErrorMessage = 'No error';".
120 120
             "olms.finishSignalReceived = 0;";
121 121
     /*
@@ -144,22 +144,22 @@  discard block
 block discarded – undo
144 144
     $mycore_exit = $mylpi->get_core_exit();
145 145
 
146 146
     $return .=
147
-            "olms.lms_lp_id=".$lp_id.";" .
148
-            "olms.lms_item_id=".$next_item.";" .
149
-            "olms.lms_old_item_id=0;" .
150
-            "olms.lms_initialized=0;" .
151
-            "olms.lms_view_id=".$view_id.";" .
152
-            "olms.lms_user_id=".$user_id.";" .
153
-            "olms.next_item=".$next_item.";" . // This one is very important to replace possible literal strings.
154
-            "olms.lms_next_item=".$mynext.";" .
155
-            "olms.lms_previous_item=".$myprevious.";" .
156
-            "olms.lms_item_type = '".$myitemtype."';" .
157
-            "olms.lms_item_credit = '".$mycredit."';" .
158
-            "olms.lms_item_lesson_mode = '".$mylesson_mode."';" .
159
-            "olms.lms_item_launch_data = '".$mylaunch_data."';" .
160
-            "olms.lms_item_interactions_count = '".$myinteractions_count."';" .
161
-            "olms.lms_item_objectives_count = '".$myinteractions_count."';" .
162
-            "olms.lms_item_core_exit = '".$mycore_exit."';" .
147
+            "olms.lms_lp_id=".$lp_id.";".
148
+            "olms.lms_item_id=".$next_item.";".
149
+            "olms.lms_old_item_id=0;".
150
+            "olms.lms_initialized=0;".
151
+            "olms.lms_view_id=".$view_id.";".
152
+            "olms.lms_user_id=".$user_id.";".
153
+            "olms.next_item=".$next_item.";".// This one is very important to replace possible literal strings.
154
+            "olms.lms_next_item=".$mynext.";".
155
+            "olms.lms_previous_item=".$myprevious.";".
156
+            "olms.lms_item_type = '".$myitemtype."';".
157
+            "olms.lms_item_credit = '".$mycredit."';".
158
+            "olms.lms_item_lesson_mode = '".$mylesson_mode."';".
159
+            "olms.lms_item_launch_data = '".$mylaunch_data."';".
160
+            "olms.lms_item_interactions_count = '".$myinteractions_count."';".
161
+            "olms.lms_item_objectives_count = '".$myinteractions_count."';".
162
+            "olms.lms_item_core_exit = '".$mycore_exit."';".
163 163
             "olms.asset_timer = 0;";
164 164
 
165 165
     $mylp->set_error_msg('');
Please login to merge, or discard this patch.
main/lp/storageapi.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         and sco_id = '$sv_sco'
104 104
         and course_id = '$sv_course'
105 105
         and sv_key = '$sv_key'
106
-        order by sv_value ".($sv_asc ? "ASC": "DESC")." limit $sv_length";
106
+        order by sv_value ".($sv_asc ? "ASC" : "DESC")." limit $sv_length";
107 107
 //	$sql_data = "select sv.user_id as user_id, sv_key as variable, sv_value as value
108 108
 //		from ".Database::get_main_table(TABLE_TRACK_STORED_VALUES)." sv
109 109
 //		where sv.user_id in (select u2.user_id from ($sql_leaders) u2)
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         and search.sco_id = '$sv_sco'
136 136
         and search.course_id = '$sv_course'
137 137
         and search.sv_key = '$sv_key'
138
-        and list.sv_value ".($sv_asc ? "<=": ">=")." search.sv_value
138
+        and list.sv_value ".($sv_asc ? "<=" : ">=")." search.sv_value
139 139
         and list.sco_id = search.sco_id
140 140
         and list.course_id = search.course_id
141 141
         and list.sv_key = search.sv_key
Please login to merge, or discard this patch.
main/lp/lp_content.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@
 block discarded – undo
106 106
 // Define the 'doc.inc.php' as language file.
107 107
 $nameTools = $_SESSION['oLP']->get_name();
108 108
 $interbreadcrumb[] = array(
109
-    'url' => api_get_path(WEB_CODE_PATH) . 'lp/lp_list.php?'.api_get_cidreq(),
109
+    'url' => api_get_path(WEB_CODE_PATH).'lp/lp_list.php?'.api_get_cidreq(),
110 110
     'name' => get_lang('Doc'),
111 111
 );
112 112
 // Update global setting to avoid displaying right menu.
Please login to merge, or discard this patch.
main/lp/scormItem.class.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
                                         }
101 101
                                         break;
102 102
                                     case 'item':
103
-                                        $oItem = new scormItem('manifest',$child);
103
+                                        $oItem = new scormItem('manifest', $child);
104 104
                                         if ($oItem->identifier != '') {
105 105
                                             $this->sub_items[$oItem->identifier] = $oItem;
106 106
                                         }
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
                         $attributes = $element->attributes;
120 120
                         //$keep_href = '';
121 121
                         foreach ($attributes as $attrib) {
122
-                            switch($attrib->name){
122
+                            switch ($attrib->name) {
123 123
                                 case 'identifier':
124 124
                                     $this->identifier = $attrib->value;
125 125
                                     break;
@@ -172,8 +172,8 @@  discard block
 block discarded – undo
172 172
         );
173 173
         $abs_order++;
174 174
         $i = 1;
175
-        foreach($this->sub_items as $id => $dummy) {
176
-            $oSubitem =& $this->sub_items[$id];
175
+        foreach ($this->sub_items as $id => $dummy) {
176
+            $oSubitem = & $this->sub_items[$id];
177 177
             $oSubitem->get_flat_list($list, $abs_order, $i, $level + 1);
178 178
             $i++;
179 179
         }
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
         parent::save($from_outside, $prereqs_complete);
189 189
         // Under certain conditions, the scorm_contact should not be set, because no scorm signal was sent.
190 190
         $this->scorm_contact = true;
191
-        if (!$this->scorm_contact){
191
+        if (!$this->scorm_contact) {
192 192
             //error_log('New LP - was expecting SCORM message but none received', 0);
193 193
         }
194 194
     }
Please login to merge, or discard this patch.
main/lp/lp_report.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 
107 107
 // View
108 108
 $interbreadcrumb[] = [
109
-    'url' => api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?'.api_get_cidreq(),
109
+    'url' => api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?'.api_get_cidreq(),
110 110
     'name' => get_lang('LearningPaths')
111 111
 ];
112 112
 
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
         array(),
118 118
         ICON_SIZE_MEDIUM
119 119
     ),
120
-    api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?' . api_get_cidreq()
120
+    api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?'.api_get_cidreq()
121 121
 );
122 122
 
123 123
 $template = new Template(get_lang('StudentScore'));
Please login to merge, or discard this patch.
main/lp/aiccItem.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@
 block discarded – undo
117 117
         $abs_order++;
118 118
         $i = 1;
119 119
         foreach ($this->sub_items as $id => $dummy) {
120
-            $oSubitem =& $this->sub_items[$id];
120
+            $oSubitem = & $this->sub_items[$id];
121 121
             $oSubitem->get_flat_list($list, $abs_order, $i, $level + 1);
122 122
             $i++;
123 123
         }
Please login to merge, or discard this patch.
main/lp/lp_subscribe_users.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -163,7 +163,7 @@
 block discarded – undo
163 163
     exit;
164 164
 } else {
165 165
     $headers = [get_lang('SubscribeUsersToLp'), get_lang('SubscribeGroupsToLp')];
166
-    $tabs = Display::tabs($headers, [$formUsers->toHtml(),$form->toHtml()]);
166
+    $tabs = Display::tabs($headers, [$formUsers->toHtml(), $form->toHtml()]);
167 167
     $tpl->assign('tabs', $tabs);
168 168
 }
169 169
 
Please login to merge, or discard this patch.
main/lp/scormOrganization.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@
 block discarded – undo
98 98
         foreach ($this->items as $id => $dummy) {
99 99
             $abs_order = 0;
100 100
             // Passes the array as a pointer so it is modified in $list directly.
101
-            $this->items[$id]->get_flat_list($list,$abs_order, $i, 0);
101
+            $this->items[$id]->get_flat_list($list, $abs_order, $i, 0);
102 102
             $i++;
103 103
         }
104 104
 
Please login to merge, or discard this patch.