Completed
Push — 1.11.x ( 69878b...1da93a )
by José
64:32 queued 39:16
created
main/exercise/hotspot_savescore.inc.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,8 +25,8 @@
 block discarded – undo
25 25
     // user clicked ON a hotspot
26 26
     $hit = 1;
27 27
     $answerId = api_substr($_GET['answerId'],22,2);
28
-	// Save into session
29
-	$_SESSION['exerciseResult'][$questionId][$answerId] = $hit;
28
+    // Save into session
29
+    $_SESSION['exerciseResult'][$questionId][$answerId] = $hit;
30 30
 }
31 31
 //round-up the coordinates
32 32
 $coords = explode('/',$coordinates);
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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.
Please login to merge, or discard this patch.
main/exercise/hotspot_updatescore.inc.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -20,16 +20,16 @@
 block discarded – undo
20 20
 $exerciseId = $objExercise->selectId();
21 21
 if ($_GET['answerId'] == "0") { // click is NOT on a hotspot
22 22
     $hit = 0;
23
-	$answerId = $hotspotId;
23
+    $answerId = $hotspotId;
24 24
 
25
-	// remove from session
26
-	unset($_SESSION['exerciseResult'][$questionId][$answerId]);
25
+    // remove from session
26
+    unset($_SESSION['exerciseResult'][$questionId][$answerId]);
27 27
 } else { // user clicked ON a hotspot
28
-	$hit = 1;
29
-	$answerId = $hotspotId;
28
+    $hit = 1;
29
+    $answerId = $hotspotId;
30 30
 
31
-	// Save into session
32
-	$_SESSION['exerciseResult'][$questionId][$answerId] = $hit;
31
+    // Save into session
32
+    $_SESSION['exerciseResult'][$questionId][$answerId] = $hit;
33 33
 }
34 34
 
35 35
 //round-up the coordinates
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,13 +33,13 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
main/mySpace/teachers.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -20,14 +20,14 @@  discard block
 block discarded – undo
20 20
 
21 21
 $this_section = SECTION_TRACKING;
22 22
 
23
-$interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('MySpace'));
23
+$interbreadcrumb[] = array("url" => "index.php", "name" => get_lang('MySpace'));
24 24
 
25 25
 if (isset($_GET["user_id"]) && $_GET["user_id"] != "" && !isset($_GET["type"])) {
26
-    $interbreadcrumb[] = array ("url" => "teachers.php", "name" => get_lang('Teachers'));
26
+    $interbreadcrumb[] = array("url" => "teachers.php", "name" => get_lang('Teachers'));
27 27
 }
28 28
 
