@@ -72,6 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | /** |
74 | 74 | * Get actual array data |
75 | + * @param integer $count |
|
75 | 76 | * @return array 2-dimensional array - each array contains the elements: |
76 | 77 | * 0: eval/link object |
77 | 78 | * 1: item name |
@@ -285,7 +286,7 @@ discard block |
||
285 | 286 | |
286 | 287 | /** |
287 | 288 | * @param $item |
288 | - * @param $ignore_score_color |
|
289 | + * @param boolean $ignore_score_color |
|
289 | 290 | * @return string |
290 | 291 | */ |
291 | 292 | private function build_average_column($item, $ignore_score_color) |
@@ -306,7 +307,7 @@ discard block |
||
306 | 307 | |
307 | 308 | /** |
308 | 309 | * @param $item |
309 | - * @param $ignore_score_color |
|
310 | + * @param boolean $ignore_score_color |
|
310 | 311 | * @return string |
311 | 312 | */ |
312 | 313 | private function build_result_column($item, $ignore_score_color) |
@@ -323,7 +324,7 @@ discard block |
||
323 | 324 | |
324 | 325 | /** |
325 | 326 | * @param $item |
326 | - * @param $ignore_score_color |
|
327 | + * @param boolean $ignore_score_color |
|
327 | 328 | * @return string |
328 | 329 | */ |
329 | 330 | private function build_mask_column($item, $ignore_score_color) |
@@ -339,7 +340,7 @@ discard block |
||
339 | 340 | |
340 | 341 | /** |
341 | 342 | * @param $coursecode |
342 | - * @return mixed |
|
343 | + * @return string |
|
343 | 344 | */ |
344 | 345 | private function get_course_name_from_code_cached($coursecode) |
345 | 346 | { |
@@ -50,9 +50,9 @@ discard block |
||
50 | 50 | |
51 | 51 | } |
52 | 52 | if (count($result) == 0) { |
53 | - $evals_filtered=$evals; |
|
53 | + $evals_filtered = $evals; |
|
54 | 54 | } else { |
55 | - $evals_filtered=$evals_filtered_copy; |
|
55 | + $evals_filtered = $evals_filtered_copy; |
|
56 | 56 | } |
57 | 57 | $this->items = array_merge($evals_filtered, $links); |
58 | 58 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | { |
86 | 86 | // do some checks on count, redefine if invalid value |
87 | 87 | if (!isset($count)) { |
88 | - $count = count ($this->items) - $start; |
|
88 | + $count = count($this->items) - $start; |
|
89 | 89 | } |
90 | 90 | if ($count < 0) { |
91 | 91 | $count = 0; |
@@ -104,20 +104,20 @@ discard block |
||
104 | 104 | } elseif ($sorting & self :: UDG_SORT_AVERAGE) { |
105 | 105 | // if user sorts on average scores, first calculate them and cache them |
106 | 106 | foreach ($allitems as $item) { |
107 | - $this->avgcache[$item->get_item_type() . $item->get_id()]= $item->calc_score(); |
|
107 | + $this->avgcache[$item->get_item_type().$item->get_id()] = $item->calc_score(); |
|
108 | 108 | } |
109 | 109 | usort($allitems, array('UserDataGenerator', 'sort_by_average')); |
110 | 110 | } elseif ($sorting & self :: UDG_SORT_SCORE) { |
111 | 111 | // if user sorts on student's scores, first calculate them and cache them |
112 | 112 | foreach ($allitems as $item) { |
113 | - $this->scorecache[$item->get_item_type() . $item->get_id()] |
|
113 | + $this->scorecache[$item->get_item_type().$item->get_id()] |
|
114 | 114 | = $item->calc_score($this->userid); |
115 | 115 | } |
116 | 116 | usort($allitems, array('UserDataGenerator', 'sort_by_score')); |
117 | 117 | } elseif ($sorting & self :: UDG_SORT_MASK) { |
118 | 118 | // if user sorts on student's masks, first calculate scores and cache them |
119 | 119 | foreach ($allitems as $item) { |
120 | - $this->scorecache[$item->get_item_type() . $item->get_id()] |
|
120 | + $this->scorecache[$item->get_item_type().$item->get_id()] |
|
121 | 121 | = $item->calc_score($this->userid); |
122 | 122 | } |
123 | 123 | usort($allitems, array('UserDataGenerator', 'sort_by_mask')); |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | // fill score cache if not done yet |
133 | 133 | if (!isset ($this->scorecache)) { |
134 | 134 | foreach ($visibleitems as $item) { |
135 | - $this->scorecache[$item->get_item_type() . $item->get_id()] |
|
135 | + $this->scorecache[$item->get_item_type().$item->get_id()] |
|
136 | 136 | = $item->calc_score($this->userid); |
137 | 137 | } |
138 | 138 | |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | $scoredisplay = ScoreDisplay :: instance(); |
142 | 142 | $data = array(); |
143 | 143 | foreach ($visibleitems as $item) { |
144 | - $row = array (); |
|
144 | + $row = array(); |
|
145 | 145 | $row[] = $item; |
146 | 146 | $row[] = $item->get_name(); |
147 | 147 | $row[] = $this->build_course_name($item); |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | function sort_by_type($item1, $item2) |
164 | 164 | { |
165 | 165 | if ($item1->get_item_type() == $item2->get_item_type()) { |
166 | - return $this->sort_by_name($item1,$item2); |
|
166 | + return $this->sort_by_name($item1, $item2); |
|
167 | 167 | } else { |
168 | 168 | return ($item1->get_item_type() < $item2->get_item_type() ? -1 : 1); |
169 | 169 | } |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | */ |
204 | 204 | function sort_by_name($item1, $item2) |
205 | 205 | { |
206 | - return api_strnatcmp($item1->get_name(),$item2->get_name()); |
|
206 | + return api_strnatcmp($item1->get_name(), $item2->get_name()); |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | /** |
@@ -213,8 +213,8 @@ discard block |
||
213 | 213 | */ |
214 | 214 | function sort_by_average($item1, $item2) |
215 | 215 | { |
216 | - $score1 = $this->avgcache[$item1->get_item_type() . $item1->get_id()]; |
|
217 | - $score2 = $this->avgcache[$item2->get_item_type() . $item2->get_id()]; |
|
216 | + $score1 = $this->avgcache[$item1->get_item_type().$item1->get_id()]; |
|
217 | + $score2 = $this->avgcache[$item2->get_item_type().$item2->get_id()]; |
|
218 | 218 | |
219 | 219 | return $this->compare_scores($score1, $score2); |
220 | 220 | } |
@@ -226,8 +226,8 @@ discard block |
||
226 | 226 | */ |
227 | 227 | function sort_by_score($item1, $item2) |
228 | 228 | { |
229 | - $score1 = $this->scorecache[$item1->get_item_type() . $item1->get_id()]; |
|
230 | - $score2 = $this->scorecache[$item2->get_item_type() . $item2->get_id()]; |
|
229 | + $score1 = $this->scorecache[$item1->get_item_type().$item1->get_id()]; |
|
230 | + $score2 = $this->scorecache[$item2->get_item_type().$item2->get_id()]; |
|
231 | 231 | |
232 | 232 | return $this->compare_scores($score1, $score2); |
233 | 233 | } |
@@ -239,8 +239,8 @@ discard block |
||
239 | 239 | */ |
240 | 240 | function sort_by_mask($item1, $item2) |
241 | 241 | { |
242 | - $score1 = $this->scorecache[$item1->get_item_type() . $item1->get_id()]; |
|
243 | - $score2 = $this->scorecache[$item2->get_item_type() . $item2->get_id()]; |
|
242 | + $score1 = $this->scorecache[$item1->get_item_type().$item1->get_id()]; |
|
243 | + $score2 = $this->scorecache[$item2->get_item_type().$item2->get_id()]; |
|
244 | 244 | |
245 | 245 | return ScoreDisplay :: compare_scores_by_custom_display($score1, $score2); |
246 | 246 | } |
@@ -256,10 +256,10 @@ discard block |
||
256 | 256 | return (isset($score2) ? 1 : 0); |
257 | 257 | } elseif (!isset($score2)) { |
258 | 258 | return -1; |
259 | - } elseif (($score1[0]/$score1[1]) == ($score2[0]/$score2[1])) { |
|
259 | + } elseif (($score1[0] / $score1[1]) == ($score2[0] / $score2[1])) { |
|
260 | 260 | return 0; |
261 | 261 | } else { |
262 | - return (($score1[0]/$score1[1]) < ($score2[0]/$score2[1]) ? -1 : 1); |
|
262 | + return (($score1[0] / $score1[1]) < ($score2[0] / $score2[1]) ? -1 : 1); |
|
263 | 263 | } |
264 | 264 | } |
265 | 265 | |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | private function build_average_column($item, $ignore_score_color) |
292 | 292 | { |
293 | 293 | if (isset($this->avgcache)) { |
294 | - $avgscore = $this->avgcache[$item->get_item_type() . $item->get_id()]; |
|
294 | + $avgscore = $this->avgcache[$item->get_item_type().$item->get_id()]; |
|
295 | 295 | } else { |
296 | 296 | $avgscore = $item->calc_score(); |
297 | 297 | } |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | */ |
312 | 312 | private function build_result_column($item, $ignore_score_color) |
313 | 313 | { |
314 | - $studscore = $this->scorecache[$item->get_item_type() . $item->get_id()]; |
|
314 | + $studscore = $this->scorecache[$item->get_item_type().$item->get_id()]; |
|
315 | 315 | $scoredisplay = ScoreDisplay :: instance(); |
316 | 316 | $displaytype = SCORE_DIV_PERCENT; |
317 | 317 | if ($ignore_score_color) { |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | */ |
329 | 329 | private function build_mask_column($item, $ignore_score_color) |
330 | 330 | { |
331 | - $studscore = $this->scorecache[$item->get_item_type() . $item->get_id()]; |
|
331 | + $studscore = $this->scorecache[$item->get_item_type().$item->get_id()]; |
|
332 | 332 | $scoredisplay = ScoreDisplay :: instance(); |
333 | 333 | $displaytype = SCORE_DIV_PERCENT; |
334 | 334 | if ($ignore_score_color) { |
@@ -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; |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | if (!api_is_anonymous() && api_is_allowed_to_session_edit(false, true)) { |
64 | 64 | $buttonReply = Display::toolbarButton( |
65 | 65 | get_lang('ReplyToMessage'), |
66 | - 'reply.php?' . api_get_cidreq() . '&' . http_build_query([ |
|
66 | + 'reply.php?'.api_get_cidreq().'&'.http_build_query([ |
|
67 | 67 | 'forum' => $clean_forum_id, |
68 | 68 | 'thread' => $clean_thread_id, |
69 | 69 | 'post' => $row['post_id'], |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | |
77 | 77 | $buttonQuote = Display::toolbarButton( |
78 | 78 | get_lang('QuoteMessage'), |
79 | - 'reply.php?' . api_get_cidreq() . '&' . http_build_query([ |
|
79 | + 'reply.php?'.api_get_cidreq().'&'.http_build_query([ |
|
80 | 80 | 'forum' => $clean_forum_id, |
81 | 81 | 'thread' => $clean_thread_id, |
82 | 82 | 'post' => $row['post_id'], |
@@ -92,21 +92,21 @@ discard block |
||
92 | 92 | if (($current_forum_category && $current_forum_category['locked'] == 1)) { |
93 | 93 | $closedPost = Display::tag( |
94 | 94 | 'div', |
95 | - '<em class="fa fa-exclamation-triangle"></em> ' . get_lang('ForumcategoryLocked'), |
|
95 | + '<em class="fa fa-exclamation-triangle"></em> '.get_lang('ForumcategoryLocked'), |
|
96 | 96 | array('class' => 'alert alert-warning post-closed') |
97 | 97 | ); |
98 | 98 | } |
99 | 99 | if ($current_forum['locked'] == 1) { |
100 | 100 | $closedPost = Display::tag( |
101 | 101 | 'div', |
102 | - '<em class="fa fa-exclamation-triangle"></em> ' . get_lang('ForumLocked'), |
|
102 | + '<em class="fa fa-exclamation-triangle"></em> '.get_lang('ForumLocked'), |
|
103 | 103 | array('class' => 'alert alert-warning post-closed') |
104 | 104 | ); |
105 | 105 | } |
106 | 106 | if ($current_thread['locked'] == 1) { |
107 | 107 | $closedPost = Display::tag( |
108 | 108 | 'div', |
109 | - '<em class="fa fa-exclamation-triangle"></em> ' . get_lang('ThreadLocked'), |
|
109 | + '<em class="fa fa-exclamation-triangle"></em> '.get_lang('ThreadLocked'), |
|
110 | 110 | array('class' => 'alert alert-warning post-closed') |
111 | 111 | ); |
112 | 112 | } |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | |
122 | 122 | if ($origin != 'learnpath') { |
123 | 123 | if (api_get_course_setting('allow_user_image_forum')) { |
124 | - $html .= '<div class="thumbnail">' . display_user_image($row['user_id'], $name, $origin) . '</div>'; |
|
124 | + $html .= '<div class="thumbnail">'.display_user_image($row['user_id'], $name, $origin).'</div>'; |
|
125 | 125 | } |
126 | 126 | $html .= Display::tag( |
127 | 127 | 'h4', |
@@ -130,9 +130,9 @@ discard block |
||
130 | 130 | ); |
131 | 131 | } else { |
132 | 132 | if (api_get_course_setting('allow_user_image_forum')) { |
133 | - $html .= '<div class="thumbnail">' . display_user_image($row['user_id'], $name, $origin) . '</div>'; |
|
133 | + $html .= '<div class="thumbnail">'.display_user_image($row['user_id'], $name, $origin).'</div>'; |
|
134 | 134 | } |
135 | - $name = Display::tag('strong', "#" . $postCount--, ['class' => 'text-info']) . " | $name"; |
|
135 | + $name = Display::tag('strong', "#".$postCount--, ['class' => 'text-info'])." | $name"; |
|
136 | 136 | $html .= Display::tag( |
137 | 137 | 'p', |
138 | 138 | $name, |
@@ -176,10 +176,10 @@ discard block |
||
176 | 176 | ) { |
177 | 177 | if (api_is_allowed_to_session_edit(false, true)) { |
178 | 178 | if ($locked == false) { |
179 | - $iconEdit .= "<a href=\"editpost.php?" . api_get_cidreq() . "&forum=" . $clean_forum_id |
|
180 | - . "&thread=" . $clean_thread_id . "&post=" . $row['post_id'] . "&origin=" |
|
181 | - . $origin . "&edit=edition&id_attach=" . $id_attach . "\">" |
|
182 | - . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . "</a>"; |
|
179 | + $iconEdit .= "<a href=\"editpost.php?".api_get_cidreq()."&forum=".$clean_forum_id |
|
180 | + . "&thread=".$clean_thread_id."&post=".$row['post_id']."&origin=" |
|
181 | + . $origin."&edit=edition&id_attach=".$id_attach."\">" |
|
182 | + . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL)."</a>"; |
|
183 | 183 | } |
184 | 184 | } |
185 | 185 | } |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | !(api_is_course_coach() && $current_forum['session_id'] != $sessionId) |
191 | 191 | ) { |
192 | 192 | if ($locked === false) { |
193 | - $deleteUrl = api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query([ |
|
193 | + $deleteUrl = api_get_self().'?'.api_get_cidreq().'&'.http_build_query([ |
|
194 | 194 | 'forum' => $clean_forum_id, |
195 | 195 | 'thread' => $clean_thread_id, |
196 | 196 | 'action' => 'delete', |
@@ -229,9 +229,9 @@ discard block |
||
229 | 229 | ); |
230 | 230 | |
231 | 231 | if ($increment > 0) { |
232 | - $iconEdit .= "<a href=\"viewthread.php?" . api_get_cidreq() . "&forum=" . $clean_forum_id |
|
233 | - . "&thread=" . $clean_thread_id . "&action=move&post=" . $row['post_id'] |
|
234 | - . "&origin=" . $origin . "\">" |
|
232 | + $iconEdit .= "<a href=\"viewthread.php?".api_get_cidreq()."&forum=".$clean_forum_id |
|
233 | + . "&thread=".$clean_thread_id."&action=move&post=".$row['post_id'] |
|
234 | + . "&origin=".$origin."\">" |
|
235 | 235 | . Display::return_icon('move.png', get_lang('MovePost'), array(), ICON_SIZE_SMALL) |
236 | 236 | . "</a>"; |
237 | 237 | } |
@@ -254,16 +254,16 @@ discard block |
||
254 | 254 | $userCanEdit = true; |
255 | 255 | } |
256 | 256 | if ($increment > 0 && $locked == false && $userCanEdit) { |
257 | - $iconEdit .= "<a href=\"forumqualify.php?" . api_get_cidreq() . "&forum=" . $my_forum_id |
|
258 | - . "&thread=" . $clean_thread_id . "&action=list&post=" . $row['post_id'] |
|
259 | - . "&user=" . $row['poster_id'] . "&user_id=" . $row['poster_id'] |
|
260 | - . "&origin=" . $origin . "&idtextqualify=" . $current_qualify_thread . "\" >" |
|
257 | + $iconEdit .= "<a href=\"forumqualify.php?".api_get_cidreq()."&forum=".$my_forum_id |
|
258 | + . "&thread=".$clean_thread_id."&action=list&post=".$row['post_id'] |
|
259 | + . "&user=".$row['poster_id']."&user_id=".$row['poster_id'] |
|
260 | + . "&origin=".$origin."&idtextqualify=".$current_qualify_thread."\" >" |
|
261 | 261 | . Display::return_icon('quiz.gif', get_lang('Qualify')) |
262 | 262 | . "</a> "; |
263 | 263 | } |
264 | 264 | } |
265 | 265 | if ($iconEdit != '') { |
266 | - $html .= '<div class="tools-icons">' . $iconEdit . $statusIcon.'</div>'; |
|
266 | + $html .= '<div class="tools-icons">'.$iconEdit.$statusIcon.'</div>'; |
|
267 | 267 | } |
268 | 268 | $html .= $closedPost; |
269 | 269 | $html .= '</div>'; |
@@ -317,26 +317,26 @@ discard block |
||
317 | 317 | $realname = $attachment['path']; |
318 | 318 | $user_filename = $attachment['filename']; |
319 | 319 | $html .= Display::return_icon('attachment.gif', get_lang('Attachment')); |
320 | - $html .= '<a href="download.php?file=' . $realname . '"> ' . $user_filename . ' </a>'; |
|
320 | + $html .= '<a href="download.php?file='.$realname.'"> '.$user_filename.' </a>'; |
|
321 | 321 | |
322 | 322 | if (($current_forum['allow_edit'] == 1 && $row['user_id'] == $_user['user_id']) || |
323 | 323 | (api_is_allowed_to_edit(false, true) && !(api_is_course_coach() && $current_forum['session_id'] != $sessionId)) |
324 | 324 | ) { |
325 | - $html .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=delete_attach&id_attach=' |
|
326 | - . $attachment['iid'] . '&forum=' . $clean_forum_id . '&thread=' . $clean_thread_id |
|
325 | + $html .= ' <a href="'.api_get_self().'?'.api_get_cidreq().'&action=delete_attach&id_attach=' |
|
326 | + . $attachment['iid'].'&forum='.$clean_forum_id.'&thread='.$clean_thread_id |
|
327 | 327 | . '" onclick="javascript:if(!confirm(\'' |
328 | 328 | . addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES)) |
329 | 329 | . '\')) return false;">' |
330 | 330 | . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) |
331 | 331 | . '</a><br />'; |
332 | 332 | } |
333 | - $html .= '<span class="forum_attach_comment" >' . $attachment['comment'] . '</span>'; |
|
333 | + $html .= '<span class="forum_attach_comment" >'.$attachment['comment'].'</span>'; |
|
334 | 334 | } |
335 | 335 | } |
336 | 336 | |
337 | 337 | $html .= '</div>'; |
338 | 338 | $html .= '<div class="col-md-5 text-right">'; |
339 | - $html .= $buttonReply . ' ' . $buttonQuote; |
|
339 | + $html .= $buttonReply.' '.$buttonQuote; |
|
340 | 340 | $html .= '</div>'; |
341 | 341 | $html .= '</div>'; |
342 | 342 |
@@ -39,15 +39,15 @@ |
||
39 | 39 | FROM ".$t_link_log." lk inner join ".$t_user." us |
40 | 40 | ON lk.user_id_log=us.user_id |
41 | 41 | WHERE lk.id_linkeval_log=".$evaledit[0]->get_id()." AND lk.type='link';"; |
42 | -$result=Database::query($sql); |
|
43 | -$list_info=array(); |
|
44 | -while ($row=Database::fetch_row($result)) { |
|
42 | +$result = Database::query($sql); |
|
43 | +$list_info = array(); |
|
44 | +while ($row = Database::fetch_row($result)) { |
|
45 | 45 | $list_info[] = $row; |
46 | 46 | } |
47 | 47 | |
48 | 48 | foreach ($list_info as $key => $info_log) { |
49 | - $list_info[$key][5]=($info_log[5]) ? api_convert_and_format_date($info_log[5]) : 'N/A'; |
|
50 | - $list_info[$key][3]=($info_log[3]==1) ? get_lang('GradebookVisible') : get_lang('GradebookInvisible'); |
|
49 | + $list_info[$key][5] = ($info_log[5]) ? api_convert_and_format_date($info_log[5]) : 'N/A'; |
|
50 | + $list_info[$key][3] = ($info_log[3] == 1) ? get_lang('GradebookVisible') : get_lang('GradebookInvisible'); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | $parameters = array( |
@@ -7,12 +7,12 @@ discard block |
||
7 | 7 | require_once '../inc/global.inc.php'; |
8 | 8 | api_block_anonymous_users(); |
9 | 9 | GradebookUtils::block_students(); |
10 | -$select_eval=Security::remove_XSS($_GET['selecteval']); |
|
10 | +$select_eval = Security::remove_XSS($_GET['selecteval']); |
|
11 | 11 | if (empty($select_eval)) { |
12 | 12 | api_not_allowed(); |
13 | 13 | } |
14 | -$resultedit = Result :: load (null,null,$select_eval); |
|
15 | -$evaluation = Evaluation :: load ($select_eval); |
|
14 | +$resultedit = Result :: load(null, null, $select_eval); |
|
15 | +$evaluation = Evaluation :: load($select_eval); |
|
16 | 16 | |
17 | 17 | $evaluation[0]->check_lock_permissions(); |
18 | 18 | |
@@ -29,9 +29,9 @@ discard block |
||
29 | 29 | $values = $edit_result_form->exportValues(); |
30 | 30 | $scores = ($values['score']); |
31 | 31 | foreach ($scores as $row) { |
32 | - $resultedit = Result :: load (key($scores)); |
|
32 | + $resultedit = Result :: load(key($scores)); |
|
33 | 33 | $row_value = $row; |
34 | - if ($row_value != '' ) { |
|
34 | + if ($row_value != '') { |
|
35 | 35 | $resultedit[0]->set_score(floatval(number_format($row_value, api_get_setting('gradebook_number_decimals')))); |
36 | 36 | $resultedit[0]->save(); |
37 | 37 | } |
@@ -41,11 +41,11 @@ discard block |
||
41 | 41 | exit; |
42 | 42 | } |
43 | 43 | |
44 | -$interbreadcrumb[] = array ( |
|
44 | +$interbreadcrumb[] = array( |
|
45 | 45 | 'url' => $_SESSION['gradebook_dest'], |
46 | 46 | 'name' => get_lang('Gradebook') |
47 | 47 | ); |
48 | -$interbreadcrumb[]= array ( |
|
48 | +$interbreadcrumb[] = array( |
|
49 | 49 | 'url' => 'gradebook_view_result.php?selecteval='.$select_eval.'&'.api_get_cidreq(), |
50 | 50 | 'name' => get_lang('ViewResult') |
51 | 51 | ); |
@@ -9,8 +9,8 @@ discard block |
||
9 | 9 | */ |
10 | 10 | class LinkAddEditForm extends FormValidator |
11 | 11 | { |
12 | - const TYPE_ADD = 1; |
|
13 | - const TYPE_EDIT = 2; |
|
12 | + const TYPE_ADD = 1; |
|
13 | + const TYPE_EDIT = 2; |
|
14 | 14 | |
15 | 15 | /** |
16 | 16 | * Constructor |
@@ -188,5 +188,5 @@ discard block |
||
188 | 188 | |
189 | 189 | // set default values |
190 | 190 | $this->setDefaults($defaults); |
191 | - } |
|
191 | + } |
|
192 | 192 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | if (isset($link_object)) { |
32 | 32 | $link = $link_object; |
33 | 33 | } elseif (isset($link_type) && isset($category_object)) { |
34 | - $link = LinkFactory :: create ($link_type); |
|
34 | + $link = LinkFactory :: create($link_type); |
|
35 | 35 | $link->set_course_code(api_get_course_id()); |
36 | 36 | $link->set_category_id($category_object[0]->get_id()); |
37 | 37 | } else { |
@@ -52,12 +52,12 @@ discard block |
||
52 | 52 | } else { |
53 | 53 | $select = $this->addElement('select', 'select_link', get_lang('ChooseItem')); |
54 | 54 | foreach ($link->get_all_links() as $newlink) { |
55 | - $select->addoption($newlink[1],$newlink[0]); |
|
55 | + $select->addoption($newlink[1], $newlink[0]); |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | } else { |
59 | - $this->addElement('label',get_lang('Name'), '<span class="freeze">'.$link->get_name().' ['.$link->get_type_name().']</span>'); |
|
60 | - $this->addElement('hidden','name_link',$link->get_name(),array('id'=>'name_link')); |
|
59 | + $this->addElement('label', get_lang('Name'), '<span class="freeze">'.$link->get_name().' ['.$link->get_type_name().']</span>'); |
|
60 | + $this->addElement('hidden', 'name_link', $link->get_name(), array('id'=>'name_link')); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | if (count($category_object) == 1) { |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | if ($my_cat->get_course_code() == api_get_course_id()) { |
79 | 79 | $grade_model_id = $my_cat->get_grade_model_id(); |
80 | 80 | if (empty($grade_model_id)) { |
81 | - if ($my_cat->get_parent_id() == 0 ) { |
|
81 | + if ($my_cat->get_parent_id() == 0) { |
|
82 | 82 | $default_weight = $my_cat->get_weight(); |
83 | 83 | $select_gradebook->addoption(get_lang('Default'), $my_cat->get_id()); |
84 | 84 | } else { |
@@ -117,8 +117,8 @@ discard block |
||
117 | 117 | 'class' => 'span1' |
118 | 118 | ));*/ |
119 | 119 | |
120 | - $this->addRule('weight_mask',get_lang('OnlyNumbers'),'numeric'); |
|
121 | - $this->addRule(array ('weight_mask', 'zero'), get_lang('NegativeValue'), 'compare', '>='); |
|
120 | + $this->addRule('weight_mask', get_lang('OnlyNumbers'), 'numeric'); |
|
121 | + $this->addRule(array('weight_mask', 'zero'), get_lang('NegativeValue'), 'compare', '>='); |
|
122 | 122 | if ($form_type == self :: TYPE_EDIT) { |
123 | 123 | $parent_cat = Category :: load($link->get_category_id()); |
124 | 124 | |
@@ -131,20 +131,20 @@ discard block |
||
131 | 131 | //var_dump($global_weight, $link->get_weight(), $parent_cat[0]->get_weight()); |
132 | 132 | //$weight = $parent_cat[0]->get_weight()* $link->get_weight() / $global_weight; |
133 | 133 | //$values['weight'] = $weight; |
134 | - $values['weight'] = $link->get_weight() ; |
|
134 | + $values['weight'] = $link->get_weight(); |
|
135 | 135 | } |
136 | - $defaults['weight_mask'] = $values['weight'] ; |
|
136 | + $defaults['weight_mask'] = $values['weight']; |
|
137 | 137 | $defaults['select_gradebook'] = $link->get_category_id(); |
138 | 138 | |
139 | 139 | } |
140 | 140 | // ELEMENT: max |
141 | 141 | if ($link->needs_max()) { |
142 | 142 | if ($form_type == self :: TYPE_EDIT && $link->has_results()) { |
143 | - $this->addText('max', get_lang('QualificationNumeric'), false, array ('size' => '4','maxlength' => '5', 'disabled' => 'disabled')); |
|
143 | + $this->addText('max', get_lang('QualificationNumeric'), false, array('size' => '4', 'maxlength' => '5', 'disabled' => 'disabled')); |
|
144 | 144 | } else { |
145 | - $this->addText('max', get_lang('QualificationNumeric'), true, array ('size' => '4','maxlength' => '5')); |
|
145 | + $this->addText('max', get_lang('QualificationNumeric'), true, array('size' => '4', 'maxlength' => '5')); |
|
146 | 146 | $this->addRule('max', get_lang('OnlyNumbers'), 'numeric'); |
147 | - $this->addRule(array ('max', 'zero'), get_lang('NegativeValue'), 'compare', '>='); |
|
147 | + $this->addRule(array('max', 'zero'), get_lang('NegativeValue'), 'compare', '>='); |
|
148 | 148 | } |
149 | 149 | if ($form_type == self :: TYPE_EDIT) { |
150 | 150 | $defaults['max'] = $link->get_max(); |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | |
154 | 154 | // ELEMENT: description |
155 | 155 | if ($link->needs_name_and_description()) { |
156 | - $this->addElement('textarea', 'description', get_lang('Description'), array ('rows' => '3','cols' => '34')); |
|
156 | + $this->addElement('textarea', 'description', get_lang('Description'), array('rows' => '3', 'cols' => '34')); |
|
157 | 157 | if ($form_type == self :: TYPE_EDIT) { |
158 | 158 | $defaults['description'] = $link->get_description(); |
159 | 159 | } |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | if (isset($setting['gradebook']) && $setting['gradebook'] == 'false') { |
184 | 184 | $visibility_default = 0; |
185 | 185 | } |
186 | - $defaults['visible'] = $visibility_default; |
|
186 | + $defaults['visible'] = $visibility_default; |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | // set default values |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | */ |
10 | 10 | class UserForm extends FormValidator |
11 | 11 | { |
12 | - const TYPE_USER_INFO= 1; |
|
12 | + const TYPE_USER_INFO = 1; |
|
13 | 13 | const TYPE_SIMPLE_SEARCH = 3; |
14 | 14 | |
15 | 15 | /** |
@@ -20,15 +20,15 @@ discard block |
||
20 | 20 | * @param method |
21 | 21 | * @param action |
22 | 22 | */ |
23 | - public function __construct($form_type, $user, $form_name, $method= 'post', $action= null) |
|
23 | + public function __construct($form_type, $user, $form_name, $method = 'post', $action = null) |
|
24 | 24 | { |
25 | 25 | parent :: __construct($form_name, $method, $action); |
26 | - $this->form_type= $form_type; |
|
26 | + $this->form_type = $form_type; |
|
27 | 27 | if (isset ($user)) { |
28 | - $this->user_info= $user; |
|
28 | + $this->user_info = $user; |
|
29 | 29 | } |
30 | 30 | if (isset ($result_object)) { |
31 | - $this->result_object= $result_object; |
|
31 | + $this->result_object = $result_object; |
|
32 | 32 | } |
33 | 33 | if ($this->form_type == self :: TYPE_USER_INFO) { |
34 | 34 | $this->build_user_info_form(); |
@@ -46,9 +46,9 @@ discard block |
||
46 | 46 | 'keyword' => Security::remove_XSS($_GET['search']) |
47 | 47 | )); |
48 | 48 | } |
49 | - $renderer =& $this->defaultRenderer(); |
|
49 | + $renderer = & $this->defaultRenderer(); |
|
50 | 50 | $renderer->setCustomElementTemplate('<span>{element}</span> '); |
51 | - $this->addElement('text','keyword',''); |
|
51 | + $this->addElement('text', 'keyword', ''); |
|
52 | 52 | $this->addButtonSearch(get_lang('Search'), 'submit'); |
53 | 53 | } |
54 | 54 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $this->addElement('static', 'fname', get_lang('FirstName'), $this->user_info['firstname']); |
63 | 63 | } |
64 | 64 | $this->addElement('static', 'uname', get_lang('UserName'), $this->user_info['username']); |
65 | - $this->addElement('static', 'email', get_lang('Email'), '<a href="mailto:' . $this->user_info['email'] . '">' . $this->user_info['email'] . '</a>'); |
|
65 | + $this->addElement('static', 'email', get_lang('Email'), '<a href="mailto:'.$this->user_info['email'].'">'.$this->user_info['email'].'</a>'); |
|
66 | 66 | $this->addElement('static', 'ofcode', get_lang('OfficialCode'), $this->user_info['official_code']); |
67 | 67 | $this->addElement('static', 'phone', get_lang('Phone'), $this->user_info['phone']); |
68 | 68 | $this->addButtonSave(get_lang('Back'), 'submit'); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | parent :: display(); |
74 | 74 | } |
75 | 75 | |
76 | - function setDefaults($defaults= array(), $filter = null) |
|
76 | + function setDefaults($defaults = array(), $filter = null) |
|
77 | 77 | { |
78 | 78 | parent :: setDefaults($defaults, $filter); |
79 | 79 | } |
@@ -32,8 +32,7 @@ |
||
32 | 32 | } |
33 | 33 | if ($this->form_type == self :: TYPE_USER_INFO) { |
34 | 34 | $this->build_user_info_form(); |
35 | - } |
|
36 | - elseif ($this->form_type == self :: TYPE_SIMPLE_SEARCH) { |
|
35 | + } elseif ($this->form_type == self :: TYPE_SIMPLE_SEARCH) { |
|
37 | 36 | $this->build_simple_search(); |
38 | 37 | } |
39 | 38 | $this->setDefaults(); |
@@ -113,7 +113,7 @@ |
||
113 | 113 | foreach ($data_array as $item) { |
114 | 114 | $row = array (); |
115 | 115 | if ($this->iscourse == '1') { |
116 | - $row[] = $item['result_id']; |
|
116 | + $row[] = $item['result_id']; |
|
117 | 117 | } |
118 | 118 | if ($is_western_name_order) { |
119 | 119 | $row[] = $item['firstname']; |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | /** |
19 | 19 | * Constructor |
20 | 20 | */ |
21 | - public function __construct($evaluation, $results = array(), $iscourse, $addparams = null,$forprint = false) |
|
21 | + public function __construct($evaluation, $results = array(), $iscourse, $addparams = null, $forprint = false) |
|
22 | 22 | { |
23 | 23 | parent :: __construct('resultlist', null, null, (api_is_western_name_order() xor api_sort_by_first_name()) ? 2 : 1); |
24 | 24 | |
@@ -28,14 +28,14 @@ discard block |
||
28 | 28 | $this->iscourse = $iscourse; |
29 | 29 | $this->forprint = $forprint; |
30 | 30 | |
31 | - if (isset ($addparams)) { |
|
31 | + if (isset ($addparams)) { |
|
32 | 32 | $this->set_additional_parameters($addparams); |
33 | 33 | } |
34 | 34 | $scoredisplay = ScoreDisplay :: instance(); |
35 | - $column= 0; |
|
35 | + $column = 0; |
|
36 | 36 | if ($this->iscourse == '1') { |
37 | 37 | $this->set_header($column++, '', false); |
38 | - $this->set_form_actions(array ( |
|
38 | + $this->set_form_actions(array( |
|
39 | 39 | 'delete' => get_lang('Delete') |
40 | 40 | )); |
41 | 41 | } |
@@ -51,14 +51,14 @@ discard block |
||
51 | 51 | $this->set_header($column++, get_lang('Display')); |
52 | 52 | } |
53 | 53 | if (!$this->forprint) { |
54 | - $this->set_header($column++, get_lang('Modify'),false); |
|
54 | + $this->set_header($column++, get_lang('Modify'), false); |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
59 | 59 | * Function used by SortableTable to get total number of items in the table |
60 | 60 | */ |
61 | - public function get_total_number_of_items () |
|
61 | + public function get_total_number_of_items() |
|
62 | 62 | { |
63 | 63 | return $this->datagen->get_total_results_count(); |
64 | 64 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | // generate the data to display |
112 | 112 | $sortable_data = array(); |
113 | 113 | foreach ($data_array as $item) { |
114 | - $row = array (); |
|
114 | + $row = array(); |
|
115 | 115 | if ($this->iscourse == '1') { |
116 | 116 | $row[] = $item['result_id']; |
117 | 117 | } |
@@ -123,13 +123,13 @@ discard block |
||
123 | 123 | $row[] = $item['firstname']; |
124 | 124 | } |
125 | 125 | |
126 | - $row[] = Display::bar_progress($item['percentage_score'], false, $item['score']); |
|
126 | + $row[] = Display::bar_progress($item['percentage_score'], false, $item['score']); |
|
127 | 127 | //$row[] = Display::bar_progress($item['percentage_score'], true); |
128 | 128 | if ($scoredisplay->is_custom()) { |
129 | 129 | $row[] = $item['display']; |
130 | 130 | } |
131 | 131 | if (!$this->forprint) { |
132 | - $row[] = $this->build_edit_column ($item); |
|
132 | + $row[] = $this->build_edit_column($item); |
|
133 | 133 | } |
134 | 134 | $sortable_data[] = $row; |
135 | 135 | } |
@@ -142,17 +142,17 @@ discard block |
||
142 | 142 | $locked_status = $this->evaluation->get_locked(); |
143 | 143 | if (api_is_allowed_to_edit(null, true) && $locked_status == 0) { |
144 | 144 | //api_is_course_admin() |
145 | - $edit_column = '<a href="' . api_get_self() . '?editres=' . $item['result_id'] . '&selecteval=' . $this->evaluation->get_id().'&'.api_get_cidreq().'">'. |
|
146 | - Display::return_icon('edit.png', get_lang('Modify'),'','22').'</a>'; |
|
147 | - $edit_column .= ' <a href="' . api_get_self() . '?delete_mark=' . $item['result_id'] . '&selecteval=' . $this->evaluation->get_id().'&'.api_get_cidreq().'">'. |
|
148 | - Display::return_icon('delete.png', get_lang('Delete'),'','22').'</a>'; |
|
145 | + $edit_column = '<a href="'.api_get_self().'?editres='.$item['result_id'].'&selecteval='.$this->evaluation->get_id().'&'.api_get_cidreq().'">'. |
|
146 | + Display::return_icon('edit.png', get_lang('Modify'), '', '22').'</a>'; |
|
147 | + $edit_column .= ' <a href="'.api_get_self().'?delete_mark='.$item['result_id'].'&selecteval='.$this->evaluation->get_id().'&'.api_get_cidreq().'">'. |
|
148 | + Display::return_icon('delete.png', get_lang('Delete'), '', '22').'</a>'; |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | if ($this->evaluation->get_course_code() == null) { |
152 | - $edit_column .= ' <a href="' . api_get_self() . '?resultdelete=' . $item['result_id'] . '&selecteval=' . $this->evaluation->get_id() . '" onclick="return confirmationuser();">'; |
|
152 | + $edit_column .= ' <a href="'.api_get_self().'?resultdelete='.$item['result_id'].'&selecteval='.$this->evaluation->get_id().'" onclick="return confirmationuser();">'; |
|
153 | 153 | $edit_column .= Display::return_icon('delete.png', get_lang('Delete')); |
154 | 154 | $edit_column .= '</a>'; |
155 | - $edit_column .= ' <a href="user_stats.php?userid=' . $item['id'] . '&selecteval=' . $this->evaluation->get_id() . '&'.api_get_cidreq().'">'; |
|
155 | + $edit_column .= ' <a href="user_stats.php?userid='.$item['id'].'&selecteval='.$this->evaluation->get_id().'&'.api_get_cidreq().'">'; |
|
156 | 156 | $edit_column .= Display::return_icon('statistics.gif', get_lang('Statistics')); |
157 | 157 | $edit_column .= '</a>'; |
158 | 158 | } |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $doc_url = $link->get_view_url($item['id']); |
164 | 164 | |
165 | 165 | if ($doc_url != null) { |
166 | - $edit_column .= ' <a href="'. $doc_url . '" target="_blank">'; |
|
166 | + $edit_column .= ' <a href="'.$doc_url.'" target="_blank">'; |
|
167 | 167 | $edit_column .= Display::return_icon('link.gif', get_lang('OpenDocument')).'</a>'; |
168 | 168 | } |
169 | 169 | } |
@@ -87,8 +87,8 @@ discard block |
||
87 | 87 | // generate the data to display |
88 | 88 | $sortable_data = array(); |
89 | 89 | foreach ($data_array as $data) { |
90 | - if ($data[2]!="") {//filter by course removed |
|
91 | - $row = array (); |
|
90 | + if ($data[2] != "") {//filter by course removed |
|
91 | + $row = array(); |
|
92 | 92 | $row[] = $this->build_type_column($data[0]); |
93 | 93 | $row[] = $this->build_name_link($data[0]); |
94 | 94 | $row[] = $data[2]; |
@@ -124,15 +124,15 @@ discard block |
||
124 | 124 | // evaluation |
125 | 125 | case 'E': |
126 | 126 | return ' ' |
127 | - . '<a href="gradebook_view_result.php?selecteval=' . $item->get_id() . '">' |
|
127 | + . '<a href="gradebook_view_result.php?selecteval='.$item->get_id().'">' |
|
128 | 128 | . $item->get_name() |
129 | 129 | . '</a>'; |
130 | 130 | // link |
131 | 131 | case 'L': |
132 | - return ' <a href="' . $item->get_link() . '">' |
|
132 | + return ' <a href="'.$item->get_link().'">' |
|
133 | 133 | . $item->get_name() |
134 | 134 | . '</a>' |
135 | - . ' [' . $item->get_type_name() . ']'; |
|
135 | + . ' ['.$item->get_type_name().']'; |
|
136 | 136 | } |
137 | 137 | } |
138 | 138 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | protected function build_move() |
58 | 58 | { |
59 | - $renderer =& $this->defaultRenderer(); |
|
59 | + $renderer = & $this->defaultRenderer(); |
|
60 | 60 | $renderer->setCustomElementTemplate('<span>{element}</span> '); |
61 | 61 | $this->addElement( |
62 | 62 | 'static', |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $link = LinkFactory::create($link); |
139 | 139 | if (!empty($courseCode)) { |
140 | 140 | $link->set_course_code($courseCode); |
141 | - } elseif(!empty($_GET['course_code'])) { |
|
141 | + } elseif (!empty($_GET['course_code'])) { |
|
142 | 142 | $link->set_course_code(Database::escape_string($_GET['course_code'], null, false)); |
143 | 143 | } |
144 | 144 |