@@ -31,8 +31,7 @@ |
||
31 | 31 | } |
32 | 32 | if ($this->form_type == self :: TYPE_USER_INFO) { |
33 | 33 | $this->build_user_info_form(); |
34 | - } |
|
35 | - elseif ($this->form_type == self :: TYPE_SIMPLE_SEARCH) { |
|
34 | + } elseif ($this->form_type == self :: TYPE_SIMPLE_SEARCH) { |
|
36 | 35 | $this->build_simple_search(); |
37 | 36 | } |
38 | 37 | $this->setDefaults(); |
@@ -674,8 +674,9 @@ |
||
674 | 674 | $scoretotal = $cattotal[0]->calc_score(api_get_user_id()); |
675 | 675 | $scoretotal_display = (isset($scoretotal) ? $scoredisplay->display_score($scoretotal, SCORE_PERCENT) : get_lang('NoResultsAvailable')); |
676 | 676 | $scoreinfo = get_lang('StatsStudent') . ' :<b> ' . $user['complete_name']. '</b><br />'; |
677 | - if ((!$catobj->get_id() == '0') && (!isset($_GET['studentoverview'])) && (!isset($_GET['search']))) |
|
678 | - $scoreinfo.= '<br />' . get_lang('TotalForThisCategory') . ' : <b>' . $scorecourse_display . '</b>'; |
|
677 | + if ((!$catobj->get_id() == '0') && (!isset($_GET['studentoverview'])) && (!isset($_GET['search']))) { |
|
678 | + $scoreinfo.= '<br />' . get_lang('TotalForThisCategory') . ' : <b>' . $scorecourse_display . '</b>'; |
|
679 | + } |
|
679 | 680 | $scoreinfo.= '<br />' . get_lang('Total') . ' : <b>' . $scoretotal_display . '</b>'; |
680 | 681 | Display :: display_normal_message($scoreinfo, false); |
681 | 682 | } |
@@ -256,10 +256,11 @@ |
||
256 | 256 | } |
257 | 257 | |
258 | 258 | // Categories. |
259 | - if (!empty($data_array)) |
|
260 | - foreach ($data_array as $data) { |
|
259 | + if (!empty($data_array)) { |
|
260 | + foreach ($data_array as $data) { |
|
261 | 261 | // list of items inside the gradebook (exercises, lps, forums, etc) |
262 | 262 | $row = array(); |
263 | + } |
|
263 | 264 | /** @var AbstractLink $item */ |
264 | 265 | $item = $mainCategory = $data[0]; |
265 | 266 |
@@ -149,8 +149,9 @@ |
||
149 | 149 | } |
150 | 150 | |
151 | 151 | foreach ($customdisplays as $display) { |
152 | - if (!in_array($display['display'], $key_list)) |
|
153 | - $resource_list[$key][$display['display']] = 0; |
|
152 | + if (!in_array($display['display'], $key_list)) { |
|
153 | + $resource_list[$key][$display['display']] = 0; |
|
154 | + } |
|
154 | 155 | } |
155 | 156 | $i++; |
156 | 157 | } |
@@ -95,8 +95,9 @@ |
||
95 | 95 | $row[] = $data[3]; |
96 | 96 | $row[] = $data[4]; |
97 | 97 | $row[] = $data[5]; |
98 | - if ($scoredisplay->is_custom()) |
|
99 | - $row[] = $data[6]; |
|
98 | + if ($scoredisplay->is_custom()) { |
|
99 | + $row[] = $data[6]; |
|
100 | + } |
|
100 | 101 | $sortable_data[] = $row; |
101 | 102 | } |
102 | 103 | } |
@@ -235,21 +235,27 @@ discard block |
||
235 | 235 | $paramcount ++; |
236 | 236 | } |
237 | 237 | if (isset ($type)) { |
238 | - if ($paramcount != 0) $sql .= ' AND'; |
|
239 | - else $sql .= ' WHERE'; |
|
238 | + if ($paramcount != 0) { |
|
239 | + $sql .= ' AND'; |
|
240 | + } else { |
|
241 | + $sql .= ' WHERE'; |
|
242 | + } |
|
240 | 243 | $sql .= ' type = '.intval($type); |
241 | 244 | $paramcount ++; |
242 | 245 | } |
243 | 246 | if (isset ($ref_id)) { |
244 | - if ($paramcount != 0) $sql .= ' AND'; |
|
245 | - else $sql .= ' WHERE'; |
|
247 | + if ($paramcount != 0) { |
|
248 | + $sql .= ' AND'; |
|
249 | + } else { |
|
250 | + $sql .= ' WHERE'; |
|
251 | + } |
|
246 | 252 | $sql .= ' ref_id = '.intval($ref_id); |
247 | 253 | $paramcount ++; |
248 | 254 | } |
249 | 255 | if (isset ($user_id)) { |
250 | 256 | if ($paramcount != 0) { |
251 | 257 | $sql .= ' AND'; |
252 | - }else { |
|
258 | + } else { |
|
253 | 259 | $sql .= ' WHERE'; |
254 | 260 | } |
255 | 261 | $sql .= ' user_id = '.intval($user_id); |
@@ -267,7 +273,7 @@ discard block |
||
267 | 273 | if (isset ($category_id)) { |
268 | 274 | if ($paramcount != 0) { |
269 | 275 | $sql .= ' AND'; |
270 | - }else { |
|
276 | + } else { |
|
271 | 277 | $sql .= ' WHERE'; |
272 | 278 | } |
273 | 279 | $sql .= ' category_id = '.intval($category_id); |
@@ -1179,7 +1179,7 @@ |
||
1179 | 1179 | cu.status = '.COURSEMANAGER.' |
1180 | 1180 | )'; |
1181 | 1181 | } |
1182 | - }elseif (api_is_platform_admin()) { |
|
1182 | + } elseif (api_is_platform_admin()) { |
|
1183 | 1183 | if (isset($session_id) && $session_id!=0) { |
1184 | 1184 | $sql.=' AND session_id='.intval($session_id); |
1185 | 1185 | } else { |
@@ -29,8 +29,9 @@ discard block |
||
29 | 29 | public function get_not_created_links() |
30 | 30 | { |
31 | 31 | return false; |
32 | - if (empty($this->course_code)) |
|
33 | - die('Error in get_not_created_links() : course code not set'); |
|
32 | + if (empty($this->course_code)) { |
|
33 | + die('Error in get_not_created_links() : course code not set'); |
|
34 | + } |
|
34 | 35 | |
35 | 36 | $tbl_grade_links = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINK); |
36 | 37 | |
@@ -57,8 +58,9 @@ discard block |
||
57 | 58 | */ |
58 | 59 | public function get_all_links() |
59 | 60 | { |
60 | - if (empty($this->course_code)) |
|
61 | - die('Error in get_not_created_links() : course code not set'); |
|
61 | + if (empty($this->course_code)) { |
|
62 | + die('Error in get_not_created_links() : course code not set'); |
|
63 | + } |
|
62 | 64 | |
63 | 65 | $session_id = api_get_session_id(); |
64 | 66 | if (empty($session_id)) { |
@@ -111,8 +113,9 @@ discard block |
||
111 | 113 | lp_id = ".$this->get_ref_id()." AND |
112 | 114 | session_id = $session_id "; |
113 | 115 | |
114 | - if (isset($stud_id)) |
|
115 | - $sql .= ' AND user_id = '.intval($stud_id); |
|
116 | + if (isset($stud_id)) { |
|
117 | + $sql .= ' AND user_id = '.intval($stud_id); |
|
118 | + } |
|
116 | 119 | |
117 | 120 | // order by id, that way the student's first attempt is accessed first |
118 | 121 | $sql .= ' ORDER BY view_count DESC'; |
@@ -122,8 +125,9 @@ discard block |
||
122 | 125 | if (isset($stud_id)) { |
123 | 126 | if ($data = Database::fetch_array($scores)) { |
124 | 127 | return array ($data['progress'], 100); |
125 | - } else |
|
126 | - return null; |
|
128 | + } else { |
|
129 | + return null; |
|
130 | + } |
|
127 | 131 | } else { |
128 | 132 | // all students -> get average |
129 | 133 | $students = array(); // user list, needed to make sure we only |
@@ -152,10 +152,11 @@ |
||
152 | 152 | $paramcount ++; |
153 | 153 | } |
154 | 154 | if (!empty($user_id)) { |
155 | - if ($paramcount != 0) |
|
156 | - $sql .= ' AND'; |
|
157 | - else |
|
158 | - $sql .= ' WHERE'; |
|
155 | + if ($paramcount != 0) { |
|
156 | + $sql .= ' AND'; |
|
157 | + } else { |
|
158 | + $sql .= ' WHERE'; |
|
159 | + } |
|
159 | 160 | $sql .= ' gr.user_id = ' . intval($user_id); |
160 | 161 | $paramcount ++; |
161 | 162 | } |