Completed
Push — 1.11.x ( 651907...6c7c62 )
by José
30:00
created
main/work/work.lib.php 1 patch
Spacing   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -36,27 +36,27 @@  discard block
 block discarded – undo
36 36
 
37 37
     if (!empty($id)) {
38 38
         $display_output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&gradebook='.$gradebook.'&id='.$my_back_id.'">'.
39
-            Display::return_icon('back.png', get_lang('BackToWorksList'),'',ICON_SIZE_MEDIUM).'</a>';
39
+            Display::return_icon('back.png', get_lang('BackToWorksList'), '', ICON_SIZE_MEDIUM).'</a>';
40 40
     }
41 41
 
42 42
     if (api_is_allowed_to_edit(null, true) && $origin != 'learnpath') {
43 43
         // Create dir
44 44
         if (empty($id)) {
45 45
             $display_output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=create_dir&gradebook='.$gradebook.'">';
46
-            $display_output .= Display::return_icon('new_work.png', get_lang('CreateAssignment'),'',ICON_SIZE_MEDIUM).'</a>';
46
+            $display_output .= Display::return_icon('new_work.png', get_lang('CreateAssignment'), '', ICON_SIZE_MEDIUM).'</a>';
47 47
         }
48 48
         if (empty($id)) {
49 49
             // Options
50 50
             $display_output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=settings&gradebook='.$gradebook.'">';
51
-            $display_output .= Display::return_icon('settings.png', get_lang('EditToolOptions'),'',ICON_SIZE_MEDIUM).'</a>';
51
+            $display_output .= Display::return_icon('settings.png', get_lang('EditToolOptions'), '', ICON_SIZE_MEDIUM).'</a>';
52 52
         }
53
-        $display_output .= '<a id="open-view-list" href="#">' . Display::return_icon('listwork.png', get_lang('ViewStudents'),'',ICON_SIZE_MEDIUM) . '</a>';
53
+        $display_output .= '<a id="open-view-list" href="#">'.Display::return_icon('listwork.png', get_lang('ViewStudents'), '', ICON_SIZE_MEDIUM).'</a>';
54 54
 
55 55
     }
56 56
 
