@@ -162,17 +162,17 @@ |
||
162 | 162 | |
163 | 163 | if ($form->validate()) { |
164 | 164 | $officialCode = $form->getSubmitValue('filter'); |
165 | - if ($officialCode == 'all') { |
|
165 | + if ($officialCode == 'all') { |
|
166 | 166 | $certificate_list = GradebookUtils::get_list_users_certificates($cat_id); |
167 | 167 | } else { |
168 | - $userList = UserManager::getUsersByOfficialCode($officialCode); |
|
169 | - if (!empty($userList)) { |
|
170 | - $certificate_list = GradebookUtils::get_list_users_certificates( |
|
171 | - $cat_id, |
|
172 | - $userList |
|
173 | - ); |
|
174 | - } |
|
175 | - } |
|
168 | + $userList = UserManager::getUsersByOfficialCode($officialCode); |
|
169 | + if (!empty($userList)) { |
|
170 | + $certificate_list = GradebookUtils::get_list_users_certificates( |
|
171 | + $cat_id, |
|
172 | + $userList |
|
173 | + ); |
|
174 | + } |
|
175 | + } |
|
176 | 176 | } else { |
177 | 177 | $certificate_list = GradebookUtils::get_list_users_certificates($cat_id); |
178 | 178 | } |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * @package chamilo.gradebook |
7 | 7 | */ |
8 | 8 | require_once '../inc/global.inc.php'; |
9 | -$current_course_tool = TOOL_GRADEBOOK; |
|
9 | +$current_course_tool = TOOL_GRADEBOOK; |
|
10 | 10 | |
11 | 11 | if (!api_is_student_boss()) { |
12 | 12 | api_protect_course_script(true); |
@@ -16,9 +16,9 @@ discard block |
||
16 | 16 | ini_set('max_execution_time', 0); |
17 | 17 | |
18 | 18 | //extra javascript functions for in html head: |
19 | -$htmlHeadXtra[] ="<script> |
|
19 | +$htmlHeadXtra[] = "<script> |
|
20 | 20 | function confirmation() { |
21 | - if (confirm(\" " . trim(get_lang('AreYouSureToDelete')) . " ?\")) { |
|
21 | + if (confirm(\" " . trim(get_lang('AreYouSureToDelete'))." ?\")) { |
|
22 | 22 | return true; |
23 | 23 | } else { |
24 | 24 | return false; |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | api_not_allowed(true); |
32 | 32 | } |
33 | 33 | |
34 | -$cat_id = isset($_GET['cat_id']) ? (int)$_GET['cat_id'] : null; |
|
34 | +$cat_id = isset($_GET['cat_id']) ? (int) $_GET['cat_id'] : null; |
|
35 | 35 | $action = isset($_GET['action']) && $_GET['action'] ? $_GET['action'] : null; |
36 | 36 | $filterOfficialCode = isset($_POST['filter']) ? Security::remove_XSS($_POST['filter']) : null; |
37 | 37 | $filterOfficialCodeGet = isset($_GET['filter']) ? Security::remove_XSS($_GET['filter']) : null; |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | |
73 | 73 | $course_code = api_get_course_id(); |
74 | 74 | |
75 | -$interbreadcrumb[] = array('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?', 'name' => get_lang('Gradebook')); |
|
76 | -$interbreadcrumb[] = array('url' => '#','name' => get_lang('GradebookListOfStudentsCertificates')); |
|
75 | +$interbreadcrumb[] = array('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?', 'name' => get_lang('Gradebook')); |
|
76 | +$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('GradebookListOfStudentsCertificates')); |
|
77 | 77 | |
78 | 78 | $this_section = SECTION_COURSES; |
79 | 79 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $certificate = new Certificate($_GET['certificate_id']); |
86 | 86 | $result = $certificate->delete(true); |
87 | 87 | Security::clear_token(); |
88 | - if ($result ==true) { |
|
88 | + if ($result == true) { |
|
89 | 89 | Display::display_confirmation_message(get_lang('CertificateRemoved')); |
90 | 90 | } else { |
91 | 91 | Display::display_error_message(get_lang('CertificateNotRemoved')); |
@@ -104,9 +104,9 @@ discard block |
||
104 | 104 | |
105 | 105 | //with this fix the teacher only can view 1 gradebook |
106 | 106 | if (api_is_platform_admin()) { |
107 | - $stud_id= (api_is_allowed_to_edit() ? null : api_get_user_id()); |
|
107 | + $stud_id = (api_is_allowed_to_edit() ? null : api_get_user_id()); |
|
108 | 108 | } else { |
109 | - $stud_id= api_get_user_id(); |
|
109 | + $stud_id = api_get_user_id(); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | $total_weight = $cats[0]->get_weight(); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $alleval = $cats[0]->get_evaluations($stud_id); |
116 | 116 | $alllink = $cats[0]->get_links($stud_id); |
117 | 117 | |
118 | - $datagen = new GradebookDataGenerator ($allcat,$alleval, $alllink); |
|
118 | + $datagen = new GradebookDataGenerator($allcat, $alleval, $alllink); |
|
119 | 119 | |
120 | 120 | $total_resource_weight = 0; |
121 | 121 | if (!empty($datagen)) { |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | $newarray[] = array_slice($data, 1); |
133 | 133 | } |
134 | 134 | |
135 | - foreach($newarray as $item) { |
|
135 | + foreach ($newarray as $item) { |
|
136 | 136 | $total_resource_weight = $total_resource_weight + $item['2']; |
137 | 137 | } |
138 | 138 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | if ($filter === 'true') { |
151 | 151 | echo '<br />'; |
152 | 152 | $options = UserManager::getOfficialCodeGrouped(); |
153 | - $options =array_merge(array('all' => get_lang('All')), $options); |
|
153 | + $options = array_merge(array('all' => get_lang('All')), $options); |
|
154 | 154 | $form = new FormValidator( |
155 | 155 | 'official_code_filter', |
156 | 156 | 'POST', |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | |
197 | 197 | echo $filterForm; |
198 | 198 | |
199 | -if (count($certificate_list) == 0 ) { |
|
199 | +if (count($certificate_list) == 0) { |
|
200 | 200 | echo Display::display_warning_message(get_lang('NoResultsAvailable')); |
201 | 201 | } else { |
202 | 202 | |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | $certificates = Display::url(get_lang('Certificate'), $url, array('target'=>'_blank', 'class' => 'btn btn-default')); |
220 | 220 | echo $certificates; |
221 | 221 | echo '<a onclick="return confirmation();" href="gradebook_display_certificate.php?sec_token='.$token.'&cidReq='.$course_code.'&action=delete&cat_id='.$cat_id.'&certificate_id='.$value_certificate['id'].'"> |
222 | - '.Display::return_icon('delete.png',get_lang('Delete')).' |
|
222 | + '.Display::return_icon('delete.png', get_lang('Delete')).' |
|
223 | 223 | </a>'; |
224 | 224 | echo '</td></tr>'; |
225 | 225 | } |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | use ChamiloSession as Session; |
10 | 10 | |
11 | 11 | require_once '../inc/global.inc.php'; |
12 | -$current_course_tool = TOOL_GRADEBOOK; |
|
12 | +$current_course_tool = TOOL_GRADEBOOK; |
|
13 | 13 | |
14 | 14 | api_protect_course_script(); |
15 | 15 | |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | api_not_allowed(true); |
22 | 22 | } |
23 | 23 | |
24 | -$cat_id = isset($_GET['selectcat']) ? (int)$_GET['selectcat'] : null; |
|
24 | +$cat_id = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : null; |
|
25 | 25 | $action = isset($_GET['action']) && $_GET['action'] ? $_GET['action'] : null; |
26 | 26 | |
27 | 27 | $userList = CourseManager::get_user_list_from_course_code( |
@@ -113,8 +113,8 @@ discard block |
||
113 | 113 | |
114 | 114 | $course_code = api_get_course_id(); |
115 | 115 | |
116 | -$interbreadcrumb[] = array('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?', 'name' => get_lang('Gradebook')); |
|
117 | -$interbreadcrumb[] = array('url' => '#','name' => get_lang('GradebookListOfStudentsReports')); |
|
116 | +$interbreadcrumb[] = array('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?', 'name' => get_lang('Gradebook')); |
|
117 | +$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('GradebookListOfStudentsReports')); |
|
118 | 118 | |
119 | 119 | $this_section = SECTION_COURSES; |
120 | 120 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | } |
132 | 132 | echo '</div>'; |
133 | 133 | |
134 | -if (count($userList) == 0 ) { |
|
134 | +if (count($userList) == 0) { |
|
135 | 135 | echo Display::display_warning_message(get_lang('NoResultsAvailable')); |
136 | 136 | } else { |
137 | 137 | echo '<br /><br /><table class="data_table">'; |
@@ -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 ) { |