Completed
Pull Request — 1.11.x (#1688)
by José
28:44
created
main/lp/aicc_api.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -78,33 +78,33 @@  discard block
 block discarded – undo
78 78
 var commit = false ;
79 79
 
80 80
 // Strictly SCORM variables.
81
-var score=<?php echo $oItem->get_score();?>;
82
-var max=<?php echo $oItem->get_max();?>;
83
-var min=<?php echo $oItem->get_min();?>;
84
-var lesson_status='<?php echo $oItem->get_status();?>';
85
-var session_time='<?php echo $oItem->get_scorm_time('js');?>';
86
-var suspend_data = '<?php echo $oItem->get_suspend_data();?>';
87
-var lesson_location = '<?php echo $oItem->get_lesson_location();?>';
88
-var total_time = '<?php echo $oItem->get_scorm_time('js');?>';
81
+var score=<?php echo $oItem->get_score(); ?>;
82
+var max=<?php echo $oItem->get_max(); ?>;
83
+var min=<?php echo $oItem->get_min(); ?>;
84
+var lesson_status='<?php echo $oItem->get_status(); ?>';
85
+var session_time='<?php echo $oItem->get_scorm_time('js'); ?>';
86
+var suspend_data = '<?php echo $oItem->get_suspend_data(); ?>';
87
+var lesson_location = '<?php echo $oItem->get_lesson_location(); ?>';
88
+var total_time = '<?php echo $oItem->get_scorm_time('js'); ?>';
89 89
 
90 90
 // Chamilo internal variables.
91 91
 var saved_lesson_status = 'not attempted';
92
-var lms_lp_id = <?php echo $oLP->get_id();?>;
93
-var lms_item_id = <?php echo $oItem->get_id();?>;
92
+var lms_lp_id = <?php echo $oLP->get_id(); ?>;
93
+var lms_item_id = <?php echo $oItem->get_id(); ?>;
94 94
 //var lms_new_item_id = 0; //temporary value (only there between a load_item() and a LMSInitialize())
95 95
 var lms_been_synchronized = 0;
96 96
 var lms_initialized = 0;
97 97
 var lms_total_lessons = <?php echo $oLP->get_total_items_count(); ?>;
98
-var lms_complete_lessons = <?php echo $oLP->get_complete_items_count();?>;
99
-var lms_progress_bar_mode = '<?php echo $oLP->progress_bar_mode;?>';
98
+var lms_complete_lessons = <?php echo $oLP->get_complete_items_count(); ?>;
99
+var lms_progress_bar_mode = '<?php echo $oLP->progress_bar_mode; ?>';
100 100
 if(lms_progress_bar_mode == ''){lms_progress_bar_mode='%';}
101
-var lms_view_id = '<?php echo $oLP->get_view();?>';
101
+var lms_view_id = '<?php echo $oLP->get_view(); ?>';
102 102
 if(lms_view_id == ''){ lms_view_id = 1;}
103
-var lms_user_id = '<?php echo $_user['user_id'];?>';
104
-var lms_next_item = '<?php echo $oLP->get_next_item_id();?>';
105
-var lms_previous_item = '<?php echo $oLP->get_previous_item_id();?>';
106
-var lms_lp_type = '<?php echo $oLP->get_type();?>';
107
-var lms_item_type = '<?php echo $oItem->get_type();?>';
103
+var lms_user_id = '<?php echo $_user['user_id']; ?>';
104
+var lms_next_item = '<?php echo $oLP->get_next_item_id(); ?>';
105
+var lms_previous_item = '<?php echo $oLP->get_previous_item_id(); ?>';
106
+var lms_lp_type = '<?php echo $oLP->get_type(); ?>';
107
+var lms_item_type = '<?php echo $oItem->get_type(); ?>';
108 108
 
109 109
 // Backup for old values.
110 110
 var old_score = 0;
@@ -162,11 +162,11 @@  discard block
 block discarded – undo
162 162
     }else if(param == 'cmi.core.lesson_mode'){
163 163
         result='normal';
164 164
     }else if(param == 'cmi.suspend_data'){
165
-        result='<?php echo $oItem->get_suspend_data();?>';
165
+        result='<?php echo $oItem->get_suspend_data(); ?>';
166 166
     }else if(param == 'cmi.launch_data'){
167 167
         result='';
168 168
     }else if(param == 'cmi.objectives._count'){
169
-        result='<?php echo $oItem->get_view_count();?>';
169
+        result='<?php echo $oItem->get_view_count(); ?>';
170 170
     }