57 57
     if (api_is_allowed_to_edit(null, true) && $origin != 'learnpath' && api_is_allowed_to_session_edit(false, true)) {
58 58
         // Delete all files
59
-        if (api_get_setting('permanently_remove_deleted_files') == 'true'){
59
+        if (api_get_setting('permanently_remove_deleted_files') == 'true') {
60 60
             $message = get_lang('ConfirmYourChoiceDeleteAllfiles');
61 61
         } else {
62 62
             $message = get_lang('ConfirmYourChoice');
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
  */
114 114
 function two_digits($number)
115 115
 {
116
-    $number = (int)$number;
116
+    $number = (int) $number;
117 117
     return ($number < 10) ? '0'.$number : $number;
118 118
 }
119 119
 
@@ -518,10 +518,10 @@  discard block
 block discarded – undo
518 518
 
519 519
     $columnModel = array(
520 520
         array('name'=>'type', 'index'=>'type', 'width'=>'30', 'align'=>'center', 'sortable' => 'false'),
521
-        array('name'=>'title', 'index'=>'title', 'width'=>'250',   'align'=>'left'),
522
-        array('name'=>'expires_on', 'index'=>'expires_on', 'width'=>'80',  'align'=>'center', 'sortable'=>'false'),
523
-        array('name'=>'feedback', 'index'=>'feedback', 'width'=>'80',  'align'=>'center', 'sortable'=>'false'),
524
-        array('name'=>'last_upload', 'index'=>'feedback', 'width'=>'125',  'align'=>'center', 'sortable'=>'false')
521
+        array('name'=>'title', 'index'=>'title', 'width'=>'250', 'align'=>'left'),
522
+        array('name'=>'expires_on', 'index'=>'expires_on', 'width'=>'80', 'align'=>'center', 'sortable'=>'false'),
523
+        array('name'=>'feedback', 'index'=>'feedback', 'width'=>'80', 'align'=>'center', 'sortable'=>'false'),
524
+        array('name'=>'last_upload', 'index'=>'feedback', 'width'=>'125', 'align'=>'center', 'sortable'=>'false')
525 525
     );
526 526
 
527 527
     if ($courseInfo['show_score'] == 0) {
@@ -558,10 +558,10 @@  discard block
 block discarded – undo
558 558
 {
559 559
     $columnModel = array(
560 560
         array('name'=>'type', 'index'=>'type', 'width'=>'35', 'align'=>'center', 'sortable' => 'false'),
561
-        array('name'=>'title', 'index'=>'title',  'width'=>'300',   'align'=>'left', 'wrap_cell' => "true"),
562
-        array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'125',  'align'=>'center'),
563
-        array('name'=>'expires_on', 'index'=>'expires_on', 'width'=>'125',  'align'=>'center'),
564
-        array('name'=>'amount', 'index'=>'amount', 'width'=>'110',  'align'=>'center', 'sortable' => 'false'),
561
+        array('name'=>'title', 'index'=>'title', 'width'=>'300', 'align'=>'left', 'wrap_cell' => "true"),
562
+        array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'125', 'align'=>'center'),
563
+        array('name'=>'expires_on', 'index'=>'expires_on', 'width'=>'125', 'align'=>'center'),
564
+        array('name'=>'amount', 'index'=>'amount', 'width'=>'110', 'align'=>'center', 'sortable' => 'false'),
565 565
         array('name'=>'actions', 'index'=>'actions', 'width'=>'110', 'align'=>'left', 'sortable'=>'false')
566 566
     );
567 567
 
@@ -762,7 +762,7 @@  discard block
 block discarded – undo
762 762
         return false;
763 763
     }
764 764
 
765
-    $base_work_dir = api_get_path(SYS_COURSE_PATH) .$_course['path'].'/work';
765
+    $base_work_dir = api_get_path(SYS_COURSE_PATH).$_course['path'].'/work';
766 766
     $work_data_url = $base_work_dir.$work_data['url'];
767 767
     $check = Security::check_abs_path($work_data_url.'/', $base_work_dir.'/');
768 768
 
@@ -846,7 +846,7 @@  discard block
 block discarded – undo
846 846
 function get_work_path($id)
847 847
 {
848 848
     $table = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
849
-    $course_id  = api_get_course_int_id();
849
+    $course_id = api_get_course_int_id();
850 850
     $sql = 'SELECT url FROM '.$table.'
851 851
             WHERE c_id = '.$course_id.' AND id='.intval($id);
852 852
     $res = Database::query($sql);
@@ -969,9 +969,9 @@  discard block
 block discarded – undo
969 969
     if ($handle = @opendir($directory)) {
970 970
         while (false !== ($file = readdir($handle))) {
971 971
             if ($file != '.' && $file != '..') {
972
-                if (is_dir($directory. '/' . $file)) {
973
-                    $array_items = array_merge($array_items, directory_to_array($directory. '/' . $file));
974
-                    $file = $directory . '/' . $file;
972
+                if (is_dir($directory.'/'.$file)) {
973
+                    $array_items = array_merge($array_items, directory_to_array($directory.'/'.$file));
974
+                    $file = $directory.'/'.$file;
975 975
                     $array_items[] = preg_replace("/\/\//si", '/', $file);
976 976
                 }
977 977
             }
@@ -1048,7 +1048,7 @@  discard block
 block discarded – undo
1048 1048
             if (is_dir($path_dir.'/'.$entry)) {
1049 1049
                 $count_dir++;
1050 1050
                 if ($recurse) {
1051
-                    $count += count_dir($path_dir . '/' . $entry, $recurse);
1051
+                    $count += count_dir($path_dir.'/'.$entry, $recurse);
1052 1052
                 }
1053 1053
             } else {
1054 1054
                 $count++;
@@ -1326,11 +1326,11 @@  discard block
 block discarded – undo
1326 1326
         $courseInfo
1327 1327
     );
1328 1328
 
1329
-    if (!in_array($direction, array('asc','desc'))) {
1329
+    if (!in_array($direction, array('asc', 'desc'))) {
1330 1330
         $direction = 'desc';
1331 1331
     }
1332 1332
     if (!empty($where_condition)) {
1333
-        $where_condition = ' AND ' . $where_condition;
1333
+        $where_condition = ' AND '.$where_condition;
1334 1334
     }
1335 1335
 
1336 1336
     $column = !empty($column) ? Database::escape_string($column) : 'sent_date';
@@ -1483,7 +1483,7 @@  discard block
 block discarded – undo
1483 1483
         $direction = 'desc';
1484 1484
     }
1485 1485
     if (!empty($where_condition)) {
1486
-        $where_condition = ' AND ' . $where_condition;
1486
+        $where_condition = ' AND '.$where_condition;
1487 1487
     }
1488 1488
 
1489 1489
     $column = !empty($column) ? Database::escape_string($column) : 'sent_date';
@@ -1542,7 +1542,7 @@  discard block
 block discarded – undo
1542 1542
             );
1543 1543
 
1544 1544
             $work['amount'] = Display::label(
1545
-                $countUniqueAttempts . '/' .
1545
+                $countUniqueAttempts.'/'.
1546 1546
                 $totalUsers,
1547 1547
                 'success'
1548 1548
             );
@@ -1591,7 +1591,7 @@  discard block
 block discarded – undo
1591 1591
                         array(),
1592 1592
                         ICON_SIZE_SMALL
1593 1593
                     ),
1594
-                    api_get_path(WEB_CODE_PATH) . 'work/downloadfolder.inc.php?id=' . $workId . '&' . api_get_cidreq()
1594
+                    api_get_path(WEB_CODE_PATH).'work/downloadfolder.inc.php?id='.$workId.'&'.api_get_cidreq()
1595 1595
                 );
1596 1596
             } else {
1597 1597
                 $downloadLink = Display::url(
@@ -1675,7 +1675,7 @@  discard block
 block discarded – undo
1675 1675
     $userCondition = " AND u.user_id = $studentId ";
1676 1676
     $sessionCondition = api_get_session_condition($sessionId, true, false, 'w.session_id');
1677 1677
     $workCondition = " AND w_rel.work_id = $workId";
1678
-    $workParentCondition  = " AND w.parent_id = $workId";
1678
+    $workParentCondition = " AND w.parent_id = $workId";
1679 1679
 
1680 1680
     $sql = "(
1681 1681
                 $select1 FROM $userTable u
@@ -1782,7 +1782,7 @@  discard block
 block discarded – undo
1782 1782
         }
1783 1783
 
1784 1784
         if ($allowEdition && !empty($itemId)) {
1785
-            $deleteLink  = Display::url($deleteIcon, $urlDelete.'&item_id='.$itemId.'&id='.$workId);
1785
+            $deleteLink = Display::url($deleteIcon, $urlDelete.'&item_id='.$itemId.'&id='.$workId);
1786 1786
         } else {
1787 1787
             $deleteLink = null;
1788 1788
         }
@@ -1860,7 +1860,7 @@  discard block
 block discarded – undo
1860 1860
     $start = intval($start);
1861 1861
     $limit = intval($limit);
1862 1862
 
1863
-    if (!in_array($direction, array('asc','desc'))) {
1863
+    if (!in_array($direction, array('asc', 'desc'))) {
1864 1864
         $direction = 'desc';
1865 1865
     }
1866 1866
 
@@ -1930,7 +1930,7 @@  discard block
 block discarded – undo
1930 1930
         $work_assignment = get_work_assignment_by_id($work_id);
1931 1931
 
1932 1932
         if (!empty($studentId)) {
1933
-            $where_condition.= " AND u.user_id = ".intval($studentId);
1933
+            $where_condition .= " AND u.user_id = ".intval($studentId);
1934 1934
         }
1935 1935
 
1936 1936
         $sql = " $select
@@ -1940,7 +1940,7 @@  discard block
 block discarded – undo
1940 1940
                     $extra_conditions 
1941 1941
                     $where_condition 
1942 1942
                     $condition_session
1943
-                    AND u.status != " . INVITEE . "
1943
+                    AND u.status != ".INVITEE."
1944 1944
                 ORDER BY $column $direction";
1945 1945
 
1946 1946
         if (!empty($start) && !empty($limit)) {
@@ -1995,7 +1995,7 @@  discard block
 block discarded – undo
1995 1995
                     $qualification_string = Display::label('-');
1996 1996
                 } else {
1997 1997
                     $label = 'info';
1998
-                    $relativeScore = $work['qualification']/$work_data['qualification'];
1998
+                    $relativeScore = $work['qualification'] / $work_data['qualification'];
1999 1999
                     if ($relativeScore < 0.5) {
2000 2000
                         $label = 'important';
2001 2001
                     } elseif ($relativeScore < 0.75) {
@@ -2048,10 +2048,10 @@  discard block
 block discarded – undo
2048 2048
                 // If URL is present then there's a file to download keep BC.
2049 2049
                 if ($work['contains_file'] || !empty($work['url'])) {
2050 2050
                     $link_to_download = '<a href="'.$url.'download.php?id='.$item_id.'&'.api_get_cidreq().'">'.
2051
-                        Display::return_icon('save.png', get_lang('Save'),array(), ICON_SIZE_SMALL).'</a> ';
2051
+                        Display::return_icon('save.png', get_lang('Save'), array(), ICON_SIZE_SMALL).'</a> ';
2052 2052
                 }
2053 2053
 
2054
-                $send_to = Portfolio::share('work', $work['id'],  array('style' => 'white-space:nowrap;'));
2054
+                $send_to = Portfolio::share('work', $work['id'], array('style' => 'white-space:nowrap;'));
2055 2055
 
2056 2056
                 $feedback = null;
2057 2057
                 $count = getWorkCommentCount($item_id, $course_info);
@@ -2060,7 +2060,7 @@  discard block
 block discarded – undo
2060 2060
                         $feedback .= ' ';
2061 2061
                     }
2062 2062
                     $feedback .= '<a href="'.$url.'view.php?'.api_get_cidreq().'&id='.$item_id.'" title="'.get_lang('View').'">'.
2063
-                    $count . ' ' . Display::returnFontAwesomeIcon('comments-o') . '</a> ';
2063
+                    $count.' '.Display::returnFontAwesomeIcon('comments-o').'</a> ';
2064 2064
                 }
2065 2065
 
2066 2066
                 $work['qualification'] = $qualification_string.$feedback;
@@ -2068,11 +2068,11 @@  discard block
 block discarded – undo
2068 2068
 
2069 2069
                 // Date.
2070 2070
                 $work_date = api_convert_and_format_date($work['sent_date']);
2071
-                $date = date_to_str_ago($work['sent_date']). ' ' . $work_date;
2072
-                $work['formatted_date'] = $work_date . ' - ' . $add_string;
2071
+                $date = date_to_str_ago($work['sent_date']).' '.$work_date;
2072
+                $work['formatted_date'] = $work_date.' - '.$add_string;
2073 2073
 
2074 2074
                 $work['sent_date_from_db'] = $work['sent_date'];
2075
-                $work['sent_date'] = '<div class="work-date" title="'.$date.'">' . $add_string . ' - ' . $work['sent_date'] . '</div>';
2075
+                $work['sent_date'] = '<div class="work-date" title="'.$date.'">'.$add_string.' - '.$work['sent_date'].'</div>';
2076 2076
 
2077 2077
                 // Actions.
2078 2078
                 $correction = '';
@@ -2090,8 +2090,8 @@  discard block
 block discarded – undo
2090 2090
                         Display::return_icon('default.png', get_lang('View'), array(), ICON_SIZE_SMALL).'</a> ';
2091 2091
 
2092 2092
                     if ($unoconv && empty($work['contains_file'])) {
2093
-                        $action .=  '<a href="'.$url.'work_list_all.php?'.api_get_cidreq().'&id='.$work_id.'&action=export_to_doc&item_id='.$item_id.'" title="'.get_lang('ExportToDoc').'" >'.
2094
-                            Display::return_icon('export_doc.png', get_lang('ExportToDoc'),array(), ICON_SIZE_SMALL).'</a> ';
2093
+                        $action .= '<a href="'.$url.'work_list_all.php?'.api_get_cidreq().'&id='.$work_id.'&action=export_to_doc&item_id='.$item_id.'" title="'.get_lang('ExportToDoc').'" >'.
2094
+                            Display::return_icon('export_doc.png', get_lang('ExportToDoc'), array(), ICON_SIZE_SMALL).'</a> ';
2095 2095
                     }
2096 2096
                     $loadingText = addslashes(get_lang('Loading'));
2097 2097
                     $uploadedText = addslashes(get_lang('Uploaded'));
@@ -2138,7 +2138,7 @@  discard block
 block discarded – undo
2138 2138
 
2139 2139
                     if ($locked) {
2140 2140
                         if ($qualification_exists) {
2141
-                            $action .= Display::return_icon('rate_work_na.png', get_lang('CorrectAndRate'),array(), ICON_SIZE_SMALL);
2141
+                            $action .= Display::return_icon('rate_work_na.png', get_lang('CorrectAndRate'), array(), ICON_SIZE_SMALL);
2142 2142
                         } else {
2143 2143
                             $action .= Display::return_icon('edit_na.png', get_lang('Comment'), array(), ICON_SIZE_SMALL);
2144 2144
                         }
@@ -2154,26 +2154,26 @@  discard block
 block discarded – undo
2154 2154
 
2155 2155
                     if ($work['contains_file']) {
2156 2156
                         if ($locked) {
2157
-                            $action .= Display::return_icon('move_na.png', get_lang('Move'),array(), ICON_SIZE_SMALL);
2157
+                            $action .= Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL);
2158 2158
                         } else {
2159 2159
                             $action .= '<a href="'.$url.'work.php?'.api_get_cidreq().'&action=move&item_id='.$item_id.'&id='.$work['parent_id'].'" title="'.get_lang('Move').'">'.
2160
-                                Display::return_icon('move.png', get_lang('Move'),array(), ICON_SIZE_SMALL).'</a>';
2160
+                                Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL).'</a>';
2161 2161
                         }
2162 2162
                     }
2163 2163
 
2164 2164
                     if ($work['accepted'] == '1') {
2165 2165
                         $action .= '<a href="'.$url.'work_list_all.php?'.api_get_cidreq().'&id='.$work_id.'&action=make_invisible&item_id='.$item_id.'" title="'.get_lang('Invisible').'" >'.
2166
-                            Display::return_icon('visible.png', get_lang('Invisible'),array(), ICON_SIZE_SMALL).'</a>';
2166
+                            Display::return_icon('visible.png', get_lang('Invisible'), array(), ICON_SIZE_SMALL).'</a>';
2167 2167
                     } else {
2168 2168
                         $action .= '<a href="'.$url.'work_list_all.php?'.api_get_cidreq().'&id='.$work_id.'&action=make_visible&item_id='.$item_id.'" title="'.get_lang('Visible').'" >'.
2169
-                            Display::return_icon('invisible.png', get_lang('Visible'),array(), ICON_SIZE_SMALL).'</a> ';
2169
+                            Display::return_icon('invisible.png', get_lang('Visible'), array(), ICON_SIZE_SMALL).'</a> ';
2170 2170
                     }
2171 2171
 
2172 2172
                     if ($locked) {
2173 2173
                         $action .= Display::return_icon('delete_na.png', get_lang('Delete'), '', ICON_SIZE_SMALL);
2174 2174
                     } else {
2175
-                        $action .= '<a href="'.$url.'work_list_all.php?'.api_get_cidreq().'&id='.$work_id.'&action=delete&item_id='.$item_id.'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES))."'".')) return false;" title="'.get_lang('Delete').'" >'.
2176
-                            Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>';
2175
+                        $action .= '<a href="'.$url.'work_list_all.php?'.api_get_cidreq().'&id='.$work_id.'&action=delete&item_id='.$item_id.'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;" title="'.get_lang('Delete').'" >'.
2176
+                            Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>';
2177 2177
                     }
2178 2178
                 } elseif ($is_author && (empty($work['qualificator_id']) || $work['qualificator_id'] == 0)) {
2179 2179
                     $action .= '<a href="'.$url.'view.php?'.api_get_cidreq().'&id='.$item_id.'" title="'.get_lang('View').'">'.
@@ -2184,8 +2184,8 @@  discard block
 block discarded – undo
2184 2184
                             $action .= '<a href="'.$url.'edit.php?'.api_get_cidreq().'&item_id='.$item_id.'&id='.$work['parent_id'].'" title="'.get_lang('Modify').'">'.
2185 2185
                                 Display::return_icon('edit.png', get_lang('Comment'), array(), ICON_SIZE_SMALL).'</a>';
2186 2186
                         }
2187
-                        $action .= ' <a href="'.$url.'work_list.php?'.api_get_cidreq().'&action=delete&item_id='.$item_id.'&id='.$work['parent_id'].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES))."'".')) return false;" title="'.get_lang('Delete').'"  >'.
2188
-                            Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>';
2187
+                        $action .= ' <a href="'.$url.'work_list.php?'.api_get_cidreq().'&action=delete&item_id='.$item_id.'&id='.$work['parent_id'].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;" title="'.get_lang('Delete').'"  >'.
2188
+                            Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>';
2189 2189
                     } else {
2190 2190
                         $action .= Display::return_icon('edit_na.png', get_lang('Modify'), array(), ICON_SIZE_SMALL);
2191 2191
                     }
