@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | api_not_allowed(); |
14 | 14 | } |
15 | 15 | |
16 | -$htmlHeadXtra[]= '<script> |
|
16 | +$htmlHeadXtra[] = '<script> |
|
17 | 17 | function plusItem(item) { |
18 | 18 | document.getElementById(item).style.display = "inline"; |
19 | 19 | document.getElementById("plus-"+item).style.display = "none"; |
@@ -45,10 +45,10 @@ discard block |
||
45 | 45 | ); |
46 | 46 | |
47 | 47 | $select_cat = intval($_GET['selectcat']); |
48 | -$displayscore= ScoreDisplay :: instance(); |
|
48 | +$displayscore = ScoreDisplay :: instance(); |
|
49 | 49 | $customdisplays = $displayscore->get_custom_score_display_settings(); |
50 | 50 | |
51 | -$nr_items = (count($customdisplays) != '0' )? count($customdisplays) : '1'; |
|
51 | +$nr_items = (count($customdisplays) != '0') ? count($customdisplays) : '1'; |
|
52 | 52 | $scoreform = new ScoreDisplayForm( |
53 | 53 | 'scoring_system_form', |
54 | 54 | api_get_self().'?selectcat='.$select_cat.'&'.api_get_cidreq() |
@@ -57,18 +57,18 @@ discard block |
||
57 | 57 | if ($scoreform->validate()) { |
58 | 58 | $value_export = ''; |
59 | 59 | $value_export = $scoreform->exportValues(); |
60 | - $value_export = isset($value_export) ? $scoreform->exportValues(): ''; |
|
60 | + $value_export = isset($value_export) ? $scoreform->exportValues() : ''; |
|
61 | 61 | $values = $value_export; |
62 | 62 | |
63 | 63 | // create new array of custom display settings |
64 | 64 | // this loop also checks if all score ranges are unique |
65 | 65 | |
66 | - $scoringdisplay= array (); |
|
66 | + $scoringdisplay = array(); |
|
67 | 67 | $ranges_ok = true; |
68 | - $endscore= isset($values['endscore']) ? $values['endscore'] : null; |
|
69 | - $displaytext=isset($values['displaytext']) ? $values['displaytext'] : null; |
|
70 | - for ($counter= 1; $ranges_ok && $counter <= 20; $counter++) { |
|
71 | - $setting= array (); |
|
68 | + $endscore = isset($values['endscore']) ? $values['endscore'] : null; |
|
69 | + $displaytext = isset($values['displaytext']) ? $values['displaytext'] : null; |
|
70 | + for ($counter = 1; $ranges_ok && $counter <= 20; $counter++) { |
|
71 | + $setting = array(); |
|
72 | 72 | $setting['score'] = $endscore[$counter]; |
73 | 73 | $setting['display'] = $displaytext[$counter]; |
74 | 74 | if (!empty($setting['score'])) { |
@@ -77,12 +77,12 @@ discard block |
||
77 | 77 | $ranges_ok = false; |
78 | 78 | } |
79 | 79 | } |
80 | - $scoringdisplay[]= $setting; |
|
80 | + $scoringdisplay[] = $setting; |
|
81 | 81 | } |
82 | 82 | } |
83 | 83 | |
84 | 84 | if (!$ranges_ok) { |
85 | - header('Location: ' . api_get_self() . '?nouniqueranges=&selectcat=' . $select_cat.'&'.api_get_cidreq()); |
|
85 | + header('Location: '.api_get_self().'?nouniqueranges=&selectcat='.$select_cat.'&'.api_get_cidreq()); |
|
86 | 86 | exit; |
87 | 87 | } |
88 | 88 | |
@@ -102,8 +102,8 @@ discard block |
||
102 | 102 | $this_section = SECTION_COURSES; |
103 | 103 | Display :: display_header(get_lang('ScoreEdit')); |
104 | 104 | |
105 | -if (((isset($_GET['isStudentView']) && $_GET['isStudentView']=='false') || |
|
106 | - (isset($_GET['selectcat']) && ($_SESSION['studentview']=='teacherview'))) |
|
105 | +if (((isset($_GET['isStudentView']) && $_GET['isStudentView'] == 'false') || |
|
106 | + (isset($_GET['selectcat']) && ($_SESSION['studentview'] == 'teacherview'))) |
|
107 | 107 | ) { |
108 | 108 | if (isset ($_GET['scoringupdated'])) { |
109 | 109 | Display::display_confirmation_message(get_lang('ScoringUpdated'), false); |
@@ -79,7 +79,7 @@ |
||
79 | 79 | |
80 | 80 | $submitted = isset($_POST['submitted']) ? $_POST['submitted'] : ''; |
81 | 81 | if ($submitted == 1) { |
82 | - Display :: display_confirmation_message(get_lang('GradebookWeightUpdated')) . '<br /><br />'; |
|
82 | + Display :: display_confirmation_message(get_lang('GradebookWeightUpdated')).'<br /><br />'; |
|
83 | 83 | if (isset($_POST['evaluation'])) { |
84 | 84 | $eval_log = new Evaluation(); |
85 | 85 | } |
@@ -36,7 +36,7 @@ |
||
36 | 36 | 'actions', |
37 | 37 | Display::toolbarButton( |
38 | 38 | get_lang('SearchCertificates'), |
39 | - api_get_path(WEB_CODE_PATH) . "gradebook/search.php", |
|
39 | + api_get_path(WEB_CODE_PATH)."gradebook/search.php", |
|
40 | 40 | 'search', |
41 | 41 | 'info' |
42 | 42 | ) |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | if (!$isDrhOfCourse) { |
17 | 17 | GradebookUtils::block_students(); |
18 | 18 | } |
19 | -$interbreadcrumb[]= array ( |
|
19 | +$interbreadcrumb[] = array( |
|
20 | 20 | 'url' => $_SESSION['gradebook_dest'], |
21 | 21 | 'name' => get_lang('Gradebook' |
22 | 22 | )); |
@@ -27,12 +27,12 @@ discard block |
||
27 | 27 | $alllinks = $category[0]->get_links($my_user_id, true); |
28 | 28 | |
29 | 29 | if ($_GET['selectcat'] != null) { |
30 | - $addparams= array ( |
|
30 | + $addparams = array( |
|
31 | 31 | 'userid' => $my_user_id, |
32 | 32 | 'selectcat' => Security::remove_XSS($_GET['selectcat']) |
33 | 33 | ); |
34 | 34 | } else { |
35 | - $addparams= array ( |
|
35 | + $addparams = array( |
|
36 | 36 | 'userid' => $my_user_id, |
37 | 37 | 'selecteval' => Security::remove_XSS($_GET['selecteval']) |
38 | 38 | ); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $newarray[] = array_slice($data, 1); |
50 | 50 | } |
51 | 51 | $userinfo = api_get_user_info($my_user_id); |
52 | - $html .= get_lang('Results').' : '.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).' ('. api_convert_and_format_date(null, DATE_FORMAT_SHORT). ' ' . api_convert_and_format_date(null, TIME_NO_SEC_FORMAT) .')'; |
|
52 | + $html .= get_lang('Results').' : '.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).' ('.api_convert_and_format_date(null, DATE_FORMAT_SHORT).' '.api_convert_and_format_date(null, TIME_NO_SEC_FORMAT).')'; |
|
53 | 53 | |
54 | 54 | if ($displayscore->is_custom()) { |
55 | 55 | $header_names = array( |
@@ -95,23 +95,23 @@ discard block |
||
95 | 95 | $actions = '<div class="actions">'; |
96 | 96 | |
97 | 97 | if (isset($_GET['selectcat'])) { |
98 | - $interbreadcrumb[]= array ('url' => 'gradebook_flatview.php?selectcat=' . Security::remove_XSS($_GET['selectcat']), 'name' => get_lang('FlatView')); |
|
99 | - $actions.= '<a href=gradebook_flatview.php?selectcat=' .Security::remove_XSS($_GET['selectcat']) . '>' . Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('FlatView'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
98 | + $interbreadcrumb[] = array('url' => 'gradebook_flatview.php?selectcat='.Security::remove_XSS($_GET['selectcat']), 'name' => get_lang('FlatView')); |
|
99 | + $actions .= '<a href=gradebook_flatview.php?selectcat='.Security::remove_XSS($_GET['selectcat']).'>'.Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('FlatView'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | if (isset ($_GET['selecteval'])) { |
103 | - $interbreadcrumb[]= array ( |
|
104 | - 'url' => 'gradebook_view_result.php?selecteval=' . Security::remove_XSS($_GET['selecteval']), |
|
103 | + $interbreadcrumb[] = array( |
|
104 | + 'url' => 'gradebook_view_result.php?selecteval='.Security::remove_XSS($_GET['selecteval']), |
|
105 | 105 | 'name' => get_lang('ViewResult' |
106 | 106 | )); |
107 | - $actions.= '<a href=gradebook_view_result.php?selecteval=' . Security::remove_XSS($_GET['selecteval']) . '> |
|
108 | - '.Display::return_icon('back.png', get_lang('BackToEvaluation'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
107 | + $actions .= '<a href=gradebook_view_result.php?selecteval='.Security::remove_XSS($_GET['selecteval']).'> |
|
108 | + '.Display::return_icon('back.png', get_lang('BackToEvaluation'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
109 | 109 | } |
110 | 110 | |
111 | -$actions.= '<a href="' . api_get_self() . '?exportpdf=&userid='.Security::remove_XSS($_GET['userid']).'&selectcat=' . $category[0]->get_id() . '" target="_blank"> |
|
112 | -' . Display::return_icon('pdf.png', get_lang('ExportPDF'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
111 | +$actions .= '<a href="'.api_get_self().'?exportpdf=&userid='.Security::remove_XSS($_GET['userid']).'&selectcat='.$category[0]->get_id().'" target="_blank"> |
|
112 | +' . Display::return_icon('pdf.png', get_lang('ExportPDF'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
113 | 113 | |
114 | -$actions.='</div>'; |
|
114 | +$actions .= '</div>'; |
|
115 | 115 | |
116 | 116 | Display :: display_header(get_lang('ResultsPerUser')); |
117 | 117 | echo $actions; |
@@ -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; |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | |
9 | 9 | // $cidReset : This is the main difference with gradebook.php, here we say, |
10 | 10 | // basically, that we are inside a course, and many things depend from that |
11 | -$cidReset= true; |
|
11 | +$cidReset = true; |
|
12 | 12 | $_in_course = false; |
13 | 13 | //make sure the destination for scripts is index.php instead of gradebook.php |
14 | 14 | require_once '../inc/global.inc.php'; |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | unset($_GET['course']); |
22 | 22 | } |
23 | 23 | |
24 | -$selectcat = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : 0; |
|
24 | +$selectcat = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : 0; |
|
25 | 25 | |
26 | 26 | $htmlHeadXtra[] = '<script> |
27 | 27 | $(document).ready( function() { |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | </script>'; |
35 | 35 | api_block_anonymous_users(); |
36 | 36 | |
37 | -$htmlHeadXtra[]= '<script> |
|
37 | +$htmlHeadXtra[] = '<script> |
|
38 | 38 | function confirmation () { |
39 | 39 | if (confirm("'.get_lang('DeleteAll').'?")) { |
40 | 40 | return true; |
@@ -50,10 +50,10 @@ discard block |
||
50 | 50 | //this is called when there is no data for the course admin |
51 | 51 | if (isset ($_GET['createallcategories'])) { |
52 | 52 | GradebookUtils::block_students(); |
53 | - $coursecat= Category :: get_not_created_course_categories(api_get_user_id()); |
|
53 | + $coursecat = Category :: get_not_created_course_categories(api_get_user_id()); |
|
54 | 54 | if (!count($coursecat) == 0) { |
55 | 55 | foreach ($coursecat as $row) { |
56 | - $cat= new Category(); |
|
56 | + $cat = new Category(); |
|
57 | 57 | $cat->set_name($row[1]); |
58 | 58 | $cat->set_course_code($row[0]); |
59 | 59 | $cat->set_description(null); |
@@ -75,26 +75,26 @@ discard block |
||
75 | 75 | GradebookUtils::block_students(); |
76 | 76 | $cats = Category :: load($move_cat); |
77 | 77 | if (!isset ($_GET['targetcat'])) { |
78 | - $move_form= new CatForm(CatForm :: TYPE_MOVE, |
|
78 | + $move_form = new CatForm(CatForm :: TYPE_MOVE, |
|
79 | 79 | $cats[0], |
80 | 80 | 'move_cat_form', |
81 | 81 | null, |
82 | - api_get_self() . '?movecat=' . $move_cat. '&selectcat=' . $selectcat |
|
82 | + api_get_self().'?movecat='.$move_cat.'&selectcat='.$selectcat |
|
83 | 83 | ); |
84 | 84 | if ($move_form->validate()) { |
85 | - header('Location: ' . api_get_self() . '?selectcat=' . $selectcat |
|
86 | - . '&movecat=' . $move_cat |
|
87 | - . '&targetcat=' . $move_form->exportValue('move_cat')); |
|
85 | + header('Location: '.api_get_self().'?selectcat='.$selectcat |
|
86 | + . '&movecat='.$move_cat |
|
87 | + . '&targetcat='.$move_form->exportValue('move_cat')); |
|
88 | 88 | exit; |
89 | 89 | } |
90 | 90 | } else { |
91 | - $get_target_cat=Security::remove_XSS($_GET['targetcat']); |
|
92 | - $targetcat= Category :: load($get_target_cat); |
|
91 | + $get_target_cat = Security::remove_XSS($_GET['targetcat']); |
|
92 | + $targetcat = Category :: load($get_target_cat); |
|
93 | 93 | $course_to_crsind = ($cats[0]->get_course_code() != null && $targetcat[0]->get_course_code() == null); |
94 | 94 | |
95 | 95 | if (!($course_to_crsind && !isset($_GET['confirm']))) { |
96 | 96 | $cats[0]->move_to_cat($targetcat[0]); |
97 | - header('Location: ' . api_get_self() . '?categorymoved=&selectcat=' . $selectcat); |
|
97 | + header('Location: '.api_get_self().'?categorymoved=&selectcat='.$selectcat); |
|
98 | 98 | exit; |
99 | 99 | } |
100 | 100 | unset($targetcat); |
@@ -105,8 +105,8 @@ discard block |
||
105 | 105 | //move an evaluation |
106 | 106 | if (isset ($_GET['moveeval'])) { |
107 | 107 | GradebookUtils::block_students(); |
108 | - $get_move_eval=Security::remove_XSS($_GET['moveeval']); |
|
109 | - $evals= Evaluation :: load($get_move_eval); |
|
108 | + $get_move_eval = Security::remove_XSS($_GET['moveeval']); |
|
109 | + $evals = Evaluation :: load($get_move_eval); |
|
110 | 110 | if (!isset ($_GET['targetcat'])) { |
111 | 111 | |
112 | 112 | $move_form = new EvalForm(EvalForm :: TYPE_MOVE, |
@@ -114,23 +114,23 @@ discard block |
||
114 | 114 | null, |
115 | 115 | 'move_eval_form', |
116 | 116 | null, |
117 | - api_get_self() . '?moveeval=' . $get_move_eval. '&selectcat=' . $selectcat |
|
117 | + api_get_self().'?moveeval='.$get_move_eval.'&selectcat='.$selectcat |
|
118 | 118 | ); |
119 | 119 | |
120 | 120 | if ($move_form->validate()) { |
121 | - header('Location: ' .api_get_self() . '?selectcat=' . $selectcat |
|
122 | - . '&moveeval=' . $get_move_eval |
|
123 | - . '&targetcat=' . $move_form->exportValue('move_cat')); |
|
121 | + header('Location: '.api_get_self().'?selectcat='.$selectcat |
|
122 | + . '&moveeval='.$get_move_eval |
|
123 | + . '&targetcat='.$move_form->exportValue('move_cat')); |
|
124 | 124 | exit; |
125 | 125 | } |
126 | 126 | } else { |
127 | - $get_target_cat=Security::remove_XSS($_GET['targetcat']); |
|
128 | - $targetcat= Category :: load($get_target_cat); |
|
127 | + $get_target_cat = Security::remove_XSS($_GET['targetcat']); |
|
128 | + $targetcat = Category :: load($get_target_cat); |
|
129 | 129 | $course_to_crsind = ($evals[0]->get_course_code() != null && $targetcat[0]->get_course_code() == null); |
130 | 130 | |
131 | 131 | if (!($course_to_crsind && !isset($_GET['confirm']))) { |
132 | 132 | $evals[0]->move_to_cat($targetcat[0]); |
133 | - header('Location: ' . api_get_self() . '?evaluationmoved=&selectcat=' . $selectcat); |
|
133 | + header('Location: '.api_get_self().'?evaluationmoved=&selectcat='.$selectcat); |
|
134 | 134 | exit; |
135 | 135 | } |
136 | 136 | unset ($targetcat); |
@@ -141,8 +141,8 @@ discard block |
||
141 | 141 | //move a link |
142 | 142 | if (isset ($_GET['movelink'])) { |
143 | 143 | GradebookUtils::block_students(); |
144 | - $get_move_link=Security::remove_XSS($_GET['movelink']); |
|
145 | - $link= LinkFactory :: load($get_move_link); |
|
144 | + $get_move_link = Security::remove_XSS($_GET['movelink']); |
|
145 | + $link = LinkFactory :: load($get_move_link); |
|
146 | 146 | $move_form = new LinkForm( |
147 | 147 | LinkForm :: TYPE_MOVE, |
148 | 148 | null, |
@@ -152,10 +152,10 @@ discard block |
||
152 | 152 | api_get_self().'?movelink='.$get_move_link.'&selectcat='.$selectcat |
153 | 153 | ); |
154 | 154 | if ($move_form->validate()) { |
155 | - $targetcat= Category :: load($move_form->exportValue('move_cat')); |
|
155 | + $targetcat = Category :: load($move_form->exportValue('move_cat')); |
|
156 | 156 | $link[0]->move_to_cat($targetcat[0]); |
157 | 157 | unset ($link); |
158 | - header('Location: ' . api_get_self(). '?linkmoved=&selectcat=' . $selectcat); |
|
158 | + header('Location: '.api_get_self().'?linkmoved=&selectcat='.$selectcat); |
|
159 | 159 | exit; |
160 | 160 | } |
161 | 161 | } |
@@ -164,11 +164,11 @@ discard block |
||
164 | 164 | if (isset ($_GET['visiblecat'])) { |
165 | 165 | GradebookUtils::block_students(); |
166 | 166 | if (isset ($_GET['set_visible'])) { |
167 | - $visibility_command= 1; |
|
167 | + $visibility_command = 1; |
|
168 | 168 | } else { |
169 | - $visibility_command= 0; |
|
169 | + $visibility_command = 0; |
|
170 | 170 | } |
171 | - $cats= Category :: load($_GET['visiblecat']); |
|
171 | + $cats = Category :: load($_GET['visiblecat']); |
|
172 | 172 | $cats[0]->set_visible($visibility_command); |
173 | 173 | $cats[0]->save(); |
174 | 174 | $cats[0]->apply_visibility_to_children(); |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | } |
184 | 184 | if (isset ($_GET['deletecat'])) { |
185 | 185 | GradebookUtils::block_students(); |
186 | - $cats= Category :: load($_GET['deletecat']); |
|
186 | + $cats = Category :: load($_GET['deletecat']); |
|
187 | 187 | //delete all categories,subcategories and results |
188 | 188 | if ($cats[0] != null) { |
189 | 189 | if ($cats[0]->get_id() != 0) { |
@@ -198,12 +198,12 @@ discard block |
||
198 | 198 | if (isset ($_GET['visibleeval'])) { |
199 | 199 | GradebookUtils::block_students(); |
200 | 200 | if (isset ($_GET['set_visible'])) { |
201 | - $visibility_command= 1; |
|
201 | + $visibility_command = 1; |
|
202 | 202 | } else { |
203 | - $visibility_command= 0; |
|
203 | + $visibility_command = 0; |
|
204 | 204 | } |
205 | 205 | |
206 | - $eval= Evaluation :: load($_GET['visibleeval']); |
|
206 | + $eval = Evaluation :: load($_GET['visibleeval']); |
|
207 | 207 | $eval[0]->set_visible($visibility_command); |
208 | 208 | $eval[0]->save(); |
209 | 209 | unset ($eval); |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | } |
218 | 218 | if (isset ($_GET['deleteeval'])) { |
219 | 219 | GradebookUtils::block_students(); |
220 | - $eval= Evaluation :: load($_GET['deleteeval']); |
|
220 | + $eval = Evaluation :: load($_GET['deleteeval']); |
|
221 | 221 | if ($eval[0] != null) { |
222 | 222 | $eval[0]->delete_with_results(); |
223 | 223 | } |
@@ -228,11 +228,11 @@ discard block |
||
228 | 228 | if (isset ($_GET['visiblelink'])) { |
229 | 229 | GradebookUtils::block_students(); |
230 | 230 | if (isset ($_GET['set_visible'])) { |
231 | - $visibility_command= 1; |
|
232 | - }else { |
|
233 | - $visibility_command= 0; |
|
231 | + $visibility_command = 1; |
|
232 | + } else { |
|
233 | + $visibility_command = 0; |
|
234 | 234 | } |
235 | - $link= LinkFactory :: load($_GET['visiblelink']); |
|
235 | + $link = LinkFactory :: load($_GET['visiblelink']); |
|
236 | 236 | $link[0]->set_visible($visibility_command); |
237 | 237 | $link[0]->save(); |
238 | 238 | unset ($link); |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | GradebookUtils::block_students(); |
249 | 249 | //fixing #5229 |
250 | 250 | if (!empty($_GET['deletelink'])) { |
251 | - $link= LinkFactory :: load($_GET['deletelink']); |
|
251 | + $link = LinkFactory :: load($_GET['deletelink']); |
|
252 | 252 | if ($link[0] != null) { |
253 | 253 | $link[0]->delete(); |
254 | 254 | } |
@@ -265,9 +265,9 @@ discard block |
||
265 | 265 | } |
266 | 266 | $button = '<form name="confirm" |
267 | 267 | method="post" |
268 | - action="'.api_get_self() .'?confirm=' |
|
269 | - .(isset($_GET['movecat']) ? '&movecat=' . Security::remove_XSS($_GET['movecat']) |
|
270 | - : '&moveeval=' . intval($_GET['moveeval']) ).'&selectcat=' . $selectcat.'&targetcat=' . Security::remove_XSS($_GET['targetcat']).'"> |
|
268 | + action="'.api_get_self().'?confirm=' |
|
269 | + .(isset($_GET['movecat']) ? '&movecat='.Security::remove_XSS($_GET['movecat']) |
|
270 | + : '&moveeval='.intval($_GET['moveeval'])).'&selectcat='.$selectcat.'&targetcat='.Security::remove_XSS($_GET['targetcat']).'"> |
|
271 | 271 | <input type="submit" value="'.' '.get_lang('Ok').' '.'"> |
272 | 272 | </form>'; |
273 | 273 | |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | //actions on the sortabletable |
278 | 278 | if (isset ($_POST['action'])) { |
279 | 279 | GradebookUtils::block_students(); |
280 | - $number_of_selected_items= count($_POST['id']); |
|
280 | + $number_of_selected_items = count($_POST['id']); |
|
281 | 281 | if ($number_of_selected_items == '0') { |
282 | 282 | $warning_message = get_lang('NoItemsSelected'); |
283 | 283 | $filter_warning_msg = false; |
@@ -285,19 +285,19 @@ discard block |
||
285 | 285 | else { |
286 | 286 | switch ($_POST['action']) { |
287 | 287 | case 'deleted' : |
288 | - $number_of_deleted_categories= 0; |
|
289 | - $number_of_deleted_evaluations= 0; |
|
290 | - $number_of_deleted_links= 0; |
|
288 | + $number_of_deleted_categories = 0; |
|
289 | + $number_of_deleted_evaluations = 0; |
|
290 | + $number_of_deleted_links = 0; |
|
291 | 291 | foreach ($_POST['id'] as $indexstr) { |
292 | 292 | if (api_substr($indexstr, 0, 4) == 'CATE') { |
293 | - $cats= Category :: load(api_substr($indexstr, 4)); |
|
293 | + $cats = Category :: load(api_substr($indexstr, 4)); |
|
294 | 294 | if ($cats[0] != null) { |
295 | 295 | $cats[0]->delete_all(); |
296 | 296 | } |
297 | 297 | $number_of_deleted_categories++; |
298 | 298 | } |
299 | 299 | if (api_substr($indexstr, 0, 4) == 'EVAL') { |
300 | - $eval= Evaluation :: load(api_substr($indexstr, 4)); |
|
300 | + $eval = Evaluation :: load(api_substr($indexstr, 4)); |
|
301 | 301 | if ($eval[0] != null) { |
302 | 302 | $eval[0]->delete_with_results(); |
303 | 303 | } |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | if (api_substr($indexstr, 0, 4) == 'LINK') { |
307 | 307 | $id = api_substr($indexstr, 4); |
308 | 308 | if (!empty($id)) { |
309 | - $link= LinkFactory :: load(); |
|
309 | + $link = LinkFactory :: load(); |
|
310 | 310 | if ($link[0] != null) { |
311 | 311 | $link[0]->delete(); |
312 | 312 | } |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | } |
315 | 315 | } |
316 | 316 | } |
317 | - $confirmation_message = get_lang('DeletedCategories') . ' : <b>' . $number_of_deleted_categories . '</b><br />' . get_lang('DeletedEvaluations') . ' : <b>' . $number_of_deleted_evaluations . '</b><br />' . get_lang('DeletedLinks') . ' : <b>' . $number_of_deleted_links . '</b><br /><br />' . get_lang('TotalItems') . ' : <b>' . $number_of_selected_items . '</b>'; |
|
317 | + $confirmation_message = get_lang('DeletedCategories').' : <b>'.$number_of_deleted_categories.'</b><br />'.get_lang('DeletedEvaluations').' : <b>'.$number_of_deleted_evaluations.'</b><br />'.get_lang('DeletedLinks').' : <b>'.$number_of_deleted_links.'</b><br /><br />'.get_lang('TotalItems').' : <b>'.$number_of_selected_items.'</b>'; |
|
318 | 318 | $filter_confirm_msg = false; |
319 | 319 | break; |
320 | 320 | case 'setvisible' : |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | } |
367 | 367 | |
368 | 368 | if (isset ($_POST['submit']) && isset ($_POST['keyword'])) { |
369 | - header('Location: ' . api_get_self() . '?selectcat=' . $selectcat |
|
369 | + header('Location: '.api_get_self().'?selectcat='.$selectcat |
|
370 | 370 | . '&search='.Security::remove_XSS($_POST['keyword'])); |
371 | 371 | exit; |
372 | 372 | } |
@@ -374,8 +374,8 @@ discard block |
||
374 | 374 | // DISPLAY HEADERS AND MESSAGES - |
375 | 375 | if (!isset($_GET['exportpdf']) && !isset($_GET['export_certificate'])) { |
376 | 376 | if (isset ($_GET['studentoverview'])) { |
377 | - $interbreadcrumb[]= array ( |
|
378 | - 'url' => $_SESSION['gradebook_dest'].'?selectcat=' . $selectcat.'&'.api_get_cidreq(), |
|
377 | + $interbreadcrumb[] = array( |
|
378 | + 'url' => $_SESSION['gradebook_dest'].'?selectcat='.$selectcat.'&'.api_get_cidreq(), |
|
379 | 379 | 'name' => get_lang('ToolGradebook') |
380 | 380 | ); |
381 | 381 | Display :: display_header(get_lang('FlatView')); |
@@ -386,13 +386,13 @@ discard block |
||
386 | 386 | $gradebook_dest = Security::remove_XSS($_SESSION['gradebook_dest']); |
387 | 387 | } |
388 | 388 | |
389 | - $interbreadcrumb[]= array ('url' => $gradebook_dest,'name' => get_lang('Gradebook')); |
|
389 | + $interbreadcrumb[] = array('url' => $gradebook_dest, 'name' => get_lang('Gradebook')); |
|
390 | 390 | |
391 | - if ((isset($_GET['selectcat']) && $_GET['selectcat']>0)) { |
|
391 | + if ((isset($_GET['selectcat']) && $_GET['selectcat'] > 0)) { |
|
392 | 392 | if (!empty($_GET['course'])) { |
393 | - $interbreadcrumb[]= array ('url' => $gradebook_dest.'selectcat='.$selectcat,'name' => get_lang('Details')); |
|
393 | + $interbreadcrumb[] = array('url' => $gradebook_dest.'selectcat='.$selectcat, 'name' => get_lang('Details')); |
|
394 | 394 | } else { |
395 | - $interbreadcrumb[]= array ('url' => $_SESSION['gradebook_dest'].'?selectcat=0','name' => get_lang('Details')); |
|
395 | + $interbreadcrumb[] = array('url' => $_SESSION['gradebook_dest'].'?selectcat=0', 'name' => get_lang('Details')); |
|
396 | 396 | } |
397 | 397 | } |
398 | 398 | Display :: display_header(''); |
@@ -402,50 +402,50 @@ discard block |
||
402 | 402 | } |
403 | 403 | |
404 | 404 | if (isset($_GET['categorymoved'])) { |
405 | - Display :: display_confirmation_message(get_lang('CategoryMoved'),false); |
|
405 | + Display :: display_confirmation_message(get_lang('CategoryMoved'), false); |
|
406 | 406 | } |
407 | 407 | if (isset($_GET['evaluationmoved'])) { |
408 | - Display :: display_confirmation_message(get_lang('EvaluationMoved'),false); |
|
408 | + Display :: display_confirmation_message(get_lang('EvaluationMoved'), false); |
|
409 | 409 | } |
410 | 410 | if (isset($_GET['linkmoved'])) { |
411 | - Display :: display_confirmation_message(get_lang('LinkMoved'),false); |
|
411 | + Display :: display_confirmation_message(get_lang('LinkMoved'), false); |
|
412 | 412 | } |
413 | 413 | if (isset ($_GET['addcat'])) { |
414 | - Display :: display_confirmation_message(get_lang('CategoryAdded'),false); |
|
414 | + Display :: display_confirmation_message(get_lang('CategoryAdded'), false); |
|
415 | 415 | } |
416 | 416 | if (isset ($_GET['linkadded'])) { |
417 | - Display :: display_confirmation_message(get_lang('LinkAdded'),false); |
|
417 | + Display :: display_confirmation_message(get_lang('LinkAdded'), false); |
|
418 | 418 | } |
419 | 419 | if (isset ($_GET['addresult'])) { |
420 | - Display :: display_confirmation_message(get_lang('ResultAdded'),false); |
|
420 | + Display :: display_confirmation_message(get_lang('ResultAdded'), false); |
|
421 | 421 | } |
422 | 422 | if (isset ($_GET['editcat'])) { |
423 | - Display :: display_confirmation_message(get_lang('CategoryEdited'),false); |
|
423 | + Display :: display_confirmation_message(get_lang('CategoryEdited'), false); |
|
424 | 424 | } |
425 | 425 | if (isset ($_GET['editeval'])) { |
426 | - Display :: display_confirmation_message(get_lang('EvaluationEdited'),false); |
|
426 | + Display :: display_confirmation_message(get_lang('EvaluationEdited'), false); |
|
427 | 427 | } |
428 | 428 | if (isset ($_GET['linkedited'])) { |
429 | - Display :: display_confirmation_message(get_lang('LinkEdited'),false); |
|
429 | + Display :: display_confirmation_message(get_lang('LinkEdited'), false); |
|
430 | 430 | } |
431 | 431 | if (isset ($_GET['nolinkitems'])) { |
432 | - Display :: display_warning_message(get_lang('NoLinkItems'),false); |
|
432 | + Display :: display_warning_message(get_lang('NoLinkItems'), false); |
|
433 | 433 | } |
434 | 434 | if (isset ($_GET['addallcat'])) { |
435 | - Display :: display_normal_message(get_lang('AddAllCat'),false); |
|
435 | + Display :: display_normal_message(get_lang('AddAllCat'), false); |
|
436 | 436 | } |
437 | 437 | if (isset ($confirmation_message)) { |
438 | - Display :: display_confirmation_message($confirmation_message,$filter_confirm_msg); |
|
438 | + Display :: display_confirmation_message($confirmation_message, $filter_confirm_msg); |
|
439 | 439 | } |
440 | 440 | if (isset ($warning_message)) { |
441 | - Display :: display_warning_message($warning_message,$filter_warning_msg); |
|
441 | + Display :: display_warning_message($warning_message, $filter_warning_msg); |
|
442 | 442 | } |
443 | 443 | if (isset ($move_form)) { |
444 | - Display :: display_normal_message($move_form->toHtml(),false); |
|
444 | + Display :: display_normal_message($move_form->toHtml(), false); |
|
445 | 445 | } |
446 | 446 | // LOAD DATA & DISPLAY TABLE - |
447 | -$is_platform_admin= api_is_platform_admin(); |
|
448 | -$is_course_admin= api_is_allowed_to_edit(); |
|
447 | +$is_platform_admin = api_is_platform_admin(); |
|
448 | +$is_course_admin = api_is_allowed_to_edit(); |
|
449 | 449 | |
450 | 450 | //load data for category, evaluation and links |
451 | 451 | if (empty($selectcat)) { |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | null, |
463 | 463 | api_get_self().'?selectcat='.$selectcat |
464 | 464 | ); |
465 | -$values= $simple_search_form->exportValues(); |
|
465 | +$values = $simple_search_form->exportValues(); |
|
466 | 466 | $keyword = ''; |
467 | 467 | if (isset($_GET['search']) && !empty($_GET['search'])) { |
468 | 468 | $keyword = Security::remove_XSS($_GET['search']); |
@@ -472,13 +472,13 @@ discard block |
||
472 | 472 | } |
473 | 473 | |
474 | 474 | if (!empty($keyword)) { |
475 | - $cats= Category :: load($category); |
|
476 | - $allcat= array (); |
|
477 | - if ((isset($_GET['selectcat']) && $_GET['selectcat']==0) && isset($_GET['search'])) { |
|
478 | - $allcat= $cats[0]->get_subcategories(null); |
|
479 | - $allcat_info = Category::find_category($keyword,$allcat); |
|
480 | - $alleval=array(); |
|
481 | - $alllink=array(); |
|
475 | + $cats = Category :: load($category); |
|
476 | + $allcat = array(); |
|
477 | + if ((isset($_GET['selectcat']) && $_GET['selectcat'] == 0) && isset($_GET['search'])) { |
|
478 | + $allcat = $cats[0]->get_subcategories(null); |
|
479 | + $allcat_info = Category::find_category($keyword, $allcat); |
|
480 | + $alleval = array(); |
|
481 | + $alllink = array(); |
|
482 | 482 | } else { |
483 | 483 | $alleval = Evaluation::find_evaluations($keyword, $cats[0]->get_id()); |
484 | 484 | $alllink = LinkFactory::find_links($keyword, $cats[0]->get_id()); |
@@ -486,13 +486,13 @@ discard block |
||
486 | 486 | |
487 | 487 | } elseif (isset ($_GET['studentoverview'])) { |
488 | 488 | //@todo this code seems to be deprecated because the gradebook tab is off |
489 | - $cats= Category :: load($category); |
|
490 | - $stud_id= (api_is_allowed_to_edit() ? null : api_get_user_id()); |
|
491 | - $allcat= array (); |
|
492 | - $alleval= $cats[0]->get_evaluations($stud_id, true); |
|
493 | - $alllink= $cats[0]->get_links($stud_id, true); |
|
489 | + $cats = Category :: load($category); |
|
490 | + $stud_id = (api_is_allowed_to_edit() ? null : api_get_user_id()); |
|
491 | + $allcat = array(); |
|
492 | + $alleval = $cats[0]->get_evaluations($stud_id, true); |
|
493 | + $alllink = $cats[0]->get_links($stud_id, true); |
|
494 | 494 | if (isset ($_GET['exportpdf'])) { |
495 | - $datagen = new GradebookDataGenerator ($allcat,$alleval, $alllink); |
|
495 | + $datagen = new GradebookDataGenerator($allcat, $alleval, $alllink); |
|
496 | 496 | $header_names = array( |
497 | 497 | get_lang('Name'), |
498 | 498 | get_lang('Description'), |
@@ -500,18 +500,18 @@ discard block |
||
500 | 500 | get_lang('Date'), |
501 | 501 | get_lang('Results'), |
502 | 502 | ); |
503 | - $data_array = $datagen->get_data(GradebookDataGenerator :: GDG_SORT_NAME,0,null,true); |
|
503 | + $data_array = $datagen->get_data(GradebookDataGenerator :: GDG_SORT_NAME, 0, null, true); |
|
504 | 504 | $newarray = array(); |
505 | 505 | foreach ($data_array as $data) { |
506 | 506 | $newarray[] = array_slice($data, 1); |
507 | 507 | } |
508 | - $pdf= new Cezpdf(); |
|
508 | + $pdf = new Cezpdf(); |
|
509 | 509 | $pdf->selectFont(api_get_path(LIBRARY_PATH).'ezpdf/fonts/Courier.afm'); |
510 | 510 | $pdf->ezSetMargins(30, 30, 50, 30); |
511 | 511 | $pdf->ezSetY(810); |
512 | - $pdf->ezText(get_lang('FlatView').' ('. api_convert_and_format_date(null, DATE_FORMAT_SHORT) . ' ' . api_convert_and_format_date(null, TIME_NO_SEC_FORMAT) .')',12,array('justification'=>'center')); |
|
513 | - $pdf->line(50,790,550,790); |
|
514 | - $pdf->line(50,40,550,40); |
|
512 | + $pdf->ezText(get_lang('FlatView').' ('.api_convert_and_format_date(null, DATE_FORMAT_SHORT).' '.api_convert_and_format_date(null, TIME_NO_SEC_FORMAT).')', 12, array('justification'=>'center')); |
|
513 | + $pdf->line(50, 790, 550, 790); |
|
514 | + $pdf->line(50, 40, 550, 40); |
|
515 | 515 | $pdf->ezSetY(750); |
516 | 516 | $pdf->ezTable( |
517 | 517 | $newarray, |
@@ -528,57 +528,57 @@ discard block |
||
528 | 528 | $pdf->ezStream(); |
529 | 529 | exit; |
530 | 530 | } |
531 | -} elseif (!empty($_GET['export_certificate'])){ |
|
531 | +} elseif (!empty($_GET['export_certificate'])) { |
|
532 | 532 | //@todo this code seems not to be used |
533 | 533 | $user_id = strval(intval($_GET['user'])); |
534 | - if (!api_is_allowed_to_edit(true,true)) { |
|
534 | + if (!api_is_allowed_to_edit(true, true)) { |
|
535 | 535 | $user_id = api_get_user_id(); |
536 | 536 | } |
537 | - $category = Category :: load ($_GET['cat_id']); |
|
537 | + $category = Category :: load($_GET['cat_id']); |
|
538 | 538 | if ($category[0]->is_certificate_available($user_id)) { |
539 | 539 | $user = api_get_user_info($user_id); |
540 | 540 | $scoredisplay = ScoreDisplay :: instance(); |
541 | 541 | $scorecourse = $category[0]->calc_score($user_id); |
542 | - $scorecourse_display = (isset($scorecourse) ? $scoredisplay->display_score($scorecourse,SCORE_AVERAGE) : get_lang('NoResultsAvailable')); |
|
542 | + $scorecourse_display = (isset($scorecourse) ? $scoredisplay->display_score($scorecourse, SCORE_AVERAGE) : get_lang('NoResultsAvailable')); |
|
543 | 543 | |
544 | 544 | $cattotal = Category :: load(0); |
545 | - $scoretotal= $cattotal[0]->calc_score($user_id); |
|
546 | - $scoretotal_display = (isset($scoretotal) ? $scoredisplay->display_score($scoretotal,SCORE_PERCENT) : get_lang('NoResultsAvailable')); |
|
545 | + $scoretotal = $cattotal[0]->calc_score($user_id); |
|
546 | + $scoretotal_display = (isset($scoretotal) ? $scoredisplay->display_score($scoretotal, SCORE_PERCENT) : get_lang('NoResultsAvailable')); |
|
547 | 547 | |
548 | 548 | //prepare all necessary variables: |
549 | 549 | $organization_name = api_get_setting('Institution'); |
550 | 550 | $portal_name = api_get_setting('siteName'); |
551 | 551 | $stud_fn = $user['firstname']; |
552 | 552 | $stud_ln = $user['lastname']; |
553 | - $certif_text = sprintf(get_lang('CertificateWCertifiesStudentXFinishedCourseYWithGradeZ'),$organization_name,$stud_fn.' '.$stud_ln,$category[0]->get_name(),$scorecourse_display); |
|
554 | - $certif_text = str_replace("\\n","\n",$certif_text); |
|
553 | + $certif_text = sprintf(get_lang('CertificateWCertifiesStudentXFinishedCourseYWithGradeZ'), $organization_name, $stud_fn.' '.$stud_ln, $category[0]->get_name(), $scorecourse_display); |
|
554 | + $certif_text = str_replace("\\n", "\n", $certif_text); |
|
555 | 555 | $date = api_convert_and_format_date(null, DATE_FORMAT_SHORT); |
556 | 556 | |
557 | - $pdf= new Cezpdf('a4','landscape'); |
|
557 | + $pdf = new Cezpdf('a4', 'landscape'); |
|
558 | 558 | $pdf->selectFont(api_get_path(LIBRARY_PATH).'ezpdf/fonts/Courier.afm'); |
559 | 559 | $pdf->ezSetMargins(30, 30, 50, 50); |
560 | 560 | //line Y coordinates in landscape mode are upside down (500 is on top, 10 is on the bottom) |
561 | - $pdf->line(50,50,790,50); |
|
562 | - $pdf->line(50,550,790,550); |
|
561 | + $pdf->line(50, 50, 790, 50); |
|
562 | + $pdf->line(50, 550, 790, 550); |
|
563 | 563 | $pdf->ezSetY(450); |
564 | 564 | $pdf->ezSetY(480); |
565 | - $pdf->ezText($certif_text,28,array('justification'=>'center')); |
|
565 | + $pdf->ezText($certif_text, 28, array('justification'=>'center')); |
|
566 | 566 | //$pdf->ezSetY(750); |
567 | 567 | $pdf->ezSetY(50); |
568 | - $pdf->ezText($date,18,array('justification'=>'center')); |
|
568 | + $pdf->ezText($date, 18, array('justification'=>'center')); |
|
569 | 569 | $pdf->ezSetY(580); |
570 | - $pdf->ezText($organization_name,22,array('justification'=>'left')); |
|
570 | + $pdf->ezText($organization_name, 22, array('justification'=>'left')); |
|
571 | 571 | $pdf->ezSetY(580); |
572 | - $pdf->ezText($portal_name,22,array('justification'=>'right')); |
|
572 | + $pdf->ezText($portal_name, 22, array('justification'=>'right')); |
|
573 | 573 | $pdf->ezStream(); |
574 | 574 | } |
575 | 575 | exit; |
576 | 576 | } else { |
577 | - $cats= Category :: load($category); |
|
578 | - $stud_id= (api_is_allowed_to_edit() ? null : api_get_user_id()); |
|
579 | - $allcat= $cats[0]->get_subcategories($stud_id); |
|
580 | - $alleval= $cats[0]->get_evaluations($stud_id); |
|
581 | - $alllink= $cats[0]->get_links($stud_id); |
|
577 | + $cats = Category :: load($category); |
|
578 | + $stud_id = (api_is_allowed_to_edit() ? null : api_get_user_id()); |
|
579 | + $allcat = $cats[0]->get_subcategories($stud_id); |
|
580 | + $alleval = $cats[0]->get_evaluations($stud_id); |
|
581 | + $alllink = $cats[0]->get_links($stud_id); |
|
582 | 582 | } |
583 | 583 | $addparams = array('selectcat' => $cats[0]->get_id()); |
584 | 584 | if (isset($_GET['search'])) { |
@@ -587,10 +587,10 @@ discard block |
||
587 | 587 | if (isset ($_GET['studentoverview'])) { |
588 | 588 | $addparams['studentoverview'] = ''; |
589 | 589 | } |
590 | -if (isset($allcat_info) && count($allcat_info)>=0 && (isset($_GET['selectcat']) && $_GET['selectcat']==0) && isset($_GET['search']) && strlen(trim($_GET['search']))>0 ) { |
|
591 | - $allcat=$allcat_info; |
|
590 | +if (isset($allcat_info) && count($allcat_info) >= 0 && (isset($_GET['selectcat']) && $_GET['selectcat'] == 0) && isset($_GET['search']) && strlen(trim($_GET['search'])) > 0) { |
|
591 | + $allcat = $allcat_info; |
|
592 | 592 | } else { |
593 | - $allcat=$allcat; |
|
593 | + $allcat = $allcat; |
|
594 | 594 | } |
595 | 595 | $gradebooktable = new GradebookTable( |
596 | 596 | $cats[0], |
@@ -603,10 +603,10 @@ discard block |
||
603 | 603 | api_is_course_tutor() |
604 | 604 | ) { |
605 | 605 | Display :: display_normal_message( |
606 | - get_lang('GradebookWelcomeMessage') . |
|
606 | + get_lang('GradebookWelcomeMessage'). |
|
607 | 607 | '<br /><br /> |
608 | - <form name="createcat" method="post" action="' . api_get_self() . '?createallcategories=1"> |
|
609 | - <input type="submit" value="' . get_lang('CreateAllCat') . '"></form>', |
|
608 | + <form name="createcat" method="post" action="' . api_get_self().'?createallcategories=1"> |
|
609 | + <input type="submit" value="' . get_lang('CreateAllCat').'"></form>', |
|
610 | 610 | false |
611 | 611 | ); |
612 | 612 | } |
@@ -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 | } |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | */ |
8 | 8 | //$cidReset = true; |
9 | 9 | require_once '../inc/global.inc.php'; |
10 | -$current_course_tool = TOOL_GRADEBOOK; |
|
10 | +$current_course_tool = TOOL_GRADEBOOK; |
|
11 | 11 | |
12 | 12 | api_protect_course_script(true); |
13 | 13 | api_block_anonymous_users(); |
@@ -25,14 +25,14 @@ discard block |
||
25 | 25 | $resultadd, |
26 | 26 | 'add_result_form', |
27 | 27 | null, |
28 | - api_get_self() . '?selectcat=' . Security::remove_XSS($category) . '&selecteval=' . $selectEval.'&'.api_get_cidreq() |
|
28 | + api_get_self().'?selectcat='.Security::remove_XSS($category).'&selecteval='.$selectEval.'&'.api_get_cidreq() |
|
29 | 29 | ); |
30 | 30 | $table = $add_result_form->toHtml(); |
31 | 31 | if ($add_result_form->validate()) { |
32 | 32 | $values = $add_result_form->exportValues(); |
33 | 33 | $nr_users = $values['nr_users']; |
34 | 34 | if ($nr_users == '0') { |
35 | - header('Location: gradebook_view_result.php?addresultnostudents=&selecteval=' . $selectEval.'&'.api_get_cidreq()); |
|
35 | + header('Location: gradebook_view_result.php?addresultnostudents=&selecteval='.$selectEval.'&'.api_get_cidreq()); |
|
36 | 36 | exit; |
37 | 37 | } |
38 | 38 | $scores = ($values['score']); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $res->add(); |
46 | 46 | next($scores); |
47 | 47 | } |
48 | - header('Location: gradebook_view_result.php?addresult=&selecteval=' . $selectEval.'&'.api_get_cidreq()); |
|
48 | + header('Location: gradebook_view_result.php?addresult=&selecteval='.$selectEval.'&'.api_get_cidreq()); |
|
49 | 49 | exit; |
50 | 50 | } |
51 | 51 | $interbreadcrumb[] = array( |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | null, |
31 | 31 | 'add_eval_form', |
32 | 32 | null, |
33 | - api_get_self() . '?selectcat=' . $select_cat.'&'.api_get_cidreq() |
|
33 | + api_get_self().'?selectcat='.$select_cat.'&'.api_get_cidreq() |
|
34 | 34 | ); |
35 | 35 | |
36 | 36 | if ($form->validate()) { |
@@ -69,23 +69,23 @@ discard block |
||
69 | 69 | //header('Location: gradebook_add_user.php?selecteval=' . $eval->get_id()); |
70 | 70 | exit; |
71 | 71 | } else { |
72 | - header('Location: ' . Security::remove_XSS($_SESSION['gradebook_dest']) . '?selectcat=' . $eval->get_category_id().'&'.api_get_cidreq()); |
|
72 | + header('Location: '.Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.$eval->get_category_id().'&'.api_get_cidreq()); |
|
73 | 73 | exit; |
74 | 74 | } |
75 | 75 | } else { |
76 | 76 | $val_addresult = isset($values['addresult']) ? $values['addresult'] : null; |
77 | 77 | if ($val_addresult == 1) { |
78 | - header('Location: gradebook_add_result.php?selecteval=' . $eval->get_id().'&'.api_get_cidreq()); |
|
78 | + header('Location: gradebook_add_result.php?selecteval='.$eval->get_id().'&'.api_get_cidreq()); |
|
79 | 79 | exit; |
80 | 80 | } else { |
81 | - header('Location: ' . Security::remove_XSS($_SESSION['gradebook_dest']) . '?selectcat=' . $eval->get_category_id().'&'.api_get_cidreq()); |
|
81 | + header('Location: '.Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.$eval->get_category_id().'&'.api_get_cidreq()); |
|
82 | 82 | exit; |
83 | 83 | } |
84 | 84 | } |
85 | 85 | } |
86 | 86 | |
87 | 87 | $interbreadcrumb[] = array( |
88 | - 'url' => Security::remove_XSS($_SESSION['gradebook_dest']) . '?selectcat=' . $select_cat.'&'.api_get_cidreq(), |
|
88 | + 'url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.$select_cat.'&'.api_get_cidreq(), |
|
89 | 89 | 'name' => get_lang('Gradebook')) |
90 | 90 | ; |
91 | 91 | $this_section = SECTION_COURSES; |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $("#hid_category_id option:selected").each(function () { |
97 | 97 | var cat_id = $(this).val(); |
98 | 98 | $.ajax({ |
99 | - url: "' . api_get_path(WEB_AJAX_PATH) . 'gradebook.ajax.php?a=get_gradebook_weight", |
|
99 | + url: "' . api_get_path(WEB_AJAX_PATH).'gradebook.ajax.php?a=get_gradebook_weight", |
|
100 | 100 | data: "cat_id="+cat_id, |
101 | 101 | success: function(return_value) { |
102 | 102 | if (return_value != 0 ) { |
@@ -558,7 +558,7 @@ |
||
558 | 558 | $my_api_cidreq = 'cidReq=' . $my_category['course_code']; |
559 | 559 | } |
560 | 560 | if ($show_add_link && !$message_resource) { |
561 | - $actionsLeft .= '<a href="gradebook_add_eval.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '" >' . |
|
561 | + $actionsLeft .= '<a href="gradebook_add_eval.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '" >' . |
|
562 | 562 | Display::return_icon('new_evaluation.png', get_lang('NewEvaluation'), '', ICON_SIZE_MEDIUM) . '</a>'; |
563 | 563 | $cats = Category :: load($selectcat); |
564 | 564 |
@@ -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 | } |
@@ -20,37 +20,37 @@ discard block |
||
20 | 20 | if (api_is_allowed_to_edit(null, true)) { |
21 | 21 | $header = '<div class="actions">'; |
22 | 22 | if ($page != 'statistics') { |
23 | - $header .= '<a href="' . Security::remove_XSS($_SESSION['gradebook_dest']) . '?selectcat=' . $selectcat . '&'.api_get_cidreq().'">' . |
|
24 | - Display::return_icon(('back.png'), get_lang('FolderView'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
23 | + $header .= '<a href="'.Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.$selectcat.'&'.api_get_cidreq().'">'. |
|
24 | + Display::return_icon(('back.png'), get_lang('FolderView'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
25 | 25 | if ($evalobj->get_course_code() == null) { |
26 | 26 | |
27 | 27 | } elseif (!$evalobj->has_results()) { |
28 | - $header .= '<a href="gradebook_add_result.php?'.api_get_cidreq().'&selectcat=' . $selectcat . '&selecteval=' . $evalobj->get_id() . '"> |
|
29 | - ' . Display::return_icon('evaluation_rate.png', get_lang('AddResult'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
28 | + $header .= '<a href="gradebook_add_result.php?'.api_get_cidreq().'&selectcat='.$selectcat.'&selecteval='.$evalobj->get_id().'"> |
|
29 | + ' . Display::return_icon('evaluation_rate.png', get_lang('AddResult'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | if (api_is_platform_admin() || $evalobj->is_locked() == false) { |
33 | - $header .= '<a href="' . api_get_self() . '?'.api_get_cidreq().'&selecteval=' . $evalobj->get_id() . '&import=">' . |
|
34 | - Display::return_icon('import_evaluation.png', get_lang('ImportResult'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
33 | + $header .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&selecteval='.$evalobj->get_id().'&import=">'. |
|
34 | + Display::return_icon('import_evaluation.png', get_lang('ImportResult'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | if ($evalobj->has_results()) { |
38 | - $header .= '<a href="' . api_get_self() . '?'.api_get_cidreq().'&selecteval=' . $evalobj->get_id() . '&export=">' . |
|
39 | - Display::return_icon('export_evaluation.png', get_lang('ExportResult'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
38 | + $header .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&selecteval='.$evalobj->get_id().'&export=">'. |
|
39 | + Display::return_icon('export_evaluation.png', get_lang('ExportResult'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
40 | 40 | |
41 | 41 | if (api_is_platform_admin() || $evalobj->is_locked() == false) { |
42 | - $header .= '<a href="gradebook_edit_result.php?'.api_get_cidreq().'&selecteval=' . $evalobj->get_id() . '">' . |
|
43 | - Display::return_icon('edit.png', get_lang('EditResult'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
44 | - $header .= '<a href="' . api_get_self() . '?'.api_get_cidreq().'&selecteval=' . $evalobj->get_id() . '&deleteall=" onclick="return confirmationall();">' . |
|
45 | - Display::return_icon('delete.png', get_lang('DeleteResult'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
42 | + $header .= '<a href="gradebook_edit_result.php?'.api_get_cidreq().'&selecteval='.$evalobj->get_id().'">'. |
|
43 | + Display::return_icon('edit.png', get_lang('EditResult'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
44 | + $header .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&selecteval='.$evalobj->get_id().'&deleteall=" onclick="return confirmationall();">'. |
|
45 | + Display::return_icon('delete.png', get_lang('DeleteResult'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
46 | 46 | } |
47 | 47 | } |
48 | 48 | |
49 | - $header .= '<a href="' . api_get_self() . '?'.api_get_cidreq().'&print=&selecteval=' . $evalobj->get_id() . '" target="_blank">' . |
|
50 | - Display::return_icon('printer.png', get_lang('Print'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
49 | + $header .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&print=&selecteval='.$evalobj->get_id().'" target="_blank">'. |
|
50 | + Display::return_icon('printer.png', get_lang('Print'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
51 | 51 | } else { |
52 | - $header .= '<a href="gradebook_view_result.php?'.api_get_cidreq().'&selecteval=' . Security::remove_XSS($_GET['selecteval']) . '"> ' . |
|
53 | - Display::return_icon(('back.png'), get_lang('FolderView'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
52 | + $header .= '<a href="gradebook_view_result.php?'.api_get_cidreq().'&selecteval='.Security::remove_XSS($_GET['selecteval']).'"> '. |
|
53 | + Display::return_icon(('back.png'), get_lang('FolderView'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
54 | 54 | } |
55 | 55 | $header .= '</div>'; |
56 | 56 | } |
@@ -69,17 +69,17 @@ discard block |
||
69 | 69 | $score = $evalobj->calc_score(); |
70 | 70 | |
71 | 71 | if ($score != null) { |
72 | - $average = get_lang('Average') . ' :<b> ' . $scoredisplay->display_score($score, SCORE_AVERAGE) . '</b>'; |
|
72 | + $average = get_lang('Average').' :<b> '.$scoredisplay->display_score($score, SCORE_AVERAGE).'</b>'; |
|
73 | 73 | $student_score = $evalobj->calc_score(api_get_user_id()); |
74 | 74 | $student_score = Display::tag( |
75 | 75 | 'h3', |
76 | - get_lang('Score') . ': ' . $scoredisplay->display_score($student_score, SCORE_DIV_PERCENT) |
|
76 | + get_lang('Score').': '.$scoredisplay->display_score($student_score, SCORE_DIV_PERCENT) |
|
77 | 77 | ); |
78 | 78 | } |
79 | 79 | } |
80 | 80 | $description = ""; |
81 | 81 | if (!$evalobj->get_description() == '') { |
82 | - $description = get_lang('Description') . ' :<b> ' . $evalobj->get_description() . '</b><br>'; |
|
82 | + $description = get_lang('Description').' :<b> '.$evalobj->get_description().'</b><br>'; |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | if ($evalobj->get_course_code() == null) { |
@@ -89,17 +89,17 @@ discard block |
||
89 | 89 | } |
90 | 90 | |
91 | 91 | $evalinfo = '<table width="100%" border="0"><tr><td>'; |
92 | - $evalinfo .= '<h2>' . $evalobj->get_name() . '</h2><hr>'; |
|
92 | + $evalinfo .= '<h2>'.$evalobj->get_name().'</h2><hr>'; |
|
93 | 93 | $evalinfo .= $description; |
94 | - $evalinfo .= get_lang('Course') . ' :<b> ' . $course . '</b><br />'; |
|
95 | - $evalinfo .= get_lang('QualificationNumeric') . ' :<b> ' . $evalobj->get_max() . '</b><br>' . $average; |
|
94 | + $evalinfo .= get_lang('Course').' :<b> '.$course.'</b><br />'; |
|
95 | + $evalinfo .= get_lang('QualificationNumeric').' :<b> '.$evalobj->get_max().'</b><br>'.$average; |
|
96 | 96 | |
97 | 97 | if (!api_is_allowed_to_edit()) { |
98 | 98 | $evalinfo .= $student_score; |
99 | 99 | } |
100 | 100 | |
101 | 101 | if (!$evalobj->has_results()) { |
102 | - $evalinfo .= '<br /><i>' . get_lang('NoResultsInEvaluation') . '</i>'; |
|
102 | + $evalinfo .= '<br /><i>'.get_lang('NoResultsInEvaluation').'</i>'; |
|
103 | 103 | } elseif ($scoredisplay->is_custom() && api_get_self() != '/main/gradebook/gradebook_statistics.php') { |
104 | 104 | if (api_is_allowed_to_edit(null, true)) { |
105 | 105 | if ($page != 'statistics') { |
@@ -109,8 +109,8 @@ discard block |
||
109 | 109 | } |
110 | 110 | if ($page != 'statistics') { |
111 | 111 | if (api_is_allowed_to_edit(null, true)) { |
112 | - $evalinfo .= '<br /><a href="gradebook_statistics.php?' . api_get_cidreq() . '&selecteval=' . Security::remove_XSS($_GET['selecteval']) . '"> ' . |
|
113 | - Display::return_icon('statistics.png', get_lang('ViewStatistics'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
112 | + $evalinfo .= '<br /><a href="gradebook_statistics.php?'.api_get_cidreq().'&selecteval='.Security::remove_XSS($_GET['selecteval']).'"> '. |
|
113 | + Display::return_icon('statistics.png', get_lang('ViewStatistics'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
114 | 114 | } |
115 | 115 | } |
116 | 116 | $evalinfo .= '</td><td>'.Display::return_icon('tutorial.gif', '', ['style' => 'float:right; position:relative;']).'</td></table>'; |
@@ -135,14 +135,14 @@ discard block |
||
135 | 135 | $select_cat = $catobj->get_parent_id(); |
136 | 136 | $url = 'gradebook_flatview.php'; |
137 | 137 | } |
138 | - $header .= '<a href="' . $url . '?' . api_get_cidreq() . '&selectcat=' . $select_cat . '">' . |
|
139 | - Display::return_icon('back.png', get_lang('FolderView'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
138 | + $header .= '<a href="'.$url.'?'.api_get_cidreq().'&selectcat='.$select_cat.'">'. |
|
139 | + Display::return_icon('back.png', get_lang('FolderView'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
140 | 140 | |
141 | 141 | $pageNum = isset($_GET['flatviewlist_page_nr']) ? intval($_GET['flatviewlist_page_nr']) : null; |
142 | 142 | $perPage = isset($_GET['flatviewlist_per_page']) ? intval($_GET['flatviewlist_per_page']) : null; |
143 | 143 | $offset = isset($_GET['offset']) ? $_GET['offset'] : '0'; |
144 | 144 | |
145 | - $exportCsvUrl = api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query([ |
|
145 | + $exportCsvUrl = api_get_self().'?'.api_get_cidreq().'&'.http_build_query([ |
|
146 | 146 | 'export_format' => 'csv', |
147 | 147 | 'export_report' => 'export_report', |
148 | 148 | 'selectcat' => $catobj->get_id() |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $exportCsvUrl |
154 | 154 | ); |
155 | 155 | |
156 | - $exportXlsUrl = api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query([ |
|
156 | + $exportXlsUrl = api_get_self().'?'.api_get_cidreq().'&'.http_build_query([ |
|
157 | 157 | 'export_format' => 'xls', |
158 | 158 | 'export_report' => 'export_report', |
159 | 159 | 'selectcat' => $catobj->get_id() |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | $exportXlsUrl |
165 | 165 | ); |
166 | 166 | |
167 | - $exportDocUrl = api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query([ |
|
167 | + $exportDocUrl = api_get_self().'?'.api_get_cidreq().'&'.http_build_query([ |
|
168 | 168 | 'export_format' => 'doc', |
169 | 169 | 'export_report' => 'export_report', |
170 | 170 | 'selectcat' => $catobj->get_id() |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $exportDocUrl |
176 | 176 | ); |
177 | 177 | |
178 | - $exportPrintUrl = api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query([ |
|
178 | + $exportPrintUrl = api_get_self().'?'.api_get_cidreq().'&'.http_build_query([ |
|
179 | 179 | 'print' => '', |
180 | 180 | 'selectcat' => $catobj->get_id(), |
181 | 181 | ]); |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | ['target' => '_blank'] |
187 | 187 | ); |
188 | 188 | |
189 | - $exportPdfUrl = api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query([ |
|
189 | + $exportPdfUrl = api_get_self().'?'.api_get_cidreq().'&'.http_build_query([ |
|
190 | 190 | 'exportpdf' => '', |
191 | 191 | 'selectcat' => $catobj->get_id(), |
192 | 192 | 'offset' => $offset, |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | $aditionalButtons .= isset($certificateLinkInfo['badge_link']) ? $certificateLinkInfo['badge_link'] : ''; |
298 | 298 | $aditionalButtons .= '</div>'; |
299 | 299 | } |
300 | - $scoreinfo .= '<strong>' . sprintf(get_lang('TotalX'), $scorecourse_display . $aditionalButtons). '</strong>'; |
|
300 | + $scoreinfo .= '<strong>'.sprintf(get_lang('TotalX'), $scorecourse_display.$aditionalButtons).'</strong>'; |
|
301 | 301 | |
302 | 302 | } |
303 | 303 | Display :: display_normal_message($scoreinfo, false); |
@@ -308,10 +308,10 @@ discard block |
||
308 | 308 | $header = '<div class="actions"><table>'; |
309 | 309 | $header .= '<tr>'; |
310 | 310 | if (!$selectcat == '0') { |
311 | - $header .= '<td><a href="' . api_get_self() . '?selectcat=' . $catobj->get_parent_id() . '">' . |
|
312 | - Display::return_icon('back.png', get_lang('BackTo') . ' ' . get_lang('RootCat'), '', ICON_SIZE_MEDIUM) . '</a></td>'; |
|
311 | + $header .= '<td><a href="'.api_get_self().'?selectcat='.$catobj->get_parent_id().'">'. |
|
312 | + Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('RootCat'), '', ICON_SIZE_MEDIUM).'</a></td>'; |
|
313 | 313 | } |
314 | - $header .= '<td>' . get_lang('CurrentCategory') . '</td>' . |
|
314 | + $header .= '<td>'.get_lang('CurrentCategory').'</td>'. |
|
315 | 315 | '<td><form name="selector"><select name="selectcat" onchange="document.selector.submit()">'; |
316 | 316 | $cats = Category :: load(); |
317 | 317 | |
@@ -324,15 +324,15 @@ discard block |
||
324 | 324 | } |
325 | 325 | $line = isset($line) ? $line : ''; |
326 | 326 | if (isset($_GET['selectcat']) && $_GET['selectcat'] == $cat[0]) { |
327 | - $header .= '<option selected value=' . $cat[0] . '>' . $line . ' ' . $cat[1] . '</option>'; |
|
327 | + $header .= '<option selected value='.$cat[0].'>'.$line.' '.$cat[1].'</option>'; |
|
328 | 328 | } else { |
329 | - $header .= '<option value=' . $cat[0] . '>' . $line . ' ' . $cat[1] . '</option>'; |
|
329 | + $header .= '<option value='.$cat[0].'>'.$line.' '.$cat[1].'</option>'; |
|
330 | 330 | } |
331 | 331 | $line = ''; |
332 | 332 | } |
333 | 333 | $header .= '</select></form></td>'; |
334 | 334 | if (!empty($simple_search_form) && $message_resource === false) { |
335 | - $header .= '<td style="vertical-align: top;">' . $simple_search_form->toHtml() . '</td>'; |
|
335 | + $header .= '<td style="vertical-align: top;">'.$simple_search_form->toHtml().'</td>'; |
|
336 | 336 | } else { |
337 | 337 | $header .= '<td></td>'; |
338 | 338 | } |
@@ -343,9 +343,9 @@ discard block |
||
343 | 343 | } elseif (!(isset($_GET['studentoverview']))) { |
344 | 344 | |
345 | 345 | } else { |
346 | - $header .= '<td style="vertical-align: top;"><a href="' . api_get_self() . '?' . api_get_cidreq() . '&studentoverview=&exportpdf=&selectcat=' . $catobj->get_id() . '" target="_blank"> |
|
346 | + $header .= '<td style="vertical-align: top;"><a href="'.api_get_self().'?'.api_get_cidreq().'&studentoverview=&exportpdf=&selectcat='.$catobj->get_id().'" target="_blank"> |
|
347 | 347 | '.Display::return_icon('pdf.png', get_lang('ExportPDF'), [], ICON_SIZE_MEDIUM).' |
348 | - ' . get_lang('ExportPDF') . '</a>'; |
|
348 | + ' . get_lang('ExportPDF').'</a>'; |
|
349 | 349 | } |
350 | 350 | $header .= '</td></tr>'; |
351 | 351 | $header .= '</table></div>'; |
@@ -358,33 +358,33 @@ discard block |
||
358 | 358 | |
359 | 359 | if (api_is_allowed_to_edit(null, true)) { |
360 | 360 | if (empty($grade_model_id) || $grade_model_id == -1) { |
361 | - $actionsLeft .= '<a href="gradebook_add_cat.php?' . api_get_cidreq() . '&selectcat=' . $catobj->get_id() . '">' . |
|
362 | - Display::return_icon('new_folder.png', get_lang('AddGradebook'), array(), ICON_SIZE_MEDIUM) . '</a></td>'; |
|
361 | + $actionsLeft .= '<a href="gradebook_add_cat.php?'.api_get_cidreq().'&selectcat='.$catobj->get_id().'">'. |
|
362 | + Display::return_icon('new_folder.png', get_lang('AddGradebook'), array(), ICON_SIZE_MEDIUM).'</a></td>'; |
|
363 | 363 | } |
364 | 364 | if ($selectcat == '0') { |
365 | 365 | |
366 | 366 | } else { |
367 | 367 | $my_category = $catobj->shows_all_information_an_category($catobj->get_id()); |
368 | 368 | if ($my_api_cidreq == '') { |
369 | - $my_api_cidreq = 'cidReq=' . $my_category['course_code']; |
|
369 | + $my_api_cidreq = 'cidReq='.$my_category['course_code']; |
|
370 | 370 | } |
371 | 371 | if ($show_add_link && !$message_resource) { |
372 | - $actionsLeft .= '<a href="gradebook_add_eval.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '" >' . |
|
373 | - Display::return_icon('new_evaluation.png', get_lang('NewEvaluation'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
372 | + $actionsLeft .= '<a href="gradebook_add_eval.php?'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'" >'. |
|
373 | + Display::return_icon('new_evaluation.png', get_lang('NewEvaluation'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
374 | 374 | $cats = Category :: load($selectcat); |
375 | 375 | |
376 | 376 | if ($cats[0]->get_course_code() != null && !$message_resource) { |
377 | - $actionsLeft .= '<a href="gradebook_add_link.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '">' . |
|
378 | - Display::return_icon('new_online_evaluation.png', get_lang('MakeLink'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
377 | + $actionsLeft .= '<a href="gradebook_add_link.php?'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'">'. |
|
378 | + Display::return_icon('new_online_evaluation.png', get_lang('MakeLink'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
379 | 379 | } else { |
380 | - $actionsLeft .= '<a href="gradebook_add_link_select_course.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '">' . |
|
381 | - Display::return_icon('new_online_evaluation.png', get_lang('MakeLink'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
380 | + $actionsLeft .= '<a href="gradebook_add_link_select_course.php?'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'">'. |
|
381 | + Display::return_icon('new_online_evaluation.png', get_lang('MakeLink'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
382 | 382 | } |
383 | 383 | } |
384 | 384 | |
385 | 385 | if (!$message_resource) { |
386 | - $actionsLeft .= '<a href="gradebook_flatview.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '">' . |
|
387 | - Display::return_icon('stats.png', get_lang('FlatView'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
386 | + $actionsLeft .= '<a href="gradebook_flatview.php?'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'">'. |
|
387 | + Display::return_icon('stats.png', get_lang('FlatView'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
388 | 388 | |
389 | 389 | if ($my_category['generate_certificates'] == 1) { |
390 | 390 | $actionsLeft .= Display::url( |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | '', |
395 | 395 | ICON_SIZE_MEDIUM |
396 | 396 | ), |
397 | - "gradebook_display_certificate.php?$my_api_cidreq&cat_id=" . $selectcat |
|
397 | + "gradebook_display_certificate.php?$my_api_cidreq&cat_id=".$selectcat |
|
398 | 398 | ); |
399 | 399 | } |
400 | 400 | |
@@ -405,29 +405,29 @@ discard block |
||
405 | 405 | '', |
406 | 406 | ICON_SIZE_MEDIUM |
407 | 407 | ), |
408 | - "gradebook_display_summary.php?$my_api_cidreq&selectcat=" . $selectcat |
|
408 | + "gradebook_display_summary.php?$my_api_cidreq&selectcat=".$selectcat |
|
409 | 409 | ); |
410 | 410 | |
411 | 411 | // Right icons |
412 | - $actionsRight = '<a href="gradebook_edit_cat.php?editcat=' . $catobj->get_id() . '&cidReq=' . $catobj->get_course_code() . '&id_session='.$catobj->get_session_id(). '">' . |
|
413 | - Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
414 | - $actionsRight .= '<a href="../document/document.php?curdirpath=/certificates&' . $my_api_cidreq . '&origin=gradebook&selectcat=' . $catobj->get_id() . '">' . |
|
415 | - Display::return_icon('certificate.png', get_lang('AttachCertificate'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
412 | + $actionsRight = '<a href="gradebook_edit_cat.php?editcat='.$catobj->get_id().'&cidReq='.$catobj->get_course_code().'&id_session='.$catobj->get_session_id().'">'. |
|
413 | + Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
414 | + $actionsRight .= '<a href="../document/document.php?curdirpath=/certificates&'.$my_api_cidreq.'&origin=gradebook&selectcat='.$catobj->get_id().'">'. |
|
415 | + Display::return_icon('certificate.png', get_lang('AttachCertificate'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
416 | 416 | |
417 | 417 | if (empty($categories)) { |
418 | - $actionsRight .= '<a href="gradebook_edit_all.php?id_session=' . api_get_session_id() . '&' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '">' . |
|
419 | - Display::return_icon('percentage.png', get_lang('EditAllWeights'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
418 | + $actionsRight .= '<a href="gradebook_edit_all.php?id_session='.api_get_session_id().'&'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'">'. |
|
419 | + Display::return_icon('percentage.png', get_lang('EditAllWeights'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
420 | 420 | } |
421 | 421 | $score_display_custom = api_get_setting('gradebook_score_display_custom'); |
422 | 422 | if (api_get_setting('teachers_can_change_score_settings') == 'true' && $score_display_custom['my_display_custom'] == 'true') { |
423 | - $actionsRight .= '<a href="gradebook_scoring_system.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '">' . |
|
424 | - Display::return_icon('ranking.png', get_lang('ScoreEdit'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
423 | + $actionsRight .= '<a href="gradebook_scoring_system.php?'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'">'. |
|
424 | + Display::return_icon('ranking.png', get_lang('ScoreEdit'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
425 | 425 | } |
426 | 426 | |
427 | 427 | } |
428 | 428 | } |
429 | 429 | } elseif (isset($_GET['search'])) { |
430 | - echo $header = '<b>' . get_lang('SearchResults') . ' :</b>'; |
|
430 | + echo $header = '<b>'.get_lang('SearchResults').' :</b>'; |
|
431 | 431 | } |
432 | 432 | |
433 | 433 | $isDrhOfCourse = CourseManager::isUserSubscribedInCourseAsDrh( |
@@ -436,26 +436,26 @@ discard block |
||
436 | 436 | ); |
437 | 437 | |
438 | 438 | if ($isDrhOfCourse) { |
439 | - $$actionsLeft .= '<a href="gradebook_flatview.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '">' . |
|
440 | - Display::return_icon('stats.png', get_lang('FlatView'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
439 | + $$actionsLeft .= '<a href="gradebook_flatview.php?'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'">'. |
|
440 | + Display::return_icon('stats.png', get_lang('FlatView'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
441 | 441 | } |
442 | 442 | |
443 | - if (api_is_allowed_to_edit(null, true)){ |
|
443 | + if (api_is_allowed_to_edit(null, true)) { |
|
444 | 444 | echo $toolbar = Display::toolbarAction('gradebook-actions', array($actionsLeft, $actionsRight)); |
445 | 445 | } |
446 | 446 | |
447 | 447 | if (api_is_allowed_to_edit(null, true)) { |
448 | 448 | $weight = intval($catobj->get_weight()) > 0 ? $catobj->get_weight() : 0; |
449 | - $weight = '<strong>' . get_lang('TotalWeight') . ' : </strong>' . $weight; |
|
449 | + $weight = '<strong>'.get_lang('TotalWeight').' : </strong>'.$weight; |
|
450 | 450 | |
451 | 451 | $min_certification = (intval($catobj->get_certificate_min_score() > 0) ? $catobj->get_certificate_min_score() : 0); |
452 | - $min_certification = get_lang('CertificateMinScore') . ' : ' . $min_certification; |
|
453 | - $edit_icon = '<a href="gradebook_edit_cat.php?editcat=' . $catobj->get_id() . '&cidReq=' . $catobj->get_course_code() . '&id_session='.$catobj->get_session_id(). '">' . |
|
454 | - Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . '</a>'; |
|
452 | + $min_certification = get_lang('CertificateMinScore').' : '.$min_certification; |
|
453 | + $edit_icon = '<a href="gradebook_edit_cat.php?editcat='.$catobj->get_id().'&cidReq='.$catobj->get_course_code().'&id_session='.$catobj->get_session_id().'">'. |
|
454 | + Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>'; |
|
455 | 455 | //$msg = Display::tag('h3', $weight.' - '.$min_certification); |
456 | - $msg = $weight . ' - ' . $min_certification . $edit_icon; |
|
456 | + $msg = $weight.' - '.$min_certification.$edit_icon; |
|
457 | 457 | //@todo show description |
458 | - $description = (($catobj->get_description() == "" || is_null($catobj->get_description())) ? '' : '<strong>' . get_lang('GradebookDescriptionLog') . '</strong>' . ': ' . $catobj->get_description()); |
|
458 | + $description = (($catobj->get_description() == "" || is_null($catobj->get_description())) ? '' : '<strong>'.get_lang('GradebookDescriptionLog').'</strong>'.': '.$catobj->get_description()); |
|
459 | 459 | Display::display_normal_message($msg, false); |
460 | 460 | if (!empty($description)) { |
461 | 461 | echo Display::div($description, array()); |
@@ -483,24 +483,24 @@ discard block |
||
483 | 483 | $cattotal = Category :: load(0); |
484 | 484 | $scoretotal = $cattotal[0]->calc_score(api_get_user_id()); |
485 | 485 | $scoretotal_display = (isset($scoretotal) ? $scoredisplay->display_score($scoretotal, SCORE_PERCENT) : get_lang('NoResultsAvailable')); |
486 | - $scoreinfo = get_lang('StatsStudent') . ' :<b> ' . $user['complete_name']. '</b><br />'; |
|
486 | + $scoreinfo = get_lang('StatsStudent').' :<b> '.$user['complete_name'].'</b><br />'; |
|
487 | 487 | if ((!$catobj->get_id() == '0') && (!isset($_GET['studentoverview'])) && (!isset($_GET['search']))) |
488 | - $scoreinfo.= '<br />' . get_lang('TotalForThisCategory') . ' : <b>' . $scorecourse_display . '</b>'; |
|
489 | - $scoreinfo.= '<br />' . get_lang('Total') . ' : <b>' . $scoretotal_display . '</b>'; |
|
488 | + $scoreinfo .= '<br />'.get_lang('TotalForThisCategory').' : <b>'.$scorecourse_display.'</b>'; |
|
489 | + $scoreinfo .= '<br />'.get_lang('Total').' : <b>'.$scoretotal_display.'</b>'; |
|
490 | 490 | Display :: display_normal_message($scoreinfo, false); |
491 | 491 | } |
492 | 492 | // show navigation tree and buttons? |
493 | 493 | $header = '<div class="actions">'; |
494 | 494 | |
495 | 495 | if ($is_course_admin) { |
496 | - $header .= '<a href="gradebook_flatview.php?' . api_get_cidreq() . '&selectcat=' . $catobj->get_id() . '">' . Display::return_icon('stats.png', get_lang('FlatView'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
497 | - $header .= '<a href="gradebook_scoring_system.php?' . api_get_cidreq() . '&selectcat=' . $catobj->get_id() . '">' . Display::return_icon('settings.png', get_lang('ScoreEdit'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
496 | + $header .= '<a href="gradebook_flatview.php?'.api_get_cidreq().'&selectcat='.$catobj->get_id().'">'.Display::return_icon('stats.png', get_lang('FlatView'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
497 | + $header .= '<a href="gradebook_scoring_system.php?'.api_get_cidreq().'&selectcat='.$catobj->get_id().'">'.Display::return_icon('settings.png', get_lang('ScoreEdit'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
498 | 498 | } elseif (!(isset($_GET['studentoverview']))) { |
499 | - $header .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&studentoverview=&selectcat=' . $catobj->get_id() . '">' . Display::return_icon('view_list.gif', get_lang('FlatView')) . ' ' . get_lang('FlatView') . '</a>'; |
|
499 | + $header .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&studentoverview=&selectcat='.$catobj->get_id().'">'.Display::return_icon('view_list.gif', get_lang('FlatView')).' '.get_lang('FlatView').'</a>'; |
|
500 | 500 | } else { |
501 | - $header .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&studentoverview=&exportpdf=&selectcat=' . $catobj->get_id() . '" target="_blank">' . Display::return_icon('pdf.png', get_lang('ExportPDF'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
501 | + $header .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&studentoverview=&exportpdf=&selectcat='.$catobj->get_id().'" target="_blank">'.Display::return_icon('pdf.png', get_lang('ExportPDF'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
502 | 502 | } |
503 | - $header.='</div>'; |
|
503 | + $header .= '</div>'; |
|
504 | 504 | echo $header; |
505 | 505 | } |
506 | 506 | |
@@ -526,8 +526,8 @@ discard block |
||
526 | 526 | $item = $evals_links[$count]; |
527 | 527 | $score = $item->calc_score($user_id); |
528 | 528 | $my_score_denom = ($score[1] == 0) ? 1 : $score[1]; |
529 | - $item_value+=$score[0] / $my_score_denom * $item->get_weight(); |
|
530 | - $item_total+=$item->get_weight(); |
|
529 | + $item_value += $score[0] / $my_score_denom * $item->get_weight(); |
|
530 | + $item_total += $item->get_weight(); |
|
531 | 531 | } |
532 | 532 | $item_value = number_format($item_value, 2, '.', ' '); |
533 | 533 | $total_score = array($item_value, $item_total); |
@@ -541,17 +541,17 @@ discard block |
||
541 | 541 | $imageUrl = UserManager::getUserPicture($userid); |
542 | 542 | |
543 | 543 | $info = '<div class="row"><div class="col-md-3">'; |
544 | - $info .= '<div class="thumbnail"><img src="' . $imageUrl . '" /></div>'; |
|
544 | + $info .= '<div class="thumbnail"><img src="'.$imageUrl.'" /></div>'; |
|
545 | 545 | $info .= '</div>'; |
546 | 546 | $info .= '<div class="col-md-6">'; |
547 | - $info .= get_lang('Name') . ' : <a target="_blank" href="' . api_get_path(WEB_CODE_PATH) . 'social/profile.php?u=' . $userid . '"> ' . |
|
548 | - $user['complete_name'] . '</a><br />'; |
|
547 | + $info .= get_lang('Name').' : <a target="_blank" href="'.api_get_path(WEB_CODE_PATH).'social/profile.php?u='.$userid.'"> '. |
|
548 | + $user['complete_name'].'</a><br />'; |
|
549 | 549 | |
550 | 550 | if (api_get_setting('show_email_addresses') == 'true') { |
551 | - $info .= get_lang('Email') . ' : <a href="mailto:' . $user['email'] . '">' . $user['email'] . '</a><br />'; |
|
551 | + $info .= get_lang('Email').' : <a href="mailto:'.$user['email'].'">'.$user['email'].'</a><br />'; |
|
552 | 552 | } |
553 | 553 | |
554 | - $info .= get_lang('TotalUser') . ' : <b>' . $scorecourse_display . '</b>'; |
|
554 | + $info .= get_lang('TotalUser').' : <b>'.$scorecourse_display.'</b>'; |
|
555 | 555 | $info .= '</div>'; |
556 | 556 | $info .= '</div>'; |
557 | 557 |
@@ -52,15 +52,15 @@ discard block |
||
52 | 52 | */ |
53 | 53 | protected function build_move_form() |
54 | 54 | { |
55 | - $renderer =& $this->defaultRenderer(); |
|
55 | + $renderer = & $this->defaultRenderer(); |
|
56 | 56 | $renderer->setCustomElementTemplate('<span>{element}</span> '); |
57 | 57 | $this->addElement( |
58 | 58 | 'static', |
59 | 59 | null, |
60 | 60 | null, |
61 | - '"' . $this->category_object->get_name() . '" ' |
|
61 | + '"'.$this->category_object->get_name().'" ' |
|
62 | 62 | ); |
63 | - $this->addElement('static', null, null, get_lang('MoveTo') . ' : '); |
|
63 | + $this->addElement('static', null, null, get_lang('MoveTo').' : '); |
|
64 | 64 | $select = $this->addElement('select', 'move_cat', null, null); |
65 | 65 | $line = null; |
66 | 66 | foreach ($this->category_object->get_target_categories() as $cat) { |
@@ -68,9 +68,9 @@ discard block |
||
68 | 68 | $line .= '--'; |
69 | 69 | } |
70 | 70 | if ($cat[0] != $this->category_object->get_parent_id()) { |
71 | - $select->addoption($line . ' ' . $cat[1], $cat[0]); |
|
71 | + $select->addoption($line.' '.$cat[1], $cat[0]); |
|
72 | 72 | } else { |
73 | - $select->addoption($line . ' ' . $cat[1], $cat[0], 'disabled'); |
|
73 | + $select->addoption($line.' '.$cat[1], $cat[0], 'disabled'); |
|
74 | 74 | } |
75 | 75 | $line = ''; |
76 | 76 | } |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $grade_model_id = $this->category_object->get_grade_model_id(); |
154 | 154 | |
155 | 155 | if (empty($links)) { |
156 | - $grade_model_id = 0; |
|
156 | + $grade_model_id = 0; |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | $category_name = $this->category_object->get_name(); |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | [ |
243 | 243 | 'id' => 'skills', |
244 | 244 | 'multiple' => 'multiple', |
245 | - 'url' => api_get_path(WEB_AJAX_PATH) . 'skill.ajax.php?a=search_skills' |
|
245 | + 'url' => api_get_path(WEB_AJAX_PATH).'skill.ajax.php?a=search_skills' |
|
246 | 246 | ] |
247 | 247 | ); |
248 | 248 | |
@@ -400,14 +400,14 @@ discard block |
||
400 | 400 | //only return courses that are not yet created by the teacher |
401 | 401 | |
402 | 402 | foreach ($coursecat as $row) { |
403 | - $select->addoption($row[1],$row[0]); |
|
403 | + $select->addoption($row[1], $row[0]); |
|
404 | 404 | } |
405 | 405 | $this->setDefaults(array( |
406 | 406 | 'hid_user_id' => $this->category_object->get_user_id(), |
407 | 407 | 'hid_parent_id' => $this->category_object->get_parent_id() |
408 | 408 | )); |
409 | - $this->addElement('hidden','hid_user_id'); |
|
410 | - $this->addElement('hidden','hid_parent_id'); |
|
409 | + $this->addElement('hidden', 'hid_user_id'); |
|
410 | + $this->addElement('hidden', 'hid_parent_id'); |
|
411 | 411 | $this->addElement('submit', null, get_lang('Ok')); |
412 | 412 | } |
413 | 413 |