@@ -48,7 +48,9 @@ discard block |
||
48 | 48 | foreach ($dashboard_blocks as $block) { |
49 | 49 | |
50 | 50 | // display only user blocks |
51 | - if (!in_array($block['id'], $user_blocks_id)) continue; |
|
51 | + if (!in_array($block['id'], $user_blocks_id)) { |
|
52 | + continue; |
|
53 | + } |
|
52 | 54 | |
53 | 55 | $path = $block['path']; |
54 | 56 | $controller_class = $block['controller']; |
@@ -61,7 +63,9 @@ discard block |
||
61 | 63 | // check if user is allowed to see the block |
62 | 64 | if (method_exists($obj, 'is_block_visible_for_user')) { |
63 | 65 | $is_block_visible_for_user = $obj->is_block_visible_for_user($user_id); |
64 | - if (!$is_block_visible_for_user) continue; |
|
66 | + if (!$is_block_visible_for_user) { |
|
67 | + continue; |
|
68 | + } |
|
65 | 69 | } |
66 | 70 | |
67 | 71 | $data_block[$path] = $obj->get_block(); |
@@ -40,7 +40,9 @@ |
||
40 | 40 | //if the rewrite rule asks for a directory, we redirect to the course view |
41 | 41 | if (is_dir($full_file_name)) { |
42 | 42 | //remove last slash if present |
43 | - while ($doc_url{$dul = strlen($doc_url)-1}=='/') $doc_url = substr($doc_url,0,$dul); |
|
43 | + while ($doc_url{$dul = strlen($doc_url)-1}=='/') { |
|
44 | + $doc_url = substr($doc_url,0,$dul); |
|
45 | + } |
|
44 | 46 | //create the path |
45 | 47 | $document_explorer = api_get_path(WEB_COURSE_PATH).api_get_course_path(); // home course path |
46 | 48 | //redirect |
@@ -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 | } |
@@ -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 | } |
@@ -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 |