Completed
Push — 1.11.x ( fba1ad...d3f8ec )
by José
61:34 queued 31:12
created
main/mySpace/access_details.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 
127 127
 echo Display::page_header(get_lang('DetailsStudentInCourse'));
128 128
 echo Display::page_subheader(
129
-    get_lang('User').': '.$userInfo['complete_name'].' - '.get_lang('Course').': '.$courseInfo['title'] . ' (' . $course_code . ')'
129
+    get_lang('User').': '.$userInfo['complete_name'].' - '.get_lang('Course').': '.$courseInfo['title'].' ('.$course_code.')'
130 130
 );
131 131
 
132 132
 $form->setDefaults(array('from' => $from, 'to' => $to));
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         </div><br />
145 145
         <div id="cev_cont_stats">
146 146
             <?php
147
-            if ($result_to_print != "")  {
147
+            if ($result_to_print != "") {
148 148
                 $rst = get_stats($user_id, $courseId);
149 149
                 $foo_stats = '<strong>'.get_lang('Total').': </strong>'.$rst['total'].'<br />';
150 150
                 $foo_stats .= '<strong>'.get_lang('Average').': </strong>'.$rst['avg'].'<br />';
Please login to merge, or discard this patch.
main/mySpace/myStudents.php 1 patch
Spacing   +76 added lines, -76 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
             <tr>
538 538
                 <td><a href="access_details.php?student=<?php echo $student_id; ?>&course=<?php echo $course_code; ?>&origin=<?php echo $origin; ?>&cidReq=<?php echo $course_code; ?>&id_session=<?php echo $sessionId; ?>"><?php echo get_lang('SeeAccess'); ?></a></td>
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
             if ($timezone !== null) {
550 550
                 ?>
551 551
                 <tr>
552
-                    <td> <?php echo get_lang('Timezone') . ' : '.$timezone; ?> </td>
552
+                    <td> <?php echo get_lang('Timezone').' : '.$timezone; ?> </td>
553 553
                 </tr>
554 554
             <?php
555 555
             }
@@ -701,9 +701,9 @@  discard block
 block discarded – undo
701 701
                 }
702 702
 
703 703
                 if (!empty($access_start_date) && !empty($access_end_date)) {
704
-                    $date_session = get_lang('From') . ' ' . $access_start_date . ' ' . get_lang('Until') . ' ' . $access_end_date;
704
+                    $date_session = get_lang('From').' '.$access_start_date.' '.get_lang('Until').' '.$access_end_date;
705 705
                 }
706
-                $title = Display::return_icon('session.png', get_lang('Session'), array(), ICON_SIZE_SMALL).' '.$session_name.($date_session?' ('.$date_session.')':'');
706
+                $title = Display::return_icon('session.png', get_lang('Session'), array(), ICON_SIZE_SMALL).' '.$session_name.($date_session ? ' ('.$date_session.')' : '');
707 707
             }
708 708
 
709 709
             // Courses
@@ -765,16 +765,16 @@  discard block
 block discarded – undo
765 765
                         $scoretotal = array();
766 766
                         if (isset($cats) && isset($cats[0])) {
767 767
                             if (!empty($sId)) {
768
-                                $scoretotal= $cats[0]->calc_score($student_id, null, $courseCodeItem, $sId);
768
+                                $scoretotal = $cats[0]->calc_score($student_id, null, $courseCodeItem, $sId);
769 769
                             } else {
770
-                                $scoretotal= $cats[0]->calc_score($student_id, null, $courseCodeItem);
770
+                                $scoretotal = $cats[0]->calc_score($student_id, null, $courseCodeItem);
771 771
                             }
772 772
                         }
773 773
 
774 774
                         $scoretotal_display = '0/0 (0%)';
775 775
                         if (!empty($scoretotal) && !empty($scoretotal[1])) {
776 776
                             $scoretotal_display =
777
-                                round($scoretotal[0], 1 ).'/'.
777
+                                round($scoretotal[0], 1).'/'.
778 778
                                 round($scoretotal[1], 1).
779 779
                                 ' ('.round(($scoretotal[0] / $scoretotal[1]) * 100, 2).' %)';
780 780
                         }
@@ -805,9 +805,9 @@  discard block
 block discarded – undo
805 805
                         );
806 806
 
807 807
                         echo '<tr>
808
-                        <td ><a href="' .$courseInfoItem['course_public_url'] .'?id_session=' . $sId . '">'.
808
+                        <td ><a href="' .$courseInfoItem['course_public_url'].'?id_session='.$sId.'">'.
809 809
                             $courseInfoItem['title'].'</a></td>
810
-                        <td >'.$time_spent_on_course .'</td>
810
+                        <td >'.$time_spent_on_course.'</td>
811 811
                         <td >'.$progress.'</td>
812 812
                         <td >'.$score.'</td>
813 813
                         <td >'.$attendances_faults_avg.'</td>
@@ -883,7 +883,7 @@  discard block
 block discarded – undo
883 883
                 <table class="table table-striped table-hover">
884 884
                 <thead>
885 885
                 <tr>
886
-                    <th><?php echo get_lang('LearningPath');?></th>
886
+                    <th><?php echo get_lang('LearningPath'); ?></th>
887 887
                     <th>
888 888
                         <?php
889 889
                         echo get_lang('Time').' ';
@@ -986,7 +986,7 @@  discard block
 block discarded – undo
986 986
                     if (!empty($start_time)) {
987 987
                         $start_time = api_convert_and_format_date($start_time, DATE_TIME_FORMAT_LONG);
988 988
                     } else {
989
-                        $start_time =  '-';
989
+                        $start_time = '-';
990 990
                     }
991 991
 
992 992
                     if (!empty($total_time)) {
@@ -1023,8 +1023,8 @@  discard block
 block discarded – undo
1023 1023
                     $csv_content[] = array(
1024 1024
                         api_html_entity_decode(stripslashes($lp_name), ENT_QUOTES, $charset),
1025 1025
                         api_time_to_hms($total_time),
1026
-                        $score . '%',
1027
-                        $score_latest . '%',
1026
+                        $score.'%',
1027
+                        $score_latest.'%',
1028 1028
                         $progress.'%',
1029 1029
                         $start_time
1030 1030
                     );
@@ -1062,7 +1062,7 @@  discard block
 block discarded – undo
1062 1062
                     if ($any_result === true) {
1063 1063
                         $from = '';
1064 1064
                         if ($from_myspace) {
1065
-                            $from ='&from=myspace';
1065
+                            $from = '&from=myspace';
1066 1066
                         }
1067 1067
                         $link = Display::url(
1068 1068
                             Display::return_icon('2rightarrow.png', get_lang('Details')),
@@ -1075,14 +1075,14 @@  discard block
 block discarded – undo
1075 1075
                         echo '<td>';
1076 1076
                         if ($any_result === true) {
1077 1077
                             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.'">';
1078
-                            echo Display::return_icon('clean.png', get_lang('Clean'),'',ICON_SIZE_SMALL).'</a>';
1078
+                            echo Display::return_icon('clean.png', get_lang('Clean'), '', ICON_SIZE_SMALL).'</a>';
1079 1079
                             echo '</a>';
1080 1080
                         }
1081 1081
                         echo '</td>';
1082 1082
                         echo '</tr>';
1083 1083
                     }
1084 1084
                     $data_learnpath[$i][] = $lp_name;
1085
-                    $data_learnpath[$i][] = $progress . '%';
1085
+                    $data_learnpath[$i][] = $progress.'%';
1086 1086
                 }
1087 1087
                 ?>
1088 1088
                 </tbody>
@@ -1098,7 +1098,7 @@  discard block
 block discarded – undo
1098 1098
         <thead>
1099 1099
         <tr>
1100 1100
             <th><?php echo get_lang('Exercises'); ?></th>
1101
-            <th><?php echo get_lang('LearningPath');?></th>
1101
+            <th><?php echo get_lang('LearningPath'); ?></th>
1102 1102
             <th><?php echo get_lang('AvgCourseScore').' '.Display :: return_icon('info3.gif', get_lang('AverageScore'), array('align' => 'absmiddle', 'hspace' => '3px')) ?></th>
1103 1103
             <th><?php echo get_lang('Attempts'); ?></th>
1104 1104
             <th><?php echo get_lang('LatestAttempt'); ?></th>
@@ -1124,7 +1124,7 @@  discard block
 block discarded – undo
1124 1124
             'quiz.session_id'
1125 1125
         );