@@ -2225,7 +2225,7 @@  discard block
 block discarded – undo
2225 2225
     $_course = api_get_course_info();
2226 2226
     $task_id = $task_data['id'];
2227 2227
     $task_title = !empty($task_data['title']) ? $task_data['title'] : basename($task_data['url']);
2228
-    $subject = '[' . api_get_setting('siteName') . '] ';
2228
+    $subject = '['.api_get_setting('siteName').'] ';
2229 2229
 
2230 2230
     // The body can be as long as you wish, and any combination of text and variables
2231 2231
     $content = get_lang('ReminderToSubmitPendingTask')."\n".get_lang('CourseName').' : '.$_course['name']."\n";
@@ -2234,7 +2234,7 @@  discard block
 block discarded – undo
2234 2234
     $mails_sent_to = array();
2235 2235
     foreach ($list_users as $user) {
2236 2236
         $name_user = api_get_person_name($user[1], $user[0], null, PERSON_NAME_EMAIL_ADDRESS);
2237
-        $dear_line = get_lang('Dear')." ".api_get_person_name($user[1], $user[0]) .", \n\n";
2237
+        $dear_line = get_lang('Dear')." ".api_get_person_name($user[1], $user[0]).", \n\n";
2238 2238
         $body      = $dear_line.$content;
2239 2239
         MessageManager::send_message($user[3], $subject, $body);
2240 2240
         $mails_sent_to[] = $name_user;
@@ -2263,22 +2263,22 @@  discard block
 block discarded – undo
2263 2263
     } else {
2264 2264
         $students = CourseManager::get_student_list_from_course_code($courseCode, true, $sessionId);
2265 2265
     }
