Completed
Push — 1.10.x ( e05167...864b91 )
by Angel Fernando Quiroz
82:50 queued 41:19
created
main/mySpace/works_in_session_report.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
     foreach ($sessionCourses as $sessionCourse) {
47 47
         $course = $sessionCourse->getCourse();
48
-        $coursesInfo[$course->getId()] =  $course->getCode();
48
+        $coursesInfo[$course->getId()] = $course->getCode();
49 49
         $criteria = Criteria::create()->where(
50 50
             Criteria::expr()->eq("status", Session::STUDENT)
51 51
         );
@@ -68,21 +68,21 @@  discard block
 block discarded – undo
68 68
                 ];
69 69
             }
70 70
 
71
-            $usersInfo[$user->getId()][$course->getId() . '_score'] = null;
72
-            $usersInfo[$user->getId()][$course->getId() . '_progress'] = null;
73
-            $usersInfo[$user->getId()][$course->getId() . '_last_sent_date'] = null;
71
+            $usersInfo[$user->getId()][$course->getId().'_score'] = null;
72
+            $usersInfo[$user->getId()][$course->getId().'_progress'] = null;
73
+            $usersInfo[$user->getId()][$course->getId().'_last_sent_date'] = null;
74 74
 
75 75
             if (!$session->hasStudentInCourse($user, $course)) {
76 76
                 continue;
77 77
             }
78 78
 
79
-            $usersInfo[$user->getId()][$course->getId() . '_score'] = Tracking::get_avg_student_score(
79
+            $usersInfo[$user->getId()][$course->getId().'_score'] = Tracking::get_avg_student_score(
80 80
                 $user->getId(),
81 81
                 $course->getCode(),
82 82
                 null,
83 83
                 $session->getId()
84 84
             );
85
-            $usersInfo[$user->getId()][$course->getId() . '_progress'] = Tracking::get_avg_student_progress(
85
+            $usersInfo[$user->getId()][$course->getId().'_progress'] = Tracking::get_avg_student_progress(
86 86
                 $user->getId(),
87 87
                 $course->getCode(),
88 88
                 null,
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
                 continue;
96 96
             }
97 97
 
98
-            $usersInfo[$user->getId()][$course->getId() . '_last_sent_date'] = api_format_date(
98
+            $usersInfo[$user->getId()][$course->getId().'_last_sent_date'] = api_format_date(
99 99
                 $lastPublication->getSentDate()->getTimestamp(),
100 100
                 DATE_TIME_FORMAT_SHORT
101 101
             );
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     $dataToExport = [
108 108
         [$toolName]
109 109
     ];
110
-    $fileName = 'works_in_session_' . api_get_local_time();
110
+    $fileName = 'works_in_session_'.api_get_local_time();
111 111
 
112 112
     $dataToExport['headers'][] = get_lang('OfficialCode');
113 113
     $dataToExport['headers'][] = get_lang('StudentName');
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 }
139 139
 
140 140
 $interbreadcrumb[] = [
141
-    'url' => api_get_path(WEB_CODE_PATH) . 'mySpace/index.php',
141
+    'url' => api_get_path(WEB_CODE_PATH).'mySpace/index.php',
142 142
     'name' => get_lang('MySpace')
143 143
 ];
144 144
 
@@ -148,11 +148,11 @@  discard block
 block discarded – undo
148 148
     $actions = [
149 149
         Display::url(
150 150
             Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), [], ICON_SIZE_MEDIUM),
151
-            api_get_self() . '?' . http_build_query(['export' => 'csv', 'session' => $session->getId()])
151
+            api_get_self().'?'.http_build_query(['export' => 'csv', 'session' => $session->getId()])
152 152
         ),
153 153
         Display::url(
154 154
             Display::return_icon('export_excel.png', get_lang('ExportAsXLS'), [], ICON_SIZE_MEDIUM),
155
-            api_get_self() . '?' . http_build_query(['export' => 'xls', 'session' => $session->getId()])
155
+            api_get_self().'?'.http_build_query(['export' => 'xls', 'session' => $session->getId()])
156 156
         )
157 157
     ];
158 158
 }
Please login to merge, or discard this patch.
main/admin/teacher_time_report_by_session.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 $cidReset = true;
9 9
 
