@@ -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(); |
@@ -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 __construct($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 __construct($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 __construct($form_type, $user, $form_name, $method= 'post', $action= null) |
|
22 | + public function __construct($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 | } |
@@ -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,29 +619,29 @@ 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 | // Right icons |
626 | - $actionsRight = '<a href="gradebook_edit_cat.php?editcat=' . $catobj->get_id() . '&cidReq=' . $catobj->get_course_code() . '&id_session='.$catobj->get_session_id(). '">' . |
|
627 | - Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
628 | - $actionsRight .= '<a href="../document/document.php?curdirpath=/certificates&' . $my_api_cidreq . '&origin=gradebook&selectcat=' . $catobj->get_id() . '">' . |
|
629 | - Display::return_icon('certificate.png', get_lang('AttachCertificate'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
626 | + $actionsRight = '<a href="gradebook_edit_cat.php?editcat='.$catobj->get_id().'&cidReq='.$catobj->get_course_code().'&id_session='.$catobj->get_session_id().'">'. |
|
627 | + Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
628 | + $actionsRight .= '<a href="../document/document.php?curdirpath=/certificates&'.$my_api_cidreq.'&origin=gradebook&selectcat='.$catobj->get_id().'">'. |
|
629 | + Display::return_icon('certificate.png', get_lang('AttachCertificate'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
630 | 630 | |
631 | 631 | if (empty($categories)) { |
632 | - $actionsRight .= '<a href="gradebook_edit_all.php?id_session=' . api_get_session_id() . '&' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '">' . |
|
633 | - Display::return_icon('percentage.png', get_lang('EditAllWeights'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
632 | + $actionsRight .= '<a href="gradebook_edit_all.php?id_session='.api_get_session_id().'&'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'">'. |
|
633 | + Display::return_icon('percentage.png', get_lang('EditAllWeights'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
634 | 634 | } |
635 | 635 | $score_display_custom = api_get_setting('gradebook_score_display_custom'); |
636 | 636 | if (api_get_setting('teachers_can_change_score_settings') == 'true' && $score_display_custom['my_display_custom'] == 'true') { |
637 | - $actionsRight .= '<a href="gradebook_scoring_system.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '">' . |
|
638 | - Display::return_icon('ranking.png', get_lang('ScoreEdit'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
637 | + $actionsRight .= '<a href="gradebook_scoring_system.php?'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'">'. |
|
638 | + Display::return_icon('ranking.png', get_lang('ScoreEdit'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
639 | 639 | } |
640 | 640 | |
641 | 641 | } |
642 | 642 | } |
643 | 643 | } elseif (isset($_GET['search'])) { |
644 | - echo $header = '<b>' . get_lang('SearchResults') . ' :</b>'; |
|
644 | + echo $header = '<b>'.get_lang('SearchResults').' :</b>'; |
|
645 | 645 | } |
646 | 646 | |
647 | 647 | $isDrhOfCourse = CourseManager::isUserSubscribedInCourseAsDrh( |
@@ -650,26 +650,26 @@ discard block |
||
650 | 650 | ); |
651 | 651 | |
652 | 652 | if ($isDrhOfCourse) { |
653 | - $$actionsLeft .= '<a href="gradebook_flatview.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '">' . |
|
654 | - Display::return_icon('stats.png', get_lang('FlatView'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
653 | + $$actionsLeft .= '<a href="gradebook_flatview.php?'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'">'. |
|
654 | + Display::return_icon('stats.png', get_lang('FlatView'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
655 | 655 | } |
656 | 656 | |
657 | - if (api_is_allowed_to_edit(null, true)){ |
|
657 | + if (api_is_allowed_to_edit(null, true)) { |
|
658 | 658 | echo $toolbar = Display::toolbarAction('gradebook-actions', array($actionsLeft, $actionsRight)); |
659 | 659 | } |
660 | 660 | |
661 | 661 | if (api_is_allowed_to_edit(null, true)) { |
662 | 662 | $weight = intval($catobj->get_weight()) > 0 ? $catobj->get_weight() : 0; |
663 | - $weight = '<strong>' . get_lang('TotalWeight') . ' : </strong>' . $weight; |
|
663 | + $weight = '<strong>'.get_lang('TotalWeight').' : </strong>'.$weight; |
|
664 | 664 | |
665 | 665 | $min_certification = (intval($catobj->get_certificate_min_score() > 0) ? $catobj->get_certificate_min_score() : 0); |
666 | - $min_certification = get_lang('CertificateMinScore') . ' : ' . $min_certification; |
|
667 | - $edit_icon = '<a href="gradebook_edit_cat.php?editcat=' . $catobj->get_id() . '&cidReq=' . $catobj->get_course_code() . '&id_session='.$catobj->get_session_id(). '">' . |
|
668 | - Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . '</a>'; |
|
666 | + $min_certification = get_lang('CertificateMinScore').' : '.$min_certification; |
|
667 | + $edit_icon = '<a href="gradebook_edit_cat.php?editcat='.$catobj->get_id().'&cidReq='.$catobj->get_course_code().'&id_session='.$catobj->get_session_id().'">'. |
|
668 | + Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>'; |
|
669 | 669 | //$msg = Display::tag('h3', $weight.' - '.$min_certification); |
670 | - $msg = $weight . ' - ' . $min_certification . $edit_icon; |
|
670 | + $msg = $weight.' - '.$min_certification.$edit_icon; |
|
671 | 671 | //@todo show description |
672 | - $description = (($catobj->get_description() == "" || is_null($catobj->get_description())) ? '' : '<strong>' . get_lang('GradebookDescriptionLog') . '</strong>' . ': ' . $catobj->get_description()); |
|
672 | + $description = (($catobj->get_description() == "" || is_null($catobj->get_description())) ? '' : '<strong>'.get_lang('GradebookDescriptionLog').'</strong>'.': '.$catobj->get_description()); |
|
673 | 673 | Display::display_normal_message($msg, false); |
674 | 674 | if (!empty($description)) { |
675 | 675 | echo Display::div($description, array()); |
@@ -697,24 +697,24 @@ discard block |
||
697 | 697 | $cattotal = Category :: load(0); |
698 | 698 | $scoretotal = $cattotal[0]->calc_score(api_get_user_id()); |
699 | 699 | $scoretotal_display = (isset($scoretotal) ? $scoredisplay->display_score($scoretotal, SCORE_PERCENT) : get_lang('NoResultsAvailable')); |
700 | - $scoreinfo = get_lang('StatsStudent') . ' :<b> ' . $user['complete_name']. '</b><br />'; |
|
700 | + $scoreinfo = get_lang('StatsStudent').' :<b> '.$user['complete_name'].'</b><br />'; |
|
701 | 701 | if ((!$catobj->get_id() == '0') && (!isset($_GET['studentoverview'])) && (!isset($_GET['search']))) |
702 | - $scoreinfo.= '<br />' . get_lang('TotalForThisCategory') . ' : <b>' . $scorecourse_display . '</b>'; |
|
703 | - $scoreinfo.= '<br />' . get_lang('Total') . ' : <b>' . $scoretotal_display . '</b>'; |
|
702 | + $scoreinfo .= '<br />'.get_lang('TotalForThisCategory').' : <b>'.$scorecourse_display.'</b>'; |
|
703 | + $scoreinfo .= '<br />'.get_lang('Total').' : <b>'.$scoretotal_display.'</b>'; |
|
704 | 704 | Display :: display_normal_message($scoreinfo, false); |
705 | 705 | } |
706 | 706 | // show navigation tree and buttons? |
707 | 707 | $header = '<div class="actions">'; |
708 | 708 | |
709 | 709 | if ($is_course_admin) { |
710 | - $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>'; |
|
711 | - $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>'; |
|
710 | + $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>'; |
|
711 | + $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>'; |
|
712 | 712 | } elseif (!(isset($_GET['studentoverview']))) { |
713 | - $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>'; |
|
713 | + $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 | 714 | } else { |
715 | - $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>'; |
|
715 | + $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 | 716 | } |
717 | - $header.='</div>'; |
|
717 | + $header .= '</div>'; |
|
718 | 718 | echo $header; |
719 | 719 | } |
720 | 720 | |
@@ -741,8 +741,8 @@ discard block |
||
741 | 741 | $item = $evals_links[$count]; |
742 | 742 | $score = $item->calc_score($user_id); |
743 | 743 | $my_score_denom = ($score[1] == 0) ? 1 : $score[1]; |
744 | - $item_value+=$score[0] / $my_score_denom * $item->get_weight(); |
|
745 | - $item_total+=$item->get_weight(); |
|
744 | + $item_value += $score[0] / $my_score_denom * $item->get_weight(); |
|
745 | + $item_total += $item->get_weight(); |
|
746 | 746 | //$row[] = $scoredisplay->display_score($score,SCORE_DIV_PERCENT); |
747 | 747 | } |
748 | 748 | $item_value = number_format($item_value, 2, '.', ' '); |
@@ -757,17 +757,17 @@ discard block |
||
757 | 757 | $imageUrl = UserManager::getUserPicture($userid); |
758 | 758 | |
759 | 759 | $info = '<div class="row"><div class="col-md-3">'; |
760 | - $info .= '<div class="thumbnail"><img src="' . $imageUrl . '" /></div>'; |
|
760 | + $info .= '<div class="thumbnail"><img src="'.$imageUrl.'" /></div>'; |
|
761 | 761 | $info .= '</div>'; |
762 | 762 | $info .= '<div class="col-md-6">'; |
763 | - $info .= get_lang('Name') . ' : <a target="_blank" href="' . api_get_path(WEB_CODE_PATH) . 'social/profile.php?u=' . $userid . '"> ' . |
|
764 | - $user['complete_name'] . '</a><br />'; |
|
763 | + $info .= get_lang('Name').' : <a target="_blank" href="'.api_get_path(WEB_CODE_PATH).'social/profile.php?u='.$userid.'"> '. |
|
764 | + $user['complete_name'].'</a><br />'; |
|
765 | 765 | |
766 | 766 | if (api_get_setting('show_email_addresses') == 'true') { |
767 | - $info .= get_lang('Email') . ' : <a href="mailto:' . $user['email'] . '">' . $user['email'] . '</a><br />'; |
|
767 | + $info .= get_lang('Email').' : <a href="mailto:'.$user['email'].'">'.$user['email'].'</a><br />'; |
|
768 | 768 | } |
769 | 769 | |
770 | - $info .= get_lang('TotalUser') . ' : <b>' . $scorecourse_display . '</b>'; |
|
770 | + $info .= get_lang('TotalUser').' : <b>'.$scorecourse_display.'</b>'; |
|
771 | 771 | $info .= '</div>'; |
772 | 772 | $info .= '</div>'; |
773 | 773 |
@@ -56,17 +56,17 @@ discard block |
||
56 | 56 | |
57 | 57 | protected function build_move() |
58 | 58 | { |
59 | - $renderer =& $this->defaultRenderer(); |
|
59 | + $renderer = & $this->defaultRenderer(); |
|
60 | 60 | $renderer->setCustomElementTemplate('<span>{element}</span> '); |
61 | - $this->addElement('static',null,null,'"'.$this->link_object->get_name().'" '); |
|
62 | - $this->addElement('static',null,null,get_lang('MoveTo').' : '); |
|
63 | - $select = $this->addElement('select','move_cat',null,null); |
|
61 | + $this->addElement('static', null, null, '"'.$this->link_object->get_name().'" '); |
|
62 | + $this->addElement('static', null, null, get_lang('MoveTo').' : '); |
|
63 | + $select = $this->addElement('select', 'move_cat', null, null); |
|
64 | 64 | $line = ''; |
65 | 65 | foreach ($this->link_object->get_target_categories() as $cat) { |
66 | - for ($i=0;$i<$cat[2];$i++) { |
|
66 | + for ($i = 0; $i < $cat[2]; $i++) { |
|
67 | 67 | $line .= '—'; |
68 | 68 | } |
69 | - $select->addoption($line.' '.$cat[1],$cat[0]); |
|
69 | + $select->addoption($line.' '.$cat[1], $cat[0]); |
|
70 | 70 | $line = ''; |
71 | 71 | } |
72 | 72 | $this->addElement('submit', null, get_lang('Ok')); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $link = LinkFactory::create($link); |
134 | 134 | if (!empty($courseCode)) { |
135 | 135 | $link->set_course_code($courseCode); |
136 | - } elseif(!empty($_GET['course_code'])) { |
|
136 | + } elseif (!empty($_GET['course_code'])) { |
|
137 | 137 | $link->set_course_code(Database::escape_string($_GET['course_code'], null, false)); |
138 | 138 | } |
139 | 139 |
@@ -10,133 +10,133 @@ |
||
10 | 10 | */ |
11 | 11 | class LinkForm extends FormValidator |
12 | 12 | { |
13 | - const TYPE_CREATE = 1; |
|
14 | - const TYPE_MOVE = 2; |
|
15 | - /** @var Category */ |
|
16 | - private $category_object; |
|
17 | - private $link_object; |
|
18 | - private $extra; |
|
13 | + const TYPE_CREATE = 1; |
|
14 | + const TYPE_MOVE = 2; |
|
15 | + /** @var Category */ |
|
16 | + private $category_object; |
|
17 | + private $link_object; |
|
18 | + private $extra; |
|
19 | 19 | |
20 | - /** |
|
21 | - * Builds a form containing form items based on a given parameter |
|
22 | - * @param int form_type 1=choose link |
|
23 | - * @param obj cat_obj the category object |
|
24 | - * @param string form name |
|
25 | - * @param method |
|
26 | - * @param action |
|
27 | - */ |
|
28 | - public function __construct( |
|
29 | - $form_type, |
|
30 | - $category_object, |
|
31 | - $link_object, |
|
32 | - $form_name, |
|
33 | - $method = 'post', |
|
34 | - $action = null, |
|
35 | - $extra = null |
|
36 | - ) { |
|
37 | - parent :: __construct($form_name, $method, $action); |
|
20 | + /** |
|
21 | + * Builds a form containing form items based on a given parameter |
|
22 | + * @param int form_type 1=choose link |
|
23 | + * @param obj cat_obj the category object |
|
24 | + * @param string form name |
|
25 | + * @param method |
|
26 | + * @param action |
|
27 | + */ |
|
28 | + public function __construct( |
|
29 | + $form_type, |
|
30 | + $category_object, |
|
31 | + $link_object, |
|
32 | + $form_name, |
|
33 | + $method = 'post', |
|
34 | + $action = null, |
|
35 | + $extra = null |
|
36 | + ) { |
|
37 | + parent :: __construct($form_name, $method, $action); |
|
38 | 38 | |
39 | - if (isset ($category_object)) { |
|
40 | - $this->category_object = $category_object; |
|
41 | - } else { |
|
42 | - if (isset($link_object)) { |
|
43 | - $this->link_object = $link_object; |
|
44 | - } |
|
45 | - } |
|
39 | + if (isset ($category_object)) { |
|
40 | + $this->category_object = $category_object; |
|
41 | + } else { |
|
42 | + if (isset($link_object)) { |
|
43 | + $this->link_object = $link_object; |
|
44 | + } |
|
45 | + } |
|
46 | 46 | |
47 | - if (isset ($extra)) { |
|
48 | - $this->extra = $extra; |
|
49 | - } |
|
50 | - if ($form_type == self :: TYPE_CREATE) { |
|
51 | - $this->build_create(); |
|
52 | - } elseif ($form_type == self :: TYPE_MOVE) { |
|
53 | - $this->build_move(); |
|
54 | - } |
|
55 | - } |
|
47 | + if (isset ($extra)) { |
|
48 | + $this->extra = $extra; |
|
49 | + } |
|
50 | + if ($form_type == self :: TYPE_CREATE) { |
|
51 | + $this->build_create(); |
|
52 | + } elseif ($form_type == self :: TYPE_MOVE) { |
|
53 | + $this->build_move(); |
|
54 | + } |
|
55 | + } |
|
56 | 56 | |
57 | - protected function build_move() |
|
58 | - { |
|
59 | - $renderer =& $this->defaultRenderer(); |
|
60 | - $renderer->setCustomElementTemplate('<span>{element}</span> '); |
|
61 | - $this->addElement('static',null,null,'"'.$this->link_object->get_name().'" '); |
|
62 | - $this->addElement('static',null,null,get_lang('MoveTo').' : '); |
|
63 | - $select = $this->addElement('select','move_cat',null,null); |
|
64 | - $line = ''; |
|
65 | - foreach ($this->link_object->get_target_categories() as $cat) { |
|
66 | - for ($i=0;$i<$cat[2];$i++) { |
|
67 | - $line .= '—'; |
|
68 | - } |
|
69 | - $select->addoption($line.' '.$cat[1],$cat[0]); |
|
70 | - $line = ''; |
|
71 | - } |
|
72 | - $this->addElement('submit', null, get_lang('Ok')); |
|
73 | - } |
|
57 | + protected function build_move() |
|
58 | + { |
|
59 | + $renderer =& $this->defaultRenderer(); |
|
60 | + $renderer->setCustomElementTemplate('<span>{element}</span> '); |
|
61 | + $this->addElement('static',null,null,'"'.$this->link_object->get_name().'" '); |
|
62 | + $this->addElement('static',null,null,get_lang('MoveTo').' : '); |
|
63 | + $select = $this->addElement('select','move_cat',null,null); |
|
64 | + $line = ''; |
|
65 | + foreach ($this->link_object->get_target_categories() as $cat) { |
|
66 | + for ($i=0;$i<$cat[2];$i++) { |
|
67 | + $line .= '—'; |
|
68 | + } |
|
69 | + $select->addoption($line.' '.$cat[1],$cat[0]); |
|
70 | + $line = ''; |
|
71 | + } |
|
72 | + $this->addElement('submit', null, get_lang('Ok')); |
|
73 | + } |
|
74 | 74 | |
75 | - /** |
|
76 | - * Builds the form |
|
77 | - */ |
|
78 | - protected function build_create() |
|
79 | - { |
|
80 | - $this->addElement('header', get_lang('MakeLink')); |
|
81 | - $select = $this->addElement( |
|
82 | - 'select', |
|
83 | - 'select_link', |
|
84 | - get_lang('ChooseLink'), |
|
85 | - null, |
|
86 | - array('onchange' => 'document.create_link.submit()') |
|
87 | - ); |
|
75 | + /** |
|
76 | + * Builds the form |
|
77 | + */ |
|
78 | + protected function build_create() |
|
79 | + { |
|
80 | + $this->addElement('header', get_lang('MakeLink')); |
|
81 | + $select = $this->addElement( |
|
82 | + 'select', |
|
83 | + 'select_link', |
|
84 | + get_lang('ChooseLink'), |
|
85 | + null, |
|
86 | + array('onchange' => 'document.create_link.submit()') |
|
87 | + ); |
|
88 | 88 | |
89 | - $linkTypes = LinkFactory::get_all_types(); |
|
89 | + $linkTypes = LinkFactory::get_all_types(); |
|
90 | 90 | |
91 | - $select->addoption('['.get_lang('ChooseLink').']', 0); |
|
91 | + $select->addoption('['.get_lang('ChooseLink').']', 0); |
|
92 | 92 | |
93 | - $courseCode = $this->category_object->get_course_code(); |
|
93 | + $courseCode = $this->category_object->get_course_code(); |
|
94 | 94 | |
95 | - foreach ($linkTypes as $linkType) { |
|
96 | - // The hot potatoe link will be added "inside" the exercise option. |
|
97 | - if ($linkType == LINK_HOTPOTATOES) { |
|
98 | - continue; |
|
99 | - } |
|
100 | - $link = $this->createLink($linkType, $courseCode); |
|
101 | - // disable this element if the link works with a dropdownlist |
|
102 | - // and if there are no links left |
|
103 | - if (!$link->needs_name_and_description() && count($link->get_all_links()) == '0') { |
|
104 | - $select->addoption($link->get_type_name(), $linkType, 'disabled'); |
|
105 | - } else { |
|
106 | - if ($link->get_type() == LINK_EXERCISE) { |
|
107 | - // Adding exercise |
|
108 | - $select->addoption($link->get_type_name(), $linkType); |
|
109 | - // Adding hot potatoes |
|
110 | - $linkHot = $this->createLink(LINK_HOTPOTATOES, $courseCode); |
|
111 | - $select->addoption( |
|
112 | - ' '.$linkHot->get_type_name(), |
|
113 | - LINK_HOTPOTATOES |
|
114 | - ); |
|
115 | - } else { |
|
116 | - $select->addoption($link->get_type_name(), $linkType); |
|
117 | - } |
|
118 | - } |
|
119 | - } |
|
95 | + foreach ($linkTypes as $linkType) { |
|
96 | + // The hot potatoe link will be added "inside" the exercise option. |
|
97 | + if ($linkType == LINK_HOTPOTATOES) { |
|
98 | + continue; |
|
99 | + } |
|
100 | + $link = $this->createLink($linkType, $courseCode); |
|
101 | + // disable this element if the link works with a dropdownlist |
|
102 | + // and if there are no links left |
|
103 | + if (!$link->needs_name_and_description() && count($link->get_all_links()) == '0') { |
|
104 | + $select->addoption($link->get_type_name(), $linkType, 'disabled'); |
|
105 | + } else { |
|
106 | + if ($link->get_type() == LINK_EXERCISE) { |
|
107 | + // Adding exercise |
|
108 | + $select->addoption($link->get_type_name(), $linkType); |
|
109 | + // Adding hot potatoes |
|
110 | + $linkHot = $this->createLink(LINK_HOTPOTATOES, $courseCode); |
|
111 | + $select->addoption( |
|
112 | + ' '.$linkHot->get_type_name(), |
|
113 | + LINK_HOTPOTATOES |
|
114 | + ); |
|
115 | + } else { |
|
116 | + $select->addoption($link->get_type_name(), $linkType); |
|
117 | + } |
|
118 | + } |
|
119 | + } |
|
120 | 120 | |
121 | - if (isset($this->extra)) { |
|
122 | - $this->setDefaults(array('select_link' => $this->extra)); |
|
123 | - } |
|
124 | - } |
|
121 | + if (isset($this->extra)) { |
|
122 | + $this->setDefaults(array('select_link' => $this->extra)); |
|
123 | + } |
|
124 | + } |
|
125 | 125 | |
126 | - /** |
|
127 | - * @param integer $link |
|
128 | - * @param null|string $courseCode |
|
129 | - * @return AttendanceLink|DropboxLink|ExerciseLink|ForumThreadLink|LearnpathLink|null|StudentPublicationLink|SurveyLink |
|
130 | - */ |
|
131 | - private function createLink($link, $courseCode) |
|
132 | - { |
|
133 | - $link = LinkFactory::create($link); |
|
134 | - if (!empty($courseCode)) { |
|
135 | - $link->set_course_code($courseCode); |
|
136 | - } elseif(!empty($_GET['course_code'])) { |
|
137 | - $link->set_course_code(Database::escape_string($_GET['course_code'], null, false)); |
|
138 | - } |
|
126 | + /** |
|
127 | + * @param integer $link |
|
128 | + * @param null|string $courseCode |
|
129 | + * @return AttendanceLink|DropboxLink|ExerciseLink|ForumThreadLink|LearnpathLink|null|StudentPublicationLink|SurveyLink |
|
130 | + */ |
|
131 | + private function createLink($link, $courseCode) |
|
132 | + { |
|
133 | + $link = LinkFactory::create($link); |
|
134 | + if (!empty($courseCode)) { |
|
135 | + $link->set_course_code($courseCode); |
|
136 | + } elseif(!empty($_GET['course_code'])) { |
|
137 | + $link->set_course_code(Database::escape_string($_GET['course_code'], null, false)); |
|
138 | + } |
|
139 | 139 | |
140 | - return $link; |
|
141 | - } |
|
140 | + return $link; |
|
141 | + } |
|
142 | 142 | } |
@@ -52,15 +52,15 @@ discard block |
||
52 | 52 | */ |
53 | 53 | protected function build_move_form() |
54 | 54 | { |
55 | - $renderer =& $this->defaultRenderer(); |
|
55 | + $renderer = & $this->defaultRenderer(); |
|
56 | 56 | $renderer->setCustomElementTemplate('<span>{element}</span> '); |
57 | 57 | $this->addElement( |
58 | 58 | 'static', |
59 | 59 | null, |
60 | 60 | null, |
61 | - '"' . $this->category_object->get_name() . '" ' |
|
61 | + '"'.$this->category_object->get_name().'" ' |
|
62 | 62 | ); |
63 | - $this->addElement('static', null, null, get_lang('MoveTo') . ' : '); |
|
63 | + $this->addElement('static', null, null, get_lang('MoveTo').' : '); |
|
64 | 64 | $select = $this->addElement('select', 'move_cat', null, null); |
65 | 65 | $line = null; |
66 | 66 | foreach ($this->category_object->get_target_categories() as $cat) { |
@@ -68,9 +68,9 @@ discard block |
||
68 | 68 | $line .= '--'; |
69 | 69 | } |
70 | 70 | if ($cat[0] != $this->category_object->get_parent_id()) { |
71 | - $select->addoption($line . ' ' . $cat[1], $cat[0]); |
|
71 | + $select->addoption($line.' '.$cat[1], $cat[0]); |
|
72 | 72 | } else { |
73 | - $select->addoption($line . ' ' . $cat[1], $cat[0], 'disabled'); |
|
73 | + $select->addoption($line.' '.$cat[1], $cat[0], 'disabled'); |
|
74 | 74 | } |
75 | 75 | $line = ''; |
76 | 76 | } |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $grade_model_id = $this->category_object->get_grade_model_id(); |
154 | 154 | |
155 | 155 | if (empty($links)) { |
156 | - $grade_model_id = 0; |
|
156 | + $grade_model_id = 0; |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | $category_name = $this->category_object->get_name(); |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | [ |
243 | 243 | 'id' => 'skills', |
244 | 244 | 'multiple' => 'multiple', |
245 | - 'url' => api_get_path(WEB_AJAX_PATH) . 'skill.ajax.php?a=search_skills' |
|
245 | + 'url' => api_get_path(WEB_AJAX_PATH).'skill.ajax.php?a=search_skills' |
|
246 | 246 | ] |
247 | 247 | ); |
248 | 248 | |
@@ -400,14 +400,14 @@ discard block |
||
400 | 400 | //only return courses that are not yet created by the teacher |
401 | 401 | |
402 | 402 | foreach ($coursecat as $row) { |
403 | - $select->addoption($row[1],$row[0]); |
|
403 | + $select->addoption($row[1], $row[0]); |
|
404 | 404 | } |
405 | 405 | $this->setDefaults(array( |
406 | 406 | 'hid_user_id' => $this->category_object->get_user_id(), |
407 | 407 | 'hid_parent_id' => $this->category_object->get_parent_id() |
408 | 408 | )); |
409 | - $this->addElement('hidden','hid_user_id'); |
|
410 | - $this->addElement('hidden','hid_parent_id'); |
|
409 | + $this->addElement('hidden', 'hid_user_id'); |
|
410 | + $this->addElement('hidden', 'hid_parent_id'); |
|
411 | 411 | $this->addElement('submit', null, get_lang('Ok')); |
412 | 412 | } |
413 | 413 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | if (isset($link_object)) { |
32 | 32 | $link = $link_object; |
33 | 33 | } elseif (isset($link_type) && isset($category_object)) { |
34 | - $link = LinkFactory :: create ($link_type); |
|
34 | + $link = LinkFactory :: create($link_type); |
|
35 | 35 | $link->set_course_code(api_get_course_id()); |
36 | 36 | $link->set_category_id($category_object[0]->get_id()); |
37 | 37 | } else { |
@@ -52,12 +52,12 @@ discard block |
||
52 | 52 | } else { |
53 | 53 | $select = $this->addElement('select', 'select_link', get_lang('ChooseItem')); |
54 | 54 | foreach ($link->get_all_links() as $newlink) { |
55 | - $select->addoption($newlink[1],$newlink[0]); |
|
55 | + $select->addoption($newlink[1], $newlink[0]); |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | } else { |
59 | - $this->addElement('label',get_lang('Name'), '<span class="freeze">'.$link->get_name().' ['.$link->get_type_name().']</span>'); |
|
60 | - $this->addElement('hidden','name_link',$link->get_name(),array('id'=>'name_link')); |
|
59 | + $this->addElement('label', get_lang('Name'), '<span class="freeze">'.$link->get_name().' ['.$link->get_type_name().']</span>'); |
|
60 | + $this->addElement('hidden', 'name_link', $link->get_name(), array('id'=>'name_link')); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | if (count($category_object) == 1) { |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $grade_model_id = $my_cat->get_grade_model_id(); |
81 | 81 | if (empty($grade_model_id)) { |
82 | 82 | |
83 | - if ($my_cat->get_parent_id() == 0 ) { |
|
83 | + if ($my_cat->get_parent_id() == 0) { |
|
84 | 84 | $default_weight = $my_cat->get_weight(); |
85 | 85 | $select_gradebook->addoption(get_lang('Default'), $my_cat->get_id()); |
86 | 86 | } else { |
@@ -119,8 +119,8 @@ discard block |
||
119 | 119 | 'class' => 'span1' |
120 | 120 | ));*/ |
121 | 121 | |
122 | - $this->addRule('weight_mask',get_lang('OnlyNumbers'),'numeric'); |
|
123 | - $this->addRule(array ('weight_mask', 'zero'), get_lang('NegativeValue'), 'compare', '>='); |
|
122 | + $this->addRule('weight_mask', get_lang('OnlyNumbers'), 'numeric'); |
|
123 | + $this->addRule(array('weight_mask', 'zero'), get_lang('NegativeValue'), 'compare', '>='); |
|
124 | 124 | if ($form_type == self :: TYPE_EDIT) { |
125 | 125 | $parent_cat = Category :: load($link->get_category_id()); |
126 | 126 | |
@@ -133,20 +133,20 @@ discard block |
||
133 | 133 | //var_dump($global_weight, $link->get_weight(), $parent_cat[0]->get_weight()); |
134 | 134 | //$weight = $parent_cat[0]->get_weight()* $link->get_weight() / $global_weight; |
135 | 135 | //$values['weight'] = $weight; |
136 | - $values['weight'] = $link->get_weight() ; |
|
136 | + $values['weight'] = $link->get_weight(); |
|
137 | 137 | } |
138 | - $defaults['weight_mask'] = $values['weight'] ; |
|
138 | + $defaults['weight_mask'] = $values['weight']; |
|
139 | 139 | $defaults['select_gradebook'] = $link->get_category_id(); |
140 | 140 | |
141 | 141 | } |
142 | 142 | // ELEMENT: max |
143 | 143 | if ($link->needs_max()) { |
144 | 144 | if ($form_type == self :: TYPE_EDIT && $link->has_results()) { |
145 | - $this->addText('max', get_lang('QualificationNumeric'), false, array ('size' => '4','maxlength' => '5', 'disabled' => 'disabled')); |
|
145 | + $this->addText('max', get_lang('QualificationNumeric'), false, array('size' => '4', 'maxlength' => '5', 'disabled' => 'disabled')); |
|
146 | 146 | } else { |
147 | - $this->addText('max', get_lang('QualificationNumeric'), true, array ('size' => '4','maxlength' => '5')); |
|
147 | + $this->addText('max', get_lang('QualificationNumeric'), true, array('size' => '4', 'maxlength' => '5')); |
|
148 | 148 | $this->addRule('max', get_lang('OnlyNumbers'), 'numeric'); |
149 | - $this->addRule(array ('max', 'zero'), get_lang('NegativeValue'), 'compare', '>='); |
|
149 | + $this->addRule(array('max', 'zero'), get_lang('NegativeValue'), 'compare', '>='); |
|
150 | 150 | } |
151 | 151 | if ($form_type == self :: TYPE_EDIT) { |
152 | 152 | $defaults['max'] = $link->get_max(); |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | |
156 | 156 | // ELEMENT: description |
157 | 157 | if ($link->needs_name_and_description()) { |
158 | - $this->addElement('textarea', 'description', get_lang('Description'), array ('rows' => '3','cols' => '34')); |
|
158 | + $this->addElement('textarea', 'description', get_lang('Description'), array('rows' => '3', 'cols' => '34')); |
|
159 | 159 | if ($form_type == self :: TYPE_EDIT) { |
160 | 160 | $defaults['description'] = $link->get_description(); |
161 | 161 | } |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | if (isset($setting['gradebook']) && $setting['gradebook'] == 'false') { |
186 | 186 | $visibility_default = 0; |
187 | 187 | } |
188 | - $defaults['visible'] = $visibility_default; |
|
188 | + $defaults['visible'] = $visibility_default; |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | // set default values |
@@ -9,108 +9,108 @@ discard block |
||
9 | 9 | */ |
10 | 10 | class LinkAddEditForm extends FormValidator |
11 | 11 | { |
12 | - const TYPE_ADD = 1; |
|
13 | - const TYPE_EDIT = 2; |
|
14 | - |
|
15 | - /** |
|
16 | - * Constructor |
|
17 | - * To add link, define category_object and link_type |
|
18 | - * To edit link, define link_object |
|
19 | - */ |
|
20 | - public function __construct( |
|
21 | - $form_type, |
|
22 | - $category_object, |
|
23 | - $link_type, |
|
24 | - $link_object, |
|
25 | - $form_name, |
|
26 | - $action = null |
|
27 | - ) { |
|
28 | - parent :: __construct($form_name, 'post', $action); |
|
29 | - |
|
30 | - // set or create link object |
|
31 | - if (isset($link_object)) { |
|
32 | - $link = $link_object; |
|
33 | - } elseif (isset($link_type) && isset($category_object)) { |
|
34 | - $link = LinkFactory :: create ($link_type); |
|
35 | - $link->set_course_code(api_get_course_id()); |
|
36 | - $link->set_category_id($category_object[0]->get_id()); |
|
37 | - } else { |
|
38 | - die ('LinkAddEditForm error: define link_type/category_object or link_object'); |
|
39 | - } |
|
40 | - |
|
41 | - $defaults = array(); |
|
42 | - $this->addElement('hidden', 'zero', 0); |
|
43 | - |
|
44 | - if (!empty($_GET['editlink'])) { |
|
45 | - $this->addElement('header', '', get_lang('EditLink')); |
|
46 | - } |
|
47 | - |
|
48 | - // ELEMENT: name |
|
49 | - if ($form_type == self :: TYPE_ADD || $link->is_allowed_to_change_name()) { |
|
50 | - if ($link->needs_name_and_description()) { |
|
51 | - $this->addText('name', get_lang('Name'), true, array('size'=>'40', 'maxlength'=>'40')); |
|
52 | - } else { |
|
53 | - $select = $this->addElement('select', 'select_link', get_lang('ChooseItem')); |
|
54 | - foreach ($link->get_all_links() as $newlink) { |
|
55 | - $select->addoption($newlink[1],$newlink[0]); |
|
56 | - } |
|
57 | - } |
|
58 | - } else { |
|
59 | - $this->addElement('label',get_lang('Name'), '<span class="freeze">'.$link->get_name().' ['.$link->get_type_name().']</span>'); |
|
60 | - $this->addElement('hidden','name_link',$link->get_name(),array('id'=>'name_link')); |
|
61 | - } |
|
62 | - |
|
63 | - if (count($category_object) == 1) { |
|
64 | - $this->addElement('hidden', 'select_gradebook', $category_object[0]->get_id()); |
|
65 | - } else { |
|
66 | - $select_gradebook = $this->addElement( |
|
67 | - 'select', |
|
68 | - 'select_gradebook', |
|
69 | - get_lang('SelectGradebook'), |
|
70 | - array(), |
|
71 | - array('id' => 'hide_category_id') |
|
72 | - ); |
|
73 | - $this->addRule('select_gradebook', get_lang('ThisFieldIsRequired'), 'nonzero'); |
|
74 | - |
|
75 | - $default_weight = 0; |
|
76 | - if (!empty($category_object)) { |
|
77 | - foreach ($category_object as $my_cat) { |
|
78 | - |
|
79 | - if ($my_cat->get_course_code() == api_get_course_id()) { |
|
80 | - $grade_model_id = $my_cat->get_grade_model_id(); |
|
81 | - if (empty($grade_model_id)) { |
|
82 | - |
|
83 | - if ($my_cat->get_parent_id() == 0 ) { |
|
84 | - $default_weight = $my_cat->get_weight(); |
|
85 | - $select_gradebook->addoption(get_lang('Default'), $my_cat->get_id()); |
|
86 | - } else { |
|
87 | - $select_gradebook->addoption($my_cat->get_name(), $my_cat->get_id()); |
|
88 | - } |
|
89 | - } else { |
|
90 | - $select_gradebook->addoption(get_lang('Select'), 0); |
|
91 | - } |
|
92 | - if ($link->get_category_id() == $my_cat->get_id()) { |
|
93 | - $default_weight = $my_cat->get_weight(); |
|
94 | - } |
|
95 | - } |
|
96 | - } |
|
97 | - } |
|
98 | - } |
|
99 | - |
|
100 | - $this->addText( |
|
101 | - 'weight_mask', |
|
102 | - array(get_lang('Weight'), null, ' [0 .. <span id="max_weight">'.$category_object[0]->get_weight().'</span>] '), |
|
103 | - true, |
|
104 | - array( |
|
105 | - 'size' => '4', |
|
106 | - 'maxlength' => '5', |
|
107 | - 'class' => 'span1' |
|
108 | - ) |
|
109 | - ); |
|
110 | - |
|
111 | - $this->addElement('hidden', 'weight'); |
|
112 | - |
|
113 | - /* |
|
12 | + const TYPE_ADD = 1; |
|
13 | + const TYPE_EDIT = 2; |
|
14 | + |
|
15 | + /** |
|
16 | + * Constructor |
|
17 | + * To add link, define category_object and link_type |
|
18 | + * To edit link, define link_object |
|
19 | + */ |
|
20 | + public function __construct( |
|
21 | + $form_type, |
|
22 | + $category_object, |
|
23 | + $link_type, |
|
24 | + $link_object, |
|
25 | + $form_name, |
|
26 | + $action = null |
|
27 | + ) { |
|
28 | + parent :: __construct($form_name, 'post', $action); |
|
29 | + |
|
30 | + // set or create link object |
|
31 | + if (isset($link_object)) { |
|
32 | + $link = $link_object; |
|
33 | + } elseif (isset($link_type) && isset($category_object)) { |
|
34 | + $link = LinkFactory :: create ($link_type); |
|
35 | + $link->set_course_code(api_get_course_id()); |
|
36 | + $link->set_category_id($category_object[0]->get_id()); |
|
37 | + } else { |
|
38 | + die ('LinkAddEditForm error: define link_type/category_object or link_object'); |
|
39 | + } |
|
40 | + |
|
41 | + $defaults = array(); |
|
42 | + $this->addElement('hidden', 'zero', 0); |
|
43 | + |
|
44 | + if (!empty($_GET['editlink'])) { |
|
45 | + $this->addElement('header', '', get_lang('EditLink')); |
|
46 | + } |
|
47 | + |
|
48 | + // ELEMENT: name |
|
49 | + if ($form_type == self :: TYPE_ADD || $link->is_allowed_to_change_name()) { |
|
50 | + if ($link->needs_name_and_description()) { |
|
51 | + $this->addText('name', get_lang('Name'), true, array('size'=>'40', 'maxlength'=>'40')); |
|
52 | + } else { |
|
53 | + $select = $this->addElement('select', 'select_link', get_lang('ChooseItem')); |
|
54 | + foreach ($link->get_all_links() as $newlink) { |
|
55 | + $select->addoption($newlink[1],$newlink[0]); |
|
56 | + } |
|
57 | + } |
|
58 | + } else { |
|
59 | + $this->addElement('label',get_lang('Name'), '<span class="freeze">'.$link->get_name().' ['.$link->get_type_name().']</span>'); |
|
60 | + $this->addElement('hidden','name_link',$link->get_name(),array('id'=>'name_link')); |
|
61 | + } |
|
62 | + |
|
63 | + if (count($category_object) == 1) { |
|
64 | + $this->addElement('hidden', 'select_gradebook', $category_object[0]->get_id()); |
|
65 | + } else { |
|
66 | + $select_gradebook = $this->addElement( |
|
67 | + 'select', |
|
68 | + 'select_gradebook', |
|
69 | + get_lang('SelectGradebook'), |
|
70 | + array(), |
|
71 | + array('id' => 'hide_category_id') |
|
72 | + ); |
|
73 | + $this->addRule('select_gradebook', get_lang('ThisFieldIsRequired'), 'nonzero'); |
|
74 | + |
|
75 | + $default_weight = 0; |
|
76 | + if (!empty($category_object)) { |
|
77 | + foreach ($category_object as $my_cat) { |
|
78 | + |
|
79 | + if ($my_cat->get_course_code() == api_get_course_id()) { |
|
80 | + $grade_model_id = $my_cat->get_grade_model_id(); |
|
81 | + if (empty($grade_model_id)) { |
|
82 | + |
|
83 | + if ($my_cat->get_parent_id() == 0 ) { |
|
84 | + $default_weight = $my_cat->get_weight(); |
|
85 | + $select_gradebook->addoption(get_lang('Default'), $my_cat->get_id()); |
|
86 | + } else { |
|
87 | + $select_gradebook->addoption($my_cat->get_name(), $my_cat->get_id()); |
|
88 | + } |
|
89 | + } else { |
|
90 | + $select_gradebook->addoption(get_lang('Select'), 0); |
|
91 | + } |
|
92 | + if ($link->get_category_id() == $my_cat->get_id()) { |
|
93 | + $default_weight = $my_cat->get_weight(); |
|
94 | + } |
|
95 | + } |
|
96 | + } |
|
97 | + } |
|
98 | + } |
|
99 | + |
|
100 | + $this->addText( |
|
101 | + 'weight_mask', |
|
102 | + array(get_lang('Weight'), null, ' [0 .. <span id="max_weight">'.$category_object[0]->get_weight().'</span>] '), |
|
103 | + true, |
|
104 | + array( |
|
105 | + 'size' => '4', |
|
106 | + 'maxlength' => '5', |
|
107 | + 'class' => 'span1' |
|
108 | + ) |
|
109 | + ); |
|
110 | + |
|
111 | + $this->addElement('hidden', 'weight'); |
|
112 | + |
|
113 | + /* |
|
114 | 114 | |
115 | 115 | // ELEMENT: weight |
116 | 116 | $this->addText('weight', array(get_lang('Weight'), null, '/ <span id="max_weight">'.$default_weight.'</span>'), true, array ( |
@@ -119,76 +119,76 @@ discard block |
||
119 | 119 | 'class' => 'span1' |
120 | 120 | ));*/ |
121 | 121 | |
122 | - $this->addRule('weight_mask',get_lang('OnlyNumbers'),'numeric'); |
|
123 | - $this->addRule(array ('weight_mask', 'zero'), get_lang('NegativeValue'), 'compare', '>='); |
|
124 | - if ($form_type == self :: TYPE_EDIT) { |
|
125 | - $parent_cat = Category :: load($link->get_category_id()); |
|
126 | - |
|
127 | - if ($parent_cat[0]->get_parent_id() == 0) { |
|
128 | - $values['weight'] = $link->get_weight(); |
|
129 | - } else { |
|
130 | - $cat = Category :: load($parent_cat[0]->get_parent_id()); |
|
131 | - //$global_weight = $cat[0]->get_weight(); |
|
132 | - //$values['weight'] = $link->get_weight()/$parent_cat[0]->get_weight()*$global_weight; |
|
133 | - //var_dump($global_weight, $link->get_weight(), $parent_cat[0]->get_weight()); |
|
134 | - //$weight = $parent_cat[0]->get_weight()* $link->get_weight() / $global_weight; |
|
135 | - //$values['weight'] = $weight; |
|
136 | - $values['weight'] = $link->get_weight() ; |
|
137 | - } |
|
138 | - $defaults['weight_mask'] = $values['weight'] ; |
|
139 | - $defaults['select_gradebook'] = $link->get_category_id(); |
|
140 | - |
|
141 | - } |
|
142 | - // ELEMENT: max |
|
143 | - if ($link->needs_max()) { |
|
144 | - if ($form_type == self :: TYPE_EDIT && $link->has_results()) { |
|
145 | - $this->addText('max', get_lang('QualificationNumeric'), false, array ('size' => '4','maxlength' => '5', 'disabled' => 'disabled')); |
|
146 | - } else { |
|
147 | - $this->addText('max', get_lang('QualificationNumeric'), true, array ('size' => '4','maxlength' => '5')); |
|
148 | - $this->addRule('max', get_lang('OnlyNumbers'), 'numeric'); |
|
149 | - $this->addRule(array ('max', 'zero'), get_lang('NegativeValue'), 'compare', '>='); |
|
150 | - } |
|
151 | - if ($form_type == self :: TYPE_EDIT) { |
|
152 | - $defaults['max'] = $link->get_max(); |
|
153 | - } |
|
154 | - } |
|
155 | - |
|
156 | - // ELEMENT: description |
|
157 | - if ($link->needs_name_and_description()) { |
|
158 | - $this->addElement('textarea', 'description', get_lang('Description'), array ('rows' => '3','cols' => '34')); |
|
159 | - if ($form_type == self :: TYPE_EDIT) { |
|
160 | - $defaults['description'] = $link->get_description(); |
|
161 | - } |
|
162 | - } |
|
163 | - |
|
164 | - // ELEMENT: visible |
|
165 | - $visible = ($form_type == self :: TYPE_EDIT && $link->is_visible()) ? '1' : '0'; |
|
166 | - $this->addElement('checkbox', 'visible', null, get_lang('Visible'), $visible); |
|
167 | - if ($form_type == self :: TYPE_EDIT) { |
|
168 | - $defaults['visible'] = $link->is_visible(); |
|
169 | - } |
|
170 | - |
|
171 | - // ELEMENT: add results |
|
172 | - if ($form_type == self :: TYPE_ADD && $link->needs_results()) { |
|
173 | - $this->addElement('checkbox', 'addresult', get_lang('AddResult')); |
|
174 | - } |
|
175 | - // submit button |
|
176 | - if ($form_type == self :: TYPE_ADD) { |
|
177 | - $this->addButtonCreate(get_lang('CreateLink')); |
|
178 | - } else { |
|
179 | - $this->addButtonUpdate(get_lang('LinkMod')); |
|
180 | - } |
|
181 | - |
|
182 | - if ($form_type == self :: TYPE_ADD) { |
|
183 | - $setting = api_get_setting('tool_visible_by_default_at_creation'); |
|
184 | - $visibility_default = 1; |
|
185 | - if (isset($setting['gradebook']) && $setting['gradebook'] == 'false') { |
|
186 | - $visibility_default = 0; |
|
187 | - } |
|
188 | - $defaults['visible'] = $visibility_default; |
|
189 | - } |
|
190 | - |
|
191 | - // set default values |
|
192 | - $this->setDefaults($defaults); |
|
193 | - } |
|
122 | + $this->addRule('weight_mask',get_lang('OnlyNumbers'),'numeric'); |
|
123 | + $this->addRule(array ('weight_mask', 'zero'), get_lang('NegativeValue'), 'compare', '>='); |
|
124 | + if ($form_type == self :: TYPE_EDIT) { |
|
125 | + $parent_cat = Category :: load($link->get_category_id()); |
|
126 | + |
|
127 | + if ($parent_cat[0]->get_parent_id() == 0) { |
|
128 | + $values['weight'] = $link->get_weight(); |
|
129 | + } else { |
|
130 | + $cat = Category :: load($parent_cat[0]->get_parent_id()); |
|
131 | + //$global_weight = $cat[0]->get_weight(); |
|
132 | + //$values['weight'] = $link->get_weight()/$parent_cat[0]->get_weight()*$global_weight; |
|
133 | + //var_dump($global_weight, $link->get_weight(), $parent_cat[0]->get_weight()); |
|
134 | + //$weight = $parent_cat[0]->get_weight()* $link->get_weight() / $global_weight; |
|
135 | + //$values['weight'] = $weight; |
|
136 | + $values['weight'] = $link->get_weight() ; |
|
137 | + } |
|
138 | + $defaults['weight_mask'] = $values['weight'] ; |
|
139 | + $defaults['select_gradebook'] = $link->get_category_id(); |
|
140 | + |
|
141 | + } |
|
142 | + // ELEMENT: max |
|
143 | + if ($link->needs_max()) { |
|
144 | + if ($form_type == self :: TYPE_EDIT && $link->has_results()) { |
|
145 | + $this->addText('max', get_lang('QualificationNumeric'), false, array ('size' => '4','maxlength' => '5', 'disabled' => 'disabled')); |
|
146 | + } else { |
|
147 | + $this->addText('max', get_lang('QualificationNumeric'), true, array ('size' => '4','maxlength' => '5')); |
|
148 | + $this->addRule('max', get_lang('OnlyNumbers'), 'numeric'); |
|
149 | + $this->addRule(array ('max', 'zero'), get_lang('NegativeValue'), 'compare', '>='); |
|
150 | + } |
|
151 | + if ($form_type == self :: TYPE_EDIT) { |
|
152 | + $defaults['max'] = $link->get_max(); |
|
153 | + } |
|
154 | + } |
|
155 | + |
|
156 | + // ELEMENT: description |
|
157 | + if ($link->needs_name_and_description()) { |
|
158 | + $this->addElement('textarea', 'description', get_lang('Description'), array ('rows' => '3','cols' => '34')); |
|
159 | + if ($form_type == self :: TYPE_EDIT) { |
|
160 | + $defaults['description'] = $link->get_description(); |
|
161 | + } |
|
162 | + } |
|
163 | + |
|
164 | + // ELEMENT: visible |
|
165 | + $visible = ($form_type == self :: TYPE_EDIT && $link->is_visible()) ? '1' : '0'; |
|
166 | + $this->addElement('checkbox', 'visible', null, get_lang('Visible'), $visible); |
|
167 | + if ($form_type == self :: TYPE_EDIT) { |
|
168 | + $defaults['visible'] = $link->is_visible(); |
|
169 | + } |
|
170 | + |
|
171 | + // ELEMENT: add results |
|
172 | + if ($form_type == self :: TYPE_ADD && $link->needs_results()) { |
|
173 | + $this->addElement('checkbox', 'addresult', get_lang('AddResult')); |
|
174 | + } |
|
175 | + // submit button |
|
176 | + if ($form_type == self :: TYPE_ADD) { |
|
177 | + $this->addButtonCreate(get_lang('CreateLink')); |
|
178 | + } else { |
|
179 | + $this->addButtonUpdate(get_lang('LinkMod')); |
|
180 | + } |
|
181 | + |
|
182 | + if ($form_type == self :: TYPE_ADD) { |
|
183 | + $setting = api_get_setting('tool_visible_by_default_at_creation'); |
|
184 | + $visibility_default = 1; |
|
185 | + if (isset($setting['gradebook']) && $setting['gradebook'] == 'false') { |
|
186 | + $visibility_default = 0; |
|
187 | + } |
|
188 | + $defaults['visible'] = $visibility_default; |
|
189 | + } |
|
190 | + |
|
191 | + // set default values |
|
192 | + $this->setDefaults($defaults); |
|
193 | + } |
|
194 | 194 | } |
@@ -201,9 +201,9 @@ discard block |
||
201 | 201 | $myCache = new pCache(array('CacheFolder' => substr($cachePath, 0, strlen($cachePath) - 1))); |
202 | 202 | $chartHash = $myCache->getHash($dataSet); |
203 | 203 | if ($myCache->isInCache($chartHash)) { |
204 | - $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash; |
|
204 | + $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash; |
|
205 | 205 | $myCache->saveFromCache($chartHash, $imgPath); |
206 | - $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash; |
|
206 | + $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash; |
|
207 | 207 | } else { |
208 | 208 | /* Create the pChart object */ |
209 | 209 | $widthSize = 480; |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | /* Set the default font */ |
231 | 231 | $myPicture->setFontProperties( |
232 | 232 | array( |
233 | - 'FontName' => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf', |
|
233 | + 'FontName' => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf', |
|
234 | 234 | 'FontSize' => 10 |
235 | 235 | ) |
236 | 236 | ); |
@@ -302,11 +302,11 @@ discard block |
||
302 | 302 | /* Render the picture (choose the best way) */ |
303 | 303 | |
304 | 304 | $myCache->writeToCache($chartHash, $myPicture); |
305 | - $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash; |
|
305 | + $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash; |
|
306 | 306 | $myCache->saveFromCache($chartHash, $imgPath); |
307 | - $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash; |
|
307 | + $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash; |
|
308 | 308 | } |
309 | - echo '<img src="' . $imgPath . '" >'; |
|
309 | + echo '<img src="'.$imgPath.'" >'; |
|
310 | 310 | if ($i % 2 == 0 && $i != 0) { |
311 | 311 | echo '<br /><br />'; |
312 | 312 | } else { |
@@ -349,10 +349,10 @@ discard block |
||
349 | 349 | // previous X |
350 | 350 | $header .= '<td style="width:100%;">'; |
351 | 351 | if ($this->offset >= GRADEBOOK_ITEM_LIMIT) { |
352 | - $header .= '<a href="' . api_get_self() |
|
353 | - . '?selectcat=' . Security::remove_XSS($_GET['selectcat']) |
|
354 | - . '&offset=' . (($this->offset) - GRADEBOOK_ITEM_LIMIT) |
|
355 | - . (isset($_GET['search']) ? '&search=' . Security::remove_XSS($_GET['search']) : '') . '">' |
|
352 | + $header .= '<a href="'.api_get_self() |
|
353 | + . '?selectcat='.Security::remove_XSS($_GET['selectcat']) |
|
354 | + . '&offset='.(($this->offset) - GRADEBOOK_ITEM_LIMIT) |
|
355 | + . (isset($_GET['search']) ? '&search='.Security::remove_XSS($_GET['search']) : '').'">' |
|
356 | 356 | . Display::return_icon('action_prev.png', get_lang('PreviousPage'), array(), 32) |
357 | 357 | . '</a>'; |
358 | 358 | } else { |
@@ -364,10 +364,10 @@ discard block |
||
364 | 364 | ($totalitems - (GRADEBOOK_ITEM_LIMIT + $this->offset)) : GRADEBOOK_ITEM_LIMIT; |
365 | 365 | |
366 | 366 | if ($calcnext > 0) { |
367 | - $header .= '<a href="' . api_get_self() |
|
368 | - . '?selectcat=' . Security::remove_XSS($_GET['selectcat']) |
|
369 | - . '&offset=' . ($this->offset + GRADEBOOK_ITEM_LIMIT) |
|
370 | - . (isset($_GET['search']) ? '&search=' . Security::remove_XSS($_GET['search']) : '') . '">' |
|
367 | + $header .= '<a href="'.api_get_self() |
|
368 | + . '?selectcat='.Security::remove_XSS($_GET['selectcat']) |
|
369 | + . '&offset='.($this->offset + GRADEBOOK_ITEM_LIMIT) |
|
370 | + . (isset($_GET['search']) ? '&search='.Security::remove_XSS($_GET['search']) : '').'">' |
|
371 | 371 | . Display::return_icon('action_next.png', get_lang('NextPage'), array(), 32) |
372 | 372 | . '</a>'; |
373 | 373 | } else { |
@@ -475,6 +475,6 @@ discard block |
||
475 | 475 | */ |
476 | 476 | private function build_name_link($user_id, $name) |
477 | 477 | { |
478 | - return '<a href="user_stats.php?userid=' . $user_id . '&selectcat=' . $this->selectcat->get_id() . '&'.api_get_cidreq().'">' . $name . '</a>'; |
|
478 | + return '<a href="user_stats.php?userid='.$user_id.'&selectcat='.$this->selectcat->get_id().'&'.api_get_cidreq().'">'.$name.'</a>'; |
|
479 | 479 | } |
480 | 480 | } |
@@ -149,8 +149,9 @@ |
||
149 | 149 | } |
150 | 150 | |
151 | 151 | foreach ($customdisplays as $display) { |
152 | - if (!in_array($display['display'], $key_list)) |
|
153 | - $resource_list[$key][$display['display']] = 0; |
|
152 | + if (!in_array($display['display'], $key_list)) { |
|
153 | + $resource_list[$key][$display['display']] = 0; |
|
154 | + } |
|
154 | 155 | } |
155 | 156 | $i++; |
156 | 157 | } |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public function UserTable($userid, $evals = array(), $links = array(), $addparams = null) |
20 | 20 | { |
21 | - parent :: __construct ('userlist', null, null, 0); |
|
21 | + parent :: __construct('userlist', null, null, 0); |
|
22 | 22 | $this->userid = $userid; |
23 | 23 | $this->datagen = new UserDataGenerator($userid, $evals, $links); |
24 | 24 | if (isset($addparams)) { |
@@ -87,8 +87,8 @@ discard block |
||
87 | 87 | // generate the data to display |
88 | 88 | $sortable_data = array(); |
89 | 89 | foreach ($data_array as $data) { |
90 | - if ($data[2]!="") {//filter by course removed |
|
91 | - $row = array (); |
|
90 | + if ($data[2] != "") {//filter by course removed |
|
91 | + $row = array(); |
|
92 | 92 | $row[] = $this->build_type_column($data[0]); |
93 | 93 | $row[] = $this->build_name_link($data[0]); |
94 | 94 | $row[] = $data[2]; |
@@ -123,15 +123,15 @@ discard block |
||
123 | 123 | // evaluation |
124 | 124 | case 'E' : |
125 | 125 | return ' ' |
126 | - . '<a href="gradebook_view_result.php?selecteval=' . $item->get_id() . '">' |
|
126 | + . '<a href="gradebook_view_result.php?selecteval='.$item->get_id().'">' |
|
127 | 127 | . $item->get_name() |
128 | 128 | . '</a>'; |
129 | 129 | // link |
130 | 130 | case 'L' : |
131 | - return ' <a href="' . $item->get_link() . '">' |
|
131 | + return ' <a href="'.$item->get_link().'">' |
|
132 | 132 | . $item->get_name() |
133 | 133 | . '</a>' |
134 | - . ' [' . $item->get_type_name() . ']'; |
|
134 | + . ' ['.$item->get_type_name().']'; |
|
135 | 135 | } |
136 | 136 | } |
137 | 137 | } |
@@ -95,8 +95,9 @@ |
||
95 | 95 | $row[] = $data[3]; |
96 | 96 | $row[] = $data[4]; |
97 | 97 | $row[] = $data[5]; |
98 | - if ($scoredisplay->is_custom()) |
|
99 | - $row[] = $data[6]; |
|
98 | + if ($scoredisplay->is_custom()) { |
|
99 | + $row[] = $data[6]; |
|
100 | + } |
|
100 | 101 | $sortable_data[] = $row; |
101 | 102 | } |
102 | 103 | } |
@@ -10,128 +10,128 @@ |
||
10 | 10 | */ |
11 | 11 | class UserTable extends SortableTable |
12 | 12 | { |
13 | - private $userid; |
|
14 | - private $datagen; |
|
13 | + private $userid; |
|
14 | + private $datagen; |
|
15 | 15 | |
16 | - /** |
|
17 | - * Constructor |
|
18 | - */ |
|
19 | - public function __construct($userid, $evals = array(), $links = array(), $addparams = null) |
|
20 | - { |
|
21 | - parent :: __construct ('userlist', null, null, 0); |
|
22 | - $this->userid = $userid; |
|
23 | - $this->datagen = new UserDataGenerator($userid, $evals, $links); |
|
24 | - if (isset($addparams)) { |
|
25 | - $this->set_additional_parameters($addparams); |
|
26 | - } |
|
27 | - $column = 0; |
|
28 | - $this->set_header($column++, get_lang('Type')); |
|
29 | - $this->set_header($column++, get_lang('Evaluation')); |
|
30 | - $this->set_header($column++, get_lang('Course')); |
|
31 | - $this->set_header($column++, get_lang('Category')); |
|
32 | - $this->set_header($column++, get_lang('EvaluationAverage')); |
|
33 | - $this->set_header($column++, get_lang('Result')); |
|
16 | + /** |
|
17 | + * Constructor |
|
18 | + */ |
|
19 | + public function __construct($userid, $evals = array(), $links = array(), $addparams = null) |
|
20 | + { |
|
21 | + parent :: __construct ('userlist', null, null, 0); |
|
22 | + $this->userid = $userid; |
|
23 | + $this->datagen = new UserDataGenerator($userid, $evals, $links); |
|
24 | + if (isset($addparams)) { |
|
25 | + $this->set_additional_parameters($addparams); |
|
26 | + } |
|
27 | + $column = 0; |
|
28 | + $this->set_header($column++, get_lang('Type')); |
|
29 | + $this->set_header($column++, get_lang('Evaluation')); |
|
30 | + $this->set_header($column++, get_lang('Course')); |
|
31 | + $this->set_header($column++, get_lang('Category')); |
|
32 | + $this->set_header($column++, get_lang('EvaluationAverage')); |
|
33 | + $this->set_header($column++, get_lang('Result')); |
|
34 | 34 | |
35 | - $scoredisplay = ScoreDisplay :: instance(); |
|
36 | - if ($scoredisplay->is_custom()) { |
|
37 | - $this->set_header($column++, get_lang('Display')); |
|
38 | - } |
|
39 | - } |
|
35 | + $scoredisplay = ScoreDisplay :: instance(); |
|
36 | + if ($scoredisplay->is_custom()) { |
|
37 | + $this->set_header($column++, get_lang('Display')); |
|
38 | + } |
|
39 | + } |
|
40 | 40 | |
41 | - /** |
|
42 | - * Function used by SortableTable to get total number of items in the table |
|
43 | - */ |
|
44 | - function get_total_number_of_items() |
|
45 | - { |
|
46 | - return $this->datagen->get_total_items_count(); |
|
47 | - } |
|
41 | + /** |
|
42 | + * Function used by SortableTable to get total number of items in the table |
|
43 | + */ |
|
44 | + function get_total_number_of_items() |
|
45 | + { |
|
46 | + return $this->datagen->get_total_items_count(); |
|
47 | + } |
|
48 | 48 | |
49 | - /** |
|
50 | - * Function used by SortableTable to generate the data to display |
|
51 | - */ |
|
52 | - public function get_table_data($from = 1, $per_page = null, $column = null, $direction = null, $sort = null) |
|
53 | - { |
|
54 | - $scoredisplay = ScoreDisplay :: instance(); |
|
49 | + /** |
|
50 | + * Function used by SortableTable to generate the data to display |
|
51 | + */ |
|
52 | + public function get_table_data($from = 1, $per_page = null, $column = null, $direction = null, $sort = null) |
|
53 | + { |
|
54 | + $scoredisplay = ScoreDisplay :: instance(); |
|
55 | 55 | |
56 | - // determine sorting type |
|
57 | - switch ($this->column) { |
|
58 | - // Type |
|
59 | - case 0: |
|
60 | - $sorting = UserDataGenerator :: UDG_SORT_TYPE; |
|
61 | - break; |
|
62 | - case 1: |
|
63 | - $sorting = UserDataGenerator :: UDG_SORT_NAME; |
|
64 | - break; |
|
65 | - case 2: |
|
66 | - $sorting = UserDataGenerator :: UDG_SORT_COURSE; |
|
67 | - break; |
|
68 | - case 3: |
|
69 | - $sorting = UserDataGenerator :: UDG_SORT_CATEGORY; |
|
70 | - break; |
|
71 | - case 4: |
|
72 | - $sorting = UserDataGenerator :: UDG_SORT_AVERAGE; |
|
73 | - break; |
|
74 | - case 5: |
|
75 | - $sorting = UserDataGenerator :: UDG_SORT_SCORE; |
|
76 | - break; |
|
77 | - case 6: |
|
78 | - $sorting = UserDataGenerator :: UDG_SORT_MASK; |
|
79 | - break; |
|
80 | - } |
|
81 | - if ($this->direction == 'DESC') { |
|
82 | - $sorting |= UserDataGenerator :: UDG_SORT_DESC; |
|
83 | - } else { |
|
84 | - $sorting |= UserDataGenerator :: UDG_SORT_ASC; |
|
85 | - } |
|
86 | - $data_array = $this->datagen->get_data($sorting, $from, $this->per_page); |
|
87 | - // generate the data to display |
|
88 | - $sortable_data = array(); |
|
89 | - foreach ($data_array as $data) { |
|
90 | - if ($data[2]!="") {//filter by course removed |
|
91 | - $row = array (); |
|
92 | - $row[] = $this->build_type_column($data[0]); |
|
93 | - $row[] = $this->build_name_link($data[0]); |
|
94 | - $row[] = $data[2]; |
|
95 | - $row[] = $data[3]; |
|
96 | - $row[] = $data[4]; |
|
97 | - $row[] = $data[5]; |
|
98 | - if ($scoredisplay->is_custom()) |
|
99 | - $row[] = $data[6]; |
|
100 | - $sortable_data[] = $row; |
|
101 | - } |
|
102 | - } |
|
56 | + // determine sorting type |
|
57 | + switch ($this->column) { |
|
58 | + // Type |
|
59 | + case 0: |
|
60 | + $sorting = UserDataGenerator :: UDG_SORT_TYPE; |
|
61 | + break; |
|
62 | + case 1: |
|
63 | + $sorting = UserDataGenerator :: UDG_SORT_NAME; |
|
64 | + break; |
|
65 | + case 2: |
|
66 | + $sorting = UserDataGenerator :: UDG_SORT_COURSE; |
|
67 | + break; |
|
68 | + case 3: |
|
69 | + $sorting = UserDataGenerator :: UDG_SORT_CATEGORY; |
|
70 | + break; |
|
71 | + case 4: |
|
72 | + $sorting = UserDataGenerator :: UDG_SORT_AVERAGE; |
|
73 | + break; |
|
74 | + case 5: |
|
75 | + $sorting = UserDataGenerator :: UDG_SORT_SCORE; |
|
76 | + break; |
|
77 | + case 6: |
|
78 | + $sorting = UserDataGenerator :: UDG_SORT_MASK; |
|
79 | + break; |
|
80 | + } |
|
81 | + if ($this->direction == 'DESC') { |
|
82 | + $sorting |= UserDataGenerator :: UDG_SORT_DESC; |
|
83 | + } else { |
|
84 | + $sorting |= UserDataGenerator :: UDG_SORT_ASC; |
|
85 | + } |
|
86 | + $data_array = $this->datagen->get_data($sorting, $from, $this->per_page); |
|
87 | + // generate the data to display |
|
88 | + $sortable_data = array(); |
|
89 | + foreach ($data_array as $data) { |
|
90 | + if ($data[2]!="") {//filter by course removed |
|
91 | + $row = array (); |
|
92 | + $row[] = $this->build_type_column($data[0]); |
|
93 | + $row[] = $this->build_name_link($data[0]); |
|
94 | + $row[] = $data[2]; |
|
95 | + $row[] = $data[3]; |
|
96 | + $row[] = $data[4]; |
|
97 | + $row[] = $data[5]; |
|
98 | + if ($scoredisplay->is_custom()) |
|
99 | + $row[] = $data[6]; |
|
100 | + $sortable_data[] = $row; |
|
101 | + } |
|
102 | + } |
|
103 | 103 | |
104 | - return $sortable_data; |
|
105 | - } |
|
104 | + return $sortable_data; |
|
105 | + } |
|
106 | 106 | |
107 | - /** |
|
108 | - * @param $item |
|
109 | - * @return string |
|
110 | - */ |
|
111 | - private function build_type_column($item) |
|
112 | - { |
|
113 | - return GradebookUtils::build_type_icon_tag($item->get_icon_name()); |
|
114 | - } |
|
107 | + /** |
|
108 | + * @param $item |
|
109 | + * @return string |
|
110 | + */ |
|
111 | + private function build_type_column($item) |
|
112 | + { |
|
113 | + return GradebookUtils::build_type_icon_tag($item->get_icon_name()); |
|
114 | + } |
|
115 | 115 | |
116 | - /** |
|
117 | - * @param $item |
|
118 | - * @return string |
|
119 | - */ |
|
120 | - private function build_name_link($item) |
|
121 | - { |
|
122 | - switch ($item->get_item_type()) { |
|
123 | - // evaluation |
|
124 | - case 'E' : |
|
125 | - return ' ' |
|
126 | - . '<a href="gradebook_view_result.php?selecteval=' . $item->get_id() . '">' |
|
127 | - . $item->get_name() |
|
128 | - . '</a>'; |
|
129 | - // link |
|
130 | - case 'L' : |
|
131 | - return ' <a href="' . $item->get_link() . '">' |
|
132 | - . $item->get_name() |
|
133 | - . '</a>' |
|
134 | - . ' [' . $item->get_type_name() . ']'; |
|
135 | - } |
|
136 | - } |
|
116 | + /** |
|
117 | + * @param $item |
|
118 | + * @return string |
|
119 | + */ |
|
120 | + private function build_name_link($item) |
|
121 | + { |
|
122 | + switch ($item->get_item_type()) { |
|
123 | + // evaluation |
|
124 | + case 'E' : |
|
125 | + return ' ' |
|
126 | + . '<a href="gradebook_view_result.php?selecteval=' . $item->get_id() . '">' |
|
127 | + . $item->get_name() |
|
128 | + . '</a>'; |
|
129 | + // link |
|
130 | + case 'L' : |
|
131 | + return ' <a href="' . $item->get_link() . '">' |
|
132 | + . $item->get_name() |
|
133 | + . '</a>' |
|
134 | + . ' [' . $item->get_type_name() . ']'; |
|
135 | + } |
|
136 | + } |
|
137 | 137 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | 'onchange' => 'document.add_users_to_evaluation.submit()' |
92 | 92 | )); |
93 | 93 | $select->addOption('', ''); |
94 | - for ($i = 65; $i <= 90; $i ++) { |
|
94 | + for ($i = 65; $i <= 90; $i++) { |
|
95 | 95 | $letter = chr($i); |
96 | 96 | if (isset($this->extra) && $this->extra == $letter) { |
97 | 97 | $select->addOption($letter, $letter, 'selected'); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | )); |
107 | 107 | foreach ($this->evaluation_object->get_not_subscribed_students() as $user) { |
108 | 108 | if ((!isset($this->extra)) || empty($this->extra) || api_strtoupper(api_substr($user[1], 0, 1)) == $this->extra) { |
109 | - $select->addoption($user[1] . ' ' . $user[2] . ' (' . $user[3] . ')', $user[0]); |
|
109 | + $select->addoption($user[1].' '.$user[2].' ('.$user[3].')', $user[0]); |
|
110 | 110 | } |
111 | 111 | } |
112 | 112 | $this->addButtonCreate(get_lang('AddUserToEval'), 'submit_button'); |
@@ -134,21 +134,21 @@ discard block |
||
134 | 134 | if (api_is_western_name_order()) { |
135 | 135 | $renderer->setHeaderTemplate( |
136 | 136 | '<tr> |
137 | - <th>' . get_lang('OfficialCode') . '</th> |
|
138 | - <th>' . get_lang('UserName') . '</th> |
|
139 | - <th>' . get_lang('FirstName') . '</th> |
|
140 | - <th>' . get_lang('LastName') . '</th> |
|
141 | - <th>' . get_lang('Qualify') . '</th> |
|
137 | + <th>' . get_lang('OfficialCode').'</th> |
|
138 | + <th>' . get_lang('UserName').'</th> |
|
139 | + <th>' . get_lang('FirstName').'</th> |
|
140 | + <th>' . get_lang('LastName').'</th> |
|
141 | + <th>' . get_lang('Qualify').'</th> |
|
142 | 142 | </tr>' |
143 | 143 | ); |
144 | 144 | } else { |
145 | 145 | $renderer->setHeaderTemplate( |
146 | 146 | '<tr> |
147 | - <th>' . get_lang('OfficialCode') . '</th> |
|
148 | - <th>' . get_lang('UserName') . '</th> |
|
149 | - <th>' . get_lang('LastName') . '</th> |
|
150 | - <th>' . get_lang('FirstName') . '</th> |
|
151 | - <th>' . get_lang('Qualify') . '</th> |
|
147 | + <th>' . get_lang('OfficialCode').'</th> |
|
148 | + <th>' . get_lang('UserName').'</th> |
|
149 | + <th>' . get_lang('LastName').'</th> |
|
150 | + <th>' . get_lang('FirstName').'</th> |
|
151 | + <th>' . get_lang('Qualify').'</th> |
|
152 | 152 | </tr>' |
153 | 153 | ); |
154 | 154 | } |
@@ -174,33 +174,33 @@ discard block |
||
174 | 174 | $result = $result_and_user['result']; |
175 | 175 | |
176 | 176 | $renderer = &$this->defaultRenderer(); |
177 | - $this->addText('score[' . $result->get_id() . ']', $this->build_stud_label($user['user_id'], $user['username'], $user['lastname'], $user['firstname']), false, array('class' => "span2", |
|
177 | + $this->addText('score['.$result->get_id().']', $this->build_stud_label($user['user_id'], $user['username'], $user['lastname'], $user['firstname']), false, array('class' => "span2", |
|
178 | 178 | 'maxlength' => 5)); |
179 | 179 | |
180 | - $this->addRule('score[' . $result->get_id() . ']', get_lang('OnlyNumbers'), 'numeric'); |
|
180 | + $this->addRule('score['.$result->get_id().']', get_lang('OnlyNumbers'), 'numeric'); |
|
181 | 181 | $this->addRule(array( |
182 | - 'score[' . $result->get_id() . ']', 'maxvalue'), get_lang('OverMax'), 'compare', '<='); |
|
182 | + 'score['.$result->get_id().']', 'maxvalue'), get_lang('OverMax'), 'compare', '<='); |
|
183 | 183 | $this->addRule(array( |
184 | - 'score[' . $result->get_id() . ']', 'minvalue'), get_lang('UnderMin'), 'compare', '>='); |
|
185 | - $defaults['score[' . $result->get_id() . ']'] = $result->get_score(); |
|
184 | + 'score['.$result->get_id().']', 'minvalue'), get_lang('UnderMin'), 'compare', '>='); |
|
185 | + $defaults['score['.$result->get_id().']'] = $result->get_score(); |
|
186 | 186 | |
187 | 187 | if (api_is_western_name_order()) { |
188 | - $user_info = '<td align="left" >' . $user['firstname'] . '</td>'; |
|
189 | - $user_info .= '<td align="left" >' . $user['lastname'] . '</td>'; |
|
188 | + $user_info = '<td align="left" >'.$user['firstname'].'</td>'; |
|
189 | + $user_info .= '<td align="left" >'.$user['lastname'].'</td>'; |
|
190 | 190 | } else { |
191 | - $user_info = '<td align="left" >' . $user['lastname'] . '</td>'; |
|
192 | - $user_info .= '<td align="left" >' . $user['firstname'] . '</td>'; |
|
191 | + $user_info = '<td align="left" >'.$user['lastname'].'</td>'; |
|
192 | + $user_info .= '<td align="left" >'.$user['firstname'].'</td>'; |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | $template = '<tr> |
196 | - <td align="left" >' . $user['official_code'] . '</td> |
|
197 | - <td align="left" >' . $user['username'] . '</td> |
|
198 | - ' . $user_info . ' |
|
199 | - <td align="left">{element} / ' . $this->evaluation_object->get_max() . ' |
|
196 | + <td align="left" >' . $user['official_code'].'</td> |
|
197 | + <td align="left" >' . $user['username'].'</td> |
|
198 | + ' . $user_info.' |
|
199 | + <td align="left">{element} / ' . $this->evaluation_object->get_max().' |
|
200 | 200 | <!-- BEGIN error --><br /><span style="color: #ff0000;font-size:10px">{error}</span><!-- END error --> |
201 | 201 | </td> |
202 | 202 | </tr>'; |
203 | - $renderer->setElementTemplate($template, 'score[' . $result->get_id() . ']'); |
|
203 | + $renderer->setElementTemplate($template, 'score['.$result->get_id().']'); |
|
204 | 204 | } |
205 | 205 | $this->setDefaults($defaults); |
206 | 206 | $this->addButtonSave(get_lang('EditResult'), 'submit'); |
@@ -215,15 +215,15 @@ discard block |
||
215 | 215 | { |
216 | 216 | $renderer = & $this->defaultRenderer(); |
217 | 217 | $renderer->setCustomElementTemplate('<span>{element}</span> '); |
218 | - $this->addElement('static', null, null, '"' . $this->evaluation_object->get_name() . '" '); |
|
219 | - $this->addElement('static', null, null, get_lang('MoveTo') . ' : '); |
|
218 | + $this->addElement('static', null, null, '"'.$this->evaluation_object->get_name().'" '); |
|
219 | + $this->addElement('static', null, null, get_lang('MoveTo').' : '); |
|
220 | 220 | $select = $this->addElement('select', 'move_cat', null, null); |
221 | 221 | $line = ''; |
222 | 222 | foreach ($this->evaluation_object->get_target_categories() as $cat) { |
223 | 223 | for ($i = 0; $i < $cat[2]; $i++) { |
224 | 224 | $line .= '—'; |
225 | 225 | } |
226 | - $select->addoption($line . ' ' . $cat[1], $cat[0]); |
|
226 | + $select->addoption($line.' '.$cat[1], $cat[0]); |
|
227 | 227 | $line = ''; |
228 | 228 | } |
229 | 229 | $this->addButtonSave(get_lang('Ok'), 'submit'); |
@@ -253,21 +253,21 @@ discard block |
||
253 | 253 | if (api_is_western_name_order()) { |
254 | 254 | $renderer->setHeaderTemplate( |
255 | 255 | '<tr> |
256 | - <th>' . get_lang('OfficialCode') . '</th> |
|
257 | - <th>' . get_lang('UserName') . '</th> |
|
258 | - <th>' . get_lang('FirstName') . '</th> |
|
259 | - <th>' . get_lang('LastName') . '</th> |
|
260 | - <th>' . get_lang('Qualify') . '</th> |
|
256 | + <th>' . get_lang('OfficialCode').'</th> |
|
257 | + <th>' . get_lang('UserName').'</th> |
|
258 | + <th>' . get_lang('FirstName').'</th> |
|
259 | + <th>' . get_lang('LastName').'</th> |
|
260 | + <th>' . get_lang('Qualify').'</th> |
|
261 | 261 | </tr>' |
262 | 262 | ); |
263 | 263 | } else { |
264 | 264 | $renderer->setHeaderTemplate( |
265 | 265 | '<tr> |
266 | - <th>' . get_lang('OfficialCode') . '</th> |
|
267 | - <th>' . get_lang('UserName') . '</th> |
|
268 | - <th>' . get_lang('LastName') . '</th> |
|
269 | - <th>' . get_lang('FirstName') . '</th> |
|
270 | - <th>' . get_lang('Qualify') . '</th> |
|
266 | + <th>' . get_lang('OfficialCode').'</th> |
|
267 | + <th>' . get_lang('UserName').'</th> |
|
268 | + <th>' . get_lang('LastName').'</th> |
|
269 | + <th>' . get_lang('FirstName').'</th> |
|
270 | + <th>' . get_lang('Qualify').'</th> |
|
271 | 271 | </tr>' |
272 | 272 | ); |
273 | 273 | } |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | $firstUser = true; |
276 | 276 | foreach ($tblusers as $user) { |
277 | 277 | |
278 | - $element_name = 'score[' . $user[0] . ']'; |
|
278 | + $element_name = 'score['.$user[0].']'; |
|
279 | 279 | |
280 | 280 | $scoreColumnProperties = array('maxlength' => 5); |
281 | 281 | if ($firstUser) { |
@@ -290,19 +290,19 @@ discard block |
||
290 | 290 | $this->addRule(array($element_name, 'minvalue'), get_lang('UnderMin'), 'compare', '>='); |
291 | 291 | |
292 | 292 | if (api_is_western_name_order()) { |
293 | - $user_info = '<td align="left" >' . $user[3] . '</td>'; |
|
294 | - $user_info .= '<td align="left" >' . $user[2] . '</td>'; |
|
293 | + $user_info = '<td align="left" >'.$user[3].'</td>'; |
|
294 | + $user_info .= '<td align="left" >'.$user[2].'</td>'; |
|
295 | 295 | } else { |
296 | - $user_info = '<td align="left" >' . $user[2] . '</td>'; |
|
297 | - $user_info .= '<td align="left" >' . $user[3] . '</td>'; |
|
296 | + $user_info = '<td align="left" >'.$user[2].'</td>'; |
|
297 | + $user_info .= '<td align="left" >'.$user[3].'</td>'; |
|
298 | 298 | } |
299 | 299 | $nr_users++; |
300 | 300 | |
301 | 301 | $template = '<tr> |
302 | - <td align="left" >' . $user[4] . '</td> |
|
303 | - <td align="left" >' . $user[1] . '</td> |
|
304 | - ' . $user_info . ' |
|
305 | - <td align="left">{element} / ' . $this->evaluation_object->get_max() . ' |
|
302 | + <td align="left" >' . $user[4].'</td> |
|
303 | + <td align="left" >' . $user[1].'</td> |
|
304 | + ' . $user_info.' |
|
305 | + <td align="left">{element} / ' . $this->evaluation_object->get_max().' |
|
306 | 306 | <!-- BEGIN error --><br /><span style="color: #ff0000;font-size:10px">{error}</span><!-- END error --> |
307 | 307 | </td> |
308 | 308 | </tr>'; |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | $renderer->setCustomElementTemplate('<span>{element}</span> '); |
337 | 337 | $this->addElement('label', get_lang('User'), $userinfo['complete_name']); |
338 | 338 | |
339 | - $this->addText('score', array(get_lang('Score'), null, '/ ' . $this->evaluation_object->get_max()), false, array( |
|
339 | + $this->addText('score', array(get_lang('Score'), null, '/ '.$this->evaluation_object->get_max()), false, array( |
|
340 | 340 | 'size' => '4', |
341 | 341 | 'class' => 'span1', |
342 | 342 | 'maxlength' => '5' |
@@ -471,7 +471,7 @@ discard block |
||
471 | 471 | } |
472 | 472 | } |
473 | 473 | |
474 | - $this->addText('weight_mask', array(get_lang('Weight'), null, ' [0 .. <span id="max_weight">' . $all_categories[0]->get_weight() . '</span>] '), true, array( |
|
474 | + $this->addText('weight_mask', array(get_lang('Weight'), null, ' [0 .. <span id="max_weight">'.$all_categories[0]->get_weight().'</span>] '), true, array( |
|
475 | 475 | 'size' => '4', |
476 | 476 | 'maxlength' => '5', |
477 | 477 | 'class' => 'span1' |
@@ -543,11 +543,11 @@ discard block |
||
543 | 543 | $link = LinkFactory :: get_evaluation_link($this->evaluation_object->get_id()); |
544 | 544 | $doc_url = $link->get_view_url($id); |
545 | 545 | if ($doc_url != null) { |
546 | - $opendocurl_start .= '<a href="' . $doc_url . '" target="_blank">'; |
|
546 | + $opendocurl_start .= '<a href="'.$doc_url.'" target="_blank">'; |
|
547 | 547 | $opendocurl_end = '</a>'; |
548 | 548 | } |
549 | 549 | } |
550 | - return $opendocurl_start . api_get_person_name($firstname, $lastname) . ' (' . $username . ')' . $opendocurl_end; |
|
550 | + return $opendocurl_start.api_get_person_name($firstname, $lastname).' ('.$username.')'.$opendocurl_end; |
|
551 | 551 | } |
552 | 552 | |
553 | 553 | function sort_by_user($item1, $item2) |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | /** |
35 | 35 | * Compare the custom display of 2 scores, can be useful in sorting |
36 | 36 | */ |
37 | - public static function compare_scores_by_custom_display ($score1, $score2) |
|
37 | + public static function compare_scores_by_custom_display($score1, $score2) |
|
38 | 38 | { |
39 | 39 | if (!isset($score1)) { |
40 | 40 | return (isset($score2) ? 1 : 0); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | if ($custom1 == $custom2) { |
48 | 48 | return 0; |
49 | 49 | } else { |
50 | - return (($score1[0]/$score1[1]) < ($score2[0]/$score2[1]) ? -1 : 1); |
|
50 | + return (($score1[0] / $score1[1]) < ($score2[0] / $score2[1]) ? -1 : 1); |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | //Setting custom enabled |
80 | 80 | $value = api_get_setting('gradebook_score_display_custom'); |
81 | 81 | $value = $value['my_display_custom']; |
82 | - $this->custom_enabled = $value == 'true' ? true : false; |
|
82 | + $this->custom_enabled = $value == 'true' ? true : false; |
|
83 | 83 | |
84 | 84 | if ($this->custom_enabled) { |
85 | 85 | $params = array('category = ?' => array('Gradebook')); |
@@ -96,10 +96,10 @@ discard block |
||
96 | 96 | sort($portal_displays); |
97 | 97 | } |
98 | 98 | $this->custom_display = $portal_displays; |
99 | - if (count($this->custom_display)>0) { |
|
99 | + if (count($this->custom_display) > 0) { |
|
100 | 100 | $value = api_get_setting('gradebook_score_display_upperlimit'); |
101 | 101 | $value = $value['my_display_upperlimit']; |
102 | - $this->upperlimit_included = $value == 'true' ? true : false; |
|
102 | + $this->upperlimit_included = $value == 'true' ? true : false; |
|
103 | 103 | $this->custom_display_conv = $this->convert_displays($this->custom_display); |
104 | 104 | } |
105 | 105 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | //Load course settings |
111 | 111 | if ($this->custom_enabled) { |
112 | 112 | $this->custom_display = $this->get_custom_displays(); |
113 | - if (count($this->custom_display)> 0) { |
|
113 | + if (count($this->custom_display) > 0) { |
|
114 | 114 | $this->custom_display_conv = $this->convert_displays($this->custom_display); |
115 | 115 | } |
116 | 116 | } |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | } |
183 | 183 | |
184 | 184 | $sql = 'SELECT id FROM '.$tbl_gradebook_category.' |
185 | - WHERE course_code = "'.$curr_course_code.'" '. $session_condition; |
|
185 | + WHERE course_code = "'.$curr_course_code.'" '.$session_condition; |
|
186 | 186 | $rs = Database::query($sql); |
187 | 187 | $category_id = 0; |
188 | 188 | if (Database::num_rows($rs) > 0) { |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | ); |
252 | 252 | |
253 | 253 | $tbl_display = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_SCORE_DISPLAY); |
254 | - foreach($display as $value => $text) { |
|
254 | + foreach ($display as $value => $text) { |
|
255 | 255 | $params = array( |
256 | 256 | 'score' => $value, |
257 | 257 | 'display' => $text, |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | $my_score = $score == 0 ? 1 : $score; |
308 | 308 | |
309 | 309 | if ($type == SCORE_BAR) { |
310 | - $percentage = $my_score[0]/$my_score[1]*100; |
|
310 | + $percentage = $my_score[0] / $my_score[1] * 100; |
|
311 | 311 | |
312 | 312 | return Display::bar_progress($percentage); |
313 | 313 | } |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | case SCORE_PERCENT : // XX % |
349 | 349 | return $this->display_as_percent($score); |
350 | 350 | case SCORE_DIV_PERCENT : // X / Y (XX %) |
351 | - return $this->display_as_div($score).' (' . $this->display_as_percent($score) . ')'; |
|
351 | + return $this->display_as_div($score).' ('.$this->display_as_percent($score).')'; |
|
352 | 352 | case SCORE_AVERAGE : // XX % |
353 | 353 | return $this->display_as_percent($score); |
354 | 354 | case SCORE_DECIMAL : // 0.50 (X/Y) |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | if (!empty($custom)) { |
359 | 359 | $custom = ' - '.$custom; |
360 | 360 | } |
361 | - return $this->display_as_div($score).' (' . $this->display_as_percent($score) . ')'.$custom; |
|
361 | + return $this->display_as_div($score).' ('.$this->display_as_percent($score).')'.$custom; |
|
362 | 362 | case SCORE_DIV_SIMPLE_WITH_CUSTOM : // X - Good! |
363 | 363 | $custom = $this->display_custom($score); |
364 | 364 | |
@@ -410,9 +410,9 @@ discard block |
||
410 | 410 | */ |
411 | 411 | private function display_as_decimal($score) |
412 | 412 | { |
413 | - $score_denom = ($score[1]==0) ? 1 : $score[1]; |
|
413 | + $score_denom = ($score[1] == 0) ? 1 : $score[1]; |
|
414 | 414 | |
415 | - return $this->format_score($score[0]/$score_denom); |
|
415 | + return $this->format_score($score[0] / $score_denom); |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | /** |
@@ -420,9 +420,9 @@ discard block |
||
420 | 420 | */ |
421 | 421 | private function display_as_percent($score) |
422 | 422 | { |
423 | - $score_denom = ($score[1]==0) ? 1 : $score[1]; |
|
423 | + $score_denom = ($score[1] == 0) ? 1 : $score[1]; |
|
424 | 424 | |
425 | - return $this->format_score($score[0]/$score_denom*100) . ' %'; |
|
425 | + return $this->format_score($score[0] / $score_denom * 100).' %'; |
|
426 | 426 | } |
427 | 427 | |
428 | 428 | /** |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | } else { |
439 | 439 | $score[0] = isset($score[0]) ? $this->format_score($score[0]) : 0; |
440 | 440 | $score[1] = isset($score[1]) ? $this->format_score($score[1]) : 0; |
441 | - return $score[0] . ' / ' . $score[1]; |
|
441 | + return $score[0].' / '.$score[1]; |
|
442 | 442 | } |
443 | 443 | } |
444 | 444 | |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | */ |
449 | 449 | private function display_custom($score) |
450 | 450 | { |
451 | - $my_score_denom= ($score[1]==0) ? 1 : $score[1]; |
|
451 | + $my_score_denom = ($score[1] == 0) ? 1 : $score[1]; |
|
452 | 452 | $scaledscore = $score[0] / $my_score_denom; |
453 | 453 | if ($this->upperlimit_included) { |
454 | 454 | foreach ($this->custom_display_conv as $displayitem) { |
@@ -512,7 +512,7 @@ discard block |
||
512 | 512 | ORDER BY score'; |
513 | 513 | $result = Database::query($sql); |
514 | 514 | |
515 | - return Database::store_result($result,'ASSOC'); |
|
515 | + return Database::store_result($result, 'ASSOC'); |
|
516 | 516 | } |
517 | 517 | |
518 | 518 | /** |