29
-if (isset($_GET["user_id"]) && $_GET["user_id"]!="" && isset($_GET["type"]) && $_GET["type"] == "coach") {
30
-    $interbreadcrumb[] = array ("url" => "coaches.php", "name" => get_lang('Tutors'));
29
+if (isset($_GET["user_id"]) && $_GET["user_id"] != "" && isset($_GET["type"]) && $_GET["type"] == "coach") {
30
+    $interbreadcrumb[] = array("url" => "coaches.php", "name" => get_lang('Tutors'));
31 31
 }
32 32
 
33 33
 function get_count_users()
@@ -122,8 +122,8 @@  discard block
 block discarded – undo
122 122
                 $courseInfo = api_get_course_info($course_code);
123 123
                 $courseId = $courseInfo['real_id'];
124 124
                 if (CourseManager :: is_user_subscribed_in_course($student_id, $course_code, true)) {
125
-                    $avg_time_spent 	+= Tracking :: get_time_spent_on_the_course($student_id, $courseId, $_GET['id_session']);
126
-                    $my_average 		 = Tracking :: get_avg_student_score($student_id, $course_code);
125
+                    $avg_time_spent += Tracking :: get_time_spent_on_the_course($student_id, $courseId, $_GET['id_session']);
126
+                    $my_average = Tracking :: get_avg_student_score($student_id, $course_code);
127 127
                     if (is_numeric($my_average)) {
128 128
                         $avg_student_score += $my_average;
129 129
                     }
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
             $detailsLink = '<a href="myStudents.php?student='.$student_id.'&id_coach='.$coach_id.'&id_session='.$_GET['id_session'].'">
163 163
 				          '.Display::return_icon('2rightarrow.png', get_lang('Details')).'</a>';
164 164
         } else {
165
-            $detailsLink =  '<a href="myStudents.php?student='.$student_id.'">
165
+            $detailsLink = '<a href="myStudents.php?student='.$student_id.'">
166 166
 				            '.Display::return_icon('2rightarrow.png', get_lang('Details')).'</a>';
167 167
         }
168 168
         $row[] = $detailsLink;
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 $actionsLeft = '';
182 182
 if (api_is_drh()) {
183 183
     $menu_items = array(
184
-        Display::url(Display::return_icon('stats.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH)."auth/my_progress.php" ),
184
+        Display::url(Display::return_icon('stats.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH)."auth/my_progress.php"),
185 185
         Display::url(Display::return_icon('user.png', get_lang('Students'), array(), ICON_SIZE_MEDIUM), 'student.php'),
186 186
         Display::url(Display::return_icon('teacher_na.png', get_lang('Trainers'), array(), ICON_SIZE_MEDIUM), 'teachers.php'),
187 187
         Display::url(Display::return_icon('course.png', get_lang('Courses'), array(), ICON_SIZE_MEDIUM), 'course.php'),
Please login to merge, or discard this patch.
main/course_home/activity.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
     // Show message to confirm that a tool it to be hidden from available tools
23 23
     // visibility 0,1->2
24 24
     if (!empty($_GET['askDelete'])) {
25
-        $content .='<div id="toolhide">'.get_lang('DelLk').'<br />&nbsp;&nbsp;&nbsp;
25
+        $content .= '<div id="toolhide">'.get_lang('DelLk').'<br />&nbsp;&nbsp;&nbsp;
26 26
             <a href="'.api_get_self().'">'.get_lang('No').'</a>&nbsp;|&nbsp;
27 27
             <a href="'.api_get_self().'?delete=yes&id='.$id.'">'.get_lang('Yes').'</a>
28 28
         </div>';
@@ -49,11 +49,11 @@  discard block
 block discarded – undo
49 49
 
50 50
 // Start of tools for CourseAdmins (teachers/tutors)
51 51
 if ($session_id === 0 && api_is_course_admin() && api_is_allowed_to_edit(null, true)) {
52
-    $content .=  '<div class="alert alert-success" style="border:0px; margin-top: 0px;padding:0px;">
52
+    $content .= '<div class="alert alert-success" style="border:0px; margin-top: 0px;padding:0px;">
53 53
 		<div class="normal-message" id="id_normal_message" style="display:none">';
54
-    $content .=  '<img src="'.api_get_path(WEB_PATH).'main/inc/lib/javascript/indicator.gif"/>&nbsp;&nbsp;';
55
-    $content .=  get_lang('PleaseStandBy');
56
-    $content .=  '</div>
54
+    $content .= '<img src="'.api_get_path(WEB_PATH).'main/inc/lib/javascript/indicator.gif"/>&nbsp;&nbsp;';
55
+    $content .= get_lang('PleaseStandBy');
56
+    $content .= '</div>
57 57
 		<div class="alert alert-success" id="id_confirmation_message" style="display:none"></div>
58 58
 	</div>';
59 59
 
@@ -78,8 +78,8 @@  discard block
 block discarded – undo
78 78
     $my_list = CourseHome::get_tools_category(TOOL_INTERACTION);
79 79
     $list2 = CourseHome::get_tools_category(TOOL_COURSE_PLUGIN);
80 80
 
81
-    $my_list = array_merge($my_list,$list2);
82
-    $items =  CourseHome::show_tools_category($my_list);
81
+    $my_list = array_merge($my_list, $list2);
82
+    $items = CourseHome::show_tools_category($my_list);
83 83
     $content .= return_block(get_lang('Interaction'), $items, 'course-tools-interaction');
84 84
 
85 85
     $my_list = CourseHome::get_tools_category(TOOL_ADMIN_PLATFORM);
@@ -94,10 +94,10 @@  discard block
 block discarded – undo
94 94
 			<span class="viewcaption">'.get_lang('SessionData').'</span>
95 95
 			<table class="course_activity_home">';
96 96
         $content .= CourseHome::show_session_data($session_id);
97
-        $content .=  '</table></div></div>';
97
+        $content .= '</table></div></div>';
98 98
     }
99 99
 
100
-    $content .=  '<div class="row">';
100
+    $content .= '<div class="row">';
101 101
     $my_list = CourseHome::get_tools_category(TOOL_STUDENT_VIEW);
102 102
     $content .= CourseHome::show_tools_category($my_list);
103 103
     $content .= '</div>';
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 {
180 180
     $html = '<div class="row">
181 181
                 <div class="col-xs-12 col-md-12">
182
-                    <div class="title-tools">' . $title . '</div>
182
+                    <div class="title-tools">' . $title.'</div>
183 183
                 </div>
184 184
             </div>
185 185
             <div class="row '.$class.'">'.$content.'</div>';
Please login to merge, or discard this patch.
main/lp/lp_admin_view.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
             }
Please login to merge, or discard this patch.
main/lp/lp_add_item.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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.
Please login to merge, or discard this patch.
certificates/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
     Event::addEvent(
46 46
         LOG_ATTEMPTED_FORCED_LOGIN,
47 47
         'tried_hacking_get',
48
-        $_SERVER['REMOTE_ADDR'].(empty($_POST['login'])?'':'/'.$_POST['login']),
48
+        $_SERVER['REMOTE_ADDR'].(empty($_POST['login']) ? '' : '/'.$_POST['login']),
49 49
         null,
50 50
         $i
51 51
     );
Please login to merge, or discard this patch.
main/create_course/add_course.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 </script>';
40 40
 
41 41
 $interbreadcrumb[] = array(
42
-    'url' => api_get_path(WEB_PATH) . 'user_portal.php',
42
+    'url' => api_get_path(WEB_PATH).'user_portal.php',
43 43
     'name' => get_lang('MyCourses')
44 44
 );
45 45
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 );
87 87
 
88 88
 // Category category.
89
-$url = api_get_path(WEB_AJAX_PATH) . 'course.ajax.php?a=search_category';
89
+$url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_category';
90 90
 
91 91
 $form->addElement(
92 92
     'select_ajax',
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
             get_lang('PickACourseAsATemplateForThisNewCourse'),
233 233
         ],
234 234
         null,
235
-        ['url' => api_get_path(WEB_AJAX_PATH) . 'course.ajax.php?a=search_course']
235
+        ['url' => api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_course']
236 236
     );
237 237
 }
238 238
 
@@ -293,8 +293,8 @@  discard block
 block discarded – undo
293 293
             $params['course_language'] = $course_language;
294 294
             $params['gradebook_model_id'] = isset($course_values['gradebook_model_id']) ? $course_values['gradebook_model_id'] : null;
295 295
 
296
-            include_once api_get_path(SYS_CODE_PATH) . 'lang/english/trad4all.inc.php';
297
-            $file_to_include = api_get_path(SYS_CODE_PATH) . 'lang/' . $course_language . '/trad4all.inc.php';
296
+            include_once api_get_path(SYS_CODE_PATH).'lang/english/trad4all.inc.php';
297
+            $file_to_include = api_get_path(SYS_CODE_PATH).'lang/'.$course_language.'/trad4all.inc.php';
298 298
 
299 299
             if (file_exists($file_to_include)) {
300 300
                 include $file_to_include;
@@ -319,14 +319,14 @@  discard block
 block discarded – undo
319 319
                 $splash = api_get_setting('course_creation_splash_screen');
320 320
                 if ($splash === 'true') {
321 321
                     $url = api_get_path(WEB_CODE_PATH);
322
-                    $url .= 'course_info/start.php?' . api_get_cidreq_params($course_info['code']);
322
+                    $url .= 'course_info/start.php?'.api_get_cidreq_params($course_info['code']);
323 323
                     $url .= '&first=1';
324
-                    header('Location: ' . $url);
324
+                    header('Location: '.$url);
325 325
                     exit;
326 326
                 } else {
327 327
 
328
-                    $url = api_get_path(WEB_COURSE_PATH) . $course_info['directory'] . '/';
329
-                    header('Location: ' . $url);
328
+                    $url = api_get_path(WEB_COURSE_PATH).$course_info['directory'].'/';
329
+                    header('Location: '.$url);
330 330
                     exit;
331 331
                 }
332 332
             } else {
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
 
355 355
             if ($request_id) {
356 356
                 $course_request_info = CourseRequestManager::get_course_request_info($request_id);
357
-                $message = (is_array($course_request_info) ? '<strong>' . $course_request_info['code'] . '</strong> : ' : '') . get_lang('CourseRequestCreated');
357
+                $message = (is_array($course_request_info) ? '<strong>'.$course_request_info['code'].'</strong> : ' : '').get_lang('CourseRequestCreated');
358 358
                 $message = Display::return_message(
359 359
                     $message,
360 360
                     'confirmation',
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
                     'div',
365 365
                     Display::url(
366 366
                         get_lang('Enter'),
367
-                        api_get_path(WEB_PATH) . 'user_portal.php',
367
+                        api_get_path(WEB_PATH).'user_portal.php',
368 368
                         ['class' => 'btn btn-default']
369 369
                     ),
370 370
                     ['style' => 'float: left; margin:0px; padding: 0px;']
Please login to merge, or discard this patch.