2266
-    $emailsubject = '[' . api_get_setting('siteName') . '] '.get_lang('HomeworkCreated');
2266
+    $emailsubject = '['.api_get_setting('siteName').'] '.get_lang('HomeworkCreated');
2267 2267
     $currentUser = api_get_user_info(api_get_user_id());
2268 2268
     if (!empty($students)) {
2269
-        foreach($students as $student) {
2269
+        foreach ($students as $student) {
2270 2270
             $user_info = api_get_user_info($student["user_id"]);
2271
-            if(!empty($user_info["mail"])) {
2271
+            if (!empty($user_info["mail"])) {
2272 2272
                 $name_user = api_get_person_name(
2273 2273
                     $user_info["firstname"],
2274 2274
                     $user_info["lastname"],
2275 2275
                     null,
2276 2276
                     PERSON_NAME_EMAIL_ADDRESS
2277 2277
                 );
2278
-                $link = api_get_path(WEB_CODE_PATH) . 'work/work_list_all.php?' . api_get_cidreq() . '&id=' . $workId;
2278
+                $link = api_get_path(WEB_CODE_PATH).'work/work_list_all.php?'.api_get_cidreq().'&id='.$workId;
2279 2279
                 $emailbody = get_lang('Dear')." ".$name_user.",\n\n";
2280 2280
                 $emailbody .= get_lang('HomeworkHasBeenCreatedForTheCourse')." ".$courseCode.". "."\n\n".
2281
-                    '<a href="'. $link . '">' . get_lang('PleaseCheckHomeworkPage') . '</a>';
2281
+                    '<a href="'.$link.'">'.get_lang('PleaseCheckHomeworkPage').'</a>';
2282 2282
                 $emailbody .= "\n\n".api_get_person_name($currentUser["firstname"], $currentUser["lastname"]);
2283 2283
 
2284 2284
                 $additionalParameters = array(
@@ -2320,7 +2320,7 @@  discard block
 block discarded – undo
2320 2320
     $url = Database::escape_string($url);
2321 2321
     $sql = "SELECT id FROM $work_table WHERE url='$url'";
2322 2322
     $result = Database::query($sql);
2323
-    if (Database::num_rows($result)> 0) {
2323
+    if (Database::num_rows($result) > 0) {
2324 2324
         $row = Database::fetch_row($result);
2325 2325
         if (empty($row)) {
2326 2326
             return false;
@@ -2441,7 +2441,7 @@  discard block
 block discarded – undo
2441 2441
     }
2442 2442
 
2443 2443
     if (!empty($studentId)) {
2444
-        $sql_users.= " AND u.user_id = ".intval($studentId);
2444
+        $sql_users .= " AND u.user_id = ".intval($studentId);
2445 2445
     }
2446 2446
 
2447 2447
     $group_id = api_get_group_id();
@@ -2451,7 +2451,7 @@  discard block
 block discarded – undo
2451 2451
         $groupInfo = GroupManager::get_group_properties($group_id);
2452 2452
         $group_user_list = GroupManager::get_subscribed_users($groupInfo['iid']);
2453 2453
         if (!empty($group_user_list)) {
2454
-            foreach($group_user_list as $group_user) {
2454
+            foreach ($group_user_list as $group_user) {
2455 2455
                 $new_group_user_list[] = $group_user['user_id'];
2456 2456
             }
2457 2457
         }
@@ -2873,7 +2873,7 @@  discard block
 block discarded – undo
2873 2873
 function getWorkComments($work)
2874 2874
 {
2875 2875
     $commentTable = Database::get_course_table(TABLE_STUDENT_PUBLICATION_ASSIGNMENT_COMMENT);
2876
-    $userTable= Database::get_main_table(TABLE_MAIN_USER);
2876
+    $userTable = Database::get_main_table(TABLE_MAIN_USER);
2877 2877
 
2878 2878
     $courseId = intval($work['c_id']);
2879 2879
     $workId = intval($work['id']);
@@ -3555,7 +3555,7 @@  discard block
 block discarded – undo
3555 3555
             null,
3556 3556
             PERSON_NAME_EMAIL_ADDRESS
3557 3557
         );
3558
-        $subject = "[" . api_get_setting('siteName') . "] ".get_lang('SendMailBody')."\n ".get_lang('CourseName').": ".$courseInfo['name']."  ";
3558
+        $subject = "[".api_get_setting('siteName')."] ".get_lang('SendMailBody')."\n ".get_lang('CourseName').": ".$courseInfo['name']."  ";
3559 3559
         foreach ($user_list as $user_data) {
3560 3560
             $to_user_id = $user_data['user_id'];
3561 3561
             $user_info = api_get_user_info($to_user_id);
@@ -3632,7 +3632,7 @@  discard block
 block discarded – undo
3632 3632
 
3633 3633
     $title = $values['title'];
3634 3634
     $description = $values['description'];
3635
-    $contains_file = isset($values['contains_file']) && !empty($values['contains_file']) ? intval($values['contains_file']): 0;
3635
+    $contains_file = isset($values['contains_file']) && !empty($values['contains_file']) ? intval($values['contains_file']) : 0;
3636 3636
 
3637 3637
     $saveWork = true;
3638 3638
     $filename = null;
@@ -4292,7 +4292,7 @@  discard block
 block discarded – undo
4292 4292
     $htmlHeadXtra[] = '
4293 4293
         <script>
4294 4294
         $(function() {
4295
-            ' . $extra['jquery_ready_content'] . '
4295
+            ' . $extra['jquery_ready_content'].'
4296 4296
         });
4297 4297
         </script>';
4298 4298
 
@@ -4360,8 +4360,8 @@  discard block
 block discarded – undo
4360 4360
     $number_of_setting = Database::num_rows($result);
4361 4361
 
4362 4362
     if ($number_of_setting == 1) {
4363
-        $query = "UPDATE " . $table_course_setting . " SET
4364
-                  value='" . Database::escape_string($studentDeleteOwnPublication) . "'
4363
+        $query = "UPDATE ".$table_course_setting." SET
4364
+                  value='" . Database::escape_string($studentDeleteOwnPublication)."'
4365 4365
                   WHERE variable = 'student_delete_own_publication' AND c_id = $courseId";
4366 4366
         Database::query($query);
4367 4367
     } else {
@@ -4400,9 +4400,9 @@  discard block
 block discarded – undo
4400 4400
     $work_table = Database :: get_course_table(TABLE_STUDENT_PUBLICATION);
4401 4401
     $item_id = intval($item_id);
4402 4402
     $course_id = $course_info['real_id'];
4403
-    $sql = "UPDATE  " . $work_table . "
4403
+    $sql = "UPDATE  ".$work_table."
4404 4404
             SET accepted = 0
4405
-            WHERE c_id = $course_id AND id = '" . $item_id . "'";
4405
+            WHERE c_id = $course_id AND id = '".$item_id."'";
4406 4406
     Database::query($sql);
4407 4407
     api_item_property_update(
4408 4408
         $course_info,
@@ -4554,7 +4554,7 @@  discard block
 block discarded – undo
4554 4554
                 $courseCode,
4555 4555
                 $sessionId,
4556 4556
                 $limitString,
4557
-                $orderBy ,
4557
+                $orderBy,
4558 4558
                 STUDENT,
4559 4559
                 $getCount
4560 4560
             );
@@ -4890,8 +4890,8 @@  discard block
 block discarded – undo
4890 4890
     if (!empty($sessionId)) {
4891 4891
         $sessionInfo = api_get_session_info($sessionId);
4892 4892
         if (!empty($sessionInfo)) {
4893
-            $header .= ' - ' . $sessionInfo['name'];
4894
-            $header .= '<br />' . $sessionInfo['description'];
4893
+            $header .= ' - '.$sessionInfo['name'];
4894
+            $header .= '<br />'.$sessionInfo['description'];
4895 4895
             $teachers = SessionManager::getCoachesByCourseSessionToString(
4896 4896
                 $sessionId,
4897 4897
                 $courseInfo['real_id']
@@ -4907,12 +4907,12 @@  discard block
 block discarded – undo
4907 4907
     $expiresOn = null;
4908 4908
 
4909 4909
     if (!empty($assignment) && isset($assignment['expires_on'])) {
4910
-        $content .= '<br /><strong>' . get_lang('ExpirationDate') . '</strong>: ' . api_get_local_time($assignment['expires_on']);
4910
+        $content .= '<br /><strong>'.get_lang('ExpirationDate').'</strong>: '.api_get_local_time($assignment['expires_on']);
4911 4911
         $expiresOn = api_get_local_time($assignment['expires_on']);
4912 4912
     }
4913 4913
 
4914 4914
     if (!empty($workData['description'])) {
4915
-        $content .= '<br /><strong>' . get_lang('Description') . '</strong>: ' . $workData['description'];
4915
+        $content .= '<br /><strong>'.get_lang('Description').'</strong>: '.$workData['description'];
4916 4916
     }
4917 4917
 
4918 4918
     $workList = get_work_user_list(null, null, null, null, $workId);
@@ -4933,7 +4933,7 @@  discard block
 block discarded – undo
4933 4933
                 );
4934 4934
 
4935 4935
                 $column = 0;
4936
-                foreach($headers as $header) {
4936
+                foreach ($headers as $header) {
4937 4937
                     $table->setHeaderContents(0, $column, $header);
4938 4938
                     $column++;
4939 4939
                 }
@@ -4981,7 +4981,7 @@  discard block
 block discarded – undo
4981 4981
 
4982 4982
                 if (!empty($content)) {
4983 4983
                     $params = array(
4984
-                        'filename' => $workData['title'] . '_' . api_get_local_time(),
4984
+                        'filename' => $workData['title'].'_'.api_get_local_time(),
4985 4985
                         'pdf_title' => api_replace_dangerous_char($workData['title']),
4986 4986
                         'course_code' => $courseInfo['code'],
4987 4987
                         'add_signatures' => false
@@ -5012,7 +5012,7 @@  discard block
 block discarded – undo
5012 5012
     $tempZipFile = api_get_path(SYS_ARCHIVE_PATH).api_get_unique_id().".zip";
5013 5013
     $coursePath = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/work/';
5014 5014
 
5015
-    $zip  = new PclZip($tempZipFile);
5015
+    $zip = new PclZip($tempZipFile);
5016 5016
 
5017 5017
     $workPerUser = getWorkPerUser($userId);
5018 5018
 
Please login to merge, or discard this patch.
main/mySpace/myStudents.php 1 patch
Spacing   +78 added lines, -78 removed lines patch added patch discarded remove patch
@@ -87,52 +87,52 @@  discard block
 block discarded – undo
87 87
 if (isset($_GET['details'])) {
88 88
     if ($origin === 'user_course') {
89 89
         if (empty($cidReq)) {
90
-            $interbreadcrumb[] = array (
91
-                "url" => api_get_path(WEB_COURSE_PATH) . $courseInfo['directory'],
90
+            $interbreadcrumb[] = array(
91
+                "url" => api_get_path(WEB_COURSE_PATH).$courseInfo['directory'],
92 92
                 'name' => $courseInfo['title']
93 93
             );
94 94
         }
95
-        $interbreadcrumb[] = array (
96
-            "url" => "../user/user.php?cidReq=" . $course_code,
95
+        $interbreadcrumb[] = array(
96
+            "url" => "../user/user.php?cidReq=".$course_code,
97 97
             "name" => get_lang("Users")
98 98
         );
99 99
     } else {
100 100
         if ($origin === 'tracking_course') {
101
-            $interbreadcrumb[] = array (
102
-                "url" => "../tracking/courseLog.php?cidReq=".$course_code.'&id_session=' . api_get_session_id(),
101
+            $interbreadcrumb[] = array(
102
+                "url" => "../tracking/courseLog.php?cidReq=".$course_code.'&id_session='.api_get_session_id(),
103 103
                 "name" => get_lang("Tracking")
104 104
             );
105 105
         } else {
106 106
             if ($origin === 'resume_session') {
107
-                $interbreadcrumb[] = array (
107
+                $interbreadcrumb[] = array(
108 108
                     'url' => "../session/session_list.php",
109 109
                     "name" => get_lang('SessionList')
110 110
                 );
111
-                $interbreadcrumb[] = array (
112
-                    'url' => "../session/resume_session.php?id_session=" . $sessionId,
111
+                $interbreadcrumb[] = array(
112
+                    'url' => "../session/resume_session.php?id_session=".$sessionId,
113 113
                     "name" => get_lang('SessionOverview')
114 114
                 );
115 115
             } else {
116
-                $interbreadcrumb[] = array (
117
-                    "url" => api_is_student_boss()?"#":"index.php",
116
+                $interbreadcrumb[] = array(
117
+                    "url" => api_is_student_boss() ? "#" : "index.php",
118 118
                     "name" => get_lang('MySpace')
119 119
                 );
120 120
                 if (isset($_GET['id_coach']) && intval($_GET['id_coach']) != 0) {
121
-                    $interbreadcrumb[] = array (
122
-                        "url" => "student.php?id_coach=" . Security :: remove_XSS($_GET['id_coach']),
121
+                    $interbreadcrumb[] = array(
122
+                        "url" => "student.php?id_coach=".Security :: remove_XSS($_GET['id_coach']),
123 123
                         "name" => get_lang("CoachStudents")
124 124
                     );
125
-                    $interbreadcrumb[] = array (
126
-                        "url" => "myStudents.php?student=" . $student_id. '&id_coach=' . Security :: remove_XSS($_GET['id_coach']),
125
+                    $interbreadcrumb[] = array(
126
+                        "url" => "myStudents.php?student=".$student_id.'&id_coach='.Security :: remove_XSS($_GET['id_coach']),
127 127
                         "name" => get_lang("StudentDetails")
128 128
                     );
129 129
                 } else {
130
-                    $interbreadcrumb[] = array (
130
+                    $interbreadcrumb[] = array(
131 131
                         "url" => "student.php",
132 132
                         "name" => get_lang("MyStudents")
133 133
                     );
134
-                    $interbreadcrumb[] = array (
135
-                        "url" => "myStudents.php?student=" . $student_id,
134
+                    $interbreadcrumb[] = array(
135
+                        "url" => "myStudents.php?student=".$student_id,
136 136
                         "name" => get_lang("StudentDetails")
137 137
                     );
138 138
                 }
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
     $nameTools = get_lang("DetailsStudentInCourse");
143 143
 } else {
144 144
     if ($origin == 'resume_session') {
145
-        $interbreadcrumb[] = array (
145
+        $interbreadcrumb[] = array(
146 146
             'url' => "../session/session_list.php",
147 147
             "name" => get_lang('SessionList')
148 148
         );
@@ -153,19 +153,19 @@  discard block
 block discarded – undo
153 153
             );
154 154
         }
155 155
     } else {
156
-        $interbreadcrumb[] = array (
157
-            "url" => api_is_student_boss()?"#":"index.php",
156
+        $interbreadcrumb[] = array(
157
+            "url" => api_is_student_boss() ? "#" : "index.php",
158 158
             "name" => get_lang('MySpace')
159 159
         );
160 160
         if (isset($_GET['id_coach']) && intval($_GET['id_coach']) != 0) {
161 161
             if ($sessionId) {
162 162
                 $interbreadcrumb[] = array(
163
-                    "url" => "student.php?id_coach=" . Security :: remove_XSS($_GET['id_coach']) . "&id_session=" . $sessionId,
163
+                    "url" => "student.php?id_coach=".Security :: remove_XSS($_GET['id_coach'])."&id_session=".$sessionId,
164 164
                     "name" => get_lang("CoachStudents")
165 165
                 );
166 166
             } else {
167 167
                 $interbreadcrumb[] = array(
168
-                    "url" => "student.php?id_coach=" . Security :: remove_XSS($_GET['id_coach']),
168
+                    "url" => "student.php?id_coach=".Security :: remove_XSS($_GET['id_coach']),
169 169
                     "name" => get_lang("CoachStudents")
170 170
                 );
171 171
             }
@@ -350,28 +350,28 @@  discard block
 block discarded – undo
350 350
     // Actions bar
351 351
     echo '<div class="actions">';
352 352
     echo '<a href="javascript: window.history.go(-1);">'.
353
-            Display::return_icon('back.png', get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>';
353
+            Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
354 354
 
355 355
     echo '<a href="javascript: void(0);" onclick="javascript: window.print();">'.
356
-            Display::return_icon('printer.png', get_lang('Print'),'',ICON_SIZE_MEDIUM).'</a>';
356
+            Display::return_icon('printer.png', get_lang('Print'), '', ICON_SIZE_MEDIUM).'</a>';
357 357
 
358
-    echo '<a href="' . api_get_self() . '?' . Security :: remove_XSS($_SERVER['QUERY_STRING']) . '&export=csv">'.
359
-            Display::return_icon('export_csv.png', get_lang('ExportAsCSV'),'',ICON_SIZE_MEDIUM).'</a> ';
358
+    echo '<a href="'.api_get_self().'?'.Security :: remove_XSS($_SERVER['QUERY_STRING']).'&export=csv">'.
359
+            Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), '', ICON_SIZE_MEDIUM).'</a> ';
360 360
 
361
-    echo '<a href="' . api_get_self() . '?' . Security :: remove_XSS($_SERVER['QUERY_STRING']) . '&export=xls">'.
362
-    Display::return_icon('export_excel.png', get_lang('ExportAsXLS'),'',ICON_SIZE_MEDIUM).'</a> ';
361
+    echo '<a href="'.api_get_self().'?'.Security :: remove_XSS($_SERVER['QUERY_STRING']).'&export=xls">'.
362
+    Display::return_icon('export_excel.png', get_lang('ExportAsXLS'), '', ICON_SIZE_MEDIUM).'</a> ';
363 363
 
364 364
     if (!empty ($user_info['email'])) {
365 365
         $send_mail = '<a href="mailto:'.$user_info['email'].'">'.
366
-            Display :: return_icon('mail_send.png', get_lang('SendMail'),'',ICON_SIZE_MEDIUM).'</a>';
366
+            Display :: return_icon('mail_send.png', get_lang('SendMail'), '', ICON_SIZE_MEDIUM).'</a>';
367 367
     } else {
368
-        $send_mail = Display :: return_icon('mail_send_na.png', get_lang('SendMail'),'',ICON_SIZE_MEDIUM);
368
+        $send_mail = Display :: return_icon('mail_send_na.png', get_lang('SendMail'), '', ICON_SIZE_MEDIUM);
369 369
     }
370 370
     echo $send_mail;
371 371
     if (!empty($student_id) && !empty($course_code)) {
372 372
         // Only show link to connection details if course and student were defined in the URL
373
-        echo '<a href="access_details.php?student=' . $student_id . '&course=' . $course_code . '&origin=' . $origin. '&cidReq='.$course_code.'&id_session='.$sessionId.'">'.
374
-            Display :: return_icon('statistics.png', get_lang('AccessDetails'),'',ICON_SIZE_MEDIUM).'</a>';
373
+        echo '<a href="access_details.php?student='.$student_id.'&course='.$course_code.'&origin='.$origin.'&cidReq='.$course_code.'&id_session='.$sessionId.'">'.
374
+            Display :: return_icon('statistics.png', get_lang('AccessDetails'), '', ICON_SIZE_MEDIUM).'</a>';
375 375
     }
376 376
     if (api_can_login_as($student_id)) {
377 377
         echo '<a href="'.api_get_path(WEB_CODE_PATH).'admin/user_list.php?action=login_as&user_id='.$student_id.'&sec_token='.$token.'">'.
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
     if (api_is_platform_admin(false, true) || api_is_student_boss()) {
382 382
         echo Display::url(
383 383
             Display::return_icon('skill-badges.png', get_lang('AssignSkill'), null, ICON_SIZE_MEDIUM),
384
-            api_get_path(WEB_CODE_PATH) . 'badge/assign.php?' . http_build_query(['user' => $student_id])
384
+            api_get_path(WEB_CODE_PATH).'badge/assign.php?'.http_build_query(['user' => $student_id])
385 385
         );
386 386
     }
387 387
 
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
     $csv_content[] = array(
443 443
         get_lang('Information')
444 444
     );
445
-    $csv_content[] = array (
445
+    $csv_content[] = array(
446 446
         get_lang('Name'),
447 447
         get_lang('Email'),
448 448
         get_lang('Tel')
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
         strip_tags($first_connection_date),
471 471
         strip_tags($last_connection_date),
472 472
         $time_spent_on_the_course,
473
-        $avg_student_progress . '%',
473
+        $avg_student_progress.'%',
474 474
         $avg_student_score
475 475
     );
476 476
 
@@ -500,19 +500,19 @@  discard block
 block discarded – undo
500 500
             </thead>
501 501
             <tbody>
502 502
             <tr>
503
-                <td><?php echo get_lang('Name') . ' : '.$user_info['complete_name']; ?></td>
503
+                <td><?php echo get_lang('Name').' : '.$user_info['complete_name']; ?></td>
504 504
             </tr>
505 505
             <tr>
506
-                <td><?php echo get_lang('Email') . ' : ';
506
+                <td><?php echo get_lang('Email').' : ';
507 507
                     if (!empty ($user_info['email'])) {
508
-                        echo '<a href="mailto:' . $user_info['email'] . '">' . $user_info['email'] . '</a>';
508
+                        echo '<a href="mailto:'.$user_info['email'].'">'.$user_info['email'].'</a>';
509 509
                     } else {
510 510
                         echo get_lang('NoEmail');
511 511
                     } ?>
512 512
                 </td>
513 513
             </tr>
514 514
             <tr>
515
-                <td> <?php echo get_lang('Tel') . ' : ';
515
+                <td> <?php echo get_lang('Tel').' : ';
516 516
                     if (!empty ($user_info['phone'])) {
517 517
                         echo $user_info['phone'];
518 518
                     } else {
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
                 </td>
523 523
             </tr>
524 524
             <tr>
525
-                <td> <?php echo get_lang('OfficialCode') . ' : ';
525
+                <td> <?php echo get_lang('OfficialCode').' : ';
526 526
                     if (!empty ($user_info['official_code'])) {
527 527
                         echo $user_info['official_code'];
528 528
                     } else {
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
                 </td>
533 533
             </tr>
534 534
             <tr>
535
-                <td><?php echo get_lang('OnLine') . ' : '.$online; ?> </td>
535
+                <td><?php echo get_lang('OnLine').' : '.$online; ?> </td>
536 536
             </tr>
537 537
             <?php
538 538
 
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
             if ($timezone !== null) {
547 547
                 ?>
548 548
                 <tr>
549
-                    <td> <?php echo get_lang('Timezone') . ' : '.$timezone; ?> </td>
549
+                    <td> <?php echo get_lang('Timezone').' : '.$timezone; ?> </td>
550 550
                 </tr>
551 551
             <?php
552 552
             }
@@ -698,9 +698,9 @@  discard block
 block discarded – undo
698 698
                 }
699 699
 
700 700
                 if (!empty($access_start_date) && !empty($access_end_date)) {
701
-                    $date_session = get_lang('From') . ' ' . $access_start_date . ' ' . get_lang('Until') . ' ' . $access_end_date;
701
+                    $date_session = get_lang('From').' '.$access_start_date.' '.get_lang('Until').' '.$access_end_date;
702 702
                 }
703
-                $title = Display::return_icon('session.png', get_lang('Session'), array(), ICON_SIZE_SMALL).' '.$session_name.($date_session?' ('.$date_session.')':'');
703
+                $title = Display::return_icon('session.png', get_lang('Session'), array(), ICON_SIZE_SMALL).' '.$session_name.($date_session ? ' ('.$date_session.')' : '');
704 704
             }
705 705
 
706 706
             // Courses
@@ -762,16 +762,16 @@  discard block
 block discarded – undo
762 762
                         $scoretotal = array();
763 763
                         if (isset($cats) && isset($cats[0])) {
764 764
                             if (!empty($sId)) {
765
-                                $scoretotal= $cats[0]->calc_score($student_id, null, $courseCodeItem, $sId);
765
+                                $scoretotal = $cats[0]->calc_score($student_id, null, $courseCodeItem, $sId);
766 766
                             } else {
767
-                                $scoretotal= $cats[0]->calc_score($student_id, null, $courseCodeItem);
767
+                                $scoretotal = $cats[0]->calc_score($student_id, null, $courseCodeItem);
768 768
                             }
769 769
                         }
770 770
 
771 771
                         $scoretotal_display = '0/0 (0%)';
772 772
                         if (!empty($scoretotal) && !empty($scoretotal[1])) {
773 773
                             $scoretotal_display =
774
-                                round($scoretotal[0], 1 ).'/'.
774
+                                round($scoretotal[0], 1).'/'.
775 775
                                 round($scoretotal[1], 1).
776 776
                                 ' ('.round(($scoretotal[0] / $scoretotal[1]) * 100, 2).' %)';
777 777
                         }
@@ -802,9 +802,9 @@  discard block
 block discarded – undo
802 802
                         );
803 803
 
804 804
                         echo '<tr>
805
-                        <td ><a href="' .$courseInfoItem['course_public_url'] .'?id_session=' . $sId . '">'.
805
+                        <td ><a href="' .$courseInfoItem['course_public_url'].'?id_session='.$sId.'">'.
806 806
                             $courseInfoItem['title'].'</a></td>
807
-                        <td >'.$time_spent_on_course .'</td>
807
+                        <td >'.$time_spent_on_course.'</td>
808 808
                         <td >'.$progress.'</td>
809 809
                         <td >'.$score.'</td>
810 810
                         <td >'.$attendances_faults_avg.'</td>
@@ -880,7 +880,7 @@  discard block
 block discarded – undo
880 880
                 <table class="table table-striped table-hover">
881 881
                 <thead>
882 882
                 <tr>
883
-                    <th><?php echo get_lang('LearningPath');?></th>
883
+                    <th><?php echo get_lang('LearningPath'); ?></th>
884 884
                     <th>
885 885
                         <?php
886 886
                         echo get_lang('Time').' ';
@@ -983,7 +983,7 @@  discard block
 block discarded – undo
983 983
                     if (!empty($start_time)) {
984 984
                         $start_time = api_convert_and_format_date($start_time, DATE_TIME_FORMAT_LONG);
985 985
                     } else {
986
-                        $start_time =  '-';
986
+                        $start_time = '-';
987 987
                     }
988 988
 
989 989
                     if (!empty($total_time)) {
@@ -1020,8 +1020,8 @@  discard block
 block discarded – undo
1020 1020
                     $csv_content[] = array(
1021 1021
                         api_html_entity_decode(stripslashes($lp_name), ENT_QUOTES, $charset),
1022 1022
                         api_time_to_hms($total_time),
1023
-                        $score . '%',
1024
-                        $score_latest . '%',
1023
+                        $score.'%',
1024
+                        $score_latest.'%',
1025 1025
                         $progress.'%',
1026 1026
                         $start_time
1027 1027
                     );
@@ -1059,7 +1059,7 @@  discard block
 block discarded – undo
1059 1059
                     if ($any_result === true) {
1060 1060
                         $from = '';
1061 1061
                         if ($from_myspace) {
1062
-                            $from ='&from=myspace';
1062
+                            $from = '&from=myspace';
1063 1063
                         }
1064 1064
                         $link = Display::url(
1065 1065
                             Display::return_icon('2rightarrow.png', get_lang('Details')),
@@ -1072,14 +1072,14 @@  discard block
 block discarded – undo
1072 1072
                         echo '<td>';
1073 1073
                         if ($any_result === true) {
1074 1074
                             echo '<a href="myStudents.php?action=reset_lp&sec_token='.$token.'&cidReq='.$course_code.'&course='.$course_code.'&details='.Security::remove_XSS($_GET['details']).'&origin='.$origin.'&lp_id='.$learnpath->getId().'&student='.$user_info['user_id'].'&details=true&id_session='.$sessionId.'">';
1075
-                            echo Display::return_icon('clean.png', get_lang('Clean'),'',ICON_SIZE_SMALL).'</a>';
1075
+                            echo Display::return_icon('clean.png', get_lang('Clean'), '', ICON_SIZE_SMALL).'</a>';
1076 1076
                             echo '</a>';
1077 1077
                         }
1078 1078
                         echo '</td>';
1079 1079
                         echo '</tr>';
1080 1080
                     }
1081 1081
                     $data_learnpath[$i][] = $lp_name;
1082
-                    $data_learnpath[$i][] = $progress . '%';
1082
+                    $data_learnpath[$i][] = $progress.'%';
1083 1083
                 }
1084 1084
                 ?>
1085 1085
                 </tbody>
@@ -1095,7 +1095,7 @@  discard block
 block discarded – undo
1095 1095
         <thead>
1096 1096
         <tr>
1097 1097
             <th><?php echo get_lang('Exercises'); ?></th>
1098
-            <th><?php echo get_lang('LearningPath');?></th>
1098
+            <th><?php echo get_lang('LearningPath'); ?></th>
1099 1099
             <th><?php echo get_lang('AvgCourseScore').' '.Display :: return_icon('info3.gif', get_lang('AverageScore'), array('align' => 'absmiddle', 'hspace' => '3px')) ?></th>
1100 1100
             <th><?php echo get_lang('Attempts'); ?></th>
1101 1101
             <th><?php echo get_lang('LatestAttempt'); ?></th>
@@ -1121,7 +1121,7 @@  discard block
 block discarded – undo
1121 1121
             'quiz.session_id'
1122 1122
         );
1123 1123
 
1124
-        $sql = "SELECT quiz.title, id FROM " . $t_quiz . " AS quiz
1124
+        $sql = "SELECT quiz.title, id FROM ".$t_quiz." AS quiz
1125 1125
                 WHERE
1126 1126
                     quiz.c_id = ".$courseInfo['real_id']." AND
1127 1127
                     active IN (0, 1)
@@ -1186,7 +1186,7 @@  discard block
 block discarded – undo
1186 1186
                 echo '<td>';
1187 1187
 
1188 1188
                 if ($count_attempts > 0) {
1189
-                    echo $score_percentage . '%';
1189
+                    echo $score_percentage.'%';
1190 1190
                 } else {
1191 1191
                     echo '-';
1192 1192
                     $score_percentage = 0;
@@ -1196,7 +1196,7 @@  discard block
 block discarded – undo
1196 1196
                 echo '<td>'.$count_attempts.'</td>';
1197 1197
                 echo '<td>';
1198 1198
 
1199
-                $sql = 'SELECT exe_id FROM ' . $tbl_stats_exercices . '
1199
+                $sql = 'SELECT exe_id FROM '.$tbl_stats_exercices.'
1200 1200
                          WHERE
1201 1201
                             exe_exo_id = "'.$exercise_id.'" AND
1202 1202
                             exe_user_id ="'.$student_id.'" AND
@@ -1209,7 +1209,7 @@  discard block
 block discarded – undo
1209 1209
                 if (Database :: num_rows($result_last_attempt) > 0) {
1210 1210
                     $id_last_attempt = Database :: result($result_last_attempt, 0, 0);
1211 1211
                     if ($count_attempts > 0)
1212
-                        echo '<a href="../exercise/exercise_show.php?id=' . $id_last_attempt . '&cidReq='.$course_code.'&session_id='.$sessionId.'&student='.$student_id.'&origin='.(empty($origin)?'tracking':$origin).'">
1212
+                        echo '<a href="../exercise/exercise_show.php?id='.$id_last_attempt.'&cidReq='.$course_code.'&session_id='.$sessionId.'&student='.$student_id.'&origin='.(empty($origin) ? 'tracking' : $origin).'">
1213 1213
                         '.Display::return_icon('quiz.png').'
1214 1214
                      </a>';
1215 1215
                 }
@@ -1217,11 +1217,11 @@  discard block
 block discarded – undo
1217 1217
 
1218 1218
                 echo '<td>';
1219 1219
                 $all_attempt_url = "../exercise/exercise_report.php?exerciseId=$exercise_id&cidReq=$course_code&filter_by_user=$student_id&id_session=$sessionId";
1220
-                echo Display::url(Display::return_icon('test_results.png', get_lang('AllAttempts'), array(), ICON_SIZE_SMALL), $all_attempt_url );
1220
+                echo Display::url(Display::return_icon('test_results.png', get_lang('AllAttempts'), array(), ICON_SIZE_SMALL), $all_attempt_url);
1221 1221
 
1222 1222
                 echo '</td></tr>';
1223 1223
                 $data_exercices[$i][] = $exercices['title'];
1224
-                $data_exercices[$i][] = $score_percentage . '%';
1224
+                $data_exercices[$i][] = $score_percentage.'%';
1225 1225
                 $data_exercices[$i][] = $count_attempts;
1226 1226
 
1227 1227
                 $csv_content[] = array(
@@ -1249,7 +1249,7 @@  discard block
 block discarded – undo
1249 1249
             $survey_list = SurveyManager::get_surveys($course_code, $sessionId);
1250 1250
 
1251 1251
             $survey_data = array();
1252
-            foreach($survey_list as $survey) {
1252
+            foreach ($survey_list as $survey) {
1253 1253
                 $user_list = SurveyManager::get_people_who_filled_survey($survey['survey_id'], false, $courseInfo['real_id']);
1254 1254
                 $survey_done = Display::return_icon("accept_na.png", get_lang('NoAnswer'), array(), ICON_SIZE_SMALL);
1255 1255
                 if (in_array($student_id, $user_list)) {
@@ -1274,7 +1274,7 @@  discard block
 block discarded – undo
1274 1274
                         $column = 0;
1275 1275
                         $table->setCellContents($row, $column, $data);
1276 1276
                         $class = 'class="row_odd"';
1277
-                        if($row % 2) {
1277
+                        if ($row % 2) {
1278 1278
                             $class = 'class="row_even"';
1279 1279
                         }
1280 1280
                         $table->setRowAttributes($row, $class, true);
@@ -1294,12 +1294,12 @@  discard block
 block discarded – undo
1294 1294
                 <table class="table table-striped table-hover">
1295 1295
                     <thead>
1296 1296
                         <tr>
1297
-                            <th>' . get_lang('Tasks') . '</th>
1298
-                            <th class="text-center">' . get_lang('DocumentNumber') . '</th>
1299
-                            <th class="text-center">' . get_lang('Note') . '</th>
1300
-                            <th class="text-center">' . get_lang('HandedOut') . '</th>
1301
-                            <th class="text-center">' . get_lang('HandOutDateLimit') . '</th>
1302
-                            <th class="text-center">' . get_lang('ConsideredWorkingTime') . '</th>
1297
+                            <th>' . get_lang('Tasks').'</th>
1298
+                            <th class="text-center">' . get_lang('DocumentNumber').'</th>
1299
+                            <th class="text-center">' . get_lang('Note').'</th>
1300
+                            <th class="text-center">' . get_lang('HandedOut').'</th>
1301
+                            <th class="text-center">' . get_lang('HandOutDateLimit').'</th>
1302
+                            <th class="text-center">' . get_lang('ConsideredWorkingTime').'</th>
1303 1303
                         </tr>
1304 1304
                     </thead>
1305 1305
                     <tbody>
@@ -1309,14 +1309,14 @@  discard block
 block discarded – undo
1309 1309
                 $work = $work['work'];
1310 1310
                 foreach ($work->user_results as $key => $results) {
1311 1311
                     echo '<tr>';
1312
-                    echo '<td>' . $work->title . '</td>';
1312
+                    echo '<td>'.$work->title.'</td>';
1313 1313
                     $documentNumber = $key + 1;
1314
-                    echo '<td class="text-center"><a href="' . api_get_path(WEB_CODE_PATH) . 'work/view.php?cidReq=' . $course_code . '&id_session=' . $sessionId .'&id=' . $results['id'] . '">(' . $documentNumber . ')</a></td>';
1314
+                    echo '<td class="text-center"><a href="'.api_get_path(WEB_CODE_PATH).'work/view.php?cidReq='.$course_code.'&id_session='.$sessionId.'&id='.$results['id'].'">('.$documentNumber.')</a></td>';
1315 1315
                     $qualification = !empty($results['qualification']) ? $results['qualification'] : '-';
1316
-                    echo '<td class="text-center">' . $qualification. '</td>';
1317
-                    echo '<td class="text-center">' . $results['formatted_date']. '</td>';
1316
+                    echo '<td class="text-center">'.$qualification.'</td>';
1317
+                    echo '<td class="text-center">'.$results['formatted_date'].'</td>';
1318 1318
                     $assignment = get_work_assignment_by_id($work->id);
1319
-                    echo '<td class="text-center">' . api_convert_and_format_date($assignment['expires_on']) . '</td>';
1319
+                    echo '<td class="text-center">'.api_convert_and_format_date($assignment['expires_on']).'</td>';
1320 1320
 
1321 1321
                     $fieldValue = new ExtraFieldValue('work');
1322 1322
                     $resultExtra = $fieldValue->getAllValuesForAnItem(
@@ -1328,7 +1328,7 @@  discard block
 block discarded – undo
1328 1328
                         $field = $field['value'];
1329 1329
 
1330 1330
                         if (api_get_configuration_value('considered_working_time') == $field->getField()->getVariable()) {
1331
-                            echo '<td class="text-center">' . $field->getValue() . '</td>';
1331
+                            echo '<td class="text-center">'.$field->getValue().'</td>';
1332 1332
                         }
1333 1333
                     }
1334 1334
 
Please login to merge, or discard this patch.