@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | $objExercise = Session::read('objExercise'); |
17 | 17 | $exerciseId = $objExercise->selectId(); |
18 | 18 | // Save clicking order |
19 | -$answerOrderId = count($_SESSION['exerciseResult'][$questionId]['ids'])+1; |
|
19 | +$answerOrderId = count($_SESSION['exerciseResult'][$questionId]['ids']) + 1; |
|
20 | 20 | if ($_GET['answerId'] == "0") { |
21 | 21 | // click is NOT on a hotspot |
22 | 22 | $hit = 0; |
@@ -24,18 +24,18 @@ discard block |
||
24 | 24 | } else { |
25 | 25 | // user clicked ON a hotspot |
26 | 26 | $hit = 1; |
27 | - $answerId = api_substr($_GET['answerId'],22,2); |
|
27 | + $answerId = api_substr($_GET['answerId'], 22, 2); |
|
28 | 28 | // Save into session |
29 | 29 | $_SESSION['exerciseResult'][$questionId][$answerId] = $hit; |
30 | 30 | } |
31 | 31 | //round-up the coordinates |
32 | -$coords = explode('/',$coordinates); |
|
32 | +$coords = explode('/', $coordinates); |
|
33 | 33 | $coordinates = ''; |
34 | 34 | foreach ($coords as $coord) { |
35 | - list($x,$y) = explode(';',$coord); |
|
35 | + list($x, $y) = explode(';', $coord); |
|
36 | 36 | $coordinates .= round($x).';'.round($y).'/'; |
37 | 37 | } |
38 | -$coordinates = substr($coordinates,0,-1); |
|
38 | +$coordinates = substr($coordinates, 0, -1); |
|
39 | 39 | |
40 | 40 | $TBL_TRACK_E_HOTSPOT = Database::get_main_table(TABLE_STATISTIC_TRACK_E_HOTSPOT); |
41 | 41 | // Save into db |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | 'quiz_id' => $exerciseId, |
46 | 46 | 'question_id' => $questionId, |
47 | 47 | 'answer_id' => $answerId, |
48 | - 'correct' => $hit , |
|
48 | + 'correct' => $hit, |
|
49 | 49 | 'coordinate' => $coordinates |
50 | 50 | ]; |
51 | 51 | // Save insert id into session if users changes answer. |
@@ -33,13 +33,13 @@ |
||
33 | 33 | } |
34 | 34 | |
35 | 35 | //round-up the coordinates |
36 | -$coords = explode('/',$coordinates); |
|
36 | +$coords = explode('/', $coordinates); |
|
37 | 37 | $coordinates = ''; |
38 | 38 | foreach ($coords as $coord) { |
39 | - list($x,$y) = explode(';',$coord); |
|
39 | + list($x, $y) = explode(';', $coord); |
|
40 | 40 | $coordinates .= round($x).';'.round($y).'/'; |
41 | 41 | } |
42 | -$coordinates = substr($coordinates,0,-1); |
|
42 | +$coordinates = substr($coordinates, 0, -1); |
|
43 | 43 | |
44 | 44 | $TBL_TRACK_E_HOTSPOT = Database::get_main_table(TABLE_STATISTIC_TRACK_E_HOTSPOT); |
45 | 45 |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | // notice for unauthorized people. |
18 | 18 | api_protect_course_script(true); |
19 | 19 | |
20 | -if ($debug>0) { |
|
20 | +if ($debug > 0) { |
|
21 | 21 | error_log('Entered exercise_result.php: '.print_r($_POST, 1)); |
22 | 22 | } |
23 | 23 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | if (isset($_SESSION['exe_id'])) { |
98 | 98 | $exe_id = intval($_SESSION['exe_id']); |
99 | 99 | } |
100 | -$exercise_stat_info = $objExercise->get_stat_track_exercise_info_by_exe_id($exe_id); |
|
100 | +$exercise_stat_info = $objExercise->get_stat_track_exercise_info_by_exe_id($exe_id); |
|
101 | 101 | if (!empty($exercise_stat_info['data_tracking'])) { |
102 | 102 | $question_list = explode(',', $exercise_stat_info['data_tracking']); |
103 | 103 | } |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | Display::url( |
250 | 250 | get_lang('ReviewQuestions'), |
251 | 251 | 'javascript://', |
252 | - array('onclick'=>'review_questions();','class'=>'btn btn-success') |
|
252 | + array('onclick'=>'review_questions();', 'class'=>'btn btn-success') |
|
253 | 253 | ); |
254 | 254 | |
255 | 255 | echo Display::div('', array('class'=>'clear')); |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | $sessionId = isset($_GET['session_id']) ? intval($_GET['session_id']) : null; |
16 | 16 | |
17 | 17 | api_block_anonymous_users(); |
18 | -$interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('MySpace')); |
|
18 | +$interbreadcrumb[] = array("url" => "index.php", "name" => get_lang('MySpace')); |
|
19 | 19 | |
20 | 20 | if (isset($_GET["id_session"]) && $_GET["id_session"] != "") { |
21 | 21 | $interbreadcrumb[] = array("url" => "session.php", "name" => get_lang('Sessions')); |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $user_id = intval($_GET['user_id']); |
67 | 67 | $user_info = api_get_user_info($user_id); |
68 | 68 | $title = get_lang('AssignedCoursesTo').' '.api_get_person_name($user_info['firstname'], $user_info['lastname']); |
69 | - $courses = CourseManager::get_course_list_of_user_as_course_admin($user_id); |
|
69 | + $courses = CourseManager::get_course_list_of_user_as_course_admin($user_id); |
|
70 | 70 | } else { |
71 | 71 | $title = get_lang('YourCourseList'); |
72 | 72 | $courses = CourseManager::get_courses_followed_by_drh(api_get_user_id()); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | |
82 | 82 | if (!api_is_session_admin()) { |
83 | 83 | $menu_items[] = Display::url( |
84 | - Display::return_icon('stats.png', get_lang('MyStats'),'',ICON_SIZE_MEDIUM), |
|
84 | + Display::return_icon('stats.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM), |
|
85 | 85 | api_get_path(WEB_CODE_PATH)."auth/my_progress.php" |
86 | 86 | ); |
87 | 87 | $menu_items[] = Display::url( |
@@ -27,8 +27,8 @@ discard block |
||
27 | 27 | $tbl_lp = Database::get_course_table(TABLE_LP_MAIN); |
28 | 28 | $tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM); |
29 | 29 | |
30 | -$isStudentView = isset($_REQUEST['isStudentView']) ? (int)$_REQUEST['isStudentView'] : null; |
|
31 | -$learnpath_id = (int)$_REQUEST['lp_id']; |
|
30 | +$isStudentView = isset($_REQUEST['isStudentView']) ? (int) $_REQUEST['isStudentView'] : null; |
|
31 | +$learnpath_id = (int) $_REQUEST['lp_id']; |
|
32 | 32 | $submit = isset($_POST['submit_button']) ? $_POST['submit_button'] : null; |
33 | 33 | $_course = api_get_course_info(); |
34 | 34 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | if (!empty($gradebook) && $gradebook == 'view') { |
58 | - $interbreadcrumb[] = array ( |
|
58 | + $interbreadcrumb[] = array( |
|
59 | 59 | 'url' => '../gradebook/'.$_SESSION['gradebook_dest'], |
60 | 60 | 'name' => get_lang('ToolGradebook') |
61 | 61 | ); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $in = implode(',', $lp_items_to_remove_audio); |
97 | 97 | } |
98 | 98 | } |
99 | - if (count($lp_items_to_remove_audio)>0) { |
|
99 | + if (count($lp_items_to_remove_audio) > 0) { |
|
100 | 100 | $sql = "UPDATE $tbl_lp_item SET audio = '' |
101 | 101 | WHERE c_id = $course_id AND id IN (".$in.")"; |
102 | 102 | $result = Database::query($sql); |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | // Adding something random to prevent overwriting. |
132 | 132 | $filename_components[count($filename_components) - 1] = time(); |
133 | 133 | // Reconstructing the new filename. |
134 | - $clean_name = implode($filename_components) .'.'.$file_extension; |
|
134 | + $clean_name = implode($filename_components).'.'.$file_extension; |
|
135 | 135 | // Using the new name in the $_FILES superglobal. |
136 | 136 | $_FILES[$key]['name'] = $clean_name; |
137 | 137 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | } |
91 | 91 | |
92 | 92 | if (!empty($gradebook) && $gradebook == 'view') { |
93 | - $interbreadcrumb[] = array ( |
|
93 | + $interbreadcrumb[] = array( |
|
94 | 94 | 'url' => '../gradebook/'.$_SESSION['gradebook_dest'], |
95 | 95 | 'name' => get_lang('ToolGradebook') |
96 | 96 | ); |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | 'url' => 'lp_controller.php?action=add_item&type=step&lp_id='.$learnPath->get_id().'&'.api_get_cidreq(), |
113 | 113 | 'name' => get_lang('NewStep'), |
114 | 114 | ); |
115 | - $interbreadcrumb[]= array('url' => '#', 'name' => get_lang('NewChapter')); |
|
115 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('NewChapter')); |
|
116 | 116 | break; |
117 | 117 | case 'document': |
118 | 118 | $interbreadcrumb[] = array( |
@@ -121,12 +121,12 @@ discard block |
||
121 | 121 | ); |
122 | 122 | break; |
123 | 123 | default: |
124 | - $interbreadcrumb[]= array('url' => '#', 'name' => get_lang('NewStep')); |
|
124 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('NewStep')); |
|
125 | 125 | break; |
126 | 126 | } |
127 | 127 | |
128 | 128 | if ($action == 'add_item' && $type == 'document') { |
129 | - $interbreadcrumb[]= array ('url' => '#', 'name' => get_lang('NewDocumentCreated')); |
|
129 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('NewDocumentCreated')); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | // Theme calls. |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | get_lang('HideColumn'), |
112 | 112 | array('align' => 'absmiddle', 'hspace' => '3px'), |
113 | 113 | ICON_SIZE_SMALL |
114 | - ) . "</div>' |
|
114 | + )."</div>' |
|
115 | 115 | ); |
116 | 116 | } |
117 | 117 | ); |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | $TABLETRACK_LINKS = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LINKS); |
147 | 147 | $TABLETRACK_DOWNLOADS = Database::get_main_table(TABLE_STATISTIC_TRACK_E_DOWNLOADS); |
148 | 148 | $TABLETRACK_ACCESS_2 = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ACCESS); |
149 | -$TABLETRACK_EXERCISES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES); |
|
149 | +$TABLETRACK_EXERCISES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES); |
|
150 | 150 | $TABLECOURSUSER = Database::get_main_table(TABLE_MAIN_COURSE_USER); |
151 | 151 | $TABLECOURSE = Database::get_main_table(TABLE_MAIN_COURSE); |
152 | 152 | $table_user = Database::get_main_table(TABLE_MAIN_USER); |
@@ -156,8 +156,8 @@ discard block |
||
156 | 156 | |
157 | 157 | // Breadcrumbs. |
158 | 158 | if (isset($_GET['origin']) && $_GET['origin'] == 'resume_session') { |
159 | - $interbreadcrumb[] = array('url' => '../admin/index.php','name' => get_lang('PlatformAdmin')); |
|
160 | - $interbreadcrumb[] = array('url' => '../session/session_list.php','name' => get_lang('SessionList')); |
|
159 | + $interbreadcrumb[] = array('url' => '../admin/index.php', 'name' => get_lang('PlatformAdmin')); |
|
160 | + $interbreadcrumb[] = array('url' => '../session/session_list.php', 'name' => get_lang('SessionList')); |
|
161 | 161 | $interbreadcrumb[] = array('url' => '../session/resume_session.php?id_session='.$sessionId, 'name' => get_lang('SessionOverview')); |
162 | 162 | } |
163 | 163 | |
@@ -228,21 +228,21 @@ discard block |
||
228 | 228 | if (!empty($sessionId)) { |
229 | 229 | $actionsLeft .= Display::url( |
230 | 230 | Display::return_icon('attendance_list.png', get_lang('Logins'), '', ICON_SIZE_MEDIUM), |
231 | - api_get_path(WEB_CODE_PATH) . 'attendance/index.php?' . api_get_cidreq() . '&action=calendar_logins' |
|
231 | + api_get_path(WEB_CODE_PATH).'attendance/index.php?'.api_get_cidreq().'&action=calendar_logins' |
|
232 | 232 | ); |
233 | 233 | } |
234 | 234 | |
235 | 235 | $actionsRight = '<div class="pull-right">'; |
236 | 236 | $actionsRight .= '<a href="javascript: void(0);" onclick="javascript: window.print();">'. |
237 | - Display::return_icon('printer.png', get_lang('Print'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
237 | + Display::return_icon('printer.png', get_lang('Print'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
238 | 238 | |
239 | 239 | $addional_param = ''; |
240 | 240 | if (isset($_GET['additional_profile_field'])) { |
241 | - $addional_param ='additional_profile_field='.intval($_GET['additional_profile_field']); |
|
241 | + $addional_param = 'additional_profile_field='.intval($_GET['additional_profile_field']); |
|
242 | 242 | } |
243 | 243 | $users_tracking_per_page = ''; |
244 | 244 | if (isset($_GET['users_tracking_per_page'])) { |
245 | - $users_tracking_per_page= '&users_tracking_per_page='.intval($_GET['users_tracking_per_page']); |
|
245 | + $users_tracking_per_page = '&users_tracking_per_page='.intval($_GET['users_tracking_per_page']); |
|
246 | 246 | } |
247 | 247 | $actionsRight .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&export=csv&'.$addional_param.$users_tracking_per_page.'"> |
248 | 248 | '.Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), '', ICON_SIZE_MEDIUM).'</a>'; |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | $course_name = get_lang('Course').' '.$courseInfo['name']; |
267 | 267 | if ($session_id) { |
268 | 268 | $titleSession = Display::return_icon('session.png', get_lang('Session'), array(), ICON_SIZE_SMALL).' '.api_get_session_name($session_id); |
269 | - $titleCourse = Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$course_name; |
|
269 | + $titleCourse = Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$course_name; |
|
270 | 270 | } else { |
271 | 271 | $titleSession = Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$courseInfo['name']; |
272 | 272 | } |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | $html .= '<ul class="session-list">'; |
307 | 307 | foreach ($sessionList as $session) { |
308 | 308 | $url = api_get_path(WEB_CODE_PATH).'mySpace/course.php?session_id='.$session['id'].'&cidReq='.$courseInfo['code']; |
309 | - $html .= Display::tag('li', $iconCourse . ' ' . Display::url($session['name'], $url)); |
|
309 | + $html .= Display::tag('li', $iconCourse.' '.Display::url($session['name'], $url)); |
|
310 | 310 | } |
311 | 311 | $html .= '</ul>'; |
312 | 312 | } |
@@ -321,12 +321,12 @@ discard block |
||
321 | 321 | $form = new FormValidator( |
322 | 322 | 'reminder_form', |
323 | 323 | 'get', |
324 | - api_get_path(WEB_CODE_PATH).'announcements/announcements.php?' . api_get_cidreq(), |
|
324 | + api_get_path(WEB_CODE_PATH).'announcements/announcements.php?'.api_get_cidreq(), |
|
325 | 325 | null, |
326 | 326 | ['style' => 'margin-bottom: 10px'], |
327 | 327 | FormValidator::LAYOUT_INLINE |
328 | 328 | ); |
329 | - $options = array ( |
|
329 | + $options = array( |
|
330 | 330 | 2 => sprintf($getLangXDays, 2), |
331 | 331 | 3 => sprintf($getLangXDays, 3), |
332 | 332 | 4 => sprintf($getLangXDays, 4), |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | ); |
340 | 340 | $el = $form->addSelect( |
341 | 341 | 'since', |
342 | - Display::returnFontAwesomeIcon('warning') . get_lang('RemindInactivesLearnersSince'), |
|
342 | + Display::returnFontAwesomeIcon('warning').get_lang('RemindInactivesLearnersSince'), |
|
343 | 343 | $options, |
344 | 344 | ['class' => 'col-sm-3'] |
345 | 345 | ); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $url = api_get_path(WEB_AJAX_PATH).'document.ajax.php?a=document_preview'; |
48 | 48 | $folder_icon = api_get_path(WEB_IMG_PATH).'icons/22/folder.png'; |
49 | 49 | $close_icon = api_get_path(WEB_IMG_PATH).'loading1.gif'; |
50 | - $htmlHeadXtra[] = '<script> |
|
50 | + $htmlHeadXtra[] = '<script> |
|
51 | 51 | $(document).ready(function() { |
52 | 52 | $(".document_preview_container").hide(); |
53 | 53 | $(".document_preview").click(function() { |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | if ($displayMyCourseViewBySessionLink) { |
80 | 80 | $htmlHeadXtra[] = ' |
81 | 81 | <script> |
82 | - userId = ' . $userId . ' |
|
82 | + userId = ' . $userId.' |
|
83 | 83 | $(document).ready(function() { |
84 | 84 | changeMyCoursesView($.cookie("defaultMyCourseView"+userId)); |
85 | 85 | }); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | function changeMyCoursesView(inView) |
92 | 92 | { |
93 | 93 | $.cookie("defaultMyCourseView"+userId, inView, { expires: 365 }); |
94 | - if (inView == ' . IndexManager::VIEW_BY_SESSION . ') { |
|
94 | + if (inView == ' . IndexManager::VIEW_BY_SESSION.') { |
|
95 | 95 | $("#viewBySession").addClass("btn-primary"); |
96 | 96 | $("#viewByDefault").removeClass("btn-primary"); |
97 | 97 | } else { |
@@ -150,16 +150,16 @@ discard block |
||
150 | 150 | if (isset($sessionInfo['courses']) && count($sessionInfo['courses']) == 1) { |
151 | 151 | $courseCode = $sessionInfo['courses'][0]['code']; |
152 | 152 | $courseInfo = api_get_course_info_by_id($sessionInfo['courses'][0]['real_id']); |
153 | - $courseUrl = $courseInfo['course_public_url'] . '?id_session=' . $sessionInfo['session_id']; |
|
154 | - header('Location:' . $courseUrl); |
|
153 | + $courseUrl = $courseInfo['course_public_url'].'?id_session='.$sessionInfo['session_id']; |
|
154 | + header('Location:'.$courseUrl); |
|
155 | 155 | exit; |
156 | 156 | } |
157 | 157 | |
158 | 158 | // Session has many courses. |
159 | 159 | if (isset($sessionInfo['session_id'])) { |
160 | - $url = api_get_path(WEB_CODE_PATH) . 'session/?session_id=' . $sessionInfo['session_id']; |
|
160 | + $url = api_get_path(WEB_CODE_PATH).'session/?session_id='.$sessionInfo['session_id']; |
|
161 | 161 | |
162 | - header('Location:' . $url); |
|
162 | + header('Location:'.$url); |
|
163 | 163 | exit; |
164 | 164 | } |
165 | 165 | } |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $courseInfo = api_get_course_info_by_id($courses[0]['real_id']); |
176 | 176 | if (!empty($courseInfo)) { |
177 | 177 | $courseUrl = $courseInfo['course_public_url']; |
178 | - header('Location:' . $courseUrl); |
|
178 | + header('Location:'.$courseUrl); |
|
179 | 179 | exit; |
180 | 180 | } |
181 | 181 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | $pdfParams['orientation'] = 'landscape'; |
36 | 36 | $pageFormat = $pdfParams['orientation'] === 'landscape' ? 'A4-L' : 'A4'; |
37 | 37 | $userInfo = api_get_user_info($certificate->user_id); |
38 | - $pdfName = api_replace_dangerous_char(get_lang('Certificate') . ' ' . $userInfo['username']); |
|
38 | + $pdfName = api_replace_dangerous_char(get_lang('Certificate').' '.$userInfo['username']); |
|
39 | 39 | |
40 | 40 | $pdf = new PDF($pageFormat, $pdfParams['orientation'], $pdfParams); |
41 | 41 | $pdf->html_to_pdf($certificatePathList, $pdfName, null, false, false); |