@@ -79,7 +79,7 @@ |
||
79 | 79 | |
80 | 80 | $submitted = isset($_POST['submitted']) ? $_POST['submitted'] : ''; |
81 | 81 | if ($submitted == 1) { |
82 | - Display :: display_confirmation_message(get_lang('GradebookWeightUpdated')) . '<br /><br />'; |
|
82 | + Display :: display_confirmation_message(get_lang('GradebookWeightUpdated')).'<br /><br />'; |
|
83 | 83 | if (isset($_POST['evaluation'])) { |
84 | 84 | $eval_log = new Evaluation(); |
85 | 85 | } |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | require_once '../inc/global.inc.php'; |
14 | 14 | api_block_anonymous_users(); |
15 | -$this_section=SECTION_COURSES; |
|
15 | +$this_section = SECTION_COURSES; |
|
16 | 16 | |
17 | 17 | $gradebook = Security::remove_XSS($_GET['gradebook']); |
18 | 18 | |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $doExerciseUrl = null; |
25 | 25 | |
26 | 26 | if (isset($_GET['doexercise'])) { |
27 | - $doExerciseUrl = api_get_path(WEB_CODE_PATH) . 'exercise/overview.php?' . http_build_query([ |
|
27 | + $doExerciseUrl = api_get_path(WEB_CODE_PATH).'exercise/overview.php?'.http_build_query([ |
|
28 | 28 | 'session_id' => $session_id, |
29 | 29 | 'cidReq' => $cidReq, |
30 | 30 | 'gradebook' => $gradebook, |
@@ -60,11 +60,11 @@ discard block |
||
60 | 60 | // If the exercise was added once redirect to the LP |
61 | 61 | $firstLp = current($exercise->lpList); |
62 | 62 | if (isset($firstLp['lp_id'])) { |
63 | - $url = api_get_path(WEB_CODE_PATH) . 'newscorm/lp_controller.php?' . api_get_cidreq() . '&lp_id=' . $firstLp['lp_id'] . '&action=view&isStudentView=true'; |
|
63 | + $url = api_get_path(WEB_CODE_PATH).'newscorm/lp_controller.php?'.api_get_cidreq().'&lp_id='.$firstLp['lp_id'].'&action=view&isStudentView=true'; |
|
64 | 64 | } |
65 | 65 | } else { |
66 | 66 | // If the exercise was added multiple times show the LP list |
67 | - $url = api_get_path(WEB_CODE_PATH) . 'newscorm/lp_controller.php?' . api_get_cidreq().'&action=list'; |
|
67 | + $url = api_get_path(WEB_CODE_PATH).'newscorm/lp_controller.php?'.api_get_cidreq().'&action=list'; |
|
68 | 68 | } |
69 | 69 | } |
70 | 70 | } |
@@ -11,9 +11,9 @@ discard block |
||
11 | 11 | api_block_anonymous_users(); |
12 | 12 | GradebookUtils::block_students(); |
13 | 13 | |
14 | -$interbreadcrumb[] = array ('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?','name' => get_lang('Gradebook')); |
|
15 | -$interbreadcrumb[] = array ('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.Security::remove_XSS($_GET['selectcat']),'name' => get_lang('Details')); |
|
16 | -$interbreadcrumb[] = array ('url' => 'gradebook_showlog_link.php?visiblelink='.Security::remove_XSS($_GET['visiblelink']).'&selectcat='.Security::remove_XSS($_GET['selectcat']), 'name' => get_lang('GradebookQualifyLog')); |
|
14 | +$interbreadcrumb[] = array('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?', 'name' => get_lang('Gradebook')); |
|
15 | +$interbreadcrumb[] = array('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.Security::remove_XSS($_GET['selectcat']), 'name' => get_lang('Details')); |
|
16 | +$interbreadcrumb[] = array('url' => 'gradebook_showlog_link.php?visiblelink='.Security::remove_XSS($_GET['visiblelink']).'&selectcat='.Security::remove_XSS($_GET['selectcat']), 'name' => get_lang('GradebookQualifyLog')); |
|
17 | 17 | $this_section = SECTION_COURSES; |
18 | 18 | Display :: display_header(''); |
19 | 19 | echo '<div class="actions">'; |
@@ -22,21 +22,21 @@ discard block |
||
22 | 22 | |
23 | 23 | $t_user = Database :: get_main_table(TABLE_MAIN_USER); |
24 | 24 | $t_link_log = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG); |
25 | -$visible_link=Security::remove_XSS($_GET['visiblelink']); |
|
25 | +$visible_link = Security::remove_XSS($_GET['visiblelink']); |
|
26 | 26 | $evaledit = EvalLink :: load($visible_link); |
27 | 27 | $sql = "SELECT lk.name,lk.description,lk.weight,lk.visible,lk.type,lk.created_at,us.username |
28 | 28 | FROM ".$t_link_log." lk inner join ".$t_user." us |
29 | 29 | ON lk.user_id_log=us.user_id |
30 | 30 | WHERE lk.id_linkeval_log=".$evaledit[0]->get_id()." AND lk.type='link';"; |
31 | -$result=Database::query($sql); |
|
32 | -$list_info=array(); |
|
33 | -while ($row=Database::fetch_row($result)) { |
|
31 | +$result = Database::query($sql); |
|
32 | +$list_info = array(); |
|
33 | +while ($row = Database::fetch_row($result)) { |
|
34 | 34 | $list_info[] = $row; |
35 | 35 | } |
36 | 36 | |
37 | -foreach($list_info as $key => $info_log) { |
|
38 | - $list_info[$key][5]=($info_log[5]) ? api_convert_and_format_date($info_log[5]) : 'N/A'; |
|
39 | - $list_info[$key][3]=($info_log[3]==1) ? get_lang('GradebookVisible') : get_lang('GradebookInvisible'); |
|
37 | +foreach ($list_info as $key => $info_log) { |
|
38 | + $list_info[$key][5] = ($info_log[5]) ? api_convert_and_format_date($info_log[5]) : 'N/A'; |
|
39 | + $list_info[$key][3] = ($info_log[3] == 1) ? get_lang('GradebookVisible') : get_lang('GradebookInvisible'); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | $parameters = array( |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | 'selectcat' => Security::remove_XSS($_GET['selectcat']), |
45 | 45 | ); |
46 | 46 | |
47 | -$table = new SortableTableFromArrayConfig($list_info, 1,20,'gradebooklink'); |
|
47 | +$table = new SortableTableFromArrayConfig($list_info, 1, 20, 'gradebooklink'); |
|
48 | 48 | $table->set_additional_parameters($parameters); |
49 | 49 | $table->set_header(0, get_lang('GradebookNameLog')); |
50 | 50 | $table->set_header(1, get_lang('GradebookDescriptionLog')); |
@@ -36,7 +36,7 @@ |
||
36 | 36 | 'actions', |
37 | 37 | Display::toolbarButton( |
38 | 38 | get_lang('SearchCertificates'), |
39 | - api_get_path(WEB_CODE_PATH) . "gradebook/search.php", |
|
39 | + api_get_path(WEB_CODE_PATH)."gradebook/search.php", |
|
40 | 40 | 'search', |
41 | 41 | 'info' |
42 | 42 | ) |
@@ -11,20 +11,20 @@ discard block |
||
11 | 11 | GradebookUtils::block_students(); |
12 | 12 | $tbl_grade_links = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINK); |
13 | 13 | //selected name of database |
14 | -$course_id = GradebookUtils::get_course_id_by_link_id($_GET['editlink']); |
|
15 | -$tbl_forum_thread = Database :: get_course_table(TABLE_FORUM_THREAD); |
|
16 | -$tbl_work = Database :: get_course_table(TABLE_STUDENT_PUBLICATION); |
|
17 | -$tbl_attendance = Database :: get_course_table(TABLE_ATTENDANCE); |
|
14 | +$course_id = GradebookUtils::get_course_id_by_link_id($_GET['editlink']); |
|
15 | +$tbl_forum_thread = Database :: get_course_table(TABLE_FORUM_THREAD); |
|
16 | +$tbl_work = Database :: get_course_table(TABLE_STUDENT_PUBLICATION); |
|
17 | +$tbl_attendance = Database :: get_course_table(TABLE_ATTENDANCE); |
|
18 | 18 | |
19 | -$linkarray = LinkFactory :: load($_GET['editlink']); |
|
19 | +$linkarray = LinkFactory :: load($_GET['editlink']); |
|
20 | 20 | /** @var AbstractLink $link */ |
21 | 21 | $link = $linkarray[0]; |
22 | 22 | if ($link->is_locked() && !api_is_platform_admin()) { |
23 | 23 | api_not_allowed(); |
24 | 24 | } |
25 | 25 | |
26 | -$linkcat = isset($_GET['selectcat']) ? Security::remove_XSS($_GET['selectcat']):''; |
|
27 | -$linkedit = isset($_GET['editlink']) ? Security::remove_XSS($_GET['editlink']):''; |
|
26 | +$linkcat = isset($_GET['selectcat']) ? Security::remove_XSS($_GET['selectcat']) : ''; |
|
27 | +$linkedit = isset($_GET['editlink']) ? Security::remove_XSS($_GET['editlink']) : ''; |
|
28 | 28 | |
29 | 29 | $session_id = api_get_session_id(); |
30 | 30 | if ($session_id == 0) { |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | null, |
40 | 40 | $link, |
41 | 41 | 'edit_link_form', |
42 | - api_get_self() . '?selectcat=' . $linkcat. '&editlink=' . $linkedit.'&'.api_get_cidreq() |
|
42 | + api_get_self().'?selectcat='.$linkcat.'&editlink='.$linkedit.'&'.api_get_cidreq() |
|
43 | 43 | ); |
44 | 44 | if ($form->validate()) { |
45 | 45 | $values = $form->exportValues(); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | //Update weight for attendance |
59 | 59 | $sql = 'SELECT ref_id FROM '.$tbl_grade_links.' |
60 | 60 | WHERE id = '.intval($_GET['editlink']).' AND type='.LINK_ATTENDANCE; |
61 | - $rs_attendance = Database::query($sql); |
|
61 | + $rs_attendance = Database::query($sql); |
|
62 | 62 | if (Database::num_rows($rs_attendance) > 0) { |
63 | 63 | $row_attendance = Database::fetch_array($rs_attendance); |
64 | 64 | $attendance_id = $row_attendance['ref_id']; |
@@ -81,11 +81,11 @@ discard block |
||
81 | 81 | weight='.$final_weight.' |
82 | 82 | WHERE c_id = '.$course_id.' AND id = ( |
83 | 83 | SELECT ref_id FROM '.$tbl_grade_links.' |
84 | - WHERE id='.intval($_GET['editlink'] ).' AND type=3 |
|
84 | + WHERE id='.intval($_GET['editlink']).' AND type=3 |
|
85 | 85 | )'; |
86 | 86 | |
87 | 87 | Database::query($sql_t); |
88 | - header('Location: '.$_SESSION['gradebook_dest'].'?linkedited=&selectcat=' . $link->get_category_id().'&'.api_get_cidreq()); |
|
88 | + header('Location: '.$_SESSION['gradebook_dest'].'?linkedited=&selectcat='.$link->get_category_id().'&'.api_get_cidreq()); |
|
89 | 89 | exit; |
90 | 90 | } |
91 | 91 |
@@ -18,53 +18,53 @@ |
||
18 | 18 | $newstudents = $evaluation[0]->get_not_subscribed_students(); |
19 | 19 | |
20 | 20 | if (count($newstudents) == '0') { |
21 | - header('Location: gradebook_view_result.php?nouser=&selecteval=' . Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq()); |
|
22 | - exit; |
|
21 | + header('Location: gradebook_view_result.php?nouser=&selecteval=' . Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq()); |
|
22 | + exit; |
|
23 | 23 | } |
24 | 24 | $add_user_form= new EvalForm(EvalForm :: TYPE_ADD_USERS_TO_EVAL, |
25 | - $evaluation[0], |
|
26 | - null, |
|
27 | - 'add_users_to_evaluation', |
|
28 | - null, |
|
29 | - api_get_self() . '?selecteval=' . Security::remove_XSS($_GET['selecteval']), |
|
30 | - Security::remove_XSS($_GET['firstletter']), |
|
31 | - $newstudents); |
|
25 | + $evaluation[0], |
|
26 | + null, |
|
27 | + 'add_users_to_evaluation', |
|
28 | + null, |
|
29 | + api_get_self() . '?selecteval=' . Security::remove_XSS($_GET['selecteval']), |
|
30 | + Security::remove_XSS($_GET['firstletter']), |
|
31 | + $newstudents); |
|
32 | 32 | |
33 | 33 | if ( isset($_POST['submit_button']) ) { |
34 | - $users= is_array($_POST['add_users']) ? $_POST['add_users'] : array (); |
|
35 | - foreach ($users as $key => $value){ |
|
36 | - $users[$key]= intval($value); |
|
37 | - } |
|
34 | + $users= is_array($_POST['add_users']) ? $_POST['add_users'] : array (); |
|
35 | + foreach ($users as $key => $value){ |
|
36 | + $users[$key]= intval($value); |
|
37 | + } |
|
38 | 38 | |
39 | - if (count($users) == 0) { |
|
40 | - header('Location: ' . api_get_self() . '?erroroneuser=&selecteval=' .Security::remove_XSS($_GET['selecteval'])); |
|
41 | - exit; |
|
42 | - } else { |
|
43 | - foreach ($users as $user_id) { |
|
44 | - $result= new Result(); |
|
45 | - $result->set_user_id($user_id); |
|
46 | - $result->set_evaluation_id($_GET['selecteval']); |
|
47 | - $result->add(); |
|
48 | - } |
|
49 | - } |
|
50 | - header('Location: gradebook_view_result.php?adduser=&selecteval=' .Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq()); |
|
51 | - exit; |
|
52 | - } elseif ($_POST['firstLetterUser']) { |
|
53 | - $firstletter= $_POST['firstLetterUser']; |
|
54 | - if (!empty ($firstletter)) { |
|
55 | - header('Location: ' . api_get_self() . '?firstletter=' . Security::remove_XSS($firstletter) . '&selecteval=' . Security::remove_XSS($_GET['selecteval'])); |
|
56 | - exit; |
|
57 | - } |
|
39 | + if (count($users) == 0) { |
|
40 | + header('Location: ' . api_get_self() . '?erroroneuser=&selecteval=' .Security::remove_XSS($_GET['selecteval'])); |
|
41 | + exit; |
|
42 | + } else { |
|
43 | + foreach ($users as $user_id) { |
|
44 | + $result= new Result(); |
|
45 | + $result->set_user_id($user_id); |
|
46 | + $result->set_evaluation_id($_GET['selecteval']); |
|
47 | + $result->add(); |
|
48 | + } |
|
49 | + } |
|
50 | + header('Location: gradebook_view_result.php?adduser=&selecteval=' .Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq()); |
|
51 | + exit; |
|
52 | + } elseif ($_POST['firstLetterUser']) { |
|
53 | + $firstletter= $_POST['firstLetterUser']; |
|
54 | + if (!empty ($firstletter)) { |
|
55 | + header('Location: ' . api_get_self() . '?firstletter=' . Security::remove_XSS($firstletter) . '&selecteval=' . Security::remove_XSS($_GET['selecteval'])); |
|
56 | + exit; |
|
57 | + } |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | $interbreadcrumb[]= array ('url' => Security::remove_XSS($_SESSION['gradebook_dest']),'name' => get_lang('Gradebook')); |
61 | 61 | $interbreadcrumb[]= array( |
62 | - 'url' => 'gradebook_view_result.php?selecteval=' .Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq(), |
|
63 | - 'name' => get_lang('ViewResult') |
|
62 | + 'url' => 'gradebook_view_result.php?selecteval=' .Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq(), |
|
63 | + 'name' => get_lang('ViewResult') |
|
64 | 64 | ); |
65 | 65 | Display :: display_header(get_lang('AddUserToEval')); |
66 | 66 | if (isset ($_GET['erroroneuser'])){ |
67 | - Display :: display_warning_message(get_lang('AtLeastOneUser'),false); |
|
67 | + Display :: display_warning_message(get_lang('AtLeastOneUser'),false); |
|
68 | 68 | } |
69 | 69 | DisplayGradebook :: display_header_result($evaluation[0], null, 0,0); |
70 | 70 | echo '<div class="main">'; |
@@ -14,59 +14,59 @@ |
||
14 | 14 | api_block_anonymous_users(); |
15 | 15 | GradebookUtils::block_students(); |
16 | 16 | |
17 | -$evaluation= Evaluation :: load($_GET['selecteval']); |
|
17 | +$evaluation = Evaluation :: load($_GET['selecteval']); |
|
18 | 18 | $newstudents = $evaluation[0]->get_not_subscribed_students(); |
19 | 19 | |
20 | 20 | if (count($newstudents) == '0') { |
21 | - header('Location: gradebook_view_result.php?nouser=&selecteval=' . Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq()); |
|
21 | + header('Location: gradebook_view_result.php?nouser=&selecteval='.Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq()); |
|
22 | 22 | exit; |
23 | 23 | } |
24 | -$add_user_form= new EvalForm(EvalForm :: TYPE_ADD_USERS_TO_EVAL, |
|
24 | +$add_user_form = new EvalForm(EvalForm :: TYPE_ADD_USERS_TO_EVAL, |
|
25 | 25 | $evaluation[0], |
26 | 26 | null, |
27 | 27 | 'add_users_to_evaluation', |
28 | 28 | null, |
29 | - api_get_self() . '?selecteval=' . Security::remove_XSS($_GET['selecteval']), |
|
29 | + api_get_self().'?selecteval='.Security::remove_XSS($_GET['selecteval']), |
|
30 | 30 | Security::remove_XSS($_GET['firstletter']), |
31 | 31 | $newstudents); |
32 | 32 | |
33 | -if ( isset($_POST['submit_button']) ) { |
|
34 | - $users= is_array($_POST['add_users']) ? $_POST['add_users'] : array (); |
|
35 | - foreach ($users as $key => $value){ |
|
36 | - $users[$key]= intval($value); |
|
33 | +if (isset($_POST['submit_button'])) { |
|
34 | + $users = is_array($_POST['add_users']) ? $_POST['add_users'] : array(); |
|
35 | + foreach ($users as $key => $value) { |
|
36 | + $users[$key] = intval($value); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | if (count($users) == 0) { |
40 | - header('Location: ' . api_get_self() . '?erroroneuser=&selecteval=' .Security::remove_XSS($_GET['selecteval'])); |
|
40 | + header('Location: '.api_get_self().'?erroroneuser=&selecteval='.Security::remove_XSS($_GET['selecteval'])); |
|
41 | 41 | exit; |
42 | 42 | } else { |
43 | 43 | foreach ($users as $user_id) { |
44 | - $result= new Result(); |
|
44 | + $result = new Result(); |
|
45 | 45 | $result->set_user_id($user_id); |
46 | 46 | $result->set_evaluation_id($_GET['selecteval']); |
47 | 47 | $result->add(); |
48 | 48 | } |
49 | 49 | } |
50 | - header('Location: gradebook_view_result.php?adduser=&selecteval=' .Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq()); |
|
50 | + header('Location: gradebook_view_result.php?adduser=&selecteval='.Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq()); |
|
51 | 51 | exit; |
52 | 52 | } elseif ($_POST['firstLetterUser']) { |
53 | - $firstletter= $_POST['firstLetterUser']; |
|
53 | + $firstletter = $_POST['firstLetterUser']; |
|
54 | 54 | if (!empty ($firstletter)) { |
55 | - header('Location: ' . api_get_self() . '?firstletter=' . Security::remove_XSS($firstletter) . '&selecteval=' . Security::remove_XSS($_GET['selecteval'])); |
|
55 | + header('Location: '.api_get_self().'?firstletter='.Security::remove_XSS($firstletter).'&selecteval='.Security::remove_XSS($_GET['selecteval'])); |
|
56 | 56 | exit; |
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
60 | -$interbreadcrumb[]= array ('url' => Security::remove_XSS($_SESSION['gradebook_dest']),'name' => get_lang('Gradebook')); |
|
61 | -$interbreadcrumb[]= array( |
|
62 | - 'url' => 'gradebook_view_result.php?selecteval=' .Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq(), |
|
60 | +$interbreadcrumb[] = array('url' => Security::remove_XSS($_SESSION['gradebook_dest']), 'name' => get_lang('Gradebook')); |
|
61 | +$interbreadcrumb[] = array( |
|
62 | + 'url' => 'gradebook_view_result.php?selecteval='.Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq(), |
|
63 | 63 | 'name' => get_lang('ViewResult') |
64 | 64 | ); |
65 | 65 | Display :: display_header(get_lang('AddUserToEval')); |
66 | -if (isset ($_GET['erroroneuser'])){ |
|
67 | - Display :: display_warning_message(get_lang('AtLeastOneUser'),false); |
|
66 | +if (isset ($_GET['erroroneuser'])) { |
|
67 | + Display :: display_warning_message(get_lang('AtLeastOneUser'), false); |
|
68 | 68 | } |
69 | -DisplayGradebook :: display_header_result($evaluation[0], null, 0,0); |
|
69 | +DisplayGradebook :: display_header_result($evaluation[0], null, 0, 0); |
|
70 | 70 | echo '<div class="main">'; |
71 | 71 | echo $add_user_form->toHtml(); |
72 | 72 | echo '</div>'; |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | if (!$isDrhOfCourse) { |
17 | 17 | GradebookUtils::block_students(); |
18 | 18 | } |
19 | -$interbreadcrumb[]= array ( |
|
19 | +$interbreadcrumb[] = array( |
|
20 | 20 | 'url' => $_SESSION['gradebook_dest'], |
21 | 21 | 'name' => get_lang('Gradebook' |
22 | 22 | )); |
@@ -27,12 +27,12 @@ discard block |
||
27 | 27 | $alllinks = $category[0]->get_links($my_user_id, true); |
28 | 28 | |
29 | 29 | if ($_GET['selectcat'] != null) { |
30 | - $addparams= array ( |
|
30 | + $addparams = array( |
|
31 | 31 | 'userid' => $my_user_id, |
32 | 32 | 'selectcat' => Security::remove_XSS($_GET['selectcat']) |
33 | 33 | ); |
34 | 34 | } else { |
35 | - $addparams= array ( |
|
35 | + $addparams = array( |
|
36 | 36 | 'userid' => $my_user_id, |
37 | 37 | 'selecteval' => Security::remove_XSS($_GET['selecteval']) |
38 | 38 | ); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $newarray[] = array_slice($data, 1); |
50 | 50 | } |
51 | 51 | $userinfo = api_get_user_info($my_user_id); |
52 | - $html .= get_lang('Results').' : '.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).' ('. api_convert_and_format_date(null, DATE_FORMAT_SHORT). ' ' . api_convert_and_format_date(null, TIME_NO_SEC_FORMAT) .')'; |
|
52 | + $html .= get_lang('Results').' : '.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).' ('.api_convert_and_format_date(null, DATE_FORMAT_SHORT).' '.api_convert_and_format_date(null, TIME_NO_SEC_FORMAT).')'; |
|
53 | 53 | |
54 | 54 | if ($displayscore->is_custom()) { |
55 | 55 | $header_names = array( |
@@ -95,23 +95,23 @@ discard block |
||
95 | 95 | $actions = '<div class="actions">'; |
96 | 96 | |
97 | 97 | if (isset($_GET['selectcat'])) { |
98 | - $interbreadcrumb[]= array ('url' => 'gradebook_flatview.php?selectcat=' . Security::remove_XSS($_GET['selectcat']), 'name' => get_lang('FlatView')); |
|
99 | - $actions.= '<a href=gradebook_flatview.php?selectcat=' .Security::remove_XSS($_GET['selectcat']) . '>' . Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('FlatView'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
98 | + $interbreadcrumb[] = array('url' => 'gradebook_flatview.php?selectcat='.Security::remove_XSS($_GET['selectcat']), 'name' => get_lang('FlatView')); |
|
99 | + $actions .= '<a href=gradebook_flatview.php?selectcat='.Security::remove_XSS($_GET['selectcat']).'>'.Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('FlatView'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | if (isset ($_GET['selecteval'])) { |
103 | - $interbreadcrumb[]= array ( |
|
104 | - 'url' => 'gradebook_view_result.php?selecteval=' . Security::remove_XSS($_GET['selecteval']), |
|
103 | + $interbreadcrumb[] = array( |
|
104 | + 'url' => 'gradebook_view_result.php?selecteval='.Security::remove_XSS($_GET['selecteval']), |
|
105 | 105 | 'name' => get_lang('ViewResult' |
106 | 106 | )); |
107 | - $actions.= '<a href=gradebook_view_result.php?selecteval=' . Security::remove_XSS($_GET['selecteval']) . '> |
|
108 | - '.Display::return_icon('back.png', get_lang('BackToEvaluation'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
107 | + $actions .= '<a href=gradebook_view_result.php?selecteval='.Security::remove_XSS($_GET['selecteval']).'> |
|
108 | + '.Display::return_icon('back.png', get_lang('BackToEvaluation'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
109 | 109 | } |
110 | 110 | |
111 | -$actions.= '<a href="' . api_get_self() . '?exportpdf=&userid='.Security::remove_XSS($_GET['userid']).'&selectcat=' . $category[0]->get_id() . '" target="_blank"> |
|
112 | -' . Display::return_icon('pdf.png', get_lang('ExportPDF'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
111 | +$actions .= '<a href="'.api_get_self().'?exportpdf=&userid='.Security::remove_XSS($_GET['userid']).'&selectcat='.$category[0]->get_id().'" target="_blank"> |
|
112 | +' . Display::return_icon('pdf.png', get_lang('ExportPDF'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
113 | 113 | |
114 | -$actions.='</div>'; |
|
114 | +$actions .= '</div>'; |
|
115 | 115 | |
116 | 116 | Display :: display_header(get_lang('ResultsPerUser')); |
117 | 117 | echo $actions; |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | GradebookUtils::block_students(); |
228 | 228 | if (isset ($_GET['set_visible'])) { |
229 | 229 | $visibility_command= 1; |
230 | - }else { |
|
230 | + } else { |
|
231 | 231 | $visibility_command= 0; |
232 | 232 | } |
233 | 233 | $link= LinkFactory :: load($_GET['visiblelink']); |
@@ -281,8 +281,7 @@ discard block |
||
281 | 281 | if ($number_of_selected_items == '0') { |
282 | 282 | $warning_message = get_lang('NoItemsSelected'); |
283 | 283 | $filter_warning_msg = false; |
284 | - } |
|
285 | - else { |
|
284 | + } else { |
|
286 | 285 | switch ($_POST['action']) { |
287 | 286 | case 'deleted' : |
288 | 287 | $number_of_deleted_categories= 0; |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | */ |
7 | 7 | // $cidReset : This is the main difference with gradebook.php, here we say, |
8 | 8 | // basically, that we are inside a course, and many things depend from that |
9 | -$cidReset= true; |
|
9 | +$cidReset = true; |
|
10 | 10 | $_in_course = false; |
11 | 11 | //make sure the destination for scripts is index.php instead of gradebook.php |
12 | 12 | require_once '../inc/global.inc.php'; |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | </script>'; |
31 | 31 | api_block_anonymous_users(); |
32 | 32 | |
33 | -$htmlHeadXtra[]= '<script type="text/javascript"> |
|
33 | +$htmlHeadXtra[] = '<script type="text/javascript"> |
|
34 | 34 | function confirmation () |
35 | 35 | { |
36 | 36 | if (confirm("'.get_lang('DeleteAll').'?")) { |
@@ -47,10 +47,10 @@ discard block |
||
47 | 47 | //this is called when there is no data for the course admin |
48 | 48 | if (isset ($_GET['createallcategories'])) { |
49 | 49 | GradebookUtils::block_students(); |
50 | - $coursecat= Category :: get_not_created_course_categories(api_get_user_id()); |
|
50 | + $coursecat = Category :: get_not_created_course_categories(api_get_user_id()); |
|
51 | 51 | if (!count($coursecat) == 0) { |
52 | 52 | foreach ($coursecat as $row) { |
53 | - $cat= new Category(); |
|
53 | + $cat = new Category(); |
|
54 | 54 | $cat->set_name($row[1]); |
55 | 55 | $cat->set_course_code($row[0]); |
56 | 56 | $cat->set_description(null); |
@@ -66,33 +66,33 @@ discard block |
||
66 | 66 | exit; |
67 | 67 | } |
68 | 68 | //move a category |
69 | -$selectcat=isset($_GET['selectcat']) ? Security::remove_XSS($_GET['selectcat']) : ''; |
|
69 | +$selectcat = isset($_GET['selectcat']) ? Security::remove_XSS($_GET['selectcat']) : ''; |
|
70 | 70 | |
71 | 71 | if (isset ($_GET['movecat'])) { |
72 | 72 | $move_cat = Security::remove_XSS($_GET['movecat']); |
73 | 73 | GradebookUtils::block_students(); |
74 | - $cats= Category :: load($move_cat); |
|
74 | + $cats = Category :: load($move_cat); |
|
75 | 75 | if (!isset ($_GET['targetcat'])) { |
76 | - $move_form= new CatForm(CatForm :: TYPE_MOVE, |
|
76 | + $move_form = new CatForm(CatForm :: TYPE_MOVE, |
|
77 | 77 | $cats[0], |
78 | 78 | 'move_cat_form', |
79 | 79 | null, |
80 | - api_get_self() . '?movecat=' . $move_cat |
|
81 | - . '&selectcat=' . Security::remove_XSS($_GET['selectcat'])); |
|
80 | + api_get_self().'?movecat='.$move_cat |
|
81 | + . '&selectcat='.Security::remove_XSS($_GET['selectcat'])); |
|
82 | 82 | if ($move_form->validate()) { |
83 | - header('Location: ' . api_get_self() . '?selectcat=' . Security::remove_XSS($_GET['selectcat']) |
|
84 | - . '&movecat=' . $move_cat |
|
85 | - . '&targetcat=' . $move_form->exportValue('move_cat')); |
|
83 | + header('Location: '.api_get_self().'?selectcat='.Security::remove_XSS($_GET['selectcat']) |
|
84 | + . '&movecat='.$move_cat |
|
85 | + . '&targetcat='.$move_form->exportValue('move_cat')); |
|
86 | 86 | exit; |
87 | 87 | } |
88 | 88 | } else { |
89 | - $get_target_cat=Security::remove_XSS($_GET['targetcat']); |
|
90 | - $targetcat= Category :: load($get_target_cat); |
|
89 | + $get_target_cat = Security::remove_XSS($_GET['targetcat']); |
|
90 | + $targetcat = Category :: load($get_target_cat); |
|
91 | 91 | $course_to_crsind = ($cats[0]->get_course_code() != null && $targetcat[0]->get_course_code() == null); |
92 | 92 | |
93 | 93 | if (!($course_to_crsind && !isset($_GET['confirm']))) { |
94 | 94 | $cats[0]->move_to_cat($targetcat[0]); |
95 | - header('Location: ' . api_get_self() . '?categorymoved=&selectcat=' . Security::remove_XSS($_GET['selectcat'])); |
|
95 | + header('Location: '.api_get_self().'?categorymoved=&selectcat='.Security::remove_XSS($_GET['selectcat'])); |
|
96 | 96 | exit; |
97 | 97 | } |
98 | 98 | unset($targetcat); |
@@ -103,32 +103,32 @@ discard block |
||
103 | 103 | //move an evaluation |
104 | 104 | if (isset ($_GET['moveeval'])) { |
105 | 105 | GradebookUtils::block_students(); |
106 | - $get_move_eval=Security::remove_XSS($_GET['moveeval']); |
|
107 | - $evals= Evaluation :: load($get_move_eval); |
|
106 | + $get_move_eval = Security::remove_XSS($_GET['moveeval']); |
|
107 | + $evals = Evaluation :: load($get_move_eval); |
|
108 | 108 | if (!isset ($_GET['targetcat'])) { |
109 | 109 | |
110 | - $move_form= new EvalForm(EvalForm :: TYPE_MOVE, |
|
110 | + $move_form = new EvalForm(EvalForm :: TYPE_MOVE, |
|
111 | 111 | $evals[0], |
112 | 112 | null, |
113 | 113 | 'move_eval_form', |
114 | 114 | null, |
115 | - api_get_self() . '?moveeval=' . $get_move_eval |
|
116 | - . '&selectcat=' . Security::remove_XSS($_GET['selectcat'])); |
|
115 | + api_get_self().'?moveeval='.$get_move_eval |
|
116 | + . '&selectcat='.Security::remove_XSS($_GET['selectcat'])); |
|
117 | 117 | |
118 | 118 | if ($move_form->validate()) { |
119 | - header('Location: ' .api_get_self() . '?selectcat=' . Security::remove_XSS($_GET['selectcat']) |
|
120 | - . '&moveeval=' . $get_move_eval |
|
121 | - . '&targetcat=' . $move_form->exportValue('move_cat')); |
|
119 | + header('Location: '.api_get_self().'?selectcat='.Security::remove_XSS($_GET['selectcat']) |
|
120 | + . '&moveeval='.$get_move_eval |
|
121 | + . '&targetcat='.$move_form->exportValue('move_cat')); |
|
122 | 122 | exit; |
123 | 123 | } |
124 | 124 | } else { |
125 | - $get_target_cat=Security::remove_XSS($_GET['targetcat']); |
|
126 | - $targetcat= Category :: load($get_target_cat); |
|
125 | + $get_target_cat = Security::remove_XSS($_GET['targetcat']); |
|
126 | + $targetcat = Category :: load($get_target_cat); |
|
127 | 127 | $course_to_crsind = ($evals[0]->get_course_code() != null && $targetcat[0]->get_course_code() == null); |
128 | 128 | |
129 | 129 | if (!($course_to_crsind && !isset($_GET['confirm']))) { |
130 | 130 | $evals[0]->move_to_cat($targetcat[0]); |
131 | - header('Location: ' . api_get_self() . '?evaluationmoved=&selectcat=' . Security::remove_XSS($_GET['selectcat'])); |
|
131 | + header('Location: '.api_get_self().'?evaluationmoved=&selectcat='.Security::remove_XSS($_GET['selectcat'])); |
|
132 | 132 | exit; |
133 | 133 | } |
134 | 134 | unset ($targetcat); |
@@ -139,8 +139,8 @@ discard block |
||
139 | 139 | //move a link |
140 | 140 | if (isset ($_GET['movelink'])) { |
141 | 141 | GradebookUtils::block_students(); |
142 | - $get_move_link=Security::remove_XSS($_GET['movelink']); |
|
143 | - $link= LinkFactory :: load($get_move_link); |
|
142 | + $get_move_link = Security::remove_XSS($_GET['movelink']); |
|
143 | + $link = LinkFactory :: load($get_move_link); |
|
144 | 144 | $move_form = new LinkForm( |
145 | 145 | LinkForm :: TYPE_MOVE, |
146 | 146 | null, |
@@ -150,10 +150,10 @@ discard block |
||
150 | 150 | api_get_self().'?movelink='.$get_move_link.'&selectcat='.Security::remove_XSS($_GET['selectcat']) |
151 | 151 | ); |
152 | 152 | if ($move_form->validate()) { |
153 | - $targetcat= Category :: load($move_form->exportValue('move_cat')); |
|
153 | + $targetcat = Category :: load($move_form->exportValue('move_cat')); |
|
154 | 154 | $link[0]->move_to_cat($targetcat[0]); |
155 | 155 | unset ($link); |
156 | - header('Location: ' . api_get_self(). '?linkmoved=&selectcat=' . Security::remove_XSS($_GET['selectcat'])); |
|
156 | + header('Location: '.api_get_self().'?linkmoved=&selectcat='.Security::remove_XSS($_GET['selectcat'])); |
|
157 | 157 | exit; |
158 | 158 | } |
159 | 159 | } |
@@ -162,11 +162,11 @@ discard block |
||
162 | 162 | if (isset ($_GET['visiblecat'])) { |
163 | 163 | GradebookUtils::block_students(); |
164 | 164 | if (isset ($_GET['set_visible'])) { |
165 | - $visibility_command= 1; |
|
165 | + $visibility_command = 1; |
|
166 | 166 | } else { |
167 | - $visibility_command= 0; |
|
167 | + $visibility_command = 0; |
|
168 | 168 | } |
169 | - $cats= Category :: load($_GET['visiblecat']); |
|
169 | + $cats = Category :: load($_GET['visiblecat']); |
|
170 | 170 | $cats[0]->set_visible($visibility_command); |
171 | 171 | $cats[0]->save(); |
172 | 172 | $cats[0]->apply_visibility_to_children(); |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | } |
182 | 182 | if (isset ($_GET['deletecat'])) { |
183 | 183 | GradebookUtils::block_students(); |
184 | - $cats= Category :: load($_GET['deletecat']); |
|
184 | + $cats = Category :: load($_GET['deletecat']); |
|
185 | 185 | //delete all categories,subcategories and results |
186 | 186 | if ($cats[0] != null) { |
187 | 187 | if ($cats[0]->get_id() != 0) { |
@@ -196,12 +196,12 @@ discard block |
||
196 | 196 | if (isset ($_GET['visibleeval'])) { |
197 | 197 | GradebookUtils::block_students(); |
198 | 198 | if (isset ($_GET['set_visible'])) { |
199 | - $visibility_command= 1; |
|
199 | + $visibility_command = 1; |
|
200 | 200 | } else { |
201 | - $visibility_command= 0; |
|
201 | + $visibility_command = 0; |
|
202 | 202 | } |
203 | 203 | |
204 | - $eval= Evaluation :: load($_GET['visibleeval']); |
|
204 | + $eval = Evaluation :: load($_GET['visibleeval']); |
|
205 | 205 | $eval[0]->set_visible($visibility_command); |
206 | 206 | $eval[0]->save(); |
207 | 207 | unset ($eval); |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | } |
216 | 216 | if (isset ($_GET['deleteeval'])) { |
217 | 217 | GradebookUtils::block_students(); |
218 | - $eval= Evaluation :: load($_GET['deleteeval']); |
|
218 | + $eval = Evaluation :: load($_GET['deleteeval']); |
|
219 | 219 | if ($eval[0] != null) { |
220 | 220 | $eval[0]->delete_with_results(); |
221 | 221 | } |
@@ -226,11 +226,11 @@ discard block |
||
226 | 226 | if (isset ($_GET['visiblelink'])) { |
227 | 227 | GradebookUtils::block_students(); |
228 | 228 | if (isset ($_GET['set_visible'])) { |
229 | - $visibility_command= 1; |
|
230 | - }else { |
|
231 | - $visibility_command= 0; |
|
229 | + $visibility_command = 1; |
|
230 | + } else { |
|
231 | + $visibility_command = 0; |
|
232 | 232 | } |
233 | - $link= LinkFactory :: load($_GET['visiblelink']); |
|
233 | + $link = LinkFactory :: load($_GET['visiblelink']); |
|
234 | 234 | $link[0]->set_visible($visibility_command); |
235 | 235 | $link[0]->save(); |
236 | 236 | unset ($link); |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | GradebookUtils::block_students(); |
247 | 247 | //fixing #5229 |
248 | 248 | if (!empty($_GET['deletelink'])) { |
249 | - $link= LinkFactory :: load($_GET['deletelink']); |
|
249 | + $link = LinkFactory :: load($_GET['deletelink']); |
|
250 | 250 | if ($link[0] != null) { |
251 | 251 | $link[0]->delete(); |
252 | 252 | } |
@@ -263,11 +263,11 @@ discard block |
||
263 | 263 | } |
264 | 264 | $button = '<form name="confirm" |
265 | 265 | method="post" |
266 | - action="'.api_get_self() .'?confirm=' |
|
267 | - .(isset($_GET['movecat']) ? '&movecat=' . Security::remove_XSS($_GET['movecat']) |
|
268 | - : '&moveeval=' . Security::remove_XSS($_GET['moveeval']) ) |
|
269 | - .'&selectcat=' . Security::remove_XSS($_GET['selectcat']) |
|
270 | - .'&targetcat=' . Security::remove_XSS($_GET['targetcat']).'"> |
|
266 | + action="'.api_get_self().'?confirm=' |
|
267 | + .(isset($_GET['movecat']) ? '&movecat='.Security::remove_XSS($_GET['movecat']) |
|
268 | + : '&moveeval='.Security::remove_XSS($_GET['moveeval'])) |
|
269 | + .'&selectcat='.Security::remove_XSS($_GET['selectcat']) |
|
270 | + .'&targetcat='.Security::remove_XSS($_GET['targetcat']).'"> |
|
271 | 271 | <input type="submit" value="'.' '.get_lang('Ok').' '.'"> |
272 | 272 | </form>'; |
273 | 273 | |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | //actions on the sortabletable |
278 | 278 | if (isset ($_POST['action'])) { |
279 | 279 | GradebookUtils::block_students(); |
280 | - $number_of_selected_items= count($_POST['id']); |
|
280 | + $number_of_selected_items = count($_POST['id']); |
|
281 | 281 | if ($number_of_selected_items == '0') { |
282 | 282 | $warning_message = get_lang('NoItemsSelected'); |
283 | 283 | $filter_warning_msg = false; |
@@ -285,19 +285,19 @@ discard block |
||
285 | 285 | else { |
286 | 286 | switch ($_POST['action']) { |
287 | 287 | case 'deleted' : |
288 | - $number_of_deleted_categories= 0; |
|
289 | - $number_of_deleted_evaluations= 0; |
|
290 | - $number_of_deleted_links= 0; |
|
288 | + $number_of_deleted_categories = 0; |
|
289 | + $number_of_deleted_evaluations = 0; |
|
290 | + $number_of_deleted_links = 0; |
|
291 | 291 | foreach ($_POST['id'] as $indexstr) { |
292 | 292 | if (api_substr($indexstr, 0, 4) == 'CATE') { |
293 | - $cats= Category :: load(api_substr($indexstr, 4)); |
|
293 | + $cats = Category :: load(api_substr($indexstr, 4)); |
|
294 | 294 | if ($cats[0] != null) { |
295 | 295 | $cats[0]->delete_all(); |
296 | 296 | } |
297 | 297 | $number_of_deleted_categories++; |
298 | 298 | } |
299 | 299 | if (api_substr($indexstr, 0, 4) == 'EVAL') { |
300 | - $eval= Evaluation :: load(api_substr($indexstr, 4)); |
|
300 | + $eval = Evaluation :: load(api_substr($indexstr, 4)); |
|
301 | 301 | if ($eval[0] != null) { |
302 | 302 | $eval[0]->delete_with_results(); |
303 | 303 | } |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | if (api_substr($indexstr, 0, 4) == 'LINK') { |
307 | 307 | $id = api_substr($indexstr, 4); |
308 | 308 | if (!empty($id)) { |
309 | - $link= LinkFactory :: load(); |
|
309 | + $link = LinkFactory :: load(); |
|
310 | 310 | if ($link[0] != null) { |
311 | 311 | $link[0]->delete(); |
312 | 312 | } |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | } |
315 | 315 | } |
316 | 316 | } |
317 | - $confirmation_message = get_lang('DeletedCategories') . ' : <b>' . $number_of_deleted_categories . '</b><br />' . get_lang('DeletedEvaluations') . ' : <b>' . $number_of_deleted_evaluations . '</b><br />' . get_lang('DeletedLinks') . ' : <b>' . $number_of_deleted_links . '</b><br /><br />' . get_lang('TotalItems') . ' : <b>' . $number_of_selected_items . '</b>'; |
|
317 | + $confirmation_message = get_lang('DeletedCategories').' : <b>'.$number_of_deleted_categories.'</b><br />'.get_lang('DeletedEvaluations').' : <b>'.$number_of_deleted_evaluations.'</b><br />'.get_lang('DeletedLinks').' : <b>'.$number_of_deleted_links.'</b><br /><br />'.get_lang('TotalItems').' : <b>'.$number_of_selected_items.'</b>'; |
|
318 | 318 | $filter_confirm_msg = false; |
319 | 319 | break; |
320 | 320 | case 'setvisible' : |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | } |
367 | 367 | |
368 | 368 | if (isset ($_POST['submit']) && isset ($_POST['keyword'])) { |
369 | - header('Location: ' . api_get_self() . '?selectcat=' . Security::remove_XSS($_GET['selectcat']) |
|
369 | + header('Location: '.api_get_self().'?selectcat='.Security::remove_XSS($_GET['selectcat']) |
|
370 | 370 | . '&search='.Security::remove_XSS($_POST['keyword'])); |
371 | 371 | exit; |
372 | 372 | } |
@@ -374,8 +374,8 @@ discard block |
||
374 | 374 | // DISPLAY HEADERS AND MESSAGES - |
375 | 375 | if (!isset($_GET['exportpdf']) && !isset($_GET['export_certificate'])) { |
376 | 376 | if (isset ($_GET['studentoverview'])) { |
377 | - $interbreadcrumb[]= array ( |
|
378 | - 'url' => $_SESSION['gradebook_dest'].'?selectcat=' . Security::remove_XSS($_GET['selectcat'].'&'.api_get_cidreq()), |
|
377 | + $interbreadcrumb[] = array( |
|
378 | + 'url' => $_SESSION['gradebook_dest'].'?selectcat='.Security::remove_XSS($_GET['selectcat'].'&'.api_get_cidreq()), |
|
379 | 379 | 'name' => get_lang('ToolGradebook') |
380 | 380 | ); |
381 | 381 | Display :: display_header(get_lang('FlatView')); |
@@ -386,13 +386,13 @@ discard block |
||
386 | 386 | $gradebook_dest = Security::remove_XSS($_SESSION['gradebook_dest']); |
387 | 387 | } |
388 | 388 | |
389 | - $interbreadcrumb[]= array ('url' => $gradebook_dest,'name' => get_lang('Gradebook')); |
|
389 | + $interbreadcrumb[] = array('url' => $gradebook_dest, 'name' => get_lang('Gradebook')); |
|
390 | 390 | |
391 | - if ((isset($_GET['selectcat']) && $_GET['selectcat']>0)) { |
|
391 | + if ((isset($_GET['selectcat']) && $_GET['selectcat'] > 0)) { |
|
392 | 392 | if (!empty($_GET['course'])) { |
393 | - $interbreadcrumb[]= array ('url' => $gradebook_dest.'selectcat='.Security::remove_XSS($_GET['selectcat']),'name' => get_lang('Details')); |
|
393 | + $interbreadcrumb[] = array('url' => $gradebook_dest.'selectcat='.Security::remove_XSS($_GET['selectcat']), 'name' => get_lang('Details')); |
|
394 | 394 | } else { |
395 | - $interbreadcrumb[]= array ('url' => $_SESSION['gradebook_dest'].'?selectcat=0','name' => get_lang('Details')); |
|
395 | + $interbreadcrumb[] = array('url' => $_SESSION['gradebook_dest'].'?selectcat=0', 'name' => get_lang('Details')); |
|
396 | 396 | } |
397 | 397 | } |
398 | 398 | Display :: display_header(''); |
@@ -402,56 +402,56 @@ discard block |
||
402 | 402 | } |
403 | 403 | |
404 | 404 | if (isset($_GET['categorymoved'])) { |
405 | - Display :: display_confirmation_message(get_lang('CategoryMoved'),false); |
|
405 | + Display :: display_confirmation_message(get_lang('CategoryMoved'), false); |
|
406 | 406 | } |
407 | 407 | if (isset($_GET['evaluationmoved'])) { |
408 | - Display :: display_confirmation_message(get_lang('EvaluationMoved'),false); |
|
408 | + Display :: display_confirmation_message(get_lang('EvaluationMoved'), false); |
|
409 | 409 | } |
410 | 410 | if (isset($_GET['linkmoved'])) { |
411 | - Display :: display_confirmation_message(get_lang('LinkMoved'),false); |
|
411 | + Display :: display_confirmation_message(get_lang('LinkMoved'), false); |
|
412 | 412 | } |
413 | 413 | if (isset ($_GET['addcat'])) { |
414 | - Display :: display_confirmation_message(get_lang('CategoryAdded'),false); |
|
414 | + Display :: display_confirmation_message(get_lang('CategoryAdded'), false); |
|
415 | 415 | } |
416 | 416 | if (isset ($_GET['linkadded'])) { |
417 | - Display :: display_confirmation_message(get_lang('LinkAdded'),false); |
|
417 | + Display :: display_confirmation_message(get_lang('LinkAdded'), false); |
|
418 | 418 | } |
419 | 419 | if (isset ($_GET['addresult'])) { |
420 | - Display :: display_confirmation_message(get_lang('ResultAdded'),false); |
|
420 | + Display :: display_confirmation_message(get_lang('ResultAdded'), false); |
|
421 | 421 | } |
422 | 422 | if (isset ($_GET['editcat'])) { |
423 | - Display :: display_confirmation_message(get_lang('CategoryEdited'),false); |
|
423 | + Display :: display_confirmation_message(get_lang('CategoryEdited'), false); |
|
424 | 424 | } |
425 | 425 | if (isset ($_GET['editeval'])) { |
426 | - Display :: display_confirmation_message(get_lang('EvaluationEdited'),false); |
|
426 | + Display :: display_confirmation_message(get_lang('EvaluationEdited'), false); |
|
427 | 427 | } |
428 | 428 | if (isset ($_GET['linkedited'])) { |
429 | - Display :: display_confirmation_message(get_lang('LinkEdited'),false); |
|
429 | + Display :: display_confirmation_message(get_lang('LinkEdited'), false); |
|
430 | 430 | } |
431 | 431 | if (isset ($_GET['nolinkitems'])) { |
432 | - Display :: display_warning_message(get_lang('NoLinkItems'),false); |
|
432 | + Display :: display_warning_message(get_lang('NoLinkItems'), false); |
|
433 | 433 | } |
434 | 434 | if (isset ($_GET['addallcat'])) { |
435 | - Display :: display_normal_message(get_lang('AddAllCat'),false); |
|
435 | + Display :: display_normal_message(get_lang('AddAllCat'), false); |
|
436 | 436 | } |
437 | 437 | if (isset ($confirmation_message)) { |
438 | - Display :: display_confirmation_message($confirmation_message,$filter_confirm_msg); |
|
438 | + Display :: display_confirmation_message($confirmation_message, $filter_confirm_msg); |
|
439 | 439 | } |
440 | 440 | if (isset ($warning_message)) { |
441 | - Display :: display_warning_message($warning_message,$filter_warning_msg); |
|
441 | + Display :: display_warning_message($warning_message, $filter_warning_msg); |
|
442 | 442 | } |
443 | 443 | if (isset ($move_form)) { |
444 | - Display :: display_normal_message($move_form->toHtml(),false); |
|
444 | + Display :: display_normal_message($move_form->toHtml(), false); |
|
445 | 445 | } |
446 | 446 | // LOAD DATA & DISPLAY TABLE - |
447 | -$is_platform_admin= api_is_platform_admin(); |
|
448 | -$is_course_admin= api_is_allowed_to_edit(); |
|
447 | +$is_platform_admin = api_is_platform_admin(); |
|
448 | +$is_course_admin = api_is_allowed_to_edit(); |
|
449 | 449 | |
450 | 450 | //load data for category, evaluation and links |
451 | 451 | if (!isset ($_GET['selectcat']) || empty ($_GET['selectcat'])) { |
452 | - $category= 0; |
|
452 | + $category = 0; |
|
453 | 453 | } else { |
454 | - $category= Security::remove_XSS($_GET['selectcat']); |
|
454 | + $category = Security::remove_XSS($_GET['selectcat']); |
|
455 | 455 | } |
456 | 456 | // search form |
457 | 457 | |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | null, |
463 | 463 | api_get_self().'?selectcat='.$selectcat |
464 | 464 | ); |
465 | -$values= $simple_search_form->exportValues(); |
|
465 | +$values = $simple_search_form->exportValues(); |
|
466 | 466 | $keyword = ''; |
467 | 467 | if (isset($_GET['search']) && !empty($_GET['search'])) { |
468 | 468 | $keyword = Security::remove_XSS($_GET['search']); |
@@ -472,13 +472,13 @@ discard block |
||
472 | 472 | } |
473 | 473 | |
474 | 474 | if (!empty($keyword)) { |
475 | - $cats= Category :: load($category); |
|
476 | - $allcat= array (); |
|
477 | - if ((isset($_GET['selectcat']) && $_GET['selectcat']==0) && isset($_GET['search'])) { |
|
478 | - $allcat= $cats[0]->get_subcategories(null); |
|
479 | - $allcat_info = Category::find_category($keyword,$allcat); |
|
480 | - $alleval=array(); |
|
481 | - $alllink=array(); |
|
475 | + $cats = Category :: load($category); |
|
476 | + $allcat = array(); |
|
477 | + if ((isset($_GET['selectcat']) && $_GET['selectcat'] == 0) && isset($_GET['search'])) { |
|
478 | + $allcat = $cats[0]->get_subcategories(null); |
|
479 | + $allcat_info = Category::find_category($keyword, $allcat); |
|
480 | + $alleval = array(); |
|
481 | + $alllink = array(); |
|
482 | 482 | } else { |
483 | 483 | $alleval = Evaluation::find_evaluations($keyword, $cats[0]->get_id()); |
484 | 484 | $alllink = LinkFactory::find_links($keyword, $cats[0]->get_id()); |
@@ -486,13 +486,13 @@ discard block |
||
486 | 486 | |
487 | 487 | } elseif (isset ($_GET['studentoverview'])) { |
488 | 488 | //@todo this code seems to be deprecated because the gradebook tab is off |
489 | - $cats= Category :: load($category); |
|
490 | - $stud_id= (api_is_allowed_to_edit() ? null : api_get_user_id()); |
|
491 | - $allcat= array (); |
|
492 | - $alleval= $cats[0]->get_evaluations($stud_id, true); |
|
493 | - $alllink= $cats[0]->get_links($stud_id, true); |
|
489 | + $cats = Category :: load($category); |
|
490 | + $stud_id = (api_is_allowed_to_edit() ? null : api_get_user_id()); |
|
491 | + $allcat = array(); |
|
492 | + $alleval = $cats[0]->get_evaluations($stud_id, true); |
|
493 | + $alllink = $cats[0]->get_links($stud_id, true); |
|
494 | 494 | if (isset ($_GET['exportpdf'])) { |
495 | - $datagen = new GradebookDataGenerator ($allcat,$alleval, $alllink); |
|
495 | + $datagen = new GradebookDataGenerator($allcat, $alleval, $alllink); |
|
496 | 496 | $header_names = array( |
497 | 497 | get_lang('Name'), |
498 | 498 | get_lang('Description'), |
@@ -500,18 +500,18 @@ discard block |
||
500 | 500 | get_lang('Date'), |
501 | 501 | get_lang('Results'), |
502 | 502 | ); |
503 | - $data_array = $datagen->get_data(GradebookDataGenerator :: GDG_SORT_NAME,0,null,true); |
|
503 | + $data_array = $datagen->get_data(GradebookDataGenerator :: GDG_SORT_NAME, 0, null, true); |
|
504 | 504 | $newarray = array(); |
505 | 505 | foreach ($data_array as $data) { |
506 | 506 | $newarray[] = array_slice($data, 1); |
507 | 507 | } |
508 | - $pdf= new Cezpdf(); |
|
508 | + $pdf = new Cezpdf(); |
|
509 | 509 | $pdf->selectFont(api_get_path(LIBRARY_PATH).'ezpdf/fonts/Courier.afm'); |
510 | 510 | $pdf->ezSetMargins(30, 30, 50, 30); |
511 | 511 | $pdf->ezSetY(810); |
512 | - $pdf->ezText(get_lang('FlatView').' ('. api_convert_and_format_date(null, DATE_FORMAT_SHORT) . ' ' . api_convert_and_format_date(null, TIME_NO_SEC_FORMAT) .')',12,array('justification'=>'center')); |
|
513 | - $pdf->line(50,790,550,790); |
|
514 | - $pdf->line(50,40,550,40); |
|
512 | + $pdf->ezText(get_lang('FlatView').' ('.api_convert_and_format_date(null, DATE_FORMAT_SHORT).' '.api_convert_and_format_date(null, TIME_NO_SEC_FORMAT).')', 12, array('justification'=>'center')); |
|
513 | + $pdf->line(50, 790, 550, 790); |
|
514 | + $pdf->line(50, 40, 550, 40); |
|
515 | 515 | $pdf->ezSetY(750); |
516 | 516 | $pdf->ezTable( |
517 | 517 | $newarray, |
@@ -528,71 +528,71 @@ discard block |
||
528 | 528 | $pdf->ezStream(); |
529 | 529 | exit; |
530 | 530 | } |
531 | -} elseif (!empty($_GET['export_certificate'])){ |
|
531 | +} elseif (!empty($_GET['export_certificate'])) { |
|
532 | 532 | //@todo this code seems not to be used |
533 | 533 | $user_id = strval(intval($_GET['user'])); |
534 | - if (!api_is_allowed_to_edit(true,true)) { |
|
534 | + if (!api_is_allowed_to_edit(true, true)) { |
|
535 | 535 | $user_id = api_get_user_id(); |
536 | 536 | } |
537 | - $category = Category :: load ($_GET['cat_id']); |
|
537 | + $category = Category :: load($_GET['cat_id']); |
|
538 | 538 | if ($category[0]->is_certificate_available($user_id)) { |
539 | 539 | $user = api_get_user_info($user_id); |
540 | 540 | $scoredisplay = ScoreDisplay :: instance(); |
541 | 541 | $scorecourse = $category[0]->calc_score($user_id); |
542 | - $scorecourse_display = (isset($scorecourse) ? $scoredisplay->display_score($scorecourse,SCORE_AVERAGE) : get_lang('NoResultsAvailable')); |
|
542 | + $scorecourse_display = (isset($scorecourse) ? $scoredisplay->display_score($scorecourse, SCORE_AVERAGE) : get_lang('NoResultsAvailable')); |
|
543 | 543 | |
544 | 544 | $cattotal = Category :: load(0); |
545 | - $scoretotal= $cattotal[0]->calc_score($user_id); |
|
546 | - $scoretotal_display = (isset($scoretotal) ? $scoredisplay->display_score($scoretotal,SCORE_PERCENT) : get_lang('NoResultsAvailable')); |
|
545 | + $scoretotal = $cattotal[0]->calc_score($user_id); |
|
546 | + $scoretotal_display = (isset($scoretotal) ? $scoredisplay->display_score($scoretotal, SCORE_PERCENT) : get_lang('NoResultsAvailable')); |
|
547 | 547 | |
548 | 548 | //prepare all necessary variables: |
549 | 549 | $organization_name = api_get_setting('Institution'); |
550 | 550 | $portal_name = api_get_setting('siteName'); |
551 | 551 | $stud_fn = $user['firstname']; |
552 | 552 | $stud_ln = $user['lastname']; |
553 | - $certif_text = sprintf(get_lang('CertificateWCertifiesStudentXFinishedCourseYWithGradeZ'),$organization_name,$stud_fn.' '.$stud_ln,$category[0]->get_name(),$scorecourse_display); |
|
554 | - $certif_text = str_replace("\\n","\n",$certif_text); |
|
553 | + $certif_text = sprintf(get_lang('CertificateWCertifiesStudentXFinishedCourseYWithGradeZ'), $organization_name, $stud_fn.' '.$stud_ln, $category[0]->get_name(), $scorecourse_display); |
|
554 | + $certif_text = str_replace("\\n", "\n", $certif_text); |
|
555 | 555 | $date = api_convert_and_format_date(null, DATE_FORMAT_SHORT); |
556 | 556 | |
557 | - $pdf= new Cezpdf('a4','landscape'); |
|
557 | + $pdf = new Cezpdf('a4', 'landscape'); |
|
558 | 558 | $pdf->selectFont(api_get_path(LIBRARY_PATH).'ezpdf/fonts/Courier.afm'); |
559 | 559 | $pdf->ezSetMargins(30, 30, 50, 50); |
560 | 560 | //line Y coordinates in landscape mode are upside down (500 is on top, 10 is on the bottom) |
561 | - $pdf->line(50,50,790,50); |
|
562 | - $pdf->line(50,550,790,550); |
|
561 | + $pdf->line(50, 50, 790, 50); |
|
562 | + $pdf->line(50, 550, 790, 550); |
|
563 | 563 | $pdf->ezSetY(450); |
564 | 564 | //@todo replace image |
565 | 565 | //$pdf->ezImage(api_get_path(SYS_CODE_PATH).'img/dokeos_logo_certif.png',1,400,'','center',''); |
566 | 566 | $pdf->ezSetY(480); |
567 | - $pdf->ezText($certif_text,28,array('justification'=>'center')); |
|
567 | + $pdf->ezText($certif_text, 28, array('justification'=>'center')); |
|
568 | 568 | //$pdf->ezSetY(750); |
569 | 569 | $pdf->ezSetY(50); |
570 | - $pdf->ezText($date,18,array('justification'=>'center')); |
|
570 | + $pdf->ezText($date, 18, array('justification'=>'center')); |
|
571 | 571 | $pdf->ezSetY(580); |
572 | - $pdf->ezText($organization_name,22,array('justification'=>'left')); |
|
572 | + $pdf->ezText($organization_name, 22, array('justification'=>'left')); |
|
573 | 573 | $pdf->ezSetY(580); |
574 | - $pdf->ezText($portal_name,22,array('justification'=>'right')); |
|
574 | + $pdf->ezText($portal_name, 22, array('justification'=>'right')); |
|
575 | 575 | $pdf->ezStream(); |
576 | 576 | } |
577 | 577 | exit; |
578 | 578 | } else { |
579 | - $cats= Category :: load($category); |
|
580 | - $stud_id= (api_is_allowed_to_edit() ? null : api_get_user_id()); |
|
581 | - $allcat= $cats[0]->get_subcategories($stud_id); |
|
582 | - $alleval= $cats[0]->get_evaluations($stud_id); |
|
583 | - $alllink= $cats[0]->get_links($stud_id); |
|
579 | + $cats = Category :: load($category); |
|
580 | + $stud_id = (api_is_allowed_to_edit() ? null : api_get_user_id()); |
|
581 | + $allcat = $cats[0]->get_subcategories($stud_id); |
|
582 | + $alleval = $cats[0]->get_evaluations($stud_id); |
|
583 | + $alllink = $cats[0]->get_links($stud_id); |
|
584 | 584 | } |
585 | -$addparams = array ('selectcat' => $cats[0]->get_id()); |
|
585 | +$addparams = array('selectcat' => $cats[0]->get_id()); |
|
586 | 586 | if (isset($_GET['search'])) { |
587 | 587 | $addparams['search'] = $keyword; |
588 | 588 | } |
589 | 589 | if (isset ($_GET['studentoverview'])) { |
590 | 590 | $addparams['studentoverview'] = ''; |
591 | 591 | } |
592 | -if (isset($allcat_info) && count($allcat_info)>=0 && (isset($_GET['selectcat']) && $_GET['selectcat']==0) && isset($_GET['search']) && strlen(trim($_GET['search']))>0 ) { |
|
593 | - $allcat=$allcat_info; |
|
592 | +if (isset($allcat_info) && count($allcat_info) >= 0 && (isset($_GET['selectcat']) && $_GET['selectcat'] == 0) && isset($_GET['search']) && strlen(trim($_GET['search'])) > 0) { |
|
593 | + $allcat = $allcat_info; |
|
594 | 594 | } else { |
595 | - $allcat=$allcat; |
|
595 | + $allcat = $allcat; |
|
596 | 596 | } |
597 | 597 | $gradebooktable = new GradebookTable( |
598 | 598 | $cats[0], |
@@ -602,7 +602,7 @@ discard block |
||
602 | 602 | $addparams |
603 | 603 | ); |
604 | 604 | if (((empty ($allcat)) && (empty ($alleval)) && (empty ($alllink)) && (!$is_platform_admin) && ($is_course_admin) && (!isset ($_GET['selectcat']))) && api_is_course_tutor()) { |
605 | - Display :: display_normal_message(get_lang('GradebookWelcomeMessage') . '<br /><br /><form name="createcat" method="post" action="' . api_get_self() . '?createallcategories=1"><input type="submit" value="' . get_lang('CreateAllCat') . '"></form>',false); |
|
605 | + Display :: display_normal_message(get_lang('GradebookWelcomeMessage').'<br /><br /><form name="createcat" method="post" action="'.api_get_self().'?createallcategories=1"><input type="submit" value="'.get_lang('CreateAllCat').'"></form>', false); |
|
606 | 606 | } |
607 | 607 | // Here we are in a sub category |
608 | 608 | if ($category != '0') { |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | foreach ($userSkills as $skill) { |
34 | 34 | $skillId = current($skill); |
35 | 35 | |
36 | - $assertionUrl = api_get_path(WEB_CODE_PATH) . "badge/assertion.php?"; |
|
36 | + $assertionUrl = api_get_path(WEB_CODE_PATH)."badge/assertion.php?"; |
|
37 | 37 | $assertionUrl .= http_build_query(array( |
38 | 38 | 'user' => $userId, |
39 | 39 | 'skill' => $skillId, |
@@ -51,14 +51,14 @@ discard block |
||
51 | 51 | $backpack = $configBackpack; |
52 | 52 | } |
53 | 53 | |
54 | -$htmlHeadXtra[] = '<script src="' . $backpack . 'issuer.js"></script>'; |
|
54 | +$htmlHeadXtra[] = '<script src="'.$backpack.'issuer.js"></script>'; |
|
55 | 55 | |
56 | 56 | $tpl = new Template(get_lang('Badges'), false, false); |
57 | 57 | |
58 | 58 | $tpl->assign( |
59 | 59 | 'content', |
60 | 60 | "<script>" |
61 | - . "$(document).on('ready', function (){ OpenBadges.issue_no_modal(" . json_encode($assertions) . "); });" |
|
61 | + . "$(document).on('ready', function (){ OpenBadges.issue_no_modal(".json_encode($assertions)."); });" |
|
62 | 62 | . "</script>" |
63 | 63 | ); |
64 | 64 |