@@ -48,8 +48,9 @@ discard block |
||
48 | 48 | |
49 | 49 | return $message; |
50 | 50 | |
51 | - } else |
|
52 | - return get_lang('InvalidId'); |
|
51 | + } else { |
|
52 | + return get_lang('InvalidId'); |
|
53 | + } |
|
53 | 54 | |
54 | 55 | } |
55 | 56 | |
@@ -92,8 +93,9 @@ discard block |
||
92 | 93 | $result = Database::fetch_row($sql_result); |
93 | 94 | return (htmlcode) ? html_entity_decode($result[0]) : $result[0]; |
94 | 95 | |
95 | - }else |
|
96 | - return get_lang('InvalidId'); |
|
96 | + } else { |
|
97 | + return get_lang('InvalidId'); |
|
98 | + } |
|
97 | 99 | |
98 | 100 | |
99 | 101 | } |
@@ -118,8 +120,9 @@ discard block |
||
118 | 120 | |
119 | 121 | return $message; |
120 | 122 | |
121 | - } else |
|
122 | - return get_lang('InvalidId'); |
|
123 | + } else { |
|
124 | + return get_lang('InvalidId'); |
|
125 | + } |
|
123 | 126 | |
124 | 127 | } |
125 | 128 | |
@@ -164,8 +167,9 @@ discard block |
||
164 | 167 | |
165 | 168 | return (htmlcode) ? html_entity_decode($result[0]) : $result[0]; |
166 | 169 | |
167 | - }else |
|
168 | - return get_lang('InvalidId'); |
|
170 | + } else { |
|
171 | + return get_lang('InvalidId'); |
|
172 | + } |
|
169 | 173 | |
170 | 174 | |
171 | 175 | } |
@@ -199,8 +203,9 @@ discard block |
||
199 | 203 | |
200 | 204 | return $inbox_last_id; |
201 | 205 | |
202 | - } else |
|
203 | - return get_lang('InvalidId'); |
|
206 | + } else { |
|
207 | + return get_lang('InvalidId'); |
|
208 | + } |
|
204 | 209 | |
205 | 210 | } |
206 | 211 |
@@ -17,8 +17,7 @@ discard block |
||
17 | 17 | $webcamname = $params['webcamname']; |
18 | 18 | $webcamdir = $params['webcamdir']; |
19 | 19 | $webcamuserid = $params['webcamuserid']; |
20 | -} |
|
21 | -else { |
|
20 | +} else { |
|
22 | 21 | api_not_allowed(); |
23 | 22 | die(); |
24 | 23 | } |
@@ -58,7 +57,9 @@ discard block |
||
58 | 57 | $webcamname_noex=basename($webcamname, ".jpg"); |
59 | 58 | if (file_exists($saveDir.'/'.$webcamname_noex.'.'.$ext)){ |
60 | 59 | $i = 1; |
61 | - while (file_exists($saveDir.'/'.$webcamname_noex.'_'.$i.'.'.$ext)) $i++; |
|
60 | + while (file_exists($saveDir.'/'.$webcamname_noex.'_'.$i.'.'.$ext)) { |
|
61 | + $i++; |
|
62 | + } |
|
62 | 63 | $webcamname_to_save = $webcamname_noex . '_' . $i . '.'.$ext; |
63 | 64 | $title_to_save = $webcamname_noex . '_' . $i . '.'.$ext; |
64 | 65 | $title_to_save = str_replace('_',' ',$title_to_save); |
@@ -93,10 +93,11 @@ discard block |
||
93 | 93 | |
94 | 94 | $is_certificate_mode = DocumentManager::is_certificate_mode($dir); |
95 | 95 | |
96 | -if (!$is_certificate_mode) |
|
96 | +if (!$is_certificate_mode) { |
|
97 | 97 | $interbreadcrumb[]= array("url" => "./document.php?curdirpath=".urlencode($my_cur_dir_path).'&'.api_get_cidreq(), "name"=> get_lang('Documents')); |
98 | -else |
|
98 | +} else { |
|
99 | 99 | $interbreadcrumb[]= array ('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook')); |
100 | +} |
|
100 | 101 | |
101 | 102 | // Interbreadcrumb for the current directory root path |
102 | 103 | if (empty($document_data['parents'])) { |
@@ -158,8 +159,7 @@ discard block |
||
158 | 159 | @file_put_contents($path_and_file, $crossdomain); |
159 | 160 | } |
160 | 161 | $credentials="true"; |
161 | -} |
|
162 | -else { |
|
162 | +} else { |
|
163 | 163 | $credentials="false"; |
164 | 164 | } |
165 | 165 |
@@ -124,7 +124,9 @@ discard block |
||
124 | 124 | |
125 | 125 | if (file_exists($saveDir.'/'.$filename.'.'.$extension)){ |
126 | 126 | $i = 1; |
127 | - while (file_exists($saveDir.'/'.$filename.'_'.$i.'.'.$extension)) $i++; |
|
127 | + while (file_exists($saveDir.'/'.$filename.'_'.$i.'.'.$extension)) { |
|
128 | + $i++; |
|
129 | + } |
|
128 | 130 | $paintFileName = $filename . '_' . $i . '.'.$extension; |
129 | 131 | $title = $filename . '_' . $i . '.'.$extension; |
130 | 132 | } |
@@ -137,7 +139,7 @@ discard block |
||
137 | 139 | $doc_id = add_document($_course, $relativeUrlPath.'/'.$paintFileName, 'file', filesize($documentPath), $title); |
138 | 140 | api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'DocumentAdded', $_user['user_id'], $groupId, null, null, null, $current_session_id); |
139 | 141 | |
140 | -}elseif($currentTool=='document/editpaint'){ |
|
142 | +} elseif($currentTool=='document/editpaint'){ |
|
141 | 143 | |
142 | 144 | $documentPath = $saveDir.'/'.$paintFileName; |
143 | 145 | //add new document to disk |
@@ -152,7 +154,7 @@ discard block |
||
152 | 154 | $document_id = DocumentManager::get_document_id($_course, $relativeUrlPath.'/'.$paintFileName); |
153 | 155 | update_existing_document($_course, $document_id, filesize($documentPath), null); |
154 | 156 | api_item_property_update($_course, TOOL_DOCUMENT, $document_id, 'DocumentUpdated', $_user['user_id'], $groupId, null, null, null, $current_session_id); |
155 | - }else{ |
|
157 | + } else{ |
|
156 | 158 | //add a new document |
157 | 159 | $doc_id = add_document($_course, $relativeUrlPath.'/'.$paintFileName, 'file', filesize($documentPath), $title); |
158 | 160 | api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'DocumentAdded', $_user['user_id'], $groupId, null, null, null, $current_session_id); |
@@ -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 |