@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | GradebookUtils::block_students(); |
228 | 228 | if (isset ($_GET['set_visible'])) { |
229 | 229 | $visibility_command= 1; |
230 | - }else { |
|
230 | + } else { |
|
231 | 231 | $visibility_command= 0; |
232 | 232 | } |
233 | 233 | $link= LinkFactory :: load($_GET['visiblelink']); |
@@ -281,8 +281,7 @@ discard block |
||
281 | 281 | if ($number_of_selected_items == '0') { |
282 | 282 | $warning_message = get_lang('NoItemsSelected'); |
283 | 283 | $filter_warning_msg = false; |
284 | - } |
|
285 | - else { |
|
284 | + } else { |
|
286 | 285 | switch ($_POST['action']) { |
287 | 286 | case 'deleted' : |
288 | 287 | $number_of_deleted_categories= 0; |
@@ -39,7 +39,9 @@ |
||
39 | 39 | $res->set_evaluation_id($values['evaluation_id']); |
40 | 40 | $res->set_user_id(key($scores)); |
41 | 41 | //if no scores are given, don't set the score |
42 | - if ((!empty ($row)) || ($row == '0')) $res->set_score($row); |
|
42 | + if ((!empty ($row)) || ($row == '0')) { |
|
43 | + $res->set_score($row); |
|
44 | + } |
|
43 | 45 | $res->add(); |
44 | 46 | next($scores); |
45 | 47 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | // sort users array |
96 | 96 | if ($sorting & self :: UDG_SORT_TYPE) { |
97 | 97 | usort($allitems, array('UserDataGenerator', 'sort_by_type')); |
98 | - }elseif ($sorting & self :: UDG_SORT_NAME) { |
|
98 | + } elseif ($sorting & self :: UDG_SORT_NAME) { |
|
99 | 99 | usort($allitems, array('UserDataGenerator', 'sort_by_name')); |
100 | 100 | } elseif ($sorting & self :: UDG_SORT_COURSE) { |
101 | 101 | usort($allitems, array('UserDataGenerator', 'sort_by_course')); |
@@ -148,8 +148,9 @@ discard block |
||
148 | 148 | $row[] = $this->build_category_name($item); |
149 | 149 | $row[] = $this->build_average_column($item, $ignore_score_color); |
150 | 150 | $row[] = $this->build_result_column($item, $ignore_score_color); |
151 | - if ($scoredisplay->is_custom()) |
|
152 | - $row[] = $this->build_mask_column($item, $ignore_score_color); |
|
151 | + if ($scoredisplay->is_custom()) { |
|
152 | + $row[] = $this->build_mask_column($item, $ignore_score_color); |
|
153 | + } |
|
153 | 154 | $data[] = $row; |
154 | 155 | } |
155 | 156 | return $data; |
@@ -362,13 +363,14 @@ discard block |
||
362 | 363 | if (isset ($this->categorycache) |
363 | 364 | && isset ($this->categorycache[$category_id])) { |
364 | 365 | return $this->categorycache[$category_id]; |
365 | - }else { |
|
366 | + } else { |
|
366 | 367 | $cat = Category::load($category_id); |
367 | 368 | if (isset($cat)){ |
368 | 369 | $this->categorycache[$category_id] = $cat[0]; |
369 | 370 | return $cat[0]; |
370 | - }else |
|
371 | - return null; |
|
371 | + } else { |
|
372 | + return null; |
|
373 | + } |
|
372 | 374 | } |
373 | 375 | } |
374 | 376 |
@@ -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); |