10 10
 require_once '../inc/global.inc.php';
11
-require_once api_get_path(SYS_CODE_PATH) . 'work/work.lib.php';
11
+require_once api_get_path(SYS_CODE_PATH).'work/work.lib.php';
12 12
 
13 13
 api_protect_admin_script();
14 14
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
 if (isset($_GET['export']) && $session && $data) {
95 95
     $dataToExport = [];
96
-    $fileName = get_lang('TeacherTimeReport') . ' ' . api_get_local_time();
96
+    $fileName = get_lang('TeacherTimeReport').' '.api_get_local_time();
97 97
 
98 98
     foreach ($data as $row) {
99 99
         $headers = [
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 $this_section = SECTION_PLATFORM_ADMIN;
143 143
 $interbreadcrumb[] = ['url' => 'index.php', 'name' => get_lang('Administration')];
144 144
 $interbreadcrumb[] = [
145
-    'url' => api_get_path(WEB_CODE_PATH) . 'admin/teacher_time_report.php',
145
+    'url' => api_get_path(WEB_CODE_PATH).'admin/teacher_time_report.php',
146 146
     'name' => get_lang('TeacherTimeReport')
147 147
 ];
148 148
 $toolName = get_lang('TeacherTimeReportBySession');
@@ -153,11 +153,11 @@  discard block
 block discarded – undo
153 153
     $actions = [
154 154
         Display::url(
155 155
             Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), [], ICON_SIZE_MEDIUM),
156
-            api_get_self() . '?' . http_build_query(['export' => 'csv', 'session' => $session->getId()])
156
+            api_get_self().'?'.http_build_query(['export' => 'csv', 'session' => $session->getId()])
157 157
         ),
158 158
         Display::url(
159 159
             Display::return_icon('export_excel.png', get_lang('ExportAsXLS'), [], ICON_SIZE_MEDIUM),
160
-            api_get_self() . '?' . http_build_query(['export' => 'xls', 'session' => $session->getId()])
160
+            api_get_self().'?'.http_build_query(['export' => 'xls', 'session' => $session->getId()])
161 161
         )
162 162
     ];
163 163
 }
Please login to merge, or discard this patch.
main/inc/ajax/model.ajax.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@  discard block
 block discarded – undo
11 11
 $action = $_GET['a'];
12 12
 $page = intval($_REQUEST['page']); //page
13 13
 $limit = intval($_REQUEST['rows']); //quantity of rows
14
-$sidx = $_REQUEST['sidx'];         //index (field) to filter
15
-$sord = $_REQUEST['sord'];         //asc or desc
14
+$sidx = $_REQUEST['sidx']; //index (field) to filter
15
+$sord = $_REQUEST['sord']; //asc or desc
16 16
 
17 17
 if (strpos(strtolower($sidx), 'asc') !== false) {
18 18
     $sidx = str_replace(array('asc', ','), '', $sidx);
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
     $sord = 'desc';
25 25
 }
26 26
 