171 171
     /*
172 172
     // Switch not working??? WTF???
@@ -227,13 +227,13 @@  discard block
 block discarded – undo
227 227
             result='normal';
228 228
             break;
229 229
         case 'cmi.suspend_data'		:
230
-            result='<?php echo $oItem->get_suspend_data();?>';
230
+            result='<?php echo $oItem->get_suspend_data(); ?>';
231 231
             break;
232 232
         case 'cmi.launch_data'		:
233 233
             result='';
234 234
             break;
235 235
         case 'cmi.objectives._count':
236
-            result='<?php echo $oItem->get_view_count();?>';
236
+            result='<?php echo $oItem->get_view_count(); ?>';
237 237
             break;
238 238
         default 					:
239 239
             result='';
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
     $url = $_SERVER['HTTP_HOST'].$self;
286 286
     $url = substr($url, 0, -14); // 14 is the length of this file's name (/scorm_api.php).
287 287
     echo $url;
288
-    ?>/lp_controller.php?<?php echo api_get_cidreq(); ?>&action=save&lp_id=<?php echo $oLP->get_id();?>&" + param + "";
288
+    ?>/lp_controller.php?<?php echo api_get_cidreq(); ?>&action=save&lp_id=<?php echo $oLP->get_id(); ?>&" + param + "";
289 289
     logit_lms('saving data (status='+lesson_status+')',1);
290 290
     xajax_save_item(lms_lp_id, lms_user_id, lms_view_id, lms_item_id, score, max, min, lesson_status, session_time, suspend_data, lesson_location);
291 291
     //xajax_update_pgs();
Please login to merge, or discard this patch.
main/lp/scormMetadata.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@
 block discarded – undo
88 88
                      //$keep_href = '';
89 89
                      if (is_array($attributes)) {
90 90
                          foreach ($attributes as $attrib) {
91
-                             if (trim($attrib->value) != ''){
91
+                             if (trim($attrib->value) != '') {
92 92
                                  $this->attribs[$attrib->name] = $attrib->value;
93 93
                              }
94 94
                          }
Please login to merge, or discard this patch.
main/lp/lp_ajax_switch_item.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -198,7 +198,7 @@
 block discarded – undo
198 198
         //"lms_progress_bar_mode='".$myprogress_mode."';" .
199 199
         "olms.lms_view_id=".$view_id.";".
200 200
         "olms.lms_user_id=".$user_id.";".
201
-        "olms.next_item=".$new_item_id.";". // This one is very important to replace possible literal strings.
201
+        "olms.next_item=".$new_item_id.";".// This one is very important to replace possible literal strings.
202 202
         "olms.lms_next_item=".$mynext.";".
203 203
         "olms.lms_previous_item=".$myprevious.";".
204 204
         "olms.lms_item_type = '".$myitemtype."';".
Please login to merge, or discard this patch.
main/lp/lp_edit_item.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 }
100 100
 
101 101
 if (!empty($gradebook) && $gradebook == 'view') {
102
-    $interbreadcrumb[] = array (
102
+    $interbreadcrumb[] = array(
103 103
         'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
104 104
         'name' => get_lang('ToolGradebook')
105 105
     );
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 $show_learn_path = true;
113 113
 $lp_theme_css = $_SESSION['oLP']->get_theme();
114 114
 
115
-Display::display_header(get_lang('Edit'),'Path');
115
+Display::display_header(get_lang('Edit'), 'Path');
116 116
 $suredel = trim(get_lang('AreYouSureToDeleteJS'));
117 117
 
118 118
 ?>
@@ -165,8 +165,8 @@  discard block
 block discarded – undo
165 165
 $path_item = isset($_GET['path_item']) ? $_GET['path_item'] : 0;
166 166
 $path_item = Database::escape_string($path_item);
167 167
 $tbl_doc = Database :: get_course_table(TABLE_DOCUMENT);
168
-$sql_doc = "SELECT path FROM " . $tbl_doc . "
169
-            WHERE c_id = $course_id AND id = '". $path_item."' ";
168
+$sql_doc = "SELECT path FROM ".$tbl_doc."
169
+            WHERE c_id = $course_id AND id = '".$path_item."' ";
170 170
 
171 171
 $res_doc = Database::query($sql_doc);
172 172
 $path_file = Database::result($res_doc, 0, 0);
Please login to merge, or discard this patch.
main/lp/lp_ajax_save_objectives.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,10 +28,10 @@
 block discarded – undo
28 28
         error_log('In xajax_save_objectives('.$lp_id.','.$user_id.','.$view_id.','.$item_id.',"'.(count($objectives) > 0 ? count($objectives) : '').'")', 0);
29 29
     }
30 30
     $mylp = learnpath::getLpFromSession(api_get_course_id(), $lp_id, $user_id);
31
-    $mylpi =& $mylp->items[$item_id];
32
-    if (is_array($objectives) && count($objectives)>0){
33
-        foreach ($objectives as $index=>$objective){
34
-            $mylpi->add_objective($index,$objectives[$index]);
31
+    $mylpi = & $mylp->items[$item_id];
32
+    if (is_array($objectives) && count($objectives) > 0) {
33
+        foreach ($objectives as $index=>$objective) {
34
+            $mylpi->add_objective($index, $objectives[$index]);
35 35
         }
36 36
         $mylpi->write_objectives_to_db();
37 37
     }
Please login to merge, or discard this patch.
main/lp/openoffice_text_document.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
         $intro_content = api_substr($content, 0, api_strpos($content, $matches[0][0]));
118 118
         $items_to_create[get_lang('Introduction')] = $intro_content;
119 119
 
120
-        for ($i = 0; $i<count($matches[0]); $i++) {
120
+        for ($i = 0; $i < count($matches[0]); $i++) {
121 121
 
122 122
             if (empty($matches[1][$i]))
123 123
                 continue;
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 
175 175
         $first_item = 0;
176 176
 
177
-        foreach($pages as $key => $page_content) {
177
+        foreach ($pages as $key => $page_content) {
178 178
             // For every pages, we create a new file.
179 179
 
180 180
             $key += 1;
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
                     foreach ($specific_fields as $specific_field) {
214 214
                         if (isset($_REQUEST[$specific_field['code']])) {
215 215
                             $sterms = trim($_REQUEST[$specific_field['code']]);
216
-                            $all_specific_terms .= ' '. $sterms;
216
+                            $all_specific_terms .= ' '.$sterms;
217 217
                             if (!empty($sterms)) {
218 218
                                 $sterms = explode(',', $sterms);
219 219
                                 foreach ($sterms as $sterm) {
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
                             }
223 223
                         }
224 224
                     }
225
-                    $page_content = $all_specific_terms .' '. $page_content;
225
+                    $page_content = $all_specific_terms.' '.$page_content;
226 226
                     $ic_slide->addValue('content', $page_content);
227 227
                     // Add a comment to say terms separated by commas.
228 228
                     $courseid = api_get_course_id();
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
                         SE_COURSE_ID => $courseid,
234 234
                         SE_TOOL_ID => TOOL_LEARNPATH,
235 235
                         SE_DATA => array('lp_id' => $lp_id, 'lp_item' => $previous, 'document_id' => $document_id),
236
-                        SE_USER => (int)api_get_user_id(),
236
+                        SE_USER => (int) api_get_user_id(),
237 237
                     );
238 238
                     $ic_slide->xapian_data = serialize($xapian_data);
239 239
                     $di->addChunk($ic_slide);
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
             $content = '<body><div style="width:'.$max_width.'">'.$content;
277 277
         }
278 278
 
279
-        $content = preg_replace('|</body>|i','</div>\\0', $content, -1, $count);
279
+        $content = preg_replace('|</body>|i', '</div>\\0', $content, -1, $count);
280 280
         if ($count < 1) {
281 281
             $content = $content.'</div></body>';
282 282
         }
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
                 }
305 305
 
306 306
             } elseif ($img_width > $max_width - 10) {
307
-                $picture_resized = str_ireplace('width='.$img_width, 'width="'.($max_width-10).'"', $images[0][$key]);
307
+                $picture_resized = str_ireplace('width='.$img_width, 'width="'.($max_width - 10).'"', $images[0][$key]);
308 308
                 $content = str_replace($images[0][$key], $picture_resized, $content);
309 309
             }
310 310
         }
Please login to merge, or discard this patch.
main/lp/lp_add_audio.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
 
17 17
 $is_allowed_to_edit = api_is_allowed_to_edit(null, true);
18 18
 
19
-$isStudentView = isset($_REQUEST['isStudentView']) ? (int)$_REQUEST['isStudentView'] : null;
20
-$learnpath_id = (int)$_REQUEST['lp_id'];
19
+$isStudentView = isset($_REQUEST['isStudentView']) ? (int) $_REQUEST['isStudentView'] : null;
20
+$learnpath_id = (int) $_REQUEST['lp_id'];
21 21
 $submit = isset($_POST['submit_button']) ? $_POST['submit_button'] : null;
22 22
 
23 23
 $type = isset($_GET['type']) ? $_GET['type'] : null;
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 }
42 42
 
43 43
 if (!empty($gradebook) && $gradebook == 'view') {
44
-    $interbreadcrumb[] = array (
44
+    $interbreadcrumb[] = array(
45 45
         'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
46 46
         'name' => get_lang('ToolGradebook')
47 47
     );
@@ -65,12 +65,12 @@  discard block
 block discarded – undo
65 65
         );
66 66
         break;
67 67
     default:
68
-        $interbreadcrumb[]= array('url' => '#', 'name' => get_lang('NewStep'));
68
+        $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('NewStep'));
69 69
         break;
70 70
 }
71 71
 
72 72
 if ($action == 'add_item' && $type == 'document') {
73
-    $interbreadcrumb[]= array ('url' => '#', 'name' => get_lang('NewDocumentCreated'));
73
+    $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('NewDocumentCreated'));
74 74
 }
75 75
 
76 76
 // Theme calls.
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 $form = new FormValidator(
87 87
     'add_audio',
88 88
     'post',
89
-    api_get_self() . '?action=add_audio&id=' . $lp_item_id . '&' . api_get_cidreq().'&lp_id='.$learnpath_id,
89
+    api_get_self().'?action=add_audio&id='.$lp_item_id.'&'.api_get_cidreq().'&lp_id='.$learnpath_id,
90 90
     null,
91 91
     array('enctype' => 'multipart/form-data')
92 92
 );
@@ -100,8 +100,8 @@  discard block
 block discarded – undo
100 100
     $urlFile = api_get_path(WEB_COURSE_PATH).$courseInfo['path'].'/document/audio/'.$lp_item->audio.'?'.api_get_cidreq();
101 101
 
102 102
     if (!file_exists($file)) {
103
-        $file = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/document'.$lpPathInfo['dir'] . '/' . $lp_item->audio;
104
-        $urlFile = api_get_path(WEB_COURSE_PATH).$courseInfo['path'].'/document'.$lpPathInfo['dir'] . '/' . $lp_item->audio.'?'.api_get_cidreq();
103
+        $file = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/document'.$lpPathInfo['dir'].'/'.$lp_item->audio;
104
+        $urlFile = api_get_path(WEB_COURSE_PATH).$courseInfo['path'].'/document'.$lpPathInfo['dir'].'/'.$lp_item->audio.'?'.api_get_cidreq();
105 105
     }
106 106
 }
107 107
 
@@ -117,10 +117,10 @@  discard block
 block discarded – undo
117 117
 
118 118
 $page .= '<div id="doc_form" class="col-md-8">';
119 119
 
120
-$htmlHeadXtra[] = '<script src="' . api_get_path(WEB_LIBRARY_JS_PATH) . 'rtc/RecordRTC.js"></script>';
121
-$htmlHeadXtra[] = '<script src="' . api_get_path(WEB_LIBRARY_PATH) . 'wami-recorder/recorder.js"></script>';
122
-$htmlHeadXtra[] = '<script src="' . api_get_path(WEB_LIBRARY_PATH) . 'wami-recorder/gui.js"></script>';
123
-$htmlHeadXtra[] = '<script type="text/javascript" src="' . api_get_path(WEB_LIBRARY_PATH) . 'swfobject/swfobject.js"></script>';
120
+$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_JS_PATH).'rtc/RecordRTC.js"></script>';
121
+$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'wami-recorder/recorder.js"></script>';
122
+$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'wami-recorder/gui.js"></script>';
123
+$htmlHeadXtra[] = '<script type="text/javascript" src="'.api_get_path(WEB_LIBRARY_PATH).'swfobject/swfobject.js"></script>';
124 124
 
125 125
 $tpl = new Template(null);
126 126
 $tpl->assign('unique_file_id', api_get_unique_id());
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         Display::getMediaPlayer($file, array('url' => $urlFile)).
142 142
         "</div>";
143 143
     $form->addElement('label', get_lang('Listen'), $audioPlayer);
144
-    $url = api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?lp_id='.$_SESSION['oLP']->get_id().'&action=add_audio&id='.$lp_item_id.'&delete_file=1&'.api_get_cidreq();
144
+    $url = api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?lp_id='.$_SESSION['oLP']->get_id().'&action=add_audio&id='.$lp_item_id.'&delete_file=1&'.api_get_cidreq();
145 145
     $form->addElement('label', null, Display::url(get_lang('RemoveAudio'), $url, array('class' => 'btn btn-danger')));
146 146
 } else {
147 147
     $form->addElement('file', 'file');
Please login to merge, or discard this patch.
main/lp/lp_ajax_switch_item_toc.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -124,22 +124,22 @@
 block discarded – undo
124 124
     $coreExit = $myLPI->get_core_exit();
125 125
 
126 126
     $return .=
127
-        "olms.lms_lp_id=".$lpId.";" .
128
-        "olms.lms_item_id=".$newItemId.";" .
129
-        "olms.lms_old_item_id=".$oldItemId.";" .
130
-        "olms.lms_initialized=0;" .
131
-        "olms.lms_view_id=".$viewId.";" .
132
-        "olms.lms_user_id=".$userId.";" .
133
-        "olms.next_item=".$newItemId.";" . // This one is very important to replace possible literal strings.
134
-        "olms.lms_next_item=".$nextItemId.";" .
135
-        "olms.lms_previous_item=".$previousItemId.";" .
136
-        "olms.lms_item_type = '".$itemType."';" .
137
-        "olms.lms_item_credit = '".$credit."';" .
138
-        "olms.lms_item_lesson_mode = '".$lessonMode."';" .
139
-        "olms.lms_item_launch_data = '".$launchData."';" .
140
-        "olms.lms_item_interactions_count = '".$interactionsCount."';" .
141
-        "olms.lms_item_objectives_count = '".$objectivesCount."';" .
142
-        "olms.lms_item_core_exit = '".$coreExit."';" .
127
+        "olms.lms_lp_id=".$lpId.";".
128
+        "olms.lms_item_id=".$newItemId.";".
129
+        "olms.lms_old_item_id=".$oldItemId.";".
130
+        "olms.lms_initialized=0;".
131
+        "olms.lms_view_id=".$viewId.";".
132
+        "olms.lms_user_id=".$userId.";".
133
+        "olms.next_item=".$newItemId.";".// This one is very important to replace possible literal strings.
134
+        "olms.lms_next_item=".$nextItemId.";".
135
+        "olms.lms_previous_item=".$previousItemId.";".
136
+        "olms.lms_item_type = '".$itemType."';".
137
+        "olms.lms_item_credit = '".$credit."';".
138
+        "olms.lms_item_lesson_mode = '".$lessonMode."';".
139
+        "olms.lms_item_launch_data = '".$launchData."';".
140
+        "olms.lms_item_interactions_count = '".$interactionsCount."';".
141
+        "olms.lms_item_objectives_count = '".$objectivesCount."';".
142
+        "olms.lms_item_core_exit = '".$coreExit."';".
143 143
         "olms.asset_timer = 0;";
144 144
 
145 145
     $return .= "update_toc('unhighlight','".$currentItem."');".
Please login to merge, or discard this patch.
main/gradebook/lib/be/learnpathlink.class.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
 
44 44
 		$result = Database::query($sql);
45 45
 
46
-		$cats=array();
47
-		while ($data=Database::fetch_array($result)) {
48
-			$cats[] = array ($data['id'], $data['name']);
46
+		$cats = array();
47
+		while ($data = Database::fetch_array($result)) {
48
+			$cats[] = array($data['id'], $data['name']);
49 49
 		}
50 50
 
51 51
 		return $cats;
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
 		$result = Database::query($sql);
73 73
 
74 74
 		$cats = array();
75
-		while ($data=Database::fetch_array($result)) {
76
-			$cats[] = array ($data['id'], $data['name']);
75
+		while ($data = Database::fetch_array($result)) {
76
+			$cats[] = array($data['id'], $data['name']);
77 77
 		}
78 78
 
79 79
 		return $cats;
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 		$sql = "SELECT count(id) AS number FROM $tbl_stats
90 90
 				WHERE c_id = ".$this->course_id." AND lp_id = ".$this->get_ref_id();
91 91
 		$result = Database::query($sql);
92
-		$number = Database::fetch_array($result,'NUM');
92
+		$number = Database::fetch_array($result, 'NUM');
93 93
 		return ($number[0] != 0);
94 94
 	}
95 95
 
@@ -121,12 +121,12 @@  discard block
 block discarded – undo
121 121
 		// for 1 student
122 122
 		if (isset($stud_id)) {
123 123
 			if ($data = Database::fetch_assoc($scores)) {
124
-				return array ($data['progress'], 100);
124
+				return array($data['progress'], 100);
125 125
 			} else
126 126
 				return null;
127 127
 		} else {
128 128
 			// all students -> get average
129
-			$students = array();  // user list, needed to make sure we only
129
+			$students = array(); // user list, needed to make sure we only
130 130
 			// take first attempts into account
131 131
 			$rescount = 0;
132 132
 			$sum = 0;
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 						return array($bestResult, 100);
155 155
 						break;
156 156
 					case 'average':
157
-						return array($sumResult/$rescount, 100);
157
+						return array($sumResult / $rescount, 100);
158 158
 						break;
159 159
 					case 'ranking':
160 160
 						return AbstractLink::getCurrentUserRanking($stud_id, $students);
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 	public function get_link()
174 174
 	{
175 175
 		$session_id = api_get_session_id();
176
-		$url = api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?'.api_get_cidreq_params($this->get_course_code(), $session_id).'&gradebook=view';
176
+		$url = api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?'.api_get_cidreq_params($this->get_course_code(), $session_id).'&gradebook=view';
177 177
 
178 178
 		if (!api_is_allowed_to_edit() || $this->calc_score(api_get_user_id()) == null) {
179 179
 			$url .= '&action=view&lp_id='.$this->get_ref_id();
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 		$sql = 'SELECT count(id) FROM '.$this->get_learnpath_table().'
209 209
                 WHERE c_id = '.$this->course_id.' AND id = '.$this->get_ref_id().' ';
210 210
 		$result = Database::query($sql);
211
-		$number = Database::fetch_row($result,'NUM');
211
+		$number = Database::fetch_row($result, 'NUM');
212 212
 		return ($number[0] != 0);
213 213
 	}
214 214
 
Please login to merge, or discard this patch.