@@ -15,7 +15,7 @@ |
||
15 | 15 | Display::return_message(get_lang('SkillNotFound'), 'error') |
16 | 16 | ); |
17 | 17 | |
18 | - header('Location: ' . api_get_path(WEB_PATH)); |
|
18 | + header('Location: '.api_get_path(WEB_PATH)); |
|
19 | 19 | exit; |
20 | 20 | } |
21 | 21 |
@@ -22,7 +22,7 @@ |
||
22 | 22 | $this_section = SECTION_REPORTS; |
23 | 23 | |
24 | 24 | // setting the name of the tool |
25 | -$tool_name=get_lang('Reports'); |
|
25 | +$tool_name = get_lang('Reports'); |
|
26 | 26 | |
27 | 27 | // Displaying the header |
28 | 28 | foreach (array('jquery.ba-bbq.min.js', 'jquery.validate.js', 'jquery.form.js', 'jquery.form.wizard.js', 'jquery.dataTables.min.js') as $js) |
@@ -4,20 +4,20 @@ discard block |
||
4 | 4 | function multiquery_query($array) { |
5 | 5 | $result = array(); |
6 | 6 | $field = 0; |
7 | - for ($i = 0; $i <sizeof($array); $i++) { |
|
7 | + for ($i = 0; $i < sizeof($array); $i++) { |
|
8 | 8 | // mysql handler |
9 | 9 | $result[$i]['mysql'] = mysql_query($array[$i]); |
10 | 10 | |
11 | - if (! $result[$i]['mysql']) |
|
11 | + if (!$result[$i]['mysql']) |
|
12 | 12 | die("error in query $i : ".$array[$i]); |
13 | 13 | |
14 | 14 | // fields |
15 | 15 | $result[$i]['num_fields'] = mysql_num_fields($result[$i]['mysql']); |
16 | 16 | for ($j = 0; $j < $result[$i]['num_fields']; $j++) { |
17 | 17 | $name = mysql_field_name($result[$i]['mysql'], $j); |
18 | - $result['field'][$field]['query']=$i; |
|
19 | - $result['field'][$field]['name']=$name; |
|
20 | - $result['field'][$field]['id']=$j; |
|
18 | + $result['field'][$field]['query'] = $i; |
|
19 | + $result['field'][$field]['name'] = $name; |
|
20 | + $result['field'][$field]['id'] = $j; |
|
21 | 21 | $result['field_assoc'][$name][$field]; |
22 | 22 | $field++; |
23 | 23 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | $result['num_queries'] = sizeof($array); |
26 | 26 | // rows |
27 | 27 | $numberOfResult = mysql_num_rows($result[0]['mysql']); |
28 | - for ($i = 1; $i <$result['num_queries']; $i++) |
|
28 | + for ($i = 1; $i < $result['num_queries']; $i++) |
|
29 | 29 | if ($numberOfResult != mysql_num_rows($result[$i]['mysql'])) |
30 | 30 | die("wrong number of row: $numberOfResult vs ". |
31 | 31 | mysql_num_rows($result[$i]['mysql'])." on query $i"); |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$reports_modules['quiz'] = array (); |
|
3 | +$reports_modules['quiz'] = array(); |
|
4 | 4 | |
5 | 5 | |
6 | 6 | function reports_modules_quiz_init() { |
@@ -28,6 +28,6 @@ discard block |
||
28 | 28 | REPORTS_PROGRESS_COMPLETED.' as progress, '. |
29 | 29 | 'exe_duration as time, exe_date as ts from '. |
30 | 30 | Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES). |
31 | - ' where c_id = ' . $courseId . |
|
31 | + ' where c_id = '.$courseId. |
|
32 | 32 | ' and exe_exo_id='.$quiz['child_id']); |
33 | 33 | } |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$reports_modules['scorm'] = array (); |
|
3 | +$reports_modules['scorm'] = array(); |
|
4 | 4 | |
5 | 5 | |
6 | 6 | function reports_modules_scorm_init() { |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$reports_modules['course'] = array (); |
|
3 | +$reports_modules['course'] = array(); |
|
4 | 4 | |
5 | 5 | |
6 | 6 | function reports_modules_course_init() { |
@@ -24,6 +24,6 @@ discard block |
||
24 | 24 | 'NULL as progress, '. |
25 | 25 | '(sum(logout_course_date) - sum(login_course_date)) as time, null as ts from '. |
26 | 26 | Database::get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS). |
27 | - ' where c_id = ' . $course['real_id'] . |
|
27 | + ' where c_id = '.$course['real_id']. |
|
28 | 28 | ' group by user_id'); |
29 | 29 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $this_section = SECTION_REPORTS; |
25 | 25 | |
26 | 26 | // setting the name of the tool |
27 | -$tool_name=get_lang('Reports'); |
|
27 | +$tool_name = get_lang('Reports'); |
|
28 | 28 | |
29 | 29 | // loading templates |
30 | 30 | reports_loadTemplates(); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | // outputing a link to csv file instead of outputing csv data directly |
71 | -if ($_REQUEST['format'] == 'csv') { |
|
71 | +if ($_REQUEST['format'] == 'csv') { |
|
72 | 72 | // converting post vars to get uri |
73 | 73 | $params = ''; |
74 | 74 | $kv = array(); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | |
97 | 97 | if (is_array($reports_template[$_REQUEST['type']])) { |
98 | 98 | $query = $reports_template[$_REQUEST['type']]['getSQL'](); |
99 | - if (! is_array($query)) |
|
99 | + if (!is_array($query)) |
|
100 | 100 | $query = array($query); |
101 | 101 | if ($_REQUEST['format'] == 'sql') |
102 | 102 | die(var_export($query, true)); |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $columns = array(); |
151 | 151 | $columns_islink = array(); |
152 | 152 | echo '<thead><tr>'; |
153 | - for ($i=0; $i < $nfields; $i++) { |
|
153 | + for ($i = 0; $i < $nfields; $i++) { |
|
154 | 154 | $columns[$i] = multiquery_field_name($result, $i); |
155 | 155 | if (substr($columns[$i], -5, 5) != '_link') { |
156 | 156 | $column_islink[$i] = false; |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | // checking resolving link column id |
163 | 163 | $columns_flip = array_flip($columns); |
164 | 164 | $columns_link = array(); |
165 | - for ($i=0; $i < $nfields; $i++) |
|
165 | + for ($i = 0; $i < $nfields; $i++) |
|
166 | 166 | if ($column_islink[$i] == false && array_key_exists($columns[$i].'_link', $columns_flip)) |
167 | 167 | $columns_link[$i] = $columns_flip[$columns[$i].'_link']; |
168 | 168 | else |
@@ -170,10 +170,10 @@ discard block |
||
170 | 170 | echo '</tr></thead><tbody>'; |
171 | 171 | while ($row = multiquery_fetch_row($result)) { |
172 | 172 | echo '<tr>'; |
173 | - for ($i = 0; $i<$nfields; $i++) |
|
174 | - if (!$columns_islink[$i]){ // ignore links |
|
173 | + for ($i = 0; $i < $nfields; $i++) |
|
174 | + if (!$columns_islink[$i]) { // ignore links |
|
175 | 175 | if ($columns_link[$i] != '') // link is defined |
176 | - if (substr($columns_link[$i],0,10) == 'javascript') { |
|
176 | + if (substr($columns_link[$i], 0, 10) == 'javascript') { |
|
177 | 177 | echo '<td><a href="#" onclick="'.$row[$columns_link[$i]].'">'.$row[$i].'</a></td>'; |
178 | 178 | } |
179 | 179 | else { |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | $nfields = multiquery_num_fields($result); |
202 | 202 | $columns = array(); |
203 | 203 | $columns_islink = array(); |
204 | - for ($i=0; $i < $nfields; $i++) { |
|
204 | + for ($i = 0; $i < $nfields; $i++) { |
|
205 | 205 | $columns[$i] = multiquery_field_name($result, $i); |
206 | 206 | if (substr($columns[$i], -5, 5) != '_link') { |
207 | 207 | $column_islink[$i] = false; |
@@ -212,16 +212,16 @@ discard block |
||
212 | 212 | |
213 | 213 | echo "\n"; |
214 | 214 | while ($row = multiquery_fetch_row($result)) { |
215 | - for ($i = 0; $i<$nfields; $i++) |
|
215 | + for ($i = 0; $i < $nfields; $i++) |
|
216 | 216 | if (!$columns_islink[$i]) // ignore links |
217 | - echo csv_escaping($row[$i]).','; // fixme |
|
217 | + echo csv_escaping($row[$i]).','; // fixme |
|
218 | 218 | echo "\n"; |
219 | 219 | } |
220 | 220 | } else die(get_lang('UnknownFormat')); |
221 | 221 | |
222 | 222 | function csv_escaping($value, $csv_separator = ',') { |
223 | - $value = str_replace('"','""',$value); |
|
224 | - if (strpos($value, '""') or strpos($value, $csv_separator) or $value != trim($value) ) { |
|
223 | + $value = str_replace('"', '""', $value); |
|
224 | + if (strpos($value, '""') or strpos($value, $csv_separator) or $value != trim($value)) { |
|
225 | 225 | $value = '"'.$value.'"'; |
226 | 226 | } |
227 | 227 | return $value; |
@@ -34,11 +34,11 @@ discard block |
||
34 | 34 | } |
35 | 35 | |
36 | 36 | $teachers = CourseManager::get_teacher_list_from_course_code($course_code); |
37 | - $teacher_list = array(); |
|
37 | + $teacher_list = array(); |
|
38 | 38 | |
39 | 39 | if (!empty($teachers)) { |
40 | - foreach($teachers as $teacher) { |
|
41 | - $teacher_list[]= $teacher['firstname'].' '.$teacher['lastname']; |
|
40 | + foreach ($teachers as $teacher) { |
|
41 | + $teacher_list[] = $teacher['firstname'].' '.$teacher['lastname']; |
|
42 | 42 | } |
43 | 43 | } |
44 | 44 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $students[] = $student['user_id']; |
55 | 55 | } |
56 | 56 | |
57 | - $t_lp = Database :: get_course_table(TABLE_LP_MAIN); |
|
57 | + $t_lp = Database :: get_course_table(TABLE_LP_MAIN); |
|
58 | 58 | $sql_lp = "SELECT lp.name, lp.id FROM $t_lp lp |
59 | 59 | WHERE c_id = $course_id AND lp.session_id = 0"; |
60 | 60 | $rs_lp = Database::query($sql_lp); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | ); |
68 | 68 | |
69 | 69 | $total_tools = 0; |
70 | - foreach($total_tools_list as $tool) { |
|
70 | + foreach ($total_tools_list as $tool) { |
|
71 | 71 | $total_tools += $tool['count_access_tool']; |
72 | 72 | } |
73 | 73 | |
@@ -93,16 +93,16 @@ discard block |
||
93 | 93 | if (!empty($students)) { |
94 | 94 | foreach ($students as $student_id) { |
95 | 95 | $avg_student_progress = Tracking::get_avg_student_progress($student_id, $course_code, array($lp_id), $session_id); |
96 | - $myavg_temp = Tracking::get_avg_student_score($student_id, $course_code, array($lp_id), $session_id); |
|
96 | + $myavg_temp = Tracking::get_avg_student_score($student_id, $course_code, array($lp_id), $session_id); |
|
97 | 97 | $avg_progress_in_course = Tracking::get_avg_student_progress($student_id, $course_code, array($lp_id), $session_id); |
98 | 98 | |
99 | 99 | if (intval($avg_progress_in_course) == 100) { |
100 | 100 | $count_students_complete_all_activities++; |
101 | 101 | } |
102 | 102 | if (intval($avg_progress_in_course) > 0 && intval($avg_progress_in_course) <= 50) { |
103 | - $count_students_complete_all_activities_at_50 ++; |
|
103 | + $count_students_complete_all_activities_at_50++; |
|
104 | 104 | } |
105 | - $total_average_progress +=$avg_progress_in_course; |
|
105 | + $total_average_progress += $avg_progress_in_course; |
|
106 | 106 | |
107 | 107 | $time_spent = Tracking::get_time_spent_on_the_course($student_id, $course_id, $session_id); |
108 | 108 | $total_time_spent += $time_spent; |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | ORDER BY item_type"; |
140 | 140 | $res_lpi = Database::query($sql_lpi); |
141 | 141 | while ($row_lpi = Database::fetch_array($res_lpi)) { |
142 | - switch($row_lpi['item_type']) { |
|
142 | + switch ($row_lpi['item_type']) { |
|
143 | 143 | case 'document': |
144 | 144 | $array[$i]['learnpath_docs']++; |
145 | 145 | break; |
@@ -171,10 +171,10 @@ discard block |
||
171 | 171 | |
172 | 172 | if (!empty($student_count)) { |
173 | 173 | $array[$i]['count_students_accessing'] = $count_students_accessing; |
174 | - $array[$i]['count_students_accessing_percentage'] = round($count_students_accessing / $student_count *100 , 0); |
|
174 | + $array[$i]['count_students_accessing_percentage'] = round($count_students_accessing / $student_count * 100, 0); |
|
175 | 175 | $array[$i]['count_students_complete_all_activities_at_50'] = $count_students_complete_all_activities; |
176 | - $array[$i]['count_students_complete_all_activities'] = round($count_students_complete_all_activities / $student_count *100 , 0);; |
|
177 | - $array[$i]['average_percentage_activities_completed_per_student'] = round($count_students_complete_all_activities/$student_count*100,2); |
|
176 | + $array[$i]['count_students_complete_all_activities'] = round($count_students_complete_all_activities / $student_count * 100, 0); ; |
|
177 | + $array[$i]['average_percentage_activities_completed_per_student'] = round($count_students_complete_all_activities / $student_count * 100, 2); |
|
178 | 178 | $array[$i]['total_time_spent'] = 0; |
179 | 179 | $array[$i]['average_time_spent_per_student'] = 0; |
180 | 180 | |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | exit; |
242 | 242 | } |
243 | 243 | |
244 | -$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('MySpace')); |
|
244 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('MySpace')); |
|
245 | 245 | |
246 | 246 | Display::display_header(get_lang('CurrentCourses')); |
247 | 247 |
@@ -16,14 +16,14 @@ |
||
16 | 16 | $this_section = SECTION_TRACKING; |
17 | 17 | |
18 | 18 | api_block_anonymous_users(); |
19 | -$interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('MySpace')); |
|
19 | +$interbreadcrumb[] = array("url" => "index.php", "name" => get_lang('MySpace')); |
|
20 | 20 | Display :: display_header($nameTools); |
21 | 21 | |
22 | 22 | // Database Table Definitions |
23 | -$tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE); |
|
24 | -$tbl_user = Database :: get_main_table(TABLE_MAIN_USER); |
|
23 | +$tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE); |
|
24 | +$tbl_user = Database :: get_main_table(TABLE_MAIN_USER); |
|
25 | 25 | $tbl_session_course = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE); |
26 | -$tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION); |
|
26 | +$tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION); |
|
27 | 27 | $tbl_track_exercice = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES); |
28 | 28 | |
29 | 29 | /* |