27
-if (!in_array($sord, array('asc','desc'))) {
27
+if (!in_array($sord, array('asc', 'desc'))) {
28 28
     $sord = 'desc';
29 29
 }
30 30
 
@@ -64,19 +64,19 @@  discard block
 block discarded – undo
64 64
 function getWhereClause($col, $oper, $val)
65 65
 {
66 66
     $ops = array(
67
-        'eq' => '=',        //equal
68
-        'ne' => '<>',       //not equal
69
-        'lt' => '<',        //less than
70
-        'le' => '<=',       //less than or equal
71
-        'gt' => '>',        //greater than
72
-        'ge' => '>=',       //greater than or equal
73
-        'bw' => 'LIKE',     //begins with
67
+        'eq' => '=', //equal
68
+        'ne' => '<>', //not equal
69
+        'lt' => '<', //less than
70
+        'le' => '<=', //less than or equal
71
+        'gt' => '>', //greater than
72
+        'ge' => '>=', //greater than or equal
73
+        'bw' => 'LIKE', //begins with
74 74
         'bn' => 'NOT LIKE', //doesn't begin with
75
-        'in' => 'LIKE',     //is in
75
+        'in' => 'LIKE', //is in
76 76
         'ni' => 'NOT LIKE', //is not in
77
-        'ew' => 'LIKE',     //ends with
77
+        'ew' => 'LIKE', //ends with
78 78
         'en' => 'NOT LIKE', //doesn't end with
79
-        'cn' => 'LIKE',     //contains
79
+        'cn' => 'LIKE', //contains
80 80
         'nc' => 'NOT LIKE'  //doesn't contain
81 81
     );
82 82
 
@@ -100,10 +100,10 @@  discard block
 block discarded – undo
100 100
 
101 101
 // If there is no search request sent by jqgrid, $where should be empty
102 102
 $whereCondition = null;
103
-$operation = isset($_REQUEST['oper'])  ? $_REQUEST['oper']  : false;
104
-$exportFormat = isset($_REQUEST['export_format'])  ? $_REQUEST['export_format']  : 'csv';
105
-$searchField = isset($_REQUEST['searchField'])  ? $_REQUEST['searchField']  : false;
106
-$searchOperator = isset($_REQUEST['searchOper'])   ? $_REQUEST['searchOper']   : false;
103
+$operation = isset($_REQUEST['oper']) ? $_REQUEST['oper'] : false;
104
+$exportFormat = isset($_REQUEST['export_format']) ? $_REQUEST['export_format'] : 'csv';
105
+$searchField = isset($_REQUEST['searchField']) ? $_REQUEST['searchField'] : false;
106
+$searchOperator = isset($_REQUEST['searchOper']) ? $_REQUEST['searchOper'] : false;
107 107
 $searchString = isset($_REQUEST['searchString']) ? $_REQUEST['searchString'] : false;
108 108
 $search = isset($_REQUEST['_search']) ? $_REQUEST['_search'] : false;
109 109
 $forceSearch = isset($_REQUEST['_force_search']) ? $_REQUEST['_force_search'] : false;
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
             foreach ($filters->rules as $key => $rule) {
168 168
                 $whereCondition .= getWhereClause($rule->field, $rule->op, $rule->data);
169 169
 
170
-                if ($counter < count($filters->rules) -1) {
170
+                if ($counter < count($filters->rules) - 1) {
171 171
                     $whereCondition .= $filters->groupOp;
172 172
                 }
173 173
                 $counter++;
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 
202 202
         $sessionId = isset($_GET['session_id']) ? intval($_GET['session_id']) : 0;
203 203
         $courseCodeList = array();
204
-        $userIdList  = array();
204
+        $userIdList = array();
205 205
         $sessionIdList = [];
206 206
         $searchByGroups = false;
207 207
         if (api_is_drh()) {
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
 $total_pages = 0;
555 555
 if ($count > 0) {
556 556
     if (!empty($limit)) {
557
-        $total_pages = ceil((float)$count/(float)$limit);
557
+        $total_pages = ceil((float) $count / (float) $limit);
558 558
     }
559 559
 }
560 560
 if ($page > $total_pages) {
@@ -806,7 +806,7 @@  discard block
 block discarded – undo
806 806
         $result = getWorkListStudent($start, $limit, $sidx, $sord, $whereCondition);
807 807
         break;
808 808
     case 'get_work_user_list_all':
809
-        if (isset($_GET['type'])  && $_GET['type'] == 'simple') {
809
+        if (isset($_GET['type']) && $_GET['type'] == 'simple') {
810 810
             $columns = array(
811 811
                 //'type',
812 812
                 'firstname',
@@ -833,18 +833,18 @@  discard block
 block discarded – undo
833 833
         $result = get_work_user_list($start, $limit, $sidx, $sord, $work_id, $whereCondition);
834 834
         break;
835 835
     case 'get_work_user_list_others':
836
-        if (isset($_GET['type'])  && $_GET['type'] == 'simple') {
836
+        if (isset($_GET['type']) && $_GET['type'] == 'simple') {
837 837
             $columns = array(
838
-                'type', 'firstname', 'lastname',  'title', 'qualification', 'sent_date', 'qualificator_id', 'actions'
838
+                'type', 'firstname', 'lastname', 'title', 'qualification', 'sent_date', 'qualificator_id', 'actions'
839 839
             );
840 840
         } else {
841
-            $columns = array('type', 'firstname', 'lastname',  'title', 'sent_date', 'actions');
841
+            $columns = array('type', 'firstname', 'lastname', 'title', 'sent_date', 'actions');
842 842
         }
843 843
         $whereCondition .= " AND u.user_id <> ".api_get_user_id();
844 844
         $result = get_work_user_list($start, $limit, $sidx, $sord, $work_id, $whereCondition);
845 845
         break;
846 846
     case 'get_work_user_list':
847
-        if (isset($_GET['type'])  && $_GET['type'] == 'simple') {
847
+        if (isset($_GET['type']) && $_GET['type'] == 'simple') {
848 848
             $columns = array(
849 849
                 'type', 'title', 'qualification', 'sent_date', 'qualificator_id', 'actions'
850 850
             );
@@ -872,10 +872,10 @@  discard block
 block discarded – undo
872 872
     case 'get_exercise_results':
873 873
         $course = api_get_course_info();
874 874
         // Used inside ExerciseLib::get_exam_results_data()
875
-        $documentPath = api_get_path(SYS_COURSE_PATH) . $course['path'] . "/document";
875
+        $documentPath = api_get_path(SYS_COURSE_PATH).$course['path']."/document";
876 876
         if ($is_allowedToEdit || api_is_student_boss()) {
877 877
             $columns = array(
878
-                'firstname', 'lastname', 'username', 'group_name', 'exe_duration', 'start_date', 'exe_date', 'score',  'user_ip', 'status', 'lp', 'actions'
878
+                'firstname', 'lastname', 'username', 'group_name', 'exe_duration', 'start_date', 'exe_date', 'score', 'user_ip', 'status', 'lp', 'actions'
879 879
             );
880 880
             $officialCodeInList = api_get_setting('show_official_code_exercise_result_list');
881 881
             if ($officialCodeInList === 'true') {
@@ -886,11 +886,11 @@  discard block
 block discarded – undo
886 886
         break;
887 887
     case 'get_hotpotatoes_exercise_results':
888 888
         $course = api_get_course_info();
889
-        $documentPath = api_get_path(SYS_COURSE_PATH) . $course['path'] . "/document";
889
+        $documentPath = api_get_path(SYS_COURSE_PATH).$course['path']."/document";
890 890
         if (api_is_allowed_to_edit()) {
891
-            $columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_date',  'score', 'actions');
891
+            $columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_date', 'score', 'actions');
892 892
         } else {
893
-            $columns = array('exe_date',  'score', 'actions');
893
+            $columns = array('exe_date', 'score', 'actions');
894 894
         }
895 895
         $result = ExerciseLib::get_exam_results_hotpotatoes_data($start, $limit, $sidx, $sord, $hotpot_path, $whereCondition);
896 896
         break;
@@ -916,12 +916,12 @@  discard block
 block discarded – undo
916 916
         break;
917 917
     case 'get_hotpotatoes_exercise_results':
918 918
         $course = api_get_course_info();
919
-        $documentPath = api_get_path(SYS_COURSE_PATH) . $course['path'] . "/document";
919
+        $documentPath = api_get_path(SYS_COURSE_PATH).$course['path']."/document";
920 920
 
921 921
         if (api_is_allowed_to_edit(null, true) || api_is_drh()) {
922
-            $columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_date',  'score', 'actions');
922
+            $columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_date', 'score', 'actions');
923 923
         } else {
924
-            $columns = array('exe_date',  'score', 'actions');
924
+            $columns = array('exe_date', 'score', 'actions');
925 925
         }
926 926
         $result = ExerciseLib::get_exam_results_hotpotatoes_data($start, $limit, $sidx, $sord, $hotpot_path, $whereCondition);
927 927
         break;
@@ -950,7 +950,7 @@  discard block
 block discarded – undo
950 950
             );
951 951
         }
952 952
 
953
-        $columns =  array(
953
+        $columns = array(
954 954
             'name',
955 955
             'date',
956 956
             'course_per_session',
@@ -986,11 +986,11 @@  discard block
 block discarded – undo
986 986
                 $detailButtons = [];
987 987
                 $detailButtons[] = Display::url(
988 988
                     Display::return_icon('works.png', get_lang('Works')),
989
-                    api_get_path(WEB_CODE_PATH) . 'mySpace/works_in_session_report.php'
989
+                    api_get_path(WEB_CODE_PATH).'mySpace/works_in_session_report.php'
990 990
                 );
991 991
                 $detailButtons[] = Display::url(
992 992
                     Display::return_icon('2rightarrow.png'),
993
-                    api_get_path(WEB_CODE_PATH) . 'mySpace/course.php?session_id=' . $session['id']
993
+                    api_get_path(WEB_CODE_PATH).'mySpace/course.php?session_id='.$session['id']
994 994
                 );
995 995
 
996 996
                 $result[] = array(
@@ -1306,7 +1306,7 @@  discard block
 block discarded – undo
1306 1306
         $result = $new_result;
1307 1307
         break;
1308 1308
     case 'get_gradebooks':
1309
-        $columns = array('name', 'certificates','skills', 'actions', 'has_certificates');
1309
+        $columns = array('name', 'certificates', 'skills', 'actions', 'has_certificates');
1310 1310
         if (!in_array($sidx, $columns)) {
1311 1311
             $sidx = 'name';
1312 1312
         }
@@ -1476,7 +1476,7 @@  discard block
 block discarded – undo
1476 1476
                     if (!empty($exercises[$cnt - 4]['title'])) {
1477 1477
                         $title = ucwords(strtolower(trim($exercises[$cnt - 4]['title'])));
1478 1478
                     }
1479
-                    $columns[] = 'exer' . $i;
1479
+                    $columns[] = 'exer'.$i;
1480 1480
                     $column_names[] = $title;
1481 1481
                     $i++;
1482 1482
                     break;
@@ -1509,7 +1509,7 @@  discard block
 block discarded – undo
1509 1509
             $sessionInfo = SessionManager::fetch($listUserSess[$user['user_id']]['id_session']);
1510 1510
             $result[$i]['session'] = $sessionInfo['name'];
1511 1511
             $result[$i]['username'] = $user['username'];
1512
-            $result[$i]['name'] = $user['lastname'] . " " . $user['firstname'];
1512
+            $result[$i]['name'] = $user['lastname']." ".$user['firstname'];
1513 1513
             $j = 1;
1514 1514
             $finalScore = 0;
1515 1515
             foreach ($quizIds as $quizID) {
@@ -1517,7 +1517,7 @@  discard block
 block discarded – undo
1517 1517
                 if (!empty($arrGrade [$user['user_id']][$quizID]) || $arrGrade [$user['user_id']][$quizID] == 0) {
1518 1518
                     $finalScore += $grade = $arrGrade [$user['user_id']][$quizID];
1519 1519
                 }
1520
-                $result[$i]['exer' . $j] = $grade;
1520
+                $result[$i]['exer'.$j] = $grade;
1521 1521
                 $j++;
1522 1522
             }
1523 1523
 
@@ -1689,9 +1689,9 @@  discard block
 block discarded – undo
1689 1689
         foreach ($result as $row) {
1690 1690
             // if results tab give not id, set id to $i otherwise id="null" for all <tr> of the jqgrid - ref #4235
1691 1691
             if (!isset($row['id']) || isset($row['id']) && $row['id'] == '') {
1692
-                $response->rows[$i]['id']= $i;
1692
+                $response->rows[$i]['id'] = $i;
1693 1693
             } else {
1694
-                $response->rows[$i]['id']= $row['id'];
1694
+                $response->rows[$i]['id'] = $row['id'];
1695 1695
             }
1696 1696
             $array = array();
1697 1697
             foreach ($columns as $col) {
@@ -1701,7 +1701,7 @@  discard block
 block discarded – undo
1701 1701
                     $array[] = isset($row[$col]) ? Security::remove_XSS($row[$col]) : '';
1702 1702
                 }
1703 1703
             }
1704
-            $response->rows[$i]['cell']=$array;
1704
+            $response->rows[$i]['cell'] = $array;
1705 1705
             $i++;
1706 1706
         }
1707 1707
     }
Please login to merge, or discard this patch.