@@ -18,53 +18,53 @@ |
||
18 | 18 | $newstudents = $evaluation[0]->get_not_subscribed_students(); |
19 | 19 | |
20 | 20 | if (count($newstudents) == '0') { |
21 | - header('Location: gradebook_view_result.php?nouser=&selecteval=' . Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq()); |
|
22 | - exit; |
|
21 | + header('Location: gradebook_view_result.php?nouser=&selecteval=' . Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq()); |
|
22 | + exit; |
|
23 | 23 | } |
24 | 24 | $add_user_form= new EvalForm(EvalForm :: TYPE_ADD_USERS_TO_EVAL, |
25 | - $evaluation[0], |
|
26 | - null, |
|
27 | - 'add_users_to_evaluation', |
|
28 | - null, |
|
29 | - api_get_self() . '?selecteval=' . Security::remove_XSS($_GET['selecteval']), |
|
30 | - Security::remove_XSS($_GET['firstletter']), |
|
31 | - $newstudents); |
|
25 | + $evaluation[0], |
|
26 | + null, |
|
27 | + 'add_users_to_evaluation', |
|
28 | + null, |
|
29 | + api_get_self() . '?selecteval=' . Security::remove_XSS($_GET['selecteval']), |
|
30 | + Security::remove_XSS($_GET['firstletter']), |
|
31 | + $newstudents); |
|
32 | 32 | |
33 | 33 | if ( isset($_POST['submit_button']) ) { |
34 | - $users= is_array($_POST['add_users']) ? $_POST['add_users'] : array (); |
|
35 | - foreach ($users as $key => $value){ |
|
36 | - $users[$key]= intval($value); |
|
37 | - } |
|
34 | + $users= is_array($_POST['add_users']) ? $_POST['add_users'] : array (); |
|
35 | + foreach ($users as $key => $value){ |
|
36 | + $users[$key]= intval($value); |
|
37 | + } |
|
38 | 38 | |
39 | - if (count($users) == 0) { |
|
40 | - header('Location: ' . api_get_self() . '?erroroneuser=&selecteval=' .Security::remove_XSS($_GET['selecteval'])); |
|
41 | - exit; |
|
42 | - } else { |
|
43 | - foreach ($users as $user_id) { |
|
44 | - $result= new Result(); |
|
45 | - $result->set_user_id($user_id); |
|
46 | - $result->set_evaluation_id($_GET['selecteval']); |
|
47 | - $result->add(); |
|
48 | - } |
|
49 | - } |
|
50 | - header('Location: gradebook_view_result.php?adduser=&selecteval=' .Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq()); |
|
51 | - exit; |
|
52 | - } elseif ($_POST['firstLetterUser']) { |
|
53 | - $firstletter= $_POST['firstLetterUser']; |
|
54 | - if (!empty ($firstletter)) { |
|
55 | - header('Location: ' . api_get_self() . '?firstletter=' . Security::remove_XSS($firstletter) . '&selecteval=' . Security::remove_XSS($_GET['selecteval'])); |
|
56 | - exit; |
|
57 | - } |
|
39 | + if (count($users) == 0) { |
|
40 | + header('Location: ' . api_get_self() . '?erroroneuser=&selecteval=' .Security::remove_XSS($_GET['selecteval'])); |
|
41 | + exit; |
|
42 | + } else { |
|
43 | + foreach ($users as $user_id) { |
|
44 | + $result= new Result(); |
|
45 | + $result->set_user_id($user_id); |
|
46 | + $result->set_evaluation_id($_GET['selecteval']); |
|
47 | + $result->add(); |
|
48 | + } |
|
49 | + } |
|
50 | + header('Location: gradebook_view_result.php?adduser=&selecteval=' .Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq()); |
|
51 | + exit; |
|
52 | + } elseif ($_POST['firstLetterUser']) { |
|
53 | + $firstletter= $_POST['firstLetterUser']; |
|
54 | + if (!empty ($firstletter)) { |
|
55 | + header('Location: ' . api_get_self() . '?firstletter=' . Security::remove_XSS($firstletter) . '&selecteval=' . Security::remove_XSS($_GET['selecteval'])); |
|
56 | + exit; |
|
57 | + } |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | $interbreadcrumb[]= array ('url' => Security::remove_XSS($_SESSION['gradebook_dest']),'name' => get_lang('Gradebook')); |
61 | 61 | $interbreadcrumb[]= array( |
62 | - 'url' => 'gradebook_view_result.php?selecteval=' .Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq(), |
|
63 | - 'name' => get_lang('ViewResult') |
|
62 | + 'url' => 'gradebook_view_result.php?selecteval=' .Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq(), |
|
63 | + 'name' => get_lang('ViewResult') |
|
64 | 64 | ); |
65 | 65 | Display :: display_header(get_lang('AddUserToEval')); |
66 | 66 | if (isset ($_GET['erroroneuser'])){ |
67 | - Display :: display_warning_message(get_lang('AtLeastOneUser'),false); |
|
67 | + Display :: display_warning_message(get_lang('AtLeastOneUser'),false); |
|
68 | 68 | } |
69 | 69 | DisplayGradebook :: display_header_result($evaluation[0], null, 0,0); |
70 | 70 | echo '<div class="main">'; |
@@ -14,59 +14,59 @@ |
||
14 | 14 | api_block_anonymous_users(); |
15 | 15 | GradebookUtils::block_students(); |
16 | 16 | |
17 | -$evaluation= Evaluation :: load($_GET['selecteval']); |
|
17 | +$evaluation = Evaluation :: load($_GET['selecteval']); |
|
18 | 18 | $newstudents = $evaluation[0]->get_not_subscribed_students(); |
19 | 19 | |
20 | 20 | if (count($newstudents) == '0') { |
21 | - header('Location: gradebook_view_result.php?nouser=&selecteval=' . Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq()); |
|
21 | + header('Location: gradebook_view_result.php?nouser=&selecteval='.Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq()); |
|
22 | 22 | exit; |
23 | 23 | } |
24 | -$add_user_form= new EvalForm(EvalForm :: TYPE_ADD_USERS_TO_EVAL, |
|
24 | +$add_user_form = new EvalForm(EvalForm :: TYPE_ADD_USERS_TO_EVAL, |
|
25 | 25 | $evaluation[0], |
26 | 26 | null, |
27 | 27 | 'add_users_to_evaluation', |
28 | 28 | null, |
29 | - api_get_self() . '?selecteval=' . Security::remove_XSS($_GET['selecteval']), |
|
29 | + api_get_self().'?selecteval='.Security::remove_XSS($_GET['selecteval']), |
|
30 | 30 | Security::remove_XSS($_GET['firstletter']), |
31 | 31 | $newstudents); |
32 | 32 | |
33 | -if ( isset($_POST['submit_button']) ) { |
|
34 | - $users= is_array($_POST['add_users']) ? $_POST['add_users'] : array (); |
|
35 | - foreach ($users as $key => $value){ |
|
36 | - $users[$key]= intval($value); |
|
33 | +if (isset($_POST['submit_button'])) { |
|
34 | + $users = is_array($_POST['add_users']) ? $_POST['add_users'] : array(); |
|
35 | + foreach ($users as $key => $value) { |
|
36 | + $users[$key] = intval($value); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | if (count($users) == 0) { |
40 | - header('Location: ' . api_get_self() . '?erroroneuser=&selecteval=' .Security::remove_XSS($_GET['selecteval'])); |
|
40 | + header('Location: '.api_get_self().'?erroroneuser=&selecteval='.Security::remove_XSS($_GET['selecteval'])); |
|
41 | 41 | exit; |
42 | 42 | } else { |
43 | 43 | foreach ($users as $user_id) { |
44 | - $result= new Result(); |
|
44 | + $result = new Result(); |
|
45 | 45 | $result->set_user_id($user_id); |
46 | 46 | $result->set_evaluation_id($_GET['selecteval']); |
47 | 47 | $result->add(); |
48 | 48 | } |
49 | 49 | } |
50 | - header('Location: gradebook_view_result.php?adduser=&selecteval=' .Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq()); |
|
50 | + header('Location: gradebook_view_result.php?adduser=&selecteval='.Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq()); |
|
51 | 51 | exit; |
52 | 52 | } elseif ($_POST['firstLetterUser']) { |
53 | - $firstletter= $_POST['firstLetterUser']; |
|
53 | + $firstletter = $_POST['firstLetterUser']; |
|
54 | 54 | if (!empty ($firstletter)) { |
55 | - header('Location: ' . api_get_self() . '?firstletter=' . Security::remove_XSS($firstletter) . '&selecteval=' . Security::remove_XSS($_GET['selecteval'])); |
|
55 | + header('Location: '.api_get_self().'?firstletter='.Security::remove_XSS($firstletter).'&selecteval='.Security::remove_XSS($_GET['selecteval'])); |
|
56 | 56 | exit; |
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
60 | -$interbreadcrumb[]= array ('url' => Security::remove_XSS($_SESSION['gradebook_dest']),'name' => get_lang('Gradebook')); |
|
61 | -$interbreadcrumb[]= array( |
|
62 | - 'url' => 'gradebook_view_result.php?selecteval=' .Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq(), |
|
60 | +$interbreadcrumb[] = array('url' => Security::remove_XSS($_SESSION['gradebook_dest']), 'name' => get_lang('Gradebook')); |
|
61 | +$interbreadcrumb[] = array( |
|
62 | + 'url' => 'gradebook_view_result.php?selecteval='.Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq(), |
|
63 | 63 | 'name' => get_lang('ViewResult') |
64 | 64 | ); |
65 | 65 | Display :: display_header(get_lang('AddUserToEval')); |
66 | -if (isset ($_GET['erroroneuser'])){ |
|
67 | - Display :: display_warning_message(get_lang('AtLeastOneUser'),false); |
|
66 | +if (isset ($_GET['erroroneuser'])) { |
|
67 | + Display :: display_warning_message(get_lang('AtLeastOneUser'), false); |
|
68 | 68 | } |
69 | -DisplayGradebook :: display_header_result($evaluation[0], null, 0,0); |
|
69 | +DisplayGradebook :: display_header_result($evaluation[0], null, 0, 0); |
|
70 | 70 | echo '<div class="main">'; |
71 | 71 | echo $add_user_form->toHtml(); |
72 | 72 | echo '</div>'; |
@@ -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; |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | */ |
7 | 7 | // $cidReset : This is the main difference with gradebook.php, here we say, |
8 | 8 | // basically, that we are inside a course, and many things depend from that |
9 | -$cidReset= true; |
|
9 | +$cidReset = true; |
|
10 | 10 | $_in_course = false; |
11 | 11 | //make sure the destination for scripts is index.php instead of gradebook.php |
12 | 12 | require_once '../inc/global.inc.php'; |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | </script>'; |
31 | 31 | api_block_anonymous_users(); |
32 | 32 | |
33 | -$htmlHeadXtra[]= '<script type="text/javascript"> |
|
33 | +$htmlHeadXtra[] = '<script type="text/javascript"> |
|
34 | 34 | function confirmation () |
35 | 35 | { |
36 | 36 | if (confirm("'.get_lang('DeleteAll').'?")) { |
@@ -47,10 +47,10 @@ discard block |
||
47 | 47 | //this is called when there is no data for the course admin |
48 | 48 | if (isset ($_GET['createallcategories'])) { |
49 | 49 | GradebookUtils::block_students(); |
50 | - $coursecat= Category :: get_not_created_course_categories(api_get_user_id()); |
|
50 | + $coursecat = Category :: get_not_created_course_categories(api_get_user_id()); |
|
51 | 51 | if (!count($coursecat) == 0) { |
52 | 52 | foreach ($coursecat as $row) { |
53 | - $cat= new Category(); |
|
53 | + $cat = new Category(); |
|
54 | 54 | $cat->set_name($row[1]); |
55 | 55 | $cat->set_course_code($row[0]); |
56 | 56 | $cat->set_description(null); |
@@ -66,33 +66,33 @@ discard block |
||
66 | 66 | exit; |
67 | 67 | } |
68 | 68 | //move a category |
69 | -$selectcat=isset($_GET['selectcat']) ? Security::remove_XSS($_GET['selectcat']) : ''; |
|
69 | +$selectcat = isset($_GET['selectcat']) ? Security::remove_XSS($_GET['selectcat']) : ''; |
|
70 | 70 | |
71 | 71 | if (isset ($_GET['movecat'])) { |
72 | 72 | $move_cat = Security::remove_XSS($_GET['movecat']); |
73 | 73 | GradebookUtils::block_students(); |
74 | - $cats= Category :: load($move_cat); |
|
74 | + $cats = Category :: load($move_cat); |
|
75 | 75 | if (!isset ($_GET['targetcat'])) { |
76 | - $move_form= new CatForm(CatForm :: TYPE_MOVE, |
|
76 | + $move_form = new CatForm(CatForm :: TYPE_MOVE, |
|
77 | 77 | $cats[0], |
78 | 78 | 'move_cat_form', |
79 | 79 | null, |
80 | - api_get_self() . '?movecat=' . $move_cat |
|
81 | - . '&selectcat=' . Security::remove_XSS($_GET['selectcat'])); |
|
80 | + api_get_self().'?movecat='.$move_cat |
|
81 | + . '&selectcat='.Security::remove_XSS($_GET['selectcat'])); |
|
82 | 82 | if ($move_form->validate()) { |
83 | - header('Location: ' . api_get_self() . '?selectcat=' . Security::remove_XSS($_GET['selectcat']) |
|
84 | - . '&movecat=' . $move_cat |
|
85 | - . '&targetcat=' . $move_form->exportValue('move_cat')); |
|
83 | + header('Location: '.api_get_self().'?selectcat='.Security::remove_XSS($_GET['selectcat']) |
|
84 | + . '&movecat='.$move_cat |
|
85 | + . '&targetcat='.$move_form->exportValue('move_cat')); |
|
86 | 86 | exit; |
87 | 87 | } |
88 | 88 | } else { |
89 | - $get_target_cat=Security::remove_XSS($_GET['targetcat']); |
|
90 | - $targetcat= Category :: load($get_target_cat); |
|
89 | + $get_target_cat = Security::remove_XSS($_GET['targetcat']); |
|
90 | + $targetcat = Category :: load($get_target_cat); |
|
91 | 91 | $course_to_crsind = ($cats[0]->get_course_code() != null && $targetcat[0]->get_course_code() == null); |
92 | 92 | |
93 | 93 | if (!($course_to_crsind && !isset($_GET['confirm']))) { |
94 | 94 | $cats[0]->move_to_cat($targetcat[0]); |
95 | - header('Location: ' . api_get_self() . '?categorymoved=&selectcat=' . Security::remove_XSS($_GET['selectcat'])); |
|
95 | + header('Location: '.api_get_self().'?categorymoved=&selectcat='.Security::remove_XSS($_GET['selectcat'])); |
|
96 | 96 | exit; |
97 | 97 | } |
98 | 98 | unset($targetcat); |
@@ -103,32 +103,32 @@ discard block |
||
103 | 103 | //move an evaluation |
104 | 104 | if (isset ($_GET['moveeval'])) { |
105 | 105 | GradebookUtils::block_students(); |
106 | - $get_move_eval=Security::remove_XSS($_GET['moveeval']); |
|
107 | - $evals= Evaluation :: load($get_move_eval); |
|
106 | + $get_move_eval = Security::remove_XSS($_GET['moveeval']); |
|
107 | + $evals = Evaluation :: load($get_move_eval); |
|
108 | 108 | if (!isset ($_GET['targetcat'])) { |
109 | 109 | |
110 | - $move_form= new EvalForm(EvalForm :: TYPE_MOVE, |
|
110 | + $move_form = new EvalForm(EvalForm :: TYPE_MOVE, |
|
111 | 111 | $evals[0], |
112 | 112 | null, |
113 | 113 | 'move_eval_form', |
114 | 114 | null, |
115 | - api_get_self() . '?moveeval=' . $get_move_eval |
|
116 | - . '&selectcat=' . Security::remove_XSS($_GET['selectcat'])); |
|
115 | + api_get_self().'?moveeval='.$get_move_eval |
|
116 | + . '&selectcat='.Security::remove_XSS($_GET['selectcat'])); |
|
117 | 117 | |
118 | 118 | if ($move_form->validate()) { |
119 | - header('Location: ' .api_get_self() . '?selectcat=' . Security::remove_XSS($_GET['selectcat']) |
|
120 | - . '&moveeval=' . $get_move_eval |
|
121 | - . '&targetcat=' . $move_form->exportValue('move_cat')); |
|
119 | + header('Location: '.api_get_self().'?selectcat='.Security::remove_XSS($_GET['selectcat']) |
|
120 | + . '&moveeval='.$get_move_eval |
|
121 | + . '&targetcat='.$move_form->exportValue('move_cat')); |
|
122 | 122 | exit; |
123 | 123 | } |
124 | 124 | } else { |
125 | - $get_target_cat=Security::remove_XSS($_GET['targetcat']); |
|
126 | - $targetcat= Category :: load($get_target_cat); |
|
125 | + $get_target_cat = Security::remove_XSS($_GET['targetcat']); |
|
126 | + $targetcat = Category :: load($get_target_cat); |
|
127 | 127 | $course_to_crsind = ($evals[0]->get_course_code() != null && $targetcat[0]->get_course_code() == null); |
128 | 128 | |
129 | 129 | if (!($course_to_crsind && !isset($_GET['confirm']))) { |
130 | 130 | $evals[0]->move_to_cat($targetcat[0]); |
131 | - header('Location: ' . api_get_self() . '?evaluationmoved=&selectcat=' . Security::remove_XSS($_GET['selectcat'])); |
|
131 | + header('Location: '.api_get_self().'?evaluationmoved=&selectcat='.Security::remove_XSS($_GET['selectcat'])); |
|
132 | 132 | exit; |
133 | 133 | } |
134 | 134 | unset ($targetcat); |
@@ -139,8 +139,8 @@ discard block |
||
139 | 139 | //move a link |
140 | 140 | if (isset ($_GET['movelink'])) { |
141 | 141 | GradebookUtils::block_students(); |
142 | - $get_move_link=Security::remove_XSS($_GET['movelink']); |
|
143 | - $link= LinkFactory :: load($get_move_link); |
|
142 | + $get_move_link = Security::remove_XSS($_GET['movelink']); |
|
143 | + $link = LinkFactory :: load($get_move_link); |
|
144 | 144 | $move_form = new LinkForm( |
145 | 145 | LinkForm :: TYPE_MOVE, |
146 | 146 | null, |
@@ -150,10 +150,10 @@ discard block |
||
150 | 150 | api_get_self().'?movelink='.$get_move_link.'&selectcat='.Security::remove_XSS($_GET['selectcat']) |
151 | 151 | ); |
152 | 152 | if ($move_form->validate()) { |
153 | - $targetcat= Category :: load($move_form->exportValue('move_cat')); |
|
153 | + $targetcat = Category :: load($move_form->exportValue('move_cat')); |
|
154 | 154 | $link[0]->move_to_cat($targetcat[0]); |
155 | 155 | unset ($link); |
156 | - header('Location: ' . api_get_self(). '?linkmoved=&selectcat=' . Security::remove_XSS($_GET['selectcat'])); |
|
156 | + header('Location: '.api_get_self().'?linkmoved=&selectcat='.Security::remove_XSS($_GET['selectcat'])); |
|
157 | 157 | exit; |
158 | 158 | } |
159 | 159 | } |
@@ -162,11 +162,11 @@ discard block |
||
162 | 162 | if (isset ($_GET['visiblecat'])) { |
163 | 163 | GradebookUtils::block_students(); |
164 | 164 | if (isset ($_GET['set_visible'])) { |
165 | - $visibility_command= 1; |
|
165 | + $visibility_command = 1; |
|
166 | 166 | } else { |
167 | - $visibility_command= 0; |
|
167 | + $visibility_command = 0; |
|
168 | 168 | } |
169 | - $cats= Category :: load($_GET['visiblecat']); |
|
169 | + $cats = Category :: load($_GET['visiblecat']); |
|
170 | 170 | $cats[0]->set_visible($visibility_command); |
171 | 171 | $cats[0]->save(); |
172 | 172 | $cats[0]->apply_visibility_to_children(); |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | } |
182 | 182 | if (isset ($_GET['deletecat'])) { |
183 | 183 | GradebookUtils::block_students(); |
184 | - $cats= Category :: load($_GET['deletecat']); |
|
184 | + $cats = Category :: load($_GET['deletecat']); |
|
185 | 185 | //delete all categories,subcategories and results |
186 | 186 | if ($cats[0] != null) { |
187 | 187 | if ($cats[0]->get_id() != 0) { |
@@ -196,12 +196,12 @@ discard block |
||
196 | 196 | if (isset ($_GET['visibleeval'])) { |
197 | 197 | GradebookUtils::block_students(); |
198 | 198 | if (isset ($_GET['set_visible'])) { |
199 | - $visibility_command= 1; |
|
199 | + $visibility_command = 1; |
|
200 | 200 | } else { |
201 | - $visibility_command= 0; |
|
201 | + $visibility_command = 0; |
|
202 | 202 | } |
203 | 203 | |
204 | - $eval= Evaluation :: load($_GET['visibleeval']); |
|
204 | + $eval = Evaluation :: load($_GET['visibleeval']); |
|
205 | 205 | $eval[0]->set_visible($visibility_command); |
206 | 206 | $eval[0]->save(); |
207 | 207 | unset ($eval); |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | } |
216 | 216 | if (isset ($_GET['deleteeval'])) { |
217 | 217 | GradebookUtils::block_students(); |
218 | - $eval= Evaluation :: load($_GET['deleteeval']); |
|
218 | + $eval = Evaluation :: load($_GET['deleteeval']); |
|
219 | 219 | if ($eval[0] != null) { |
220 | 220 | $eval[0]->delete_with_results(); |
221 | 221 | } |
@@ -226,11 +226,11 @@ discard block |
||
226 | 226 | if (isset ($_GET['visiblelink'])) { |
227 | 227 | GradebookUtils::block_students(); |
228 | 228 | if (isset ($_GET['set_visible'])) { |
229 | - $visibility_command= 1; |
|
230 | - }else { |
|
231 | - $visibility_command= 0; |
|
229 | + $visibility_command = 1; |
|
230 | + } else { |
|
231 | + $visibility_command = 0; |
|
232 | 232 | } |
233 | - $link= LinkFactory :: load($_GET['visiblelink']); |
|
233 | + $link = LinkFactory :: load($_GET['visiblelink']); |
|
234 | 234 | $link[0]->set_visible($visibility_command); |
235 | 235 | $link[0]->save(); |
236 | 236 | unset ($link); |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | GradebookUtils::block_students(); |
247 | 247 | //fixing #5229 |
248 | 248 | if (!empty($_GET['deletelink'])) { |
249 | - $link= LinkFactory :: load($_GET['deletelink']); |
|
249 | + $link = LinkFactory :: load($_GET['deletelink']); |
|
250 | 250 | if ($link[0] != null) { |
251 | 251 | $link[0]->delete(); |
252 | 252 | } |
@@ -263,11 +263,11 @@ discard block |
||
263 | 263 | } |
264 | 264 | $button = '<form name="confirm" |
265 | 265 | method="post" |
266 | - action="'.api_get_self() .'?confirm=' |
|
267 | - .(isset($_GET['movecat']) ? '&movecat=' . Security::remove_XSS($_GET['movecat']) |
|
268 | - : '&moveeval=' . Security::remove_XSS($_GET['moveeval']) ) |
|
269 | - .'&selectcat=' . Security::remove_XSS($_GET['selectcat']) |
|
270 | - .'&targetcat=' . Security::remove_XSS($_GET['targetcat']).'"> |
|
266 | + action="'.api_get_self().'?confirm=' |
|
267 | + .(isset($_GET['movecat']) ? '&movecat='.Security::remove_XSS($_GET['movecat']) |
|
268 | + : '&moveeval='.Security::remove_XSS($_GET['moveeval'])) |
|
269 | + .'&selectcat='.Security::remove_XSS($_GET['selectcat']) |
|
270 | + .'&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=' . Security::remove_XSS($_GET['selectcat']) |
|
369 | + header('Location: '.api_get_self().'?selectcat='.Security::remove_XSS($_GET['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=' . Security::remove_XSS($_GET['selectcat'].'&'.api_get_cidreq()), |
|
377 | + $interbreadcrumb[] = array( |
|
378 | + 'url' => $_SESSION['gradebook_dest'].'?selectcat='.Security::remove_XSS($_GET['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='.Security::remove_XSS($_GET['selectcat']),'name' => get_lang('Details')); |
|
393 | + $interbreadcrumb[] = array('url' => $gradebook_dest.'selectcat='.Security::remove_XSS($_GET['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,56 +402,56 @@ 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 (!isset ($_GET['selectcat']) || empty ($_GET['selectcat'])) { |
452 | - $category= 0; |
|
452 | + $category = 0; |
|
453 | 453 | } else { |
454 | - $category= Security::remove_XSS($_GET['selectcat']); |
|
454 | + $category = Security::remove_XSS($_GET['selectcat']); |
|
455 | 455 | } |
456 | 456 | // search form |
457 | 457 | |
@@ -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,71 +528,71 @@ 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 | //@todo replace image |
565 | 565 | //$pdf->ezImage(api_get_path(SYS_CODE_PATH).'img/dokeos_logo_certif.png',1,400,'','center',''); |
566 | 566 | $pdf->ezSetY(480); |
567 | - $pdf->ezText($certif_text,28,array('justification'=>'center')); |
|
567 | + $pdf->ezText($certif_text, 28, array('justification'=>'center')); |
|
568 | 568 | //$pdf->ezSetY(750); |
569 | 569 | $pdf->ezSetY(50); |
570 | - $pdf->ezText($date,18,array('justification'=>'center')); |
|
570 | + $pdf->ezText($date, 18, array('justification'=>'center')); |
|
571 | 571 | $pdf->ezSetY(580); |
572 | - $pdf->ezText($organization_name,22,array('justification'=>'left')); |
|
572 | + $pdf->ezText($organization_name, 22, array('justification'=>'left')); |
|
573 | 573 | $pdf->ezSetY(580); |
574 | - $pdf->ezText($portal_name,22,array('justification'=>'right')); |
|
574 | + $pdf->ezText($portal_name, 22, array('justification'=>'right')); |
|
575 | 575 | $pdf->ezStream(); |
576 | 576 | } |
577 | 577 | exit; |
578 | 578 | } else { |
579 | - $cats= Category :: load($category); |
|
580 | - $stud_id= (api_is_allowed_to_edit() ? null : api_get_user_id()); |
|
581 | - $allcat= $cats[0]->get_subcategories($stud_id); |
|
582 | - $alleval= $cats[0]->get_evaluations($stud_id); |
|
583 | - $alllink= $cats[0]->get_links($stud_id); |
|
579 | + $cats = Category :: load($category); |
|
580 | + $stud_id = (api_is_allowed_to_edit() ? null : api_get_user_id()); |
|
581 | + $allcat = $cats[0]->get_subcategories($stud_id); |
|
582 | + $alleval = $cats[0]->get_evaluations($stud_id); |
|
583 | + $alllink = $cats[0]->get_links($stud_id); |
|
584 | 584 | } |
585 | -$addparams = array ('selectcat' => $cats[0]->get_id()); |
|
585 | +$addparams = array('selectcat' => $cats[0]->get_id()); |
|
586 | 586 | if (isset($_GET['search'])) { |
587 | 587 | $addparams['search'] = $keyword; |
588 | 588 | } |
589 | 589 | if (isset ($_GET['studentoverview'])) { |
590 | 590 | $addparams['studentoverview'] = ''; |
591 | 591 | } |
592 | -if (isset($allcat_info) && count($allcat_info)>=0 && (isset($_GET['selectcat']) && $_GET['selectcat']==0) && isset($_GET['search']) && strlen(trim($_GET['search']))>0 ) { |
|
593 | - $allcat=$allcat_info; |
|
592 | +if (isset($allcat_info) && count($allcat_info) >= 0 && (isset($_GET['selectcat']) && $_GET['selectcat'] == 0) && isset($_GET['search']) && strlen(trim($_GET['search'])) > 0) { |
|
593 | + $allcat = $allcat_info; |
|
594 | 594 | } else { |
595 | - $allcat=$allcat; |
|
595 | + $allcat = $allcat; |
|
596 | 596 | } |
597 | 597 | $gradebooktable = new GradebookTable( |
598 | 598 | $cats[0], |
@@ -602,7 +602,7 @@ discard block |
||
602 | 602 | $addparams |
603 | 603 | ); |
604 | 604 | if (((empty ($allcat)) && (empty ($alleval)) && (empty ($alllink)) && (!$is_platform_admin) && ($is_course_admin) && (!isset ($_GET['selectcat']))) && api_is_course_tutor()) { |
605 | - Display :: display_normal_message(get_lang('GradebookWelcomeMessage') . '<br /><br /><form name="createcat" method="post" action="' . api_get_self() . '?createallcategories=1"><input type="submit" value="' . get_lang('CreateAllCat') . '"></form>',false); |
|
605 | + Display :: display_normal_message(get_lang('GradebookWelcomeMessage').'<br /><br /><form name="createcat" method="post" action="'.api_get_self().'?createallcategories=1"><input type="submit" value="'.get_lang('CreateAllCat').'"></form>', false); |
|
606 | 606 | } |
607 | 607 | // Here we are in a sub category |
608 | 608 | if ($category != '0') { |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | foreach ($userSkills as $skill) { |
34 | 34 | $skillId = current($skill); |
35 | 35 | |
36 | - $assertionUrl = api_get_path(WEB_CODE_PATH) . "badge/assertion.php?"; |
|
36 | + $assertionUrl = api_get_path(WEB_CODE_PATH)."badge/assertion.php?"; |
|
37 | 37 | $assertionUrl .= http_build_query(array( |
38 | 38 | 'user' => $userId, |
39 | 39 | 'skill' => $skillId, |
@@ -51,14 +51,14 @@ discard block |
||
51 | 51 | $backpack = $configBackpack; |
52 | 52 | } |
53 | 53 | |
54 | -$htmlHeadXtra[] = '<script src="' . $backpack . 'issuer.js"></script>'; |
|
54 | +$htmlHeadXtra[] = '<script src="'.$backpack.'issuer.js"></script>'; |
|
55 | 55 | |
56 | 56 | $tpl = new Template(get_lang('Badges'), false, false); |
57 | 57 | |
58 | 58 | $tpl->assign( |
59 | 59 | 'content', |
60 | 60 | "<script>" |
61 | - . "$(document).on('ready', function (){ OpenBadges.issue_no_modal(" . json_encode($assertions) . "); });" |
|
61 | + . "$(document).on('ready', function (){ OpenBadges.issue_no_modal(".json_encode($assertions)."); });" |
|
62 | 62 | . "</script>" |
63 | 63 | ); |
64 | 64 |
@@ -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(); |
@@ -23,14 +23,14 @@ discard block |
||
23 | 23 | $resultadd, |
24 | 24 | 'add_result_form', |
25 | 25 | null, |
26 | - api_get_self() . '?selectcat=' . Security::remove_XSS($category) . '&selecteval=' . Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq() |
|
26 | + api_get_self().'?selectcat='.Security::remove_XSS($category).'&selecteval='.Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq() |
|
27 | 27 | ); |
28 | 28 | $table = $add_result_form->toHtml(); |
29 | 29 | if ($add_result_form->validate()) { |
30 | 30 | $values = $add_result_form->exportValues(); |
31 | 31 | $nr_users = $values['nr_users']; |
32 | 32 | if ($nr_users == '0') { |
33 | - header('Location: gradebook_view_result.php?addresultnostudents=&selecteval=' . Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq()); |
|
33 | + header('Location: gradebook_view_result.php?addresultnostudents=&selecteval='.Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq()); |
|
34 | 34 | exit; |
35 | 35 | } |
36 | 36 | $scores = ($values['score']); |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $res->add(); |
44 | 44 | next($scores); |
45 | 45 | } |
46 | - header('Location: gradebook_view_result.php?addresult=&selecteval=' . Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq()); |
|
46 | + header('Location: gradebook_view_result.php?addresult=&selecteval='.Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq()); |
|
47 | 47 | exit; |
48 | 48 | } |
49 | 49 | $interbreadcrumb[] = array( |
@@ -51,6 +51,6 @@ discard block |
||
51 | 51 | 'name' => get_lang('Gradebook') |
52 | 52 | ); |
53 | 53 | Display :: display_header(get_lang('AddResult')); |
54 | -DisplayGradebook :: display_header_result ($evaluation[0], null, 0,0); |
|
54 | +DisplayGradebook :: display_header_result($evaluation[0], null, 0, 0); |
|
55 | 55 | echo $table; |
56 | 56 | Display :: display_footer(); |
@@ -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 | } |
@@ -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 ) { |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | */ |
8 | 8 | |
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(); |
@@ -16,13 +16,13 @@ discard block |
||
16 | 16 | $catadd = new Category(); |
17 | 17 | $catadd->set_user_id(api_get_user_id()); |
18 | 18 | $catadd->set_parent_id($_GET['selectcat']); |
19 | -$catcourse = Category :: load ($_GET['selectcat']); |
|
19 | +$catcourse = Category :: load($_GET['selectcat']); |
|
20 | 20 | $form = new CatForm( |
21 | 21 | CatForm :: TYPE_SELECT_COURSE, |
22 | 22 | $catadd, |
23 | 23 | 'add_cat_form', |
24 | 24 | null, |
25 | - api_get_self() . '?selectcat=' . Security::remove_XSS($_GET['selectcat']).'&'.api_get_cidreq() |
|
25 | + api_get_self().'?selectcat='.Security::remove_XSS($_GET['selectcat']).'&'.api_get_cidreq() |
|
26 | 26 | ); |
27 | 27 | |
28 | 28 | if ($form->validate()) { |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | $cat = new Category(); |
31 | 31 | $cat->set_course_code($values['select_course']); |
32 | 32 | $cat->set_name($values['name']); |
33 | - header('location: gradebook_add_link.php?selectcat=' .Security::remove_XSS($_GET['selectcat']).'&course_code='.Security::remove_XSS($values['select_course']).'&'.api_get_cidreq()); |
|
33 | + header('location: gradebook_add_link.php?selectcat='.Security::remove_XSS($_GET['selectcat']).'&course_code='.Security::remove_XSS($values['select_course']).'&'.api_get_cidreq()); |
|
34 | 34 | exit; |
35 | 35 | } |
36 | 36 | |
37 | -$interbreadcrumb[] = array ( |
|
37 | +$interbreadcrumb[] = array( |
|
38 | 38 | 'url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.Security::remove_XSS($_GET['selectcat']).'&'.api_get_cidreq(), |
39 | 39 | 'name' => get_lang('Gradebook') |
40 | 40 | ); |
@@ -9,71 +9,71 @@ |
||
9 | 9 | */ |
10 | 10 | class UserForm extends FormValidator |
11 | 11 | { |
12 | - const TYPE_USER_INFO= 1; |
|
13 | - const TYPE_SIMPLE_SEARCH = 3; |
|
14 | - /** |
|
15 | - * Builds a form containing form items based on a given parameter |
|
16 | - * @param int form_type 1 = user_info |
|
17 | - * @param user array |
|
18 | - * @param string form name |
|
19 | - * @param method |
|
20 | - * @param action |
|
21 | - */ |
|
22 | - public function UserForm($form_type, $user, $form_name, $method= 'post', $action= null) |
|
23 | - { |
|
24 | - parent :: __construct($form_name, $method, $action); |
|
25 | - $this->form_type= $form_type; |
|
26 | - if (isset ($user)) { |
|
27 | - $this->user_info= $user; |
|
28 | - } |
|
29 | - if (isset ($result_object)) { |
|
30 | - $this->result_object= $result_object; |
|
31 | - } |
|
32 | - if ($this->form_type == self :: TYPE_USER_INFO) { |
|
33 | - $this->build_user_info_form(); |
|
34 | - } |
|
35 | - elseif ($this->form_type == self :: TYPE_SIMPLE_SEARCH) { |
|
36 | - $this->build_simple_search(); |
|
37 | - } |
|
38 | - $this->setDefaults(); |
|
39 | - } |
|
12 | + const TYPE_USER_INFO= 1; |
|
13 | + const TYPE_SIMPLE_SEARCH = 3; |
|
14 | + /** |
|
15 | + * Builds a form containing form items based on a given parameter |
|
16 | + * @param int form_type 1 = user_info |
|
17 | + * @param user array |
|
18 | + * @param string form name |
|
19 | + * @param method |
|
20 | + * @param action |
|
21 | + */ |
|
22 | + public function UserForm($form_type, $user, $form_name, $method= 'post', $action= null) |
|
23 | + { |
|
24 | + parent :: __construct($form_name, $method, $action); |
|
25 | + $this->form_type= $form_type; |
|
26 | + if (isset ($user)) { |
|
27 | + $this->user_info= $user; |
|
28 | + } |
|
29 | + if (isset ($result_object)) { |
|
30 | + $this->result_object= $result_object; |
|
31 | + } |
|
32 | + if ($this->form_type == self :: TYPE_USER_INFO) { |
|
33 | + $this->build_user_info_form(); |
|
34 | + } |
|
35 | + elseif ($this->form_type == self :: TYPE_SIMPLE_SEARCH) { |
|
36 | + $this->build_simple_search(); |
|
37 | + } |
|
38 | + $this->setDefaults(); |
|
39 | + } |
|
40 | 40 | |
41 | - protected function build_simple_search() |
|
42 | - { |
|
43 | - if (isset($_GET['search']) && (!empty($_GET['search']))) { |
|
44 | - $this->setDefaults(array( |
|
45 | - 'keyword' => Security::remove_XSS($_GET['search']) |
|
46 | - )); |
|
47 | - } |
|
48 | - $renderer =& $this->defaultRenderer(); |
|
49 | - $renderer->setCustomElementTemplate('<span>{element}</span> '); |
|
50 | - $this->addElement('text','keyword',''); |
|
51 | - $this->addButtonSearch(get_lang('Search'), 'submit'); |
|
52 | - } |
|
41 | + protected function build_simple_search() |
|
42 | + { |
|
43 | + if (isset($_GET['search']) && (!empty($_GET['search']))) { |
|
44 | + $this->setDefaults(array( |
|
45 | + 'keyword' => Security::remove_XSS($_GET['search']) |
|
46 | + )); |
|
47 | + } |
|
48 | + $renderer =& $this->defaultRenderer(); |
|
49 | + $renderer->setCustomElementTemplate('<span>{element}</span> '); |
|
50 | + $this->addElement('text','keyword',''); |
|
51 | + $this->addButtonSearch(get_lang('Search'), 'submit'); |
|
52 | + } |
|
53 | 53 | |
54 | - protected function build_user_info_form() |
|
55 | - { |
|
56 | - if (api_is_western_name_order()) { |
|
57 | - $this->addElement('static', 'fname', get_lang('FirstName'), $this->user_info['firstname']); |
|
58 | - $this->addElement('static', 'lname', get_lang('LastName'), $this->user_info['lastname']); |
|
59 | - } else { |
|
60 | - $this->addElement('static', 'lname', get_lang('LastName'), $this->user_info['lastname']); |
|
61 | - $this->addElement('static', 'fname', get_lang('FirstName'), $this->user_info['firstname']); |
|
62 | - } |
|
63 | - $this->addElement('static', 'uname', get_lang('UserName'), $this->user_info['username']); |
|
64 | - $this->addElement('static', 'email', get_lang('Email'), '<a href="mailto:' . $this->user_info['email'] . '">' . $this->user_info['email'] . '</a>'); |
|
65 | - $this->addElement('static', 'ofcode', get_lang('OfficialCode'), $this->user_info['official_code']); |
|
66 | - $this->addElement('static', 'phone', get_lang('Phone'), $this->user_info['phone']); |
|
67 | - $this->addButtonSave(get_lang('Back'), 'submit'); |
|
68 | - } |
|
54 | + protected function build_user_info_form() |
|
55 | + { |
|
56 | + if (api_is_western_name_order()) { |
|
57 | + $this->addElement('static', 'fname', get_lang('FirstName'), $this->user_info['firstname']); |
|
58 | + $this->addElement('static', 'lname', get_lang('LastName'), $this->user_info['lastname']); |
|
59 | + } else { |
|
60 | + $this->addElement('static', 'lname', get_lang('LastName'), $this->user_info['lastname']); |
|
61 | + $this->addElement('static', 'fname', get_lang('FirstName'), $this->user_info['firstname']); |
|
62 | + } |
|
63 | + $this->addElement('static', 'uname', get_lang('UserName'), $this->user_info['username']); |
|
64 | + $this->addElement('static', 'email', get_lang('Email'), '<a href="mailto:' . $this->user_info['email'] . '">' . $this->user_info['email'] . '</a>'); |
|
65 | + $this->addElement('static', 'ofcode', get_lang('OfficialCode'), $this->user_info['official_code']); |
|
66 | + $this->addElement('static', 'phone', get_lang('Phone'), $this->user_info['phone']); |
|
67 | + $this->addButtonSave(get_lang('Back'), 'submit'); |
|
68 | + } |
|
69 | 69 | |
70 | - function display() |
|
71 | - { |
|
72 | - parent :: display(); |
|
73 | - } |
|
70 | + function display() |
|
71 | + { |
|
72 | + parent :: display(); |
|
73 | + } |
|
74 | 74 | |
75 | - function setDefaults($defaults= array(), $filter = null) |
|
76 | - { |
|
77 | - parent :: setDefaults($defaults, $filter); |
|
78 | - } |
|
75 | + function setDefaults($defaults= array(), $filter = null) |
|
76 | + { |
|
77 | + parent :: setDefaults($defaults, $filter); |
|
78 | + } |
|
79 | 79 | } |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | */ |
10 | 10 | class UserForm extends FormValidator |
11 | 11 | { |
12 | - const TYPE_USER_INFO= 1; |
|
12 | + const TYPE_USER_INFO = 1; |
|
13 | 13 | const TYPE_SIMPLE_SEARCH = 3; |
14 | 14 | /** |
15 | 15 | * Builds a form containing form items based on a given parameter |
@@ -19,15 +19,15 @@ discard block |
||
19 | 19 | * @param method |
20 | 20 | * @param action |
21 | 21 | */ |
22 | - public function UserForm($form_type, $user, $form_name, $method= 'post', $action= null) |
|
22 | + public function UserForm($form_type, $user, $form_name, $method = 'post', $action = null) |
|
23 | 23 | { |
24 | 24 | parent :: __construct($form_name, $method, $action); |
25 | - $this->form_type= $form_type; |
|
25 | + $this->form_type = $form_type; |
|
26 | 26 | if (isset ($user)) { |
27 | - $this->user_info= $user; |
|
27 | + $this->user_info = $user; |
|
28 | 28 | } |
29 | 29 | if (isset ($result_object)) { |
30 | - $this->result_object= $result_object; |
|
30 | + $this->result_object = $result_object; |
|
31 | 31 | } |
32 | 32 | if ($this->form_type == self :: TYPE_USER_INFO) { |
33 | 33 | $this->build_user_info_form(); |
@@ -45,9 +45,9 @@ discard block |
||
45 | 45 | 'keyword' => Security::remove_XSS($_GET['search']) |
46 | 46 | )); |
47 | 47 | } |
48 | - $renderer =& $this->defaultRenderer(); |
|
48 | + $renderer = & $this->defaultRenderer(); |
|
49 | 49 | $renderer->setCustomElementTemplate('<span>{element}</span> '); |
50 | - $this->addElement('text','keyword',''); |
|
50 | + $this->addElement('text', 'keyword', ''); |
|
51 | 51 | $this->addButtonSearch(get_lang('Search'), 'submit'); |
52 | 52 | } |
53 | 53 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $this->addElement('static', 'fname', get_lang('FirstName'), $this->user_info['firstname']); |
62 | 62 | } |
63 | 63 | $this->addElement('static', 'uname', get_lang('UserName'), $this->user_info['username']); |
64 | - $this->addElement('static', 'email', get_lang('Email'), '<a href="mailto:' . $this->user_info['email'] . '">' . $this->user_info['email'] . '</a>'); |
|
64 | + $this->addElement('static', 'email', get_lang('Email'), '<a href="mailto:'.$this->user_info['email'].'">'.$this->user_info['email'].'</a>'); |
|
65 | 65 | $this->addElement('static', 'ofcode', get_lang('OfficialCode'), $this->user_info['official_code']); |
66 | 66 | $this->addElement('static', 'phone', get_lang('Phone'), $this->user_info['phone']); |
67 | 67 | $this->addButtonSave(get_lang('Back'), 'submit'); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | parent :: display(); |
73 | 73 | } |
74 | 74 | |
75 | - function setDefaults($defaults= array(), $filter = null) |
|
75 | + function setDefaults($defaults = array(), $filter = null) |
|
76 | 76 | { |
77 | 77 | parent :: setDefaults($defaults, $filter); |
78 | 78 | } |
@@ -31,8 +31,7 @@ |
||
31 | 31 | } |
32 | 32 | if ($this->form_type == self :: TYPE_USER_INFO) { |
33 | 33 | $this->build_user_info_form(); |
34 | - } |
|
35 | - elseif ($this->form_type == self :: TYPE_SIMPLE_SEARCH) { |
|
34 | + } elseif ($this->form_type == self :: TYPE_SIMPLE_SEARCH) { |
|
36 | 35 | $this->build_simple_search(); |
37 | 36 | } |
38 | 37 | $this->setDefaults(); |
@@ -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>'; |
@@ -127,8 +127,8 @@ discard block |
||
127 | 127 | public function display_header_flatview($catobj, $showeval, $showlink, $simple_search_form) |
128 | 128 | { |
129 | 129 | $header = '<table border="0" cellpadding="5">'; |
130 | - $header .= '<td style="vertical-align: top;"><a href="' . Security::remove_XSS($_SESSION['gradebook_dest']) . '?selectcat=' . Security::remove_XSS($_GET['selectcat']) . '">' . Display::return_icon('gradebook.gif') . get_lang('Gradebook') . '</a></td>'; |
|
131 | - $header .= '<td style="vertical-align: top;">' . get_lang('FilterCategory') . '</td><td style="vertical-align: top;"><form name="selector"><select name="selectcat" onchange="document.selector.submit()">'; |
|
130 | + $header .= '<td style="vertical-align: top;"><a href="'.Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.Security::remove_XSS($_GET['selectcat']).'">'.Display::return_icon('gradebook.gif').get_lang('Gradebook').'</a></td>'; |
|
131 | + $header .= '<td style="vertical-align: top;">'.get_lang('FilterCategory').'</td><td style="vertical-align: top;"><form name="selector"><select name="selectcat" onchange="document.selector.submit()">'; |
|
132 | 132 | $cats = Category :: load(); |
133 | 133 | $tree = $cats[0]->get_tree(); |
134 | 134 | unset($cats); |
@@ -137,35 +137,35 @@ discard block |
||
137 | 137 | $line .= '—'; |
138 | 138 | } |
139 | 139 | if ($_GET['selectcat'] == $cat[0]) { |
140 | - $header .= '<option selected="selected" value=' . $cat[0] . '>' . $line . ' ' . $cat[1] . '</option>'; |
|
140 | + $header .= '<option selected="selected" value='.$cat[0].'>'.$line.' '.$cat[1].'</option>'; |
|
141 | 141 | } else { |
142 | - $header .= '<option value=' . $cat[0] . '>' . $line . ' ' . $cat[1] . '</option>'; |
|
142 | + $header .= '<option value='.$cat[0].'>'.$line.' '.$cat[1].'</option>'; |
|
143 | 143 | } |
144 | 144 | $line = ''; |
145 | 145 | } |
146 | 146 | $header .= '</td></select></form>'; |
147 | 147 | if (!$catobj->get_id() == '0') { |
148 | - $header .= '<td style="vertical-align: top;"><a href="' . api_get_self() . '?selectcat=' . $catobj->get_parent_id() . '">'; |
|
148 | + $header .= '<td style="vertical-align: top;"><a href="'.api_get_self().'?selectcat='.$catobj->get_parent_id().'">'; |
|
149 | 149 | $header .= Display::return_icon('gradebook.gif', get_lang('Up')); |
150 | 150 | $header .= '</a></td>'; |
151 | 151 | } |
152 | - $header .= '<td style="vertical-align: top;">' . $simple_search_form->toHtml() . '</td>'; |
|
152 | + $header .= '<td style="vertical-align: top;">'.$simple_search_form->toHtml().'</td>'; |
|
153 | 153 | $header .= '<td style="vertical-align: top;"> |
154 | - <a href="' . api_get_self() . '?exportpdf=&offset=' . Security::remove_XSS($_GET['offset']) . '&search=' . Security::remove_XSS($_GET['search']) . '&selectcat=' . $catobj->get_id() . '"> |
|
154 | + <a href="' . api_get_self().'?exportpdf=&offset='.Security::remove_XSS($_GET['offset']).'&search='.Security::remove_XSS($_GET['search']).'&selectcat='.$catobj->get_id().'"> |
|
155 | 155 | '.Display::return_icon('pdf.png', get_lang('ExportPDF'), [], ICON_SIZE_MEDIUM).' |
156 | - ' . get_lang('ExportPDF') . '</a>'; |
|
156 | + ' . get_lang('ExportPDF').'</a>'; |
|
157 | 157 | $header .= '<td style="vertical-align: top;"> |
158 | - <a href="' . api_get_self() . '?print=&selectcat=' . $catobj->get_id() . '" target="_blank"> |
|
158 | + <a href="' . api_get_self().'?print=&selectcat='.$catobj->get_id().'" target="_blank"> |
|
159 | 159 | '.Display::return_icon('printer.png', get_lang('Print'), [], ICON_SIZE_MEDIUM).' |
160 | - ' . get_lang('Print') . '</a>'; |
|
160 | + ' . get_lang('Print').'</a>'; |
|
161 | 161 | $header .= '</td></tr></table>'; |
162 | 162 | if (!$catobj->get_id() == '0') { |
163 | - $header .= '<table border="0" cellpadding="5"><tr><td><form name="itemfilter" method="post" action="' . api_get_self() . '?selectcat=' . $catobj->get_id() . '"> |
|
164 | - <input type="checkbox" name="showeval" onclick="document.itemfilter.submit()" ' . (($showeval == '1') ? 'checked' : '') . '>Show Evaluations '; |
|
165 | - $header .= '<input type="checkbox" name="showlink" onclick="document.itemfilter.submit()" ' . (($showlink == '1') ? 'checked' : '') . '>' . get_lang('ShowLinks') . '</form></td></tr></table>'; |
|
163 | + $header .= '<table border="0" cellpadding="5"><tr><td><form name="itemfilter" method="post" action="'.api_get_self().'?selectcat='.$catobj->get_id().'"> |
|
164 | + <input type="checkbox" name="showeval" onclick="document.itemfilter.submit()" ' . (($showeval == '1') ? 'checked' : '').'>Show Evaluations '; |
|
165 | + $header .= '<input type="checkbox" name="showlink" onclick="document.itemfilter.submit()" '.(($showlink == '1') ? 'checked' : '').'>'.get_lang('ShowLinks').'</form></td></tr></table>'; |
|
166 | 166 | } |
167 | 167 | if (isset($_GET['search'])) { |
168 | - $header .= '<b>' . get_lang('SearchResults') . ' :</b>'; |
|
168 | + $header .= '<b>'.get_lang('SearchResults').' :</b>'; |
|
169 | 169 | } |
170 | 170 | echo $header; |
171 | 171 | } |
@@ -186,14 +186,14 @@ discard block |
||
186 | 186 | $select_cat = $catobj->get_parent_id(); |
187 | 187 | $url = 'gradebook_flatview.php'; |
188 | 188 | } |
189 | - $header .= '<a href="' . $url . '?' . api_get_cidreq() . '&selectcat=' . $select_cat . '">' . |
|
190 | - Display::return_icon('back.png', get_lang('FolderView'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
189 | + $header .= '<a href="'.$url.'?'.api_get_cidreq().'&selectcat='.$select_cat.'">'. |
|
190 | + Display::return_icon('back.png', get_lang('FolderView'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
191 | 191 | |
192 | 192 | $pageNum = isset($_GET['flatviewlist_page_nr']) ? intval($_GET['flatviewlist_page_nr']) : null; |
193 | 193 | $perPage = isset($_GET['flatviewlist_per_page']) ? intval($_GET['flatviewlist_per_page']) : null; |
194 | 194 | $offset = isset($_GET['offset']) ? $_GET['offset'] : '0'; |
195 | 195 | |
196 | - $exportCsvUrl = api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query([ |
|
196 | + $exportCsvUrl = api_get_self().'?'.api_get_cidreq().'&'.http_build_query([ |
|
197 | 197 | 'export_format' => 'csv', |
198 | 198 | 'export_report' => 'export_report', |
199 | 199 | 'selectcat' => $catobj->get_id() |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | $exportCsvUrl |
205 | 205 | ); |
206 | 206 | |
207 | - $exportXlsUrl = api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query([ |
|
207 | + $exportXlsUrl = api_get_self().'?'.api_get_cidreq().'&'.http_build_query([ |
|
208 | 208 | 'export_format' => 'xls', |
209 | 209 | 'export_report' => 'export_report', |
210 | 210 | 'selectcat' => $catobj->get_id() |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | $exportXlsUrl |
216 | 216 | ); |
217 | 217 | |
218 | - $exportDocUrl = api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query([ |
|
218 | + $exportDocUrl = api_get_self().'?'.api_get_cidreq().'&'.http_build_query([ |
|
219 | 219 | 'export_format' => 'doc', |
220 | 220 | 'export_report' => 'export_report', |
221 | 221 | 'selectcat' => $catobj->get_id() |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | $exportDocUrl |
227 | 227 | ); |
228 | 228 | |
229 | - $exportPrintUrl = api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query([ |
|
229 | + $exportPrintUrl = api_get_self().'?'.api_get_cidreq().'&'.http_build_query([ |
|
230 | 230 | 'print' => '', |
231 | 231 | 'selectcat' => $catobj->get_id(), |
232 | 232 | ]); |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | ['target' => '_blank'] |
238 | 238 | ); |
239 | 239 | |
240 | - $exportPdfUrl = api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query([ |
|
240 | + $exportPdfUrl = api_get_self().'?'.api_get_cidreq().'&'.http_build_query([ |
|
241 | 241 | 'exportpdf' => '', |
242 | 242 | 'selectcat' => $catobj->get_id(), |
243 | 243 | 'offset' => $offset, |
@@ -290,8 +290,8 @@ discard block |
||
290 | 290 | $item = $evals_links[$count]; |
291 | 291 | $score = $item->calc_score($user_id); |
292 | 292 | $my_score_denom = ($score[1] == 0) ? 1 : $score[1]; |
293 | - $item_value+=$score[0] / $my_score_denom * $item->get_weight(); |
|
294 | - $item_total+=$item->get_weight(); |
|
293 | + $item_value += $score[0] / $my_score_denom * $item->get_weight(); |
|
294 | + $item_total += $item->get_weight(); |
|
295 | 295 | } |
296 | 296 | $item_value = number_format($item_value, 2, '.', ' '); |
297 | 297 | $total_score = array($item_value, $item_total); |
@@ -300,9 +300,9 @@ discard block |
||
300 | 300 | $cattotal = Category :: load(0); |
301 | 301 | $scoretotal = $cattotal[0]->calc_score(api_get_user_id()); |
302 | 302 | $scoretotal_display = (isset($scoretotal) ? $scoredisplay->display_score($scoretotal, SCORE_PERCENT) : get_lang('NoResultsAvailable')); |
303 | - $scoreinfo = get_lang('StatsStudent') . ' :<b> ' . api_get_person_name($user['firstname'], $user['lastname']) . '</b><br />'; |
|
303 | + $scoreinfo = get_lang('StatsStudent').' :<b> '.api_get_person_name($user['firstname'], $user['lastname']).'</b><br />'; |
|
304 | 304 | if ((!$catobj->get_id() == '0') && (!isset($_GET['studentoverview'])) && (!isset($_GET['search']))) { |
305 | - $scoreinfo.= '<h2>' . get_lang('Total') . ' : ' . $scorecourse_display . '</h2>'; |
|
305 | + $scoreinfo .= '<h2>'.get_lang('Total').' : '.$scorecourse_display.'</h2>'; |
|
306 | 306 | } |
307 | 307 | Display :: display_normal_message($scoreinfo, false); |
308 | 308 | } |
@@ -312,9 +312,9 @@ discard block |
||
312 | 312 | if (($showtree == '1') || (isset($_GET['studentoverview']))) { |
313 | 313 | $header .= '<tr>'; |
314 | 314 | if (!$selectcat == '0') { |
315 | - $header .= '<td style=" "><a href="' . api_get_self() . '?selectcat=' . $catobj->get_parent_id() . '">' . Display::return_icon('back.png', get_lang('BackTo') . ' ' . get_lang('RootCat'), '', ICON_SIZE_MEDIUM) . '</a></td>'; |
|
315 | + $header .= '<td style=" "><a href="'.api_get_self().'?selectcat='.$catobj->get_parent_id().'">'.Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('RootCat'), '', ICON_SIZE_MEDIUM).'</a></td>'; |
|
316 | 316 | } |
317 | - $header .= '<td style=" ">' . get_lang('CurrentCategory') . '</td>' . |
|
317 | + $header .= '<td style=" ">'.get_lang('CurrentCategory').'</td>'. |
|
318 | 318 | '<td style=" "><form name="selector"><select name="selectcat" onchange="document.selector.submit()">'; |
319 | 319 | $cats = Category :: load(); |
320 | 320 | |
@@ -327,15 +327,15 @@ discard block |
||
327 | 327 | } |
328 | 328 | $line = isset($line) ? $line : ''; |
329 | 329 | if (isset($_GET['selectcat']) && $_GET['selectcat'] == $cat[0]) { |
330 | - $header .= '<option selected value=' . $cat[0] . '>' . $line . ' ' . $cat[1] . '</option>'; |
|
330 | + $header .= '<option selected value='.$cat[0].'>'.$line.' '.$cat[1].'</option>'; |
|
331 | 331 | } else { |
332 | - $header .= '<option value=' . $cat[0] . '>' . $line . ' ' . $cat[1] . '</option>'; |
|
332 | + $header .= '<option value='.$cat[0].'>'.$line.' '.$cat[1].'</option>'; |
|
333 | 333 | } |
334 | 334 | $line = ''; |
335 | 335 | } |
336 | 336 | $header .= '</select></form></td>'; |
337 | 337 | if (!empty($simple_search_form) && $message_resource === false) { |
338 | - $header .= '<td style="vertical-align: top;">' . $simple_search_form->toHtml() . '</td>'; |
|
338 | + $header .= '<td style="vertical-align: top;">'.$simple_search_form->toHtml().'</td>'; |
|
339 | 339 | } else { |
340 | 340 | $header .= '<td></td>'; |
341 | 341 | } |
@@ -345,13 +345,13 @@ discard block |
||
345 | 345 | } elseif (!(isset($_GET['studentoverview']))) { |
346 | 346 | |
347 | 347 | } else { |
348 | - $header .= '<td style="vertical-align: top;"><a href="' . api_get_self() . '?' . api_get_cidreq() . '&studentoverview=&exportpdf=&selectcat=' . $catobj->get_id() . '" target="_blank"> |
|
348 | + $header .= '<td style="vertical-align: top;"><a href="'.api_get_self().'?'.api_get_cidreq().'&studentoverview=&exportpdf=&selectcat='.$catobj->get_id().'" target="_blank"> |
|
349 | 349 | '.Display::return_icon('pdf.png', get_lang('ExportPDF'), [], ICON_SIZE_MEDIUM).' |
350 | - ' . get_lang('ExportPDF') . '</a>'; |
|
350 | + ' . get_lang('ExportPDF').'</a>'; |
|
351 | 351 | } |
352 | 352 | $header .= '</td></tr>'; |
353 | 353 | } |
354 | - $header.='</table></div>'; |
|
354 | + $header .= '</table></div>'; |
|
355 | 355 | |
356 | 356 | // for course admin & platform admin add item buttons are added to the header |
357 | 357 | $header .= '<div class="actions">'; |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | $my_category = $catobj->shows_all_information_an_category($catobj->get_id()); |
372 | 372 | $my_api_cidreq = api_get_cidreq(); |
373 | 373 | if ($my_api_cidreq == '') { |
374 | - $my_api_cidreq = 'cidReq=' . $my_category['course_code']; |
|
374 | + $my_api_cidreq = 'cidReq='.$my_category['course_code']; |
|
375 | 375 | } |
376 | 376 | |
377 | 377 | if (!$message_resource) { |
@@ -380,24 +380,24 @@ discard block |
||
380 | 380 | $my_course_id = api_get_course_id(); |
381 | 381 | $my_file = substr($_SESSION['gradebook_dest'], 0, 5); |
382 | 382 | |
383 | - $header .= '<td style="vertical-align: top;"><a href="gradebook_flatview.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '">' . |
|
384 | - Display::return_icon('stats.png', get_lang('FlatView'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
385 | - $header .= '<td style="vertical-align: top;"><a href="gradebook_display_certificate.php?' . $my_api_cidreq . '&cat_id=' . (int) $_GET['selectcat'] . '">' . |
|
386 | - Display::return_icon('certificate_list.png', get_lang('GradebookSeeListOfStudentsCertificates'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
383 | + $header .= '<td style="vertical-align: top;"><a href="gradebook_flatview.php?'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'">'. |
|
384 | + Display::return_icon('stats.png', get_lang('FlatView'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
385 | + $header .= '<td style="vertical-align: top;"><a href="gradebook_display_certificate.php?'.$my_api_cidreq.'&cat_id='.(int) $_GET['selectcat'].'">'. |
|
386 | + Display::return_icon('certificate_list.png', get_lang('GradebookSeeListOfStudentsCertificates'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
387 | 387 | |
388 | 388 | $visibility_icon = ($catobj->is_visible() == 0) ? 'invisible' : 'visible'; |
389 | 389 | $visibility_command = ($catobj->is_visible() == 0) ? 'set_visible' : 'set_invisible'; |
390 | 390 | |
391 | 391 | //Right icons |
392 | - $modify_icons = '<a href="gradebook_edit_cat.php?editcat=' . $catobj->get_id() . '&cidReq=' . $catobj->get_course_code() . '&id_session='.$catobj->get_session_id(). '">' . Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
392 | + $modify_icons = '<a href="gradebook_edit_cat.php?editcat='.$catobj->get_id().'&cidReq='.$catobj->get_course_code().'&id_session='.$catobj->get_session_id().'">'.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
393 | 393 | if ($catobj->get_name() != api_get_course_id()) { |
394 | - $modify_icons .= ' <a href="' . api_get_self() . '?deletecat=' . $catobj->get_id() . '&selectcat=0&cidReq=' . $catobj->get_course_code() . '" onclick="return confirmation();">' . Display::return_icon('delete.png', get_lang('DeleteAll'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
394 | + $modify_icons .= ' <a href="'.api_get_self().'?deletecat='.$catobj->get_id().'&selectcat=0&cidReq='.$catobj->get_course_code().'" onclick="return confirmation();">'.Display::return_icon('delete.png', get_lang('DeleteAll'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
395 | 395 | } |
396 | 396 | $header .= Display::div($modify_icons, array('class' => 'right')); |
397 | 397 | } |
398 | 398 | } |
399 | 399 | } elseif (isset($_GET['search'])) { |
400 | - $header .= '<b>' . get_lang('SearchResults') . ' :</b>'; |
|
400 | + $header .= '<b>'.get_lang('SearchResults').' :</b>'; |
|
401 | 401 | } |
402 | 402 | $header .= '</div>'; |
403 | 403 | echo $header; |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | $aditionalButtons .= isset($certificateLinkInfo['badge_link']) ? $certificateLinkInfo['badge_link'] : ''; |
510 | 510 | $aditionalButtons .= '</div>'; |
511 | 511 | } |
512 | - $scoreinfo .= '<strong>' . sprintf(get_lang('TotalX'), $scorecourse_display . $aditionalButtons). '</strong>'; |
|
512 | + $scoreinfo .= '<strong>'.sprintf(get_lang('TotalX'), $scorecourse_display.$aditionalButtons).'</strong>'; |
|
513 | 513 | |
514 | 514 | } |
515 | 515 | Display :: display_normal_message($scoreinfo, false); |
@@ -520,10 +520,10 @@ discard block |
||
520 | 520 | $header = '<div class="actions"><table>'; |
521 | 521 | $header .= '<tr>'; |
522 | 522 | if (!$selectcat == '0') { |
523 | - $header .= '<td><a href="' . api_get_self() . '?selectcat=' . $catobj->get_parent_id() . '">' . |
|
524 | - Display::return_icon('back.png', get_lang('BackTo') . ' ' . get_lang('RootCat'), '', ICON_SIZE_MEDIUM) . '</a></td>'; |
|
523 | + $header .= '<td><a href="'.api_get_self().'?selectcat='.$catobj->get_parent_id().'">'. |
|
524 | + Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('RootCat'), '', ICON_SIZE_MEDIUM).'</a></td>'; |
|
525 | 525 | } |
526 | - $header .= '<td>' . get_lang('CurrentCategory') . '</td>' . |
|
526 | + $header .= '<td>'.get_lang('CurrentCategory').'</td>'. |
|
527 | 527 | '<td><form name="selector"><select name="selectcat" onchange="document.selector.submit()">'; |
528 | 528 | $cats = Category :: load(); |
529 | 529 | |
@@ -536,15 +536,15 @@ discard block |
||
536 | 536 | } |
537 | 537 | $line = isset($line) ? $line : ''; |
538 | 538 | if (isset($_GET['selectcat']) && $_GET['selectcat'] == $cat[0]) { |
539 | - $header .= '<option selected value=' . $cat[0] . '>' . $line . ' ' . $cat[1] . '</option>'; |
|
539 | + $header .= '<option selected value='.$cat[0].'>'.$line.' '.$cat[1].'</option>'; |
|
540 | 540 | } else { |
541 | - $header .= '<option value=' . $cat[0] . '>' . $line . ' ' . $cat[1] . '</option>'; |
|
541 | + $header .= '<option value='.$cat[0].'>'.$line.' '.$cat[1].'</option>'; |
|
542 | 542 | } |
543 | 543 | $line = ''; |
544 | 544 | } |
545 | 545 | $header .= '</select></form></td>'; |
546 | 546 | if (!empty($simple_search_form) && $message_resource === false) { |
547 | - $header .= '<td style="vertical-align: top;">' . $simple_search_form->toHtml() . '</td>'; |
|
547 | + $header .= '<td style="vertical-align: top;">'.$simple_search_form->toHtml().'</td>'; |
|
548 | 548 | } else { |
549 | 549 | $header .= '<td></td>'; |
550 | 550 | } |
@@ -555,9 +555,9 @@ discard block |
||
555 | 555 | } elseif (!(isset($_GET['studentoverview']))) { |
556 | 556 | |
557 | 557 | } else { |
558 | - $header .= '<td style="vertical-align: top;"><a href="' . api_get_self() . '?' . api_get_cidreq() . '&studentoverview=&exportpdf=&selectcat=' . $catobj->get_id() . '" target="_blank"> |
|
558 | + $header .= '<td style="vertical-align: top;"><a href="'.api_get_self().'?'.api_get_cidreq().'&studentoverview=&exportpdf=&selectcat='.$catobj->get_id().'" target="_blank"> |
|
559 | 559 | '.Display::return_icon('pdf.png', get_lang('ExportPDF'), [], ICON_SIZE_MEDIUM).' |
560 | - ' . get_lang('ExportPDF') . '</a>'; |
|
560 | + ' . get_lang('ExportPDF').'</a>'; |
|
561 | 561 | } |
562 | 562 | $header .= '</td></tr>'; |
563 | 563 | $header .= '</table></div>'; |
@@ -572,33 +572,33 @@ discard block |
||
572 | 572 | |
573 | 573 | if (api_is_allowed_to_edit(null, true)) { |
574 | 574 | if (empty($grade_model_id) || $grade_model_id == -1) { |
575 | - $actionsLeft .= '<a href="gradebook_add_cat.php?' . api_get_cidreq() . '&selectcat=' . $catobj->get_id() . '">' . |
|
576 | - Display::return_icon('new_folder.png', get_lang('AddGradebook'), array(), ICON_SIZE_MEDIUM) . '</a></td>'; |
|
575 | + $actionsLeft .= '<a href="gradebook_add_cat.php?'.api_get_cidreq().'&selectcat='.$catobj->get_id().'">'. |
|
576 | + Display::return_icon('new_folder.png', get_lang('AddGradebook'), array(), ICON_SIZE_MEDIUM).'</a></td>'; |
|
577 | 577 | } |
578 | 578 | if ($selectcat == '0') { |
579 | 579 | |
580 | 580 | } else { |
581 | 581 | $my_category = $catobj->shows_all_information_an_category($catobj->get_id()); |
582 | 582 | if ($my_api_cidreq == '') { |
583 | - $my_api_cidreq = 'cidReq=' . $my_category['course_code']; |
|
583 | + $my_api_cidreq = 'cidReq='.$my_category['course_code']; |
|
584 | 584 | } |
585 | 585 | if ($show_add_link && !$message_resource) { |
586 | - $actionsLeft .= '<a href="gradebook_add_eval.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '" >' . |
|
587 | - Display::return_icon('new_evaluation.png', get_lang('NewEvaluation'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
586 | + $actionsLeft .= '<a href="gradebook_add_eval.php?'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'" >'. |
|
587 | + Display::return_icon('new_evaluation.png', get_lang('NewEvaluation'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
588 | 588 | $cats = Category :: load($selectcat); |
589 | 589 | |
590 | 590 | if ($cats[0]->get_course_code() != null && !$message_resource) { |
591 | - $actionsLeft .= '<a href="gradebook_add_link.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '">' . |
|
592 | - Display::return_icon('new_online_evaluation.png', get_lang('MakeLink'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
591 | + $actionsLeft .= '<a href="gradebook_add_link.php?'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'">'. |
|
592 | + Display::return_icon('new_online_evaluation.png', get_lang('MakeLink'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
593 | 593 | } else { |
594 | - $actionsLeft .= '<a href="gradebook_add_link_select_course.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '">' . |
|
595 | - Display::return_icon('new_online_evaluation.png', get_lang('MakeLink'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
594 | + $actionsLeft .= '<a href="gradebook_add_link_select_course.php?'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'">'. |
|
595 | + Display::return_icon('new_online_evaluation.png', get_lang('MakeLink'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
596 | 596 | } |
597 | 597 | } |
598 | 598 | |
599 | 599 | if (!$message_resource) { |
600 | - $actionsLeft .= '<a href="gradebook_flatview.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '">' . |
|
601 | - Display::return_icon('stats.png', get_lang('FlatView'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
600 | + $actionsLeft .= '<a href="gradebook_flatview.php?'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'">'. |
|
601 | + Display::return_icon('stats.png', get_lang('FlatView'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
602 | 602 | |
603 | 603 | if ($my_category['generate_certificates'] == 1) { |
604 | 604 | $actionsLeft .= Display::url( |
@@ -608,7 +608,7 @@ discard block |
||
608 | 608 | '', |
609 | 609 | ICON_SIZE_MEDIUM |
610 | 610 | ), |
611 | - "gradebook_display_certificate.php?$my_api_cidreq&cat_id=" . intval($_GET['selectcat']) |
|
611 | + "gradebook_display_certificate.php?$my_api_cidreq&cat_id=".intval($_GET['selectcat']) |
|
612 | 612 | ); |
613 | 613 | } |
614 | 614 | |
@@ -619,30 +619,30 @@ discard block |
||
619 | 619 | '', |
620 | 620 | ICON_SIZE_MEDIUM |
621 | 621 | ), |
622 | - "gradebook_display_summary.php?$my_api_cidreq&selectcat=" . intval($_GET['selectcat']) |
|
622 | + "gradebook_display_summary.php?$my_api_cidreq&selectcat=".intval($_GET['selectcat']) |
|
623 | 623 | ); |
624 | 624 | |
625 | 625 | |
626 | 626 | // Right icons |
627 | - $actionsRight = '<a href="gradebook_edit_cat.php?editcat=' . $catobj->get_id() . '&cidReq=' . $catobj->get_course_code() . '&id_session='.$catobj->get_session_id(). '">' . |
|
628 | - Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
629 | - $actionsRight .= '<a href="../document/document.php?curdirpath=/certificates&' . $my_api_cidreq . '&origin=gradebook&selectcat=' . $catobj->get_id() . '">' . |
|
630 | - Display::return_icon('certificate.png', get_lang('AttachCertificate'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
627 | + $actionsRight = '<a href="gradebook_edit_cat.php?editcat='.$catobj->get_id().'&cidReq='.$catobj->get_course_code().'&id_session='.$catobj->get_session_id().'">'. |
|
628 | + Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
629 | + $actionsRight .= '<a href="../document/document.php?curdirpath=/certificates&'.$my_api_cidreq.'&origin=gradebook&selectcat='.$catobj->get_id().'">'. |
|
630 | + Display::return_icon('certificate.png', get_lang('AttachCertificate'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
631 | 631 | |
632 | 632 | if (empty($categories)) { |
633 | - $actionsRight .= '<a href="gradebook_edit_all.php?id_session=' . api_get_session_id() . '&' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '">' . |
|
634 | - Display::return_icon('percentage.png', get_lang('EditAllWeights'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
633 | + $actionsRight .= '<a href="gradebook_edit_all.php?id_session='.api_get_session_id().'&'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'">'. |
|
634 | + Display::return_icon('percentage.png', get_lang('EditAllWeights'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
635 | 635 | } |
636 | 636 | $score_display_custom = api_get_setting('gradebook_score_display_custom'); |
637 | 637 | if (api_get_setting('teachers_can_change_score_settings') == 'true' && $score_display_custom['my_display_custom'] == 'true') { |
638 | - $actionsRight .= '<a href="gradebook_scoring_system.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '">' . |
|
639 | - Display::return_icon('ranking.png', get_lang('ScoreEdit'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
638 | + $actionsRight .= '<a href="gradebook_scoring_system.php?'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'">'. |
|
639 | + Display::return_icon('ranking.png', get_lang('ScoreEdit'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
640 | 640 | } |
641 | 641 | |
642 | 642 | } |
643 | 643 | } |
644 | 644 | } elseif (isset($_GET['search'])) { |
645 | - echo $header = '<b>' . get_lang('SearchResults') . ' :</b>'; |
|
645 | + echo $header = '<b>'.get_lang('SearchResults').' :</b>'; |
|
646 | 646 | } |
647 | 647 | |
648 | 648 | $isDrhOfCourse = CourseManager::isUserSubscribedInCourseAsDrh( |
@@ -651,26 +651,26 @@ discard block |
||
651 | 651 | ); |
652 | 652 | |
653 | 653 | if ($isDrhOfCourse) { |
654 | - $$actionsLeft .= '<a href="gradebook_flatview.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '">' . |
|
655 | - Display::return_icon('stats.png', get_lang('FlatView'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
654 | + $$actionsLeft .= '<a href="gradebook_flatview.php?'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'">'. |
|
655 | + Display::return_icon('stats.png', get_lang('FlatView'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
656 | 656 | } |
657 | 657 | |
658 | - if (api_is_allowed_to_edit(null, true)){ |
|
659 | - echo $toolbar = Display::toolbarAction('gradebook-actions', array(0 => $actionsLeft, 1 => $actionsRight )); |
|
658 | + if (api_is_allowed_to_edit(null, true)) { |
|
659 | + echo $toolbar = Display::toolbarAction('gradebook-actions', array(0 => $actionsLeft, 1 => $actionsRight)); |
|
660 | 660 | } |
661 | 661 | |
662 | 662 | if (api_is_allowed_to_edit(null, true)) { |
663 | 663 | $weight = intval($catobj->get_weight()) > 0 ? $catobj->get_weight() : 0; |
664 | - $weight = '<strong>' . get_lang('TotalWeight') . ' : </strong>' . $weight; |
|
664 | + $weight = '<strong>'.get_lang('TotalWeight').' : </strong>'.$weight; |
|
665 | 665 | |
666 | 666 | $min_certification = (intval($catobj->get_certificate_min_score() > 0) ? $catobj->get_certificate_min_score() : 0); |
667 | - $min_certification = get_lang('CertificateMinScore') . ' : ' . $min_certification; |
|
668 | - $edit_icon = '<a href="gradebook_edit_cat.php?editcat=' . $catobj->get_id() . '&cidReq=' . $catobj->get_course_code() . '&id_session='.$catobj->get_session_id(). '">' . |
|
669 | - Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . '</a>'; |
|
667 | + $min_certification = get_lang('CertificateMinScore').' : '.$min_certification; |
|
668 | + $edit_icon = '<a href="gradebook_edit_cat.php?editcat='.$catobj->get_id().'&cidReq='.$catobj->get_course_code().'&id_session='.$catobj->get_session_id().'">'. |
|
669 | + Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>'; |
|
670 | 670 | //$msg = Display::tag('h3', $weight.' - '.$min_certification); |
671 | - $msg = $weight . ' - ' . $min_certification . $edit_icon; |
|
671 | + $msg = $weight.' - '.$min_certification.$edit_icon; |
|
672 | 672 | //@todo show description |
673 | - $description = (($catobj->get_description() == "" || is_null($catobj->get_description())) ? '' : '<strong>' . get_lang('GradebookDescriptionLog') . '</strong>' . ': ' . $catobj->get_description()); |
|
673 | + $description = (($catobj->get_description() == "" || is_null($catobj->get_description())) ? '' : '<strong>'.get_lang('GradebookDescriptionLog').'</strong>'.': '.$catobj->get_description()); |
|
674 | 674 | Display::display_normal_message($msg, false); |
675 | 675 | if (!empty($description)) { |
676 | 676 | echo Display::div($description, array()); |
@@ -698,24 +698,24 @@ discard block |
||
698 | 698 | $cattotal = Category :: load(0); |
699 | 699 | $scoretotal = $cattotal[0]->calc_score(api_get_user_id()); |
700 | 700 | $scoretotal_display = (isset($scoretotal) ? $scoredisplay->display_score($scoretotal, SCORE_PERCENT) : get_lang('NoResultsAvailable')); |
701 | - $scoreinfo = get_lang('StatsStudent') . ' :<b> ' . $user['complete_name']. '</b><br />'; |
|
701 | + $scoreinfo = get_lang('StatsStudent').' :<b> '.$user['complete_name'].'</b><br />'; |
|
702 | 702 | if ((!$catobj->get_id() == '0') && (!isset($_GET['studentoverview'])) && (!isset($_GET['search']))) |
703 | - $scoreinfo.= '<br />' . get_lang('TotalForThisCategory') . ' : <b>' . $scorecourse_display . '</b>'; |
|
704 | - $scoreinfo.= '<br />' . get_lang('Total') . ' : <b>' . $scoretotal_display . '</b>'; |
|
703 | + $scoreinfo .= '<br />'.get_lang('TotalForThisCategory').' : <b>'.$scorecourse_display.'</b>'; |
|
704 | + $scoreinfo .= '<br />'.get_lang('Total').' : <b>'.$scoretotal_display.'</b>'; |
|
705 | 705 | Display :: display_normal_message($scoreinfo, false); |
706 | 706 | } |
707 | 707 | // show navigation tree and buttons? |
708 | 708 | $header = '<div class="actions">'; |
709 | 709 | |
710 | 710 | if ($is_course_admin) { |
711 | - $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>'; |
|
712 | - $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>'; |
|
711 | + $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>'; |
|
712 | + $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>'; |
|
713 | 713 | } elseif (!(isset($_GET['studentoverview']))) { |
714 | - $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>'; |
|
714 | + $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>'; |
|
715 | 715 | } else { |
716 | - $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>'; |
|
716 | + $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>'; |
|
717 | 717 | } |
718 | - $header.='</div>'; |
|
718 | + $header .= '</div>'; |
|
719 | 719 | echo $header; |
720 | 720 | } |
721 | 721 | |
@@ -742,8 +742,8 @@ discard block |
||
742 | 742 | $item = $evals_links[$count]; |
743 | 743 | $score = $item->calc_score($user_id); |
744 | 744 | $my_score_denom = ($score[1] == 0) ? 1 : $score[1]; |
745 | - $item_value+=$score[0] / $my_score_denom * $item->get_weight(); |
|
746 | - $item_total+=$item->get_weight(); |
|
745 | + $item_value += $score[0] / $my_score_denom * $item->get_weight(); |
|
746 | + $item_total += $item->get_weight(); |
|
747 | 747 | //$row[] = $scoredisplay->display_score($score,SCORE_DIV_PERCENT); |
748 | 748 | } |
749 | 749 | $item_value = number_format($item_value, 2, '.', ' '); |
@@ -758,17 +758,17 @@ discard block |
||
758 | 758 | $imageUrl = UserManager::getUserPicture($userid); |
759 | 759 | |
760 | 760 | $info = '<div class="row"><div class="col-md-3">'; |
761 | - $info .= '<div class="thumbnail"><img src="' . $imageUrl . '" /></div>'; |
|
761 | + $info .= '<div class="thumbnail"><img src="'.$imageUrl.'" /></div>'; |
|
762 | 762 | $info .= '</div>'; |
763 | 763 | $info .= '<div class="col-md-6">'; |
764 | - $info .= get_lang('Name') . ' : <a target="_blank" href="' . api_get_path(WEB_CODE_PATH) . 'social/profile.php?u=' . $userid . '"> ' . |
|
765 | - $user['complete_name'] . '</a><br />'; |
|
764 | + $info .= get_lang('Name').' : <a target="_blank" href="'.api_get_path(WEB_CODE_PATH).'social/profile.php?u='.$userid.'"> '. |
|
765 | + $user['complete_name'].'</a><br />'; |
|
766 | 766 | |
767 | 767 | if (api_get_setting('show_email_addresses') == 'true') { |
768 | - $info .= get_lang('Email') . ' : <a href="mailto:' . $user['email'] . '">' . $user['email'] . '</a><br />'; |
|
768 | + $info .= get_lang('Email').' : <a href="mailto:'.$user['email'].'">'.$user['email'].'</a><br />'; |
|
769 | 769 | } |
770 | 770 | |
771 | - $info .= get_lang('TotalUser') . ' : <b>' . $scorecourse_display . '</b>'; |
|
771 | + $info .= get_lang('TotalUser').' : <b>'.$scorecourse_display.'</b>'; |
|
772 | 772 | $info .= '</div>'; |
773 | 773 | $info .= '</div>'; |
774 | 774 |