1126 1126
 
1127
-        $sql = "SELECT quiz.title, id FROM " . $t_quiz . " AS quiz
1127
+        $sql = "SELECT quiz.title, id FROM ".$t_quiz." AS quiz
1128 1128
                 WHERE
1129 1129
                     quiz.c_id = ".$courseInfo['real_id']." AND
1130 1130
                     active IN (0, 1)
@@ -1189,7 +1189,7 @@  discard block
 block discarded – undo
1189 1189
                 echo '<td>';
1190 1190
 
1191 1191
                 if ($count_attempts > 0) {
1192
-                    echo $score_percentage . '%';
1192
+                    echo $score_percentage.'%';
1193 1193
                 } else {
1194 1194
                     echo '-';
1195 1195
                     $score_percentage = 0;
@@ -1199,7 +1199,7 @@  discard block
 block discarded – undo
1199 1199
                 echo '<td>'.$count_attempts.'</td>';
1200 1200
                 echo '<td>';
1201 1201
 
1202
-                $sql = 'SELECT exe_id FROM ' . $tbl_stats_exercices . '
1202
+                $sql = 'SELECT exe_id FROM '.$tbl_stats_exercices.'
1203 1203
                          WHERE
1204 1204
                             exe_exo_id = "'.$exercise_id.'" AND
1205 1205
                             exe_user_id ="'.$student_id.'" AND
@@ -1236,7 +1236,7 @@  discard block
 block discarded – undo
1236 1236
 
1237 1237
                 echo '</tr>';
1238 1238
                 $data_exercices[$i][] = $exercices['title'];
1239
-                $data_exercices[$i][] = $score_percentage . '%';
1239
+                $data_exercices[$i][] = $score_percentage.'%';
1240 1240
                 $data_exercices[$i][] = $count_attempts;
1241 1241
 
1242 1242
                 $csv_content[] = array(
@@ -1264,7 +1264,7 @@  discard block
 block discarded – undo
1264 1264
             $survey_list = SurveyManager::get_surveys($course_code, $sessionId);
1265 1265
 
1266 1266
             $survey_data = array();
1267
-            foreach($survey_list as $survey) {
1267
+            foreach ($survey_list as $survey) {
1268 1268
                 $user_list = SurveyManager::get_people_who_filled_survey($survey['survey_id'], false, $courseInfo['real_id']);
1269 1269
                 $survey_done = Display::return_icon("accept_na.png", get_lang('NoAnswer'), array(), ICON_SIZE_SMALL);
1270 1270
                 if (in_array($student_id, $user_list)) {
@@ -1289,7 +1289,7 @@  discard block
 block discarded – undo
1289 1289
                         $column = 0;
1290 1290
                         $table->setCellContents($row, $column, $data);
1291 1291
                         $class = 'class="row_odd"';
1292
-                        if($row % 2) {
1292
+                        if ($row % 2) {
1293 1293
                             $class = 'class="row_even"';
1294 1294
                         }
1295 1295
                         $table->setRowAttributes($row, $class, true);
@@ -1308,12 +1308,12 @@  discard block
 block discarded – undo
1308 1308
                 <table class="table table-striped table-hover">
1309 1309
                     <thead>
1310 1310
                         <tr>
1311
-                            <th>' . get_lang('Tasks') . '</th>
1312
-                            <th class="text-center">' . get_lang('DocumentNumber') . '</th>
1313
-                            <th class="text-center">' . get_lang('Note') . '</th>
1314
-                            <th class="text-center">' . get_lang('HandedOut') . '</th>
1315
-                            <th class="text-center">' . get_lang('HandOutDateLimit') . '</th>
1316
-                            <th class="text-center">' . get_lang('ConsideredWorkingTime') . '</th>
1311
+                            <th>' . get_lang('Tasks').'</th>
1312
+                            <th class="text-center">' . get_lang('DocumentNumber').'</th>
1313
+                            <th class="text-center">' . get_lang('Note').'</th>
1314
+                            <th class="text-center">' . get_lang('HandedOut').'</th>
1315
+                            <th class="text-center">' . get_lang('HandOutDateLimit').'</th>
1316
+                            <th class="text-center">' . get_lang('ConsideredWorkingTime').'</th>
1317 1317
                         </tr>
1318 1318
                     </thead>
1319 1319
                     <tbody>
@@ -1323,14 +1323,14 @@  discard block
 block discarded – undo
1323 1323
                 $work = $work['work'];
1324 1324
                 foreach ($work->user_results as $key => $results) {
1325 1325
                     echo '<tr>';
1326
-                    echo '<td>' . $work->title . '</td>';
1326
+                    echo '<td>'.$work->title.'</td>';
1327 1327
                     $documentNumber = $key + 1;
1328
-                    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>';
1328
+                    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>';
1329 1329
                     $qualification = !empty($results['qualification']) ? $results['qualification'] : '-';
1330
-                    echo '<td class="text-center">' . $qualification. '</td>';
1331
-                    echo '<td class="text-center">' . $results['formatted_date']. '</td>';
1330
+                    echo '<td class="text-center">'.$qualification.'</td>';
1331
+                    echo '<td class="text-center">'.$results['formatted_date'].'</td>';
1332 1332
                     $assignment = get_work_assignment_by_id($work->id, $courseInfo['real_id']);
1333
-                    echo '<td class="text-center">' . api_convert_and_format_date($assignment['expires_on']) . '</td>';
1333
+                    echo '<td class="text-center">'.api_convert_and_format_date($assignment['expires_on']).'</td>';
1334 1334
 
1335 1335
                     $fieldValue = new ExtraFieldValue('work');
1336 1336
                     $resultExtra = $fieldValue->getAllValuesForAnItem(
@@ -1342,7 +1342,7 @@  discard block
 block discarded – undo
1342 1342
                         $field = $field['value'];
1343 1343
 
1344 1344
                         if (api_get_configuration_value('considered_working_time') == $field->getField()->getVariable()) {
1345
-                            echo '<td class="text-center">' . $field->getValue() . '</td>';
1345
+                            echo '<td class="text-center">'.$field->getValue().'</td>';
1346 1346
                         }
1347 1347
                     }
1348 1348
 
Please login to merge, or discard this patch.
main/inc/lib/myspace.lib.php 1 patch
Spacing   +101 added lines, -101 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         $session_id  = intval($session_id);
135 135
 
136 136
         $sql = 'SELECT login_course_date, logout_course_date
137
-                FROM ' . $tbl_track_course . '
137
+                FROM ' . $tbl_track_course.'
138 138
                 WHERE
139 139
                     user_id = '.$user_id.' AND
140 140
                     c_id = '.$courseId.' AND
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
         foreach ($course_list as $course_item) {
174 174
             $courseInfo = api_get_course_info($course_item['code']);
175 175
             $courseId = $courseInfo['real_id'];
176
-            $new_course_list[] =  '"'.$courseId.'"';
176
+            $new_course_list[] = '"'.$courseId.'"';
177 177
         }
178 178
         $course_list = implode(', ', $new_course_list);
179 179
 
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
             return false;
182 182
         }
183 183
         $sql = 'SELECT login_course_date, logout_course_date, c_id
184
-                FROM ' . $tbl_track_course . '
184
+                FROM ' . $tbl_track_course.'
185 185
                 WHERE
186 186
                     user_id = '.$user_id.' AND
187 187
                     c_id IN ('.$course_list.') AND
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
             // student score
260 260
             $avg_score = Tracking :: get_avg_student_score($user_id, $courseCode);
261 261
             if (is_numeric($avg_score)) {
262
-                $avg_score = round($avg_score,2);
262
+                $avg_score = round($avg_score, 2);
263 263
             } else {
264 264
                 $$avg_score = '-';
265 265
             }
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 
296 296
         $t_head = '    <table style="width: 100%;border:0;padding:0;border-collapse:collapse;table-layout: fixed">';
297 297
         //$t_head .= '  <caption>'.get_lang('CourseInformation').'</caption>';
298
-        $t_head .=      '<tr>';
298
+        $t_head .= '<tr>';
299 299
         $t_head .= '        <th width="155px" style="border-left:0;border-bottom:0"><span>'.get_lang('Course').'</span></th>';
300 300
         $t_head .= '        <th style="padding:0;border-bottom:0"><span>'.cut(get_lang('AvgTimeSpentInTheCourse'), 6, true).'</span></th>';
301 301
         $t_head .= '        <th style="padding:0;border-bottom:0"><span>'.cut(get_lang('AvgStudentsProgress'), 6, true).'</span></th>';
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 
314 314
         $addparams = array('view' => 'admin', 'display' => 'user');
315 315
 
316
-        $table = new SortableTable('tracking_user_overview', array('MySpace','get_number_of_users_tracking_overview'), array('MySpace','get_user_data_tracking_overview'), 0);
316
+        $table = new SortableTable('tracking_user_overview', array('MySpace', 'get_number_of_users_tracking_overview'), array('MySpace', 'get_user_data_tracking_overview'), 0);
317 317
         $table->additional_parameters = $addparams;
318 318
 
319 319
         $table->set_header(0, get_lang('OfficialCode'), true, array('style' => 'font-size:8pt'), array('style' => 'font-size:8pt'));
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
         }
327 327
         $table->set_header(3, get_lang('LoginName'), true, array('style' => 'font-size:8pt'), array('style' => 'font-size:8pt'));
328 328
         $table->set_header(4, $t_head, false, array('style' => 'width:90%;border:0;padding:0;font-size:7.5pt;'), array('style' => 'width:90%;padding:0;font-size:7.5pt;'));
329
-        $table->set_column_filter(4, array('MySpace','course_info_tracking_filter'));
329
+        $table->set_column_filter(4, array('MySpace', 'course_info_tracking_filter'));
330 330
         $table->display();
331 331
     }
332 332
 
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
         $table -> set_header(7, get_lang('Sessions'), false);
387 387
 
388 388
         if ($is_western_name_order) {
389
-            $csv_header[] = array (
389
+            $csv_header[] = array(
390 390
                 get_lang('FirstName'),
391 391
                 get_lang('LastName'),
392 392
                 get_lang('TimeSpentOnThePlatform'),
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
                 get_lang('NumberOfSessions')
397 397
             );
398 398
         } else {
399
-            $csv_header[] = array (
399
+            $csv_header[] = array(
400 400
                 get_lang('LastName'),
401 401
                 get_lang('FirstName'),
402 402
                 get_lang('TimeSpentOnThePlatform'),
@@ -536,9 +536,9 @@  discard block
 block discarded – undo
536 536
 
537 537
         if ($tracking_column != 3) {
538 538
             if ($tracking_direction == 'DESC') {
539
-                usort($all_datas, array('MySpace','rsort_users'));
539
+                usort($all_datas, array('MySpace', 'rsort_users'));
540 540
             } else {
541
-                usort($all_datas, array('MySpace','sort_users'));
541
+                usort($all_datas, array('MySpace', 'sort_users'));
542 542
             }
543 543
         }
544 544
 
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
         /**
598 598
          * Column config
599 599
          */
600
-        $column_model   = array(
600
+        $column_model = array(
601 601
             array(
602 602
                 'name' => 'username',
603 603
                 'index' => 'username',
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
 
639 639
         $action_links = '';
640 640
         // jqgrid will use this URL to do the selects
641
-        $url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_session_lp_progress&session_id=' . $sessionId . '&course_id=' . $courseId . '&date_to=' . $date_to . '&date_from=' . $date_from;
641
+        $url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_session_lp_progress&session_id='.$sessionId.'&course_id='.$courseId.'&date_to='.$date_to.'&date_from='.$date_from;
642 642
 
643 643
         //Table Id
644 644
         $tableId = 'lpProgress';
@@ -660,11 +660,11 @@  discard block
 block discarded – undo
660 660
             true
661 661
         );
662 662
 
663
-        $return = '<script>$(function() {'. $table .
663
+        $return = '<script>$(function() {'.$table.
664 664
             'jQuery("#'.$tableId.'").jqGrid("navGrid","#'.$tableId.'_pager",{view:false, edit:false, add:false, del:false, search:false, excel:true});
665 665
                 jQuery("#'.$tableId.'").jqGrid("navButtonAdd","#'.$tableId.'_pager",{
666 666
                        caption:"",
667
-                       title:"' . get_lang('ExportExcel') . '",
667
+                       title:"' . get_lang('ExportExcel').'",
668 668
                        onClickButton : function () {
669 669
                            jQuery("#'.$tableId.'").jqGrid("excelExport",{"url":"'.$url.'&export_format=xls"});
670 670
                        }
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
         /**
715 715
          * Column config
716 716
          */
717
-        $column_model   = array(
717
+        $column_model = array(
718 718
             array('name'=>'session', 'index'=>'session', 'align'=>'left', 'search' => 'true', 'wrap_cell' => "true"),
719 719
             array('name'=>'exercise_id', 'index'=>'exercise_id', 'align'=>'left', 'search' => 'true'),
720 720
             array('name'=>'quiz_title', 'index'=>'quiz_title', 'align'=>'left', 'search' => 'true'),
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
         //get dynamic column names
732 732
 
733 733
         // jqgrid will use this URL to do the selects
734
-        $url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_exercise_progress&session_id=' . $sessionId . '&course_id=' . $courseId  . '&exercise_id=' . $exerciseId . '&date_to=' . $date_to . '&date_from=' . $date_from;
734
+        $url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_exercise_progress&session_id='.$sessionId.'&course_id='.$courseId.'&exercise_id='.$exerciseId.'&date_to='.$date_to.'&date_from='.$date_from;
735 735
 
736 736
         // Autowidth
737 737
         $extra_params['autowidth'] = 'true';
@@ -742,11 +742,11 @@  discard block
 block discarded – undo
742 742
         $tableId = 'exerciseProgressOverview';
743 743
         $table = Display::grid_js($tableId, $url, $columns, $column_model, $extra_params, array(), '', true);
744 744
 
745
-        $return = '<script>$(function() {'. $table .
745
+        $return = '<script>$(function() {'.$table.
746 746
             'jQuery("#'.$tableId.'").jqGrid("navGrid","#'.$tableId.'_pager",{view:false, edit:false, add:false, del:false, search:false, excel:true});
747 747
                 jQuery("#'.$tableId.'").jqGrid("navButtonAdd","#'.$tableId.'_pager",{
748 748
                        caption:"",
749
-                       title:"' . get_lang('ExportExcel') . '",
749
+                       title:"' . get_lang('ExportExcel').'",
750 750
                        onClickButton : function () {
751 751
                            jQuery("#'.$tableId.'").jqGrid("excelExport",{"url":"'.$url.'&export_format=xls"});
752 752
                        }
@@ -806,7 +806,7 @@  discard block
 block discarded – undo
806 806
                 // adding the fields that are checked to the session
807 807
                 $message = '';
808 808
                 foreach ($values as $field_ids => $value) {
809
-                    if ($value == 1 && strstr($field_ids,'extra_export_field')) {
809
+                    if ($value == 1 && strstr($field_ids, 'extra_export_field')) {
810 810
                         $_SESSION['additional_export_fields'][] = str_replace('extra_export_field', '', $field_ids);
811 811
                     }
812 812
                 }
@@ -821,7 +821,7 @@  discard block
 block discarded – undo
821 821
                 // Displaying a feedback message
822 822
                 if (!empty($_SESSION['additional_export_fields'])) {
823 823
                     Display::display_confirmation_message(get_lang('FollowingFieldsWillAlsoBeExported').': <br /><ul>'.$message.'</ul>', false);
824
-                } else  {
824
+                } else {
825 825
                     Display::display_confirmation_message(get_lang('NoAdditionalFieldsWillBeExported'), false);
826 826
                 }
827 827
             } else {
@@ -849,7 +849,7 @@  discard block
 block discarded – undo
849 849
     {
850 850
         $t_head = '    <table style="width: 100%;border:0;padding:0;border-collapse:collapse;table-layout: fixed">';
851 851
         //$t_head .= '  <caption>'.get_lang('CourseInformation').'</caption>';
852
-        $t_head .=      '<tr>';
852
+        $t_head .= '<tr>';
853 853
         $t_head .= '        <th style="padding:0;border-bottom:0"><span>'.cut(get_lang('AvgTimeSpentInTheCourse'), 6, true).'</span></th>';
854 854
         $t_head .= '        <th style="padding:0;border-bottom:0"><span>'.cut(get_lang('AvgStudentsProgress'), 6, true).'</span></th>';
855 855
         $t_head .= '        <th style="padding:0;border-bottom:0"><span>'.cut(get_lang('AvgCourseScore'), 6, true).'</span></th>';
@@ -866,13 +866,13 @@  discard block
 block discarded – undo
866 866
 
867 867
         $addparams = array('view' => 'admin', 'display' => 'courseoverview');
868 868
 
869
-        $table = new SortableTable('tracking_session_overview', array('MySpace', 'get_total_number_courses'), array('MySpace','get_course_data_tracking_overview'), 1);
869
+        $table = new SortableTable('tracking_session_overview', array('MySpace', 'get_total_number_courses'), array('MySpace', 'get_course_data_tracking_overview'), 1);
870 870
         $table->additional_parameters = $addparams;
871 871
 
872 872
         $table->set_header(0, '', false, null, array('style' => 'display: none'));
873 873
         $table->set_header(1, get_lang('Course'), true, array('style' => 'font-size:8pt'), array('style' => 'font-size:8pt'));
874 874
         $table->set_header(2, $t_head, false, array('style' => 'width:90%;border:0;padding:0;font-size:7.5pt;'), array('style' => 'width:90%;padding:0;font-size:7.5pt;'));
875
-        $table->set_column_filter(2, array('MySpace','course_tracking_filter'));
875
+        $table->set_column_filter(2, array('MySpace', 'course_tracking_filter'));
876 876
         $table->display();
877 877
     }
878 878
 
@@ -910,7 +910,7 @@  discard block
 block discarded – undo
910 910
         $sql .= " ORDER BY col$column $direction ";
911 911
         $sql .= " LIMIT $from,$number_of_items";
912 912
         $result = Database::query($sql);
913
-        $return = array ();
913
+        $return = array();
914 914
         while ($course = Database::fetch_row($result)) {
915 915
             $return[] = $course;
916 916
         }
@@ -963,18 +963,18 @@  discard block
 block discarded – undo
963 963
             $progress += $progress_tmp[0];
964 964
             $nb_progress_lp += $progress_tmp[1];
965 965
             $score_tmp = Tracking :: get_avg_student_score($row->user_id, $course_code, array(), null, true);
966
-            if(is_array($score_tmp)) {
966
+            if (is_array($score_tmp)) {
967 967
                 $score += $score_tmp[0];
968 968
                 $nb_score_lp += $score_tmp[1];
969 969
             }
970 970
             $nb_messages += Tracking::count_student_messages($row->user_id, $course_code);
971 971
             $nb_assignments += Tracking::count_student_assignments($row->user_id, $course_code);
972 972
             $last_login_date_tmp = Tracking :: get_last_connection_date_on_the_course($row->user_id, $courseInfo, null, false);
973
-            if($last_login_date_tmp != false && $last_login_date == false) { // TODO: To be cleaned
973
+            if ($last_login_date_tmp != false && $last_login_date == false) { // TODO: To be cleaned
974 974
                 $last_login_date = $last_login_date_tmp;
975
-            } else if($last_login_date_tmp != false && $last_login_date != false) { // TODO: Repeated previous condition. To be cleaned.
975
+            } else if ($last_login_date_tmp != false && $last_login_date != false) { // TODO: Repeated previous condition. To be cleaned.
976 976
                 // Find the max and assign it to first_login_date
977
-                if(strtotime($last_login_date_tmp) > strtotime($last_login_date)) {
977
+                if (strtotime($last_login_date_tmp) > strtotime($last_login_date)) {
978 978
                     $last_login_date = $last_login_date_tmp;
979 979
                 }
980 980
             }
@@ -1112,7 +1112,7 @@  discard block
 block discarded – undo
1112 1112
                 $progress += $progress_tmp[0];
1113 1113
                 $nb_progress_lp += $progress_tmp[1];
1114 1114
                 $score_tmp = Tracking :: get_avg_student_score($row->user_id, $course_code, array(), null, true);
1115
-                if(is_array($score_tmp)) {
1115
+                if (is_array($score_tmp)) {
1116 1116
                     $score += $score_tmp[0];
1117 1117
                     $nb_score_lp += $score_tmp[1];
1118 1118
                 }
@@ -1120,11 +1120,11 @@  discard block
 block discarded – undo
1120 1120
                 $nb_assignments += Tracking::count_student_assignments($row->user_id, $course_code);
1121 1121
 
1122 1122
                 $last_login_date_tmp = Tracking::get_last_connection_date_on_the_course($row->user_id, $courseInfo, null, false);
1123
-                if($last_login_date_tmp != false && $last_login_date == false) { // TODO: To be cleaned.
1123
+                if ($last_login_date_tmp != false && $last_login_date == false) { // TODO: To be cleaned.
1124 1124
                     $last_login_date = $last_login_date_tmp;
1125
-                } else if($last_login_date_tmp != false && $last_login_date == false) { // TODO: Repeated previous condition. To be cleaned.
1125
+                } else if ($last_login_date_tmp != false && $last_login_date == false) { // TODO: Repeated previous condition. To be cleaned.
1126 1126
                     // Find the max and assign it to first_login_date
1127
-                    if(strtotime($last_login_date_tmp) > strtotime($last_login_date)) {
1127
+                    if (strtotime($last_login_date_tmp) > strtotime($last_login_date)) {
1128 1128
                         $last_login_date = $last_login_date_tmp;
1129 1129
                     }
1130 1130
                 }
@@ -1134,22 +1134,22 @@  discard block
 block discarded – undo
1134 1134
                 $total_score_possible += $exercise_results_tmp['score_possible'];
1135 1135
                 $total_questions_answered += $exercise_results_tmp['questions_answered'];
1136 1136
             }
1137
-            if($nb_progress_lp > 0) {
1137
+            if ($nb_progress_lp > 0) {
1138 1138
                 $avg_progress = round($progress / $nb_progress_lp, 2);
1139 1139
             } else {
1140 1140
                 $avg_progress = 0;
1141 1141
             }
1142
-            if($nb_score_lp > 0) {
1142
+            if ($nb_score_lp > 0) {
1143 1143
                 $avg_score = round($score / $nb_score_lp, 2);
1144 1144
             } else {
1145 1145
                 $avg_score = '-';
1146 1146
             }
1147
-            if($last_login_date) {
1147
+            if ($last_login_date) {
1148 1148
                 $last_login_date = api_convert_and_format_date($last_login_date, DATE_FORMAT_SHORT, date_default_timezone_get());
1149 1149
             } else {
1150 1150
                 $last_login_date = '-';
1151 1151
             }
1152
-            if($total_score_possible > 0) {
1152
+            if ($total_score_possible > 0) {
1153 1153
                 $total_score_percentage = round($total_score_obtained / $total_score_possible * 100, 2);
1154 1154
             } else {
1155 1155
                 $total_score_percentage = 0;
@@ -1185,7 +1185,7 @@  discard block
 block discarded – undo
1185 1185
     {
1186 1186
         $t_head = '    <table style="width: 100%;border:0;padding:0;border-collapse:collapse;table-layout: fixed">';
1187 1187
         //$t_head .= '  <caption>'.get_lang('CourseInformation').'</caption>';
1188
-        $t_head .=      '<tr>';
1188
+        $t_head .= '<tr>';
1189 1189
         $t_head .= '        <th width="155px" style="border-left:0;border-bottom:0"><span>'.get_lang('Course').'</span></th>';
1190 1190
         $t_head .= '        <th style="padding:0;border-bottom:0"><span>'.cut(get_lang('AvgTimeSpentInTheCourse'), 6, true).'</span></th>';
1191 1191
         $t_head .= '        <th style="padding:0;border-bottom:0"><span>'.cut(get_lang('AvgStudentsProgress'), 6, true).'</span></th>';
@@ -1203,7 +1203,7 @@  discard block
 block discarded – undo
1203 1203
 
1204 1204
         $addparams = array('view' => 'admin', 'display' => 'sessionoverview');
1205 1205
 
1206
-        $table = new SortableTable('tracking_session_overview', array('MySpace','get_total_number_sessions'), array('MySpace','get_session_data_tracking_overview'), 1);
1206
+        $table = new SortableTable('tracking_session_overview', array('MySpace', 'get_total_number_sessions'), array('MySpace', 'get_session_data_tracking_overview'), 1);
1207 1207
         $table->additional_parameters = $addparams;
1208 1208
 
1209 1209
         $table->set_header(0, '', false, null, array('style' => 'display: none'));
@@ -1245,7 +1245,7 @@  discard block
 block discarded – undo
1245 1245
         $sql .= " ORDER BY col$column $direction ";
1246 1246
         $sql .= " LIMIT $from,$number_of_items";
1247 1247
         $result = Database::query($sql);
1248
-        $return = array ();
1248
+        $return = array();
1249 1249
         while ($session = Database::fetch_row($result)) {
1250 1250
             $return[] = $session;
1251 1251
         }
@@ -1334,10 +1334,10 @@  discard block
 block discarded – undo
1334 1334
                 if ($last_login_date_tmp != false && $last_login_date == false) {
1335 1335
                     // TODO: To be cleaned.
1336 1336
                     $last_login_date = $last_login_date_tmp;
1337
-                } else if($last_login_date_tmp != false && $last_login_date != false) {
1337
+                } else if ($last_login_date_tmp != false && $last_login_date != false) {
1338 1338
                     // TODO: Repeated previous condition! To be cleaned.
1339 1339
                     // Find the max and assign it to first_login_date
1340
-                    if(strtotime($last_login_date_tmp) > strtotime($last_login_date)) {
1340
+                    if (strtotime($last_login_date_tmp) > strtotime($last_login_date)) {
1341 1341
                         $last_login_date = $last_login_date_tmp;
1342 1342
                     }
1343 1343
                 }
@@ -1347,27 +1347,27 @@  discard block
 block discarded – undo
1347 1347
                 $total_score_possible += $exercise_results_tmp['score_possible'];
1348 1348
                 $total_questions_answered += $exercise_results_tmp['questions_answered'];
1349 1349
             }
1350
-            if($nb_progress_lp > 0) {
1350
+            if ($nb_progress_lp > 0) {
1351 1351
                 $avg_progress = round($progress / $nb_progress_lp, 2);
1352 1352
             } else {
1353 1353
                 $avg_progress = 0;
1354 1354
             }
1355
-            if($nb_score_lp > 0) {
1355
+            if ($nb_score_lp > 0) {
1356 1356
                 $avg_score = round($score / $nb_score_lp, 2);
1357 1357
             } else {
1358 1358
                 $avg_score = '-';
1359 1359
             }
1360
-            if($last_login_date) {
1360
+            if ($last_login_date) {
1361 1361
                 $last_login_date = api_convert_and_format_date($last_login_date, DATE_FORMAT_SHORT, date_default_timezone_get());
1362 1362
             } else {
1363 1363
                 $last_login_date = '-';
1364 1364
             }
1365
-            if($total_score_possible > 0) {
1365
+            if ($total_score_possible > 0) {
1366 1366
                 $total_score_percentage = round($total_score_obtained / $total_score_possible * 100, 2);
1367 1367
             } else {
1368 1368
                 $total_score_percentage = 0;
1369 1369
             }
1370
-            if($total_score_percentage > 0) {
1370
+            if ($total_score_percentage > 0) {
1371 1371
                 $total_score = $total_score_obtained.'/'.$total_score_possible.' ('.$total_score_percentage.' %)';
1372 1372
             } else {
1373 1373
                 $total_score = '-';
@@ -1478,7 +1478,7 @@  discard block
 block discarded – undo
1478 1478
                 $total_score_obtained = 0;
1479 1479
                 $total_score_possible = 0;
1480 1480
                 $total_questions_answered = 0;
1481
-                while($row_user = Database::fetch_object($result_users)) {
1481
+                while ($row_user = Database::fetch_object($result_users)) {
1482 1482
                     // get time spent in the course and session
1483 1483
                     $time_spent += Tracking::get_time_spent_on_the_course($row_user->user_id, $courseId, $session_id);
1484 1484
                     $progress_tmp = Tracking::get_avg_student_progress($row_user->user_id, $row->code, array(), $session_id, true);
@@ -1507,11 +1507,11 @@  discard block
 block discarded – undo
1507 1507
                         $session_id,
1508 1508
                         false
1509 1509
                     );
1510
-                    if($last_login_date_tmp != false && $last_login_date == false) { // TODO: To be cleaned.
1510
+                    if ($last_login_date_tmp != false && $last_login_date == false) { // TODO: To be cleaned.
1511 1511
                         $last_login_date = $last_login_date_tmp;
1512
-                    } else if($last_login_date_tmp != false && $last_login_date == false) { // TODO: Repeated previous condition. To be cleaned.
1512
+                    } else if ($last_login_date_tmp != false && $last_login_date == false) { // TODO: Repeated previous condition. To be cleaned.
1513 1513
                         // Find the max and assign it to first_login_date
1514
-                        if(strtotime($last_login_date_tmp) > strtotime($last_login_date)) {
1514
+                        if (strtotime($last_login_date_tmp) > strtotime($last_login_date)) {
1515 1515
                             $last_login_date = $last_login_date_tmp;
1516 1516
                         }
1517 1517
                     }
@@ -1521,27 +1521,27 @@  discard block
 block discarded – undo
1521 1521
                     $total_score_possible += $exercise_results_tmp['score_possible'];
1522 1522
                     $total_questions_answered += $exercise_results_tmp['questions_answered'];
1523 1523
                 }
1524
-                if($nb_progress_lp > 0) {
1524
+                if ($nb_progress_lp > 0) {
1525 1525
                     $avg_progress = round($progress / $nb_progress_lp, 2);
1526 1526
                 } else {
1527 1527
                     $avg_progress = 0;
1528 1528
                 }
1529
-                if($nb_score_lp > 0) {
1529
+                if ($nb_score_lp > 0) {
1530 1530
                     $avg_score = round($score / $nb_score_lp, 2);
1531 1531
                 } else {
1532 1532
                     $avg_score = '-';
1533 1533
                 }
1534
-                if($last_login_date) {
1534
+                if ($last_login_date) {
1535 1535
                     $last_login_date = api_convert_and_format_date($last_login_date, DATE_FORMAT_SHORT, date_default_timezone_get());
1536 1536
                 } else {
1537 1537
                     $last_login_date = '-';
1538 1538
                 }
1539
-                if($total_score_possible > 0) {
1539
+                if ($total_score_possible > 0) {
1540 1540
                     $total_score_percentage = round($total_score_obtained / $total_score_possible * 100, 2);
1541 1541
                 } else {
1542 1542
                     $total_score_percentage = 0;
1543 1543
                 }
1544
-                if($total_score_percentage > 0) {
1544
+                if ($total_score_percentage > 0) {
1545 1545
                     $total_score = $total_score_obtained.'/'.$total_score_possible.' ('.$total_score_percentage.' %)';
1546 1546
                 } else {
1547 1547
                     $total_score = '-';
@@ -1601,7 +1601,7 @@  discard block
 block discarded – undo
1601 1601
         while ($row = Database::fetch_array($result)) {
1602 1602
             $score_obtained += $row['exe_result'];
1603 1603
             $score_possible += $row['exe_weighting'];
1604
-            $questions_answered ++;
1604
+            $questions_answered++;
1605 1605
         }
1606 1606
 
1607 1607
         if ($score_possible != 0) {
@@ -1721,9 +1721,9 @@  discard block
 block discarded – undo
1721 1721
                     }
1722 1722
                 }
1723 1723
                 // time spent in the course
1724
-                $csv_row[] = api_time_to_hms(Tracking::get_time_spent_on_the_course ($user[4], $courseId));
1724
+                $csv_row[] = api_time_to_hms(Tracking::get_time_spent_on_the_course($user[4], $courseId));
1725 1725
                 // student progress in course
1726
-                $csv_row[] = round(Tracking::get_avg_student_progress ($user[4], $row[0]), 2);
1726
+                $csv_row[] = round(Tracking::get_avg_student_progress($user[4], $row[0]), 2);
1727 1727
                 // student score
1728 1728
                 $csv_row[] = round(Tracking::get_avg_student_score($user[4], $row[0]), 2);
1729 1729
                 // student tes score
@@ -1731,7 +1731,7 @@  discard block
 block discarded – undo
1731 1731
                 // student messages
1732 1732
                 $csv_row[] = Tracking::count_student_messages($user[4], $row[0]);
1733 1733
                 // student assignments
1734
-                $csv_row[] = Tracking::count_student_assignments ($user[4], $row[0]);
1734
+                $csv_row[] = Tracking::count_student_assignments($user[4], $row[0]);
1735 1735
                 // student exercises results
1736 1736
                 $exercises_results = MySpace::exercises_results($user[4], $row[0]);
1737 1737
                 $csv_row[] = $exercises_results['score_obtained'];
@@ -1739,7 +1739,7 @@  discard block
 block discarded – undo
1739 1739
                 $csv_row[] = $exercises_results['questions_answered'];
1740 1740
                 $csv_row[] = $exercises_results['percentage'];
1741 1741
                 // first connection
1742
-                $csv_row[] = Tracking::get_first_connection_date_on_the_course ($user[4], $courseId);
1742
+                $csv_row[] = Tracking::get_first_connection_date_on_the_course($user[4], $courseId);
1743 1743
                 // last connection
1744 1744
                 $csv_row[] = strip_tags(Tracking::get_last_connection_date_on_the_course($user[4], $courseInfo));
1745 1745
 
@@ -1773,9 +1773,9 @@  discard block
 block discarded – undo
1773 1773
         // get all courses with limit
1774 1774
         $sql = "SELECT course.code as col1, course.title as col2
1775 1775
                 FROM $tbl_course course
1776
-                WHERE course.code IN (".implode(',',$courses_code).")";
1776
+                WHERE course.code IN (".implode(',', $courses_code).")";
1777 1777
 
1778
-        if (!in_array($direction, array('ASC','DESC'))) $direction = 'ASC';
1778
+        if (!in_array($direction, array('ASC', 'DESC'))) $direction = 'ASC';
1779 1779
 
1780 1780
         $column = intval($column);
1781 1781
         $from = intval($from);
@@ -1844,7 +1844,7 @@  discard block
 block discarded – undo
1844 1844
             $table_row[] = $avg_assignments_in_course;
1845 1845
 
1846 1846
             //set the "from" value to know if I access the Reporting by the chamilo tab or the course link
1847
-            $table_row[] = '<center><a href="../../tracking/courseLog.php?cidReq=' .$course_code.'&from=myspace&id_session='.$session_id.'">
1847
+            $table_row[] = '<center><a href="../../tracking/courseLog.php?cidReq='.$course_code.'&from=myspace&id_session='.$session_id.'">
1848 1848
                              '.Display::return_icon('2rightarrow.png').'
1849 1849
                              </a>
1850 1850
                             </center>';
@@ -1853,7 +1853,7 @@  discard block
 block discarded – undo
1853 1853
                 $nb_students_in_course,
1854 1854
                 $avg_time_spent_in_course,
1855 1855
                 is_null($avg_progress_in_course) ? null : $avg_progress_in_course.'%',
1856
-                is_null($avg_score_in_course) ? null : is_numeric($avg_score_in_course) ? $avg_score_in_course.'%' : $avg_score_in_course ,
1856
+                is_null($avg_score_in_course) ? null : is_numeric($avg_score_in_course) ? $avg_score_in_course.'%' : $avg_score_in_course,
1857 1857
                 is_null($avg_score_in_exercise) ? null : $avg_score_in_exercise.'%',
1858 1858
                 $avg_messages_in_course,
1859 1859
                 $avg_assignments_in_course,
@@ -1924,7 +1924,7 @@  discard block
 block discarded – undo
1924 1924
         $sql .= " ORDER BY col$column $direction ";
1925 1925
         $sql .= " LIMIT $from,$number_of_items";
1926 1926
         $result = Database::query($sql);
1927
-        $return = array ();
1927
+        $return = array();
1928 1928
         while ($user = Database::fetch_row($result)) {
1929 1929
             $return[] = $user;
1930 1930
         }
@@ -1979,7 +1979,7 @@  discard block
 block discarded – undo
1979 1979
                     $i++;
1980 1980
                 }
1981 1981
             }
1982
-            $username_array = array('username' => $desired_username , 'sufix' => $sufix);
1982
+            $username_array = array('username' => $desired_username, 'sufix' => $sufix);
1983 1983
             return $username_array;
1984 1984
         } else {
1985 1985
             $username_array = array('username' => $username, 'sufix' => '');
@@ -2254,7 +2254,7 @@  discard block
 block discarded – undo
2254 2254
         foreach ($users as $index => $user) {
2255 2255
             $userid = $user['id'];
2256 2256
             $sql_insert = "INSERT IGNORE INTO $tbl_session_rel_user(session_id, user_id, registered_at)
2257
-                           VALUES ('$id_session','$userid', '" . api_get_utc_datetime() . "')";
2257
+                           VALUES ('$id_session','$userid', '".api_get_utc_datetime()."')";
2258 2258
             Database::query($sql_insert);
2259 2259
             $user['added_at_session'] = 1;
2260 2260
             $new_users[] = $user;
@@ -2288,10 +2288,10 @@  discard block
 block discarded – undo
2288 2288
                 );
2289 2289
                 $userInfo = api_get_user_info($user['id']);
2290 2290
 
2291
-                if (($user['added_at_platform'] == 1  && $user['added_at_session'] == 1) || $user['added_at_session'] == 1) {
2291
+                if (($user['added_at_platform'] == 1 && $user['added_at_session'] == 1) || $user['added_at_session'] == 1) {
2292 2292
                     if ($user['added_at_platform'] == 1) {
2293 2293
                         $addedto = get_lang('UserCreatedPlatform');
2294
-                    } else  {
2294
+                    } else {
2295 2295
                         $addedto = '          ';
2296 2296
                     }
2297 2297
 
@@ -2354,7 +2354,7 @@  discard block
 block discarded – undo
2354 2354
         global $current_tag;
2355 2355
         switch ($data) {
2356 2356
             case 'Contact' :
2357
-                $user = array ();
2357
+                $user = array();
2358 2358
                 break;
2359 2359
             default :
2360 2360
                 $current_tag = $data;
@@ -2401,9 +2401,9 @@  discard block
 block discarded – undo
2401 2401
         global $current_value;
2402 2402
         global $user;
2403 2403
         global $users;
2404
-        $users = array ();
2404
+        $users = array();
2405 2405
         $parser = xml_parser_create('UTF-8');
2406
-        xml_set_element_handler($parser, array('MySpace','element_start'), array('MySpace','element_end'));
2406
+        xml_set_element_handler($parser, array('MySpace', 'element_start'), array('MySpace', 'element_end'));
2407 2407
         xml_set_character_data_handler($parser, "character_data");
2408 2408
         xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, false);
2409 2409
         xml_parse($parser, api_utf8_encode_xml(file_get_contents($file)));
@@ -2449,7 +2449,7 @@  discard block
 block discarded – undo
2449 2449
             get_lang('SearchCourse'),
2450 2450
             $courseList,
2451 2451
             [
2452
-                'url' => api_get_path(WEB_AJAX_PATH) . 'course.ajax.php?' . http_build_query([
2452
+                'url' => api_get_path(WEB_AJAX_PATH).'course.ajax.php?'.http_build_query([
2453 2453
                     'a' => 'search_course_by_session_all',
2454 2454
                     'session_id' => $sessionId
2455 2455
                 ])
@@ -2468,7 +2468,7 @@  discard block
 block discarded – undo
2468 2468
                             course_id: $('#course_id').val() || 0
2469 2469
                         });
2470 2470
 
2471
-                        return '" . api_get_path(WEB_AJAX_PATH) . "session.ajax.php?' + params;
2471
+                        return '" . api_get_path(WEB_AJAX_PATH)."session.ajax.php?' + params;
2472 2472
                     }
2473 2473
                 "
2474 2474
             ]
@@ -2499,7 +2499,7 @@  discard block
 block discarded – undo
2499 2499
                             course_id: $('#course_id').val()
2500 2500
                         });
2501 2501
 
2502
-                        return '" . api_get_path(WEB_AJAX_PATH) . "course.ajax.php?' + params;
2502
+                        return '" . api_get_path(WEB_AJAX_PATH)."course.ajax.php?' + params;
2503 2503
                     }
2504 2504
                 "
2505 2505
             ]
@@ -2600,7 +2600,7 @@  discard block
 block discarded – undo
2600 2600
                     " : "
2601 2601
                         u.lastname AS col2,
2602 2602
                         u.firstname AS col3,
2603
-                " ) . "
2603
+                " )."
2604 2604
                 a.logout_course_date,
2605 2605
                 c.title,
2606 2606
                 c.code,
@@ -2611,7 +2611,7 @@  discard block
 block discarded – undo
2611 2611
 
2612 2612
         if (isset($_GET['session_id']) && !empty($_GET['session_id'])) {
2613 2613
             $sessionId = intval($_GET['session_id']);
2614
-            $sql .= " WHERE a.session_id = " . $sessionId;
2614
+            $sql .= " WHERE a.session_id = ".$sessionId;
2615 2615
         }
2616 2616
 
2617 2617
         $sql .= " ORDER BY col$column $orderDirection ";
@@ -2717,13 +2717,13 @@  discard block
 block discarded – undo
2717 2717
 function get_stats($user_id, $courseId, $start_date = null, $end_date = null)
2718 2718
 {
2719 2719
     // Database table definitions
2720
-    $tbl_track_course   = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
2720
+    $tbl_track_course = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
2721 2721
 
2722 2722
     $course_info = api_get_course_info_by_id($courseId);
2723 2723
     if (!empty($course_info)) {
2724 2724
         $strg_sd = '';
2725 2725
         $strg_ed = '';
2726
-        if ($start_date != null && $end_date != null){
2726
+        if ($start_date != null && $end_date != null) {
2727 2727
             $end_date = add_day_to($end_date);
2728 2728
             $strg_sd = "AND login_course_date BETWEEN '$start_date' AND '$end_date'";
2729 2729
             $strg_ed = "AND logout_course_date BETWEEN '$start_date' AND '$end_date'";
@@ -2732,10 +2732,10 @@  discard block
 block discarded – undo
2732 2732
                 SEC_TO_TIME(avg(time_to_sec(timediff(logout_course_date,login_course_date)))) as avrg,
2733 2733
                 SEC_TO_TIME(sum(time_to_sec(timediff(logout_course_date,login_course_date)))) as total,
2734 2734
                 count(user_id) as times
2735
-                FROM ' . $tbl_track_course . '
2735
+                FROM ' . $tbl_track_course.'
2736 2736
                 WHERE
2737
-                    user_id = ' . intval($user_id) . ' AND
2738
-                    c_id = ' . intval($courseId) . ' '.$strg_sd.' '.$strg_ed.' '.'
2737
+                    user_id = ' . intval($user_id).' AND
2738
+                    c_id = ' . intval($courseId).' '.$strg_sd.' '.$strg_ed.' '.'
2739 2739
                 ORDER BY login_course_date ASC';
2740 2740
 
2741 2741
         $rs = Database::query($sql);
@@ -2753,7 +2753,7 @@  discard block
 block discarded – undo
2753 2753
 }
2754 2754
 
2755 2755
 function add_day_to($end_date) {
2756
-    $foo_date = strtotime( $end_date );
2756
+    $foo_date = strtotime($end_date);
2757 2757
     $foo_date = strtotime(" +1 day", $foo_date);
2758 2758
     $foo_date = date("Y-m-d", $foo_date);
2759 2759
     return $foo_date;
@@ -2767,7 +2767,7 @@  discard block
 block discarded – undo
2767 2767
  * @version OCT-22- 2010
2768 2768
  * @return array
2769 2769
  */
2770
-function convert_to_array($sql_result){
2770
+function convert_to_array($sql_result) {
2771 2771
     $result_to_print = '<table>';
2772 2772
     foreach ($sql_result as $key => $data) {
2773 2773
         $result_to_print .= '<tr><td>'.date('d-m-Y (H:i:s)', $data['login']).'</td><td>'.api_time_to_hms($data['logout'] - $data['login']).'</tr></td>'."\n";
@@ -2786,7 +2786,7 @@  discard block
 block discarded – undo
2786 2786
  * @version OCT-22- 2010
2787 2787
  * @return string
2788 2788
  */
2789
-function convert_to_string($sql_result){
2789
+function convert_to_string($sql_result) {
2790 2790
     $result_to_print = '<table>';
2791 2791
     if (!empty($sql_result)) {
2792 2792
         foreach ($sql_result as $key => $data) {
@@ -2811,10 +2811,10 @@  discard block
 block discarded – undo
2811 2811
  */
2812 2812
 function grapher($sql_result, $start_date, $end_date, $type = "")
2813 2813
 {
2814
-    if (empty($start_date)) { $start_date =""; }
2815
-    if (empty($end_date)) { $end_date =""; }
2816
-    if ($type == ""){ $type = 'day'; }
2817
-    $main_year  = $main_month_year = $main_day = [];
2814
+    if (empty($start_date)) { $start_date = ""; }
2815
+    if (empty($end_date)) { $end_date = ""; }
2816
+    if ($type == "") { $type = 'day'; }
2817
+    $main_year = $main_month_year = $main_day = [];
2818 2818
 
2819 2819
     $period = new DatePeriod(
2820 2820
         new DateTime($start_date),
@@ -2873,7 +2873,7 @@  discard block
 block discarded – undo
2873 2873
         /* Create and populate the pData object */
2874 2874
         $myData = new pData();
2875 2875
         $myData->addPoints($main_date, 'Serie1');
2876
-        if (count($main_date)!= 1) {
2876
+        if (count($main_date) != 1) {
2877 2877
             $myData->addPoints($labels, 'Labels');
2878 2878
             $myData->setSerieDescription('Labels', 'Months');
2879 2879
             $myData->setAbscissa('Labels');
@@ -2881,7 +2881,7 @@  discard block
 block discarded – undo
2881 2881
         $myData->setSerieWeight('Serie1', 1);
2882 2882
         $myData->setSerieDescription('Serie1', get_lang('MyResults'));
2883 2883
         $myData->setAxisName(0, get_lang('Minutes'));
2884
-        $myData->loadPalette(api_get_path(SYS_CODE_PATH) . 'palettes/pchart/default.color', true);
2884
+        $myData->loadPalette(api_get_path(SYS_CODE_PATH).'palettes/pchart/default.color', true);
2885 2885
 
2886 2886
         // Cache definition
2887 2887
         $cachePath = api_get_path(SYS_ARCHIVE_PATH);
@@ -2890,9 +2890,9 @@  discard block
 block discarded – undo
2890 2890
 
2891 2891
         if ($myCache->isInCache($chartHash)) {
2892 2892
             //if we already created the img
2893
-            $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash;
2893
+            $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash;
2894 2894
             $myCache->saveFromCache($chartHash, $imgPath);
2895
-            $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash;
2895
+            $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash;
2896 2896
         } else {
2897 2897
             /* Define width, height and angle */
2898 2898
             $mainWidth = 760;
@@ -2921,7 +2921,7 @@  discard block
 block discarded – undo
2921 2921
             /* Set the default font */
2922 2922
             $myPicture->setFontProperties(
2923 2923
                 array(
2924
-                    "FontName" => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf',
2924
+                    "FontName" => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf',
2925 2925
                     "FontSize" => 10)
2926 2926
             );
2927 2927
             /* Write the chart title */
@@ -2938,7 +2938,7 @@  discard block
 block discarded – undo
2938 2938
             /* Set the default font */
2939 2939
             $myPicture->setFontProperties(
2940 2940
                 array(
2941
-                    "FontName" => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf',
2941
+                    "FontName" => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf',
2942 2942
                     "FontSize" => 8
2943 2943
                 )
2944 2944
             );
@@ -2980,7 +2980,7 @@  discard block
 block discarded – undo
2980 2980
             /* Draw the line chart */
2981 2981
             $myPicture->setFontProperties(
2982 2982
                 array(
2983
-                    "FontName" => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf',
2983
+                    "FontName" => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf',
2984 2984
                     "FontSize" => 10
2985 2985
                 )
2986 2986
             );
@@ -2999,15 +2999,15 @@  discard block
 block discarded – undo
2999 2999
 
3000 3000
             /* Write and save into cache */
3001 3001
             $myCache->writeToCache($chartHash, $myPicture);
3002
-            $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash;
3002
+            $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash;
3003 3003
             $myCache->saveFromCache($chartHash, $imgPath);
3004
-            $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash;
3004
+            $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash;
3005 3005
         }
3006
-        $html = '<img src="' . $imgPath . '">';
3006
+        $html = '<img src="'.$imgPath.'">';
3007 3007
 
3008 3008
         return $html;
3009 3009
     } else {
3010
-        $foo_img = api_convert_encoding('<div id="messages" class="warning-message">'.get_lang('GraphicNotAvailable').'</div>','UTF-8');
3010
+        $foo_img = api_convert_encoding('<div id="messages" class="warning-message">'.get_lang('GraphicNotAvailable').'</div>', 'UTF-8');
3011 3011
 
3012 3012
         return $foo_img;
3013 3013
     }
Please login to merge, or discard this patch.