Passed
Push — 1.10.x ( 04397c...5e25f1 )
by Angel Fernando Quiroz
181:14 queued 130:00
created
main/survey/survey.lib.php 1 patch
Spacing   +179 added lines, -180 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
             $result = Database::query($sql);
36 36
             if (Database::num_rows($result)) {
37 37
                 $num++;
38
-                $new_code = $code . $num;
38
+                $new_code = $code.$num;
39 39
             } else {
40 40
                 break;
41 41
             }
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         $sql = "SELECT survey_invitation_id, survey_code
64 64
                 FROM $table_survey_invitation WHERE user = '$user_id' AND c_id <> 0 ";
65 65
         $result = Database::query($sql);
66
-        while ($row = Database::fetch_array($result ,'ASSOC')){
66
+        while ($row = Database::fetch_array($result, 'ASSOC')) {
67 67
             $survey_invitation_id = $row['survey_invitation_id'];
68 68
             $survey_code = $row['survey_code'];
69 69
             $sql2 = "DELETE FROM $table_survey_invitation
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
         $table_survey = Database :: get_course_table(TABLE_SURVEY);
130 130
 
131 131
         if ($shared != 0) {
132
-            $table_survey	= Database :: get_main_table(TABLE_MAIN_SHARED_SURVEY_QUESTION);
132
+            $table_survey = Database :: get_main_table(TABLE_MAIN_SHARED_SURVEY_QUESTION);
133 133
             $sql = "SELECT * FROM $table_survey
134 134
                     WHERE survey_id='".intval($survey_id)."' ";
135 135
         } else {
@@ -142,8 +142,8 @@  discard block
 block discarded – undo
142 142
         $result = Database::query($sql);
143 143
         $return = array();
144 144
 
145
-        if (Database::num_rows($result)> 0) {
146
-            $return = Database::fetch_array($result,'ASSOC');
145
+        if (Database::num_rows($result) > 0) {
146
+            $return = Database::fetch_array($result, 'ASSOC');
147 147
             if ($simple_return) {
148 148
                 return $return;
149 149
             }
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
             $return['survey_type'] = $return['survey_type'];
162 162
             $return['one_question_per_page'] = $return['one_question_per_page'];
163 163
             $return['show_form_profile'] = $return['show_form_profile'];
164
-            $return['input_name_list']		= isset($return['input_name_list']) ? $return['input_name_list'] : null;
164
+            $return['input_name_list'] = isset($return['input_name_list']) ? $return['input_name_list'] : null;
165 165
             $return['shuffle'] = $return['shuffle'];
166 166
             $return['parent_id'] = $return['parent_id'];
167 167
             $return['survey_version'] = $return['survey_version'];
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
         $course_id = api_get_course_int_id();
188 188
         $session_id = api_get_session_id();
189 189
         $courseCode = api_get_course_id();
190
-        $table_survey 	= Database :: get_course_table(TABLE_SURVEY);
190
+        $table_survey = Database :: get_course_table(TABLE_SURVEY);
191 191
         $shared_survey_id = 0;
192 192
 
193 193
         if (!isset($values['survey_id'])) {
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
                             if ($values[$field] == '') {
234 234
                                 $values[$field] = 0;
235 235
                             }
236
-                            $field_values.= $field.':'.$values[$field].'@';
236
+                            $field_values .= $field.':'.$values[$field].'@';
237 237
                         }
238 238
                     }
239 239
                     $extraParams['form_fields'] = $field_values;
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
             if ($values['anonymous'] == 0) {
386 386
                 $extraParams['show_form_profile'] = $values['show_form_profile'];
387 387
                 if ($values['show_form_profile'] == 1) {
388
-                    $fields = explode(',',$values['input_name_list']);
388
+                    $fields = explode(',', $values['input_name_list']);
389 389
                     $field_values = '';
390 390
                     foreach ($fields as & $field) {
391 391
                         if ($field != '') {
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
                             ) {
395 395
                                 $values[$field] = 0;
396 396
                             }
397
-                            $field_values.= $field.':'.$values[$field].'@';
397
+                            $field_values .= $field.':'.$values[$field].'@';
398 398
                         }
399 399
                     }
400 400
                     $extraParams['form_fields'] = $field_values;
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
         $_course = api_get_course_info();
527 527
 
528 528
         // Table definitions
529
-        $table_survey	= Database :: get_main_table(TABLE_MAIN_SHARED_SURVEY);
529
+        $table_survey = Database :: get_main_table(TABLE_MAIN_SHARED_SURVEY);
530 530
 
531 531
         if (!$values['survey_id'] ||
532 532
             !is_numeric($values['survey_id']) ||
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
                     '".api_get_utc_datetime()."',
545 545
                     '".$_course['id']."')";
546 546
             Database::query($sql);
547
-            $return	= Database::insert_id();
547
+            $return = Database::insert_id();
548 548
 
549 549
             $sql = "UPDATE $table_survey SET survey_id = $return WHERE iid = $return";
550 550
             Database::query($sql);
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
                         surveythanks	= '".Database::escape_string($values['survey_thanks'])."'
562 562
 					WHERE survey_id = '".Database::escape_string($values['survey_share']['survey_share'])."'";
563 563
             Database::query($sql);
564
-            $return	= $values['survey_share']['survey_share'];
564
+            $return = $values['survey_share']['survey_share'];
565 565
         }
566 566
 
567 567
         return $return;
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
             $params['c_id'] = $targetCourseId;
660 660
             unset($params['survey_id']);
661 661
             $params['session_id'] = api_get_session_id();
662
-            $params['title'] = $params['title'] . ' ' . get_lang('Copy');
662
+            $params['title'] = $params['title'].' '.get_lang('Copy');
663 663
             unset($params['iid']);
664 664
             Database::insert($table_survey, $params);
665 665
             $new_survey_id = Database::insert_id();
@@ -685,7 +685,7 @@  discard block
 block discarded – undo
685 685
         $sql = "SELECT * FROM $table_survey_question_group
686 686
                 WHERE c_id = $course_id AND  survey_id='".$survey_id."'";
687 687
         $res = Database::query($sql);
688
-        while($row = Database::fetch_array($res, 'ASSOC')) {
688
+        while ($row = Database::fetch_array($res, 'ASSOC')) {
689 689
             $params = array(
690 690
                 'c_id' =>  $targetCourseId,
691 691
                 'name' => $row['name'],
@@ -732,7 +732,7 @@  discard block
 block discarded – undo
732 732
                 WHERE c_id = $course_id AND survey_id='".$survey_id."'";
733 733
 
734 734
         $res = Database::query($sql);
735
-        while ($row = Database::fetch_array($res ,'ASSOC')) {
735
+        while ($row = Database::fetch_array($res, 'ASSOC')) {
736 736
             $params = array(
737 737
                 'c_id' =>  $targetCourseId,
738 738
                 'question_id' => $question_id[$row['question_id']],
@@ -916,7 +916,7 @@  discard block
 block discarded – undo
916 916
     {
917 917
         // Table definitions
918 918
         $tbl_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION);
919
-        $table_survey_question_option 	= Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION);
919
+        $table_survey_question_option = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION);
920 920
         $course_id = api_get_course_int_id();
921 921
 
922 922
         $sql = "SELECT * FROM $tbl_survey_question
@@ -942,7 +942,7 @@  discard block
 block discarded – undo
942 942
         // Getting the information of the question
943 943
 
944 944
         $result = Database::query($sql);
945
-        $row = Database::fetch_array($result,'ASSOC');
945
+        $row = Database::fetch_array($result, 'ASSOC');
946 946
 
947 947
         $return['survey_id'] = $row['survey_id'];
948 948
         $return['question_id'] = $row['question_id'];
@@ -990,8 +990,8 @@  discard block
 block discarded – undo
990 990
     public static function get_questions($survey_id, $course_id = '')
991 991
     {
992 992
         // Table definitions
993
-        $tbl_survey_question 			= Database :: get_course_table(TABLE_SURVEY_QUESTION);
994
-        $table_survey_question_option 	= Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION);
993
+        $tbl_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION);
994
+        $table_survey_question_option = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION);
995 995
 
996 996
         if (empty($course_id)) {
997 997
             $course_id = api_get_course_int_id();
@@ -1096,7 +1096,7 @@  discard block
 block discarded – undo
1096 1096
 					        FROM $tbl_survey_question
1097 1097
                             WHERE c_id = $course_id AND survey_id='".intval($form_content['survey_id'])."'";
1098 1098
                     $result = Database::query($sql);
1099
-                    $row = Database::fetch_array($result,'ASSOC');
1099
+                    $row = Database::fetch_array($result, 'ASSOC');
1100 1100
                     $max_sort = $row['max_sort'];
1101 1101
 
1102 1102
                     // Some variables defined for survey-test type
@@ -1233,7 +1233,7 @@  discard block
 block discarded – undo
1233 1233
                     WHERE survey_id='".intval($survey_data['survey_share'])."'
1234 1234
                     AND code='".Database::escape_string($_course['id'])."'";
1235 1235
             $result = Database::query($sql);
1236
-            $row = Database::fetch_array($result,'ASSOC');
1236
+            $row = Database::fetch_array($result, 'ASSOC');
1237 1237
             $max_sort = $row['max_sort'];
1238 1238
 
1239 1239
             // Adding the question to the survey_question table
@@ -1243,11 +1243,11 @@  discard block
 block discarded – undo
1243 1243
                     '".Database::escape_string($form_content['question_comment'])."',
1244 1244
                     '".Database::escape_string($form_content['type'])."',
1245 1245
                     '".Database::escape_string($form_content['horizontalvertical'])."',
1246
-                    '".Database::escape_string($max_sort+1)."',
1246
+                    '".Database::escape_string($max_sort + 1)."',
1247 1247
                     '".Database::escape_string($_course['id'])."')";
1248 1248
             Database::query($sql);
1249 1249
             $shared_question_id = Database::insert_id();
1250
-        }  else {
1250
+        } else {
1251 1251
             // Updating an existing question
1252 1252
             // adding the question to the survey_question table
1253 1253
             $sql = "UPDATE $tbl_survey_question SET
@@ -1277,7 +1277,7 @@  discard block
 block discarded – undo
1277 1277
     public static function move_survey_question($direction, $survey_question_id, $survey_id)
1278 1278
     {
1279 1279
         // Table definition
1280
-        $table_survey_question 	= Database :: get_course_table(TABLE_SURVEY_QUESTION);
1280
+        $table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION);
1281 1281
         $course_id = api_get_course_int_id();
1282 1282
 
1283 1283
         if ($direction == 'moveup') {
@@ -1329,11 +1329,11 @@  discard block
 block discarded – undo
1329 1329
         $course_id = api_get_course_int_id();
1330 1330
 
1331 1331
         // Table definitions
1332
-        $table_survey_question 	= Database :: get_course_table(TABLE_SURVEY_QUESTION);
1332
+        $table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION);
1333 1333
         $course_condition = " c_id = $course_id AND ";
1334 1334
         if ($shared) {
1335 1335
             $course_condition = "";
1336
-            $table_survey_question 	= Database :: get_main_table(TABLE_MAIN_SHARED_SURVEY_QUESTION);
1336
+            $table_survey_question = Database :: get_main_table(TABLE_MAIN_SHARED_SURVEY_QUESTION);
1337 1337
         }
1338 1338
 
1339 1339
         $sql = "DELETE FROM $table_survey_question
@@ -1366,7 +1366,7 @@  discard block
 block discarded – undo
1366 1366
     {
1367 1367
         $course_id = api_get_course_int_id();
1368 1368
         // Table definitions
1369
-        $table_survey_question 	= Database :: get_course_table(TABLE_SURVEY_QUESTION);
1369
+        $table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION);
1370 1370
         if ($shared) {
1371 1371
             SurveyManager::delete_shared_survey_question($survey_id, $question_id);
1372 1372
         }
@@ -1428,7 +1428,7 @@  discard block
 block discarded – undo
1428 1428
         $course_id = api_get_course_int_id();
1429 1429
         // A percentage question type has options 1 -> 100
1430 1430
         if ($form_content['type'] == 'percentage') {
1431
-            for($i = 1; $i < 101; $i++) {
1431
+            for ($i = 1; $i < 101; $i++) {
1432 1432
                 $form_content['answers'][] = $i;
1433 1433
             }
1434 1434
         }
@@ -1608,7 +1608,7 @@  discard block
 block discarded – undo
1608 1608
     {
1609 1609
         $table_survey_answer = Database :: get_course_table(TABLE_SURVEY_ANSWER);
1610 1610
 
1611
-        $user_id	= intval($user_id);
1611
+        $user_id = intval($user_id);
1612 1612
         $course_id	= intval($course_id);
1613 1613
         $survey_id	= intval($survey_id);
1614 1614
 
@@ -1636,14 +1636,14 @@  discard block
 block discarded – undo
1636 1636
     static function get_people_who_filled_survey($survey_id, $all_user_info = false, $course_id = null)
1637 1637
     {
1638 1638
         // Database table definition
1639
-        $table_survey_answer 		= Database :: get_course_table(TABLE_SURVEY_ANSWER);
1640
-        $table_user					= Database :: get_main_table(TABLE_MAIN_USER);
1639
+        $table_survey_answer = Database :: get_course_table(TABLE_SURVEY_ANSWER);
1640
+        $table_user = Database :: get_main_table(TABLE_MAIN_USER);
1641 1641
 
1642 1642
         // Variable initialisation
1643 1643
         $return = array();
1644 1644
 
1645 1645
         if (empty($course_id)) {
1646
-            $course_id  = api_get_course_int_id();
1646
+            $course_id = api_get_course_int_id();
1647 1647
         } else {
1648 1648
             $course_id = intval($course_id);
1649 1649
         }
@@ -1766,7 +1766,7 @@  discard block
 block discarded – undo
1766 1766
     static function remove_answer($user, $survey_id, $question_id, $course_id) {
1767 1767
         $course_id = intval($course_id);
1768 1768
         // table definition
1769
-        $table_survey_answer 		= Database :: get_course_table(TABLE_SURVEY_ANSWER);
1769
+        $table_survey_answer = Database :: get_course_table(TABLE_SURVEY_ANSWER);
1770 1770
         $sql = "DELETE FROM $table_survey_answer
1771 1771
 				WHERE
1772 1772
 				    c_id = $course_id AND
@@ -1939,16 +1939,16 @@  discard block
 block discarded – undo
1939 1939
      */
1940 1940
     function delete_user_report($survey_id, $user_id)
1941 1941
     {
1942
-        $table_survey_answer 		= Database :: get_course_table(TABLE_SURVEY_ANSWER);
1943
-        $table_survey_invitation 	= Database :: get_course_table(TABLE_SURVEY_INVITATION);
1944
-        $table_survey 				= Database :: get_course_table(TABLE_SURVEY);
1942
+        $table_survey_answer = Database :: get_course_table(TABLE_SURVEY_ANSWER);
1943
+        $table_survey_invitation = Database :: get_course_table(TABLE_SURVEY_INVITATION);
1944
+        $table_survey = Database :: get_course_table(TABLE_SURVEY);
1945 1945
 
1946 1946
         $course_id = api_get_course_int_id();
1947 1947
 
1948 1948
         if (!empty($survey_id) && !empty($user_id)) {
1949 1949
             // delete data from survey_answer by user_id and survey_id
1950 1950
             $sql = "DELETE FROM $table_survey_answer
1951
-			        WHERE c_id = $course_id AND survey_id = '".(int)$survey_id."' AND user = '".(int)$user_id."'";
1951
+			        WHERE c_id = $course_id AND survey_id = '".(int) $survey_id."' AND user = '".(int) $user_id."'";
1952 1952
             Database::query($sql);
1953 1953
             // update field answered from survey_invitation by user_id and survey_id
1954 1954
             $sql = "UPDATE $table_survey_invitation SET answered = '0'
@@ -1958,9 +1958,9 @@  discard block
 block discarded – undo
1958 1958
                             SELECT code FROM $table_survey
1959 1959
                             WHERE
1960 1960
                                 c_id = $course_id AND
1961
-                                survey_id = '".(int)$survey_id."'
1961
+                                survey_id = '".(int) $survey_id."'
1962 1962
                         ) AND
1963
-			            user = '".(int)$user_id."'";
1963
+			            user = '".(int) $user_id."'";
1964 1964
             $result = Database::query($sql);
1965 1965
         }
1966 1966
 
@@ -1990,19 +1990,19 @@  discard block
 block discarded – undo
1990 1990
         // Actions bar
1991 1991
         echo '<div class="actions">';
1992 1992
         echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?survey_id='.Security::remove_XSS($_GET['survey_id']).'">'.
1993
-            Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('ReportingOverview'),'',ICON_SIZE_MEDIUM).'</a>';
1993
+            Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('ReportingOverview'), '', ICON_SIZE_MEDIUM).'</a>';
1994 1994
         if (isset($_GET['user'])) {
1995 1995
             if (api_is_allowed_to_edit()) {
1996 1996
                 // The delete link
1997 1997
                 echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action=deleteuserreport&survey_id='.Security::remove_XSS($_GET['survey_id']).'&user='.Security::remove_XSS($_GET['user']).'" >'.
1998
-                    Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_MEDIUM).'</a>';
1998
+                    Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_MEDIUM).'</a>';
1999 1999
             }
2000 2000
 
2001 2001
             // Export the user report
2002 2002
             echo '<a href="javascript: void(0);" onclick="document.form1a.submit();">'.
2003
-                Display::return_icon('export_csv.png', get_lang('ExportAsCSV'),'',ICON_SIZE_MEDIUM).'</a> ';
2003
+                Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), '', ICON_SIZE_MEDIUM).'</a> ';
2004 2004
             echo '<a href="javascript: void(0);" onclick="document.form1b.submit();">'.
2005
-                Display::return_icon('export_excel.png', get_lang('ExportAsXLS'),'',ICON_SIZE_MEDIUM).'</a> ';
2005
+                Display::return_icon('export_excel.png', get_lang('ExportAsXLS'), '', ICON_SIZE_MEDIUM).'</a> ';
2006 2006
             echo '<form id="form1a" name="form1a" method="post" action="'.api_get_self().'?action='.Security::remove_XSS($_GET['action']).'&survey_id='.Security::remove_XSS($_GET['survey_id']).'&user_id='.Security::remove_XSS($_GET['user']).'">';
2007 2007
             echo '<input type="hidden" name="export_report" value="export_report">';
2008 2008
             echo '<input type="hidden" name="export_format" value="csv">';
@@ -2035,7 +2035,7 @@  discard block
 block discarded – undo
2035 2035
                     $name = $person['invited_user'];
2036 2036
                 }
2037 2037
             } else {
2038
-                $name  = get_lang('Anonymous') . ' ' . ($key + 1);
2038
+                $name = get_lang('Anonymous').' '.($key + 1);
2039 2039
                 $id = $person;
2040 2040
             }
2041 2041
             echo '<option value="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action='.Security::remove_XSS($_GET['action']).'&survey_id='.Security::remove_XSS($_GET['survey_id']).'&user='.Security::remove_XSS($id).'" ';
@@ -2165,9 +2165,9 @@  discard block
 block discarded – undo
2165 2165
         $singlePage = isset($_GET['single_page']) ? intval($_GET['single_page']) : 0;
2166 2166
         $course_id = api_get_course_int_id();
2167 2167
         // Database table definitions
2168
-        $table_survey_question 			= Database :: get_course_table(TABLE_SURVEY_QUESTION);
2169
-        $table_survey_question_option 	= Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION);
2170
-        $table_survey_answer 			= Database :: get_course_table(TABLE_SURVEY_ANSWER);
2168
+        $table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION);
2169
+        $table_survey_question_option = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION);
2170
+        $table_survey_answer = Database :: get_course_table(TABLE_SURVEY_ANSWER);
2171 2171
 
2172 2172
         // Determining the offset of the sql statement (the n-th question of the survey)
2173 2173
         $offset = !isset($_GET['question']) ? 0 : intval($_GET['question']);
@@ -2178,7 +2178,7 @@  discard block
 block discarded – undo
2178 2178
 
2179 2179
         echo '<div class="actions">';
2180 2180
         echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?survey_id='.$surveyId.'">'.
2181
-            Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('ReportingOverview'),'',ICON_SIZE_MEDIUM).'</a>';
2181
+            Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('ReportingOverview'), '', ICON_SIZE_MEDIUM).'</a>';
2182 2182
         echo '</div>';
2183 2183
 
2184 2184
         if ($survey_data['number_of_questions'] > 0) {
@@ -2188,21 +2188,21 @@  discard block
 block discarded – undo
2188 2188
                 /* echo '<ul><li class="disabled"><a href="#">'.get_lang('Question').'</a></li>'; */
2189 2189
 
2190 2190
                 if ($currentQuestion != 0) {
2191
-                    echo '<li><a href="' . api_get_path(WEB_CODE_PATH) . 'survey/reporting.php?action=' . $action . '&' . api_get_cidreq() . '&survey_id=' . $surveyId . '&question=' . ($offset - 1) . '">' . get_lang('PreviousQuestion') . '</a></li>';
2191
+                    echo '<li><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action='.$action.'&'.api_get_cidreq().'&survey_id='.$surveyId.'&question='.($offset - 1).'">'.get_lang('PreviousQuestion').'</a></li>';
2192 2192
                 }
2193 2193
 
2194 2194
                 for ($i = 1; $i <= $survey_data['number_of_questions']; $i++) {
2195 2195
                     if ($offset != $i - 1) {
2196
-                        echo '<li><a href="' . api_get_path(WEB_CODE_PATH) . 'survey/reporting.php?action=' . $action . '&' . api_get_cidreq() . '&survey_id=' . $surveyId . '&question=' . ($i - 1) . '">' . $i . '</a></li>';
2196
+                        echo '<li><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action='.$action.'&'.api_get_cidreq().'&survey_id='.$surveyId.'&question='.($i - 1).'">'.$i.'</a></li>';
2197 2197
                     } else {
2198
-                        echo '<li class="disabled"s><a href="#">' . $i . '</a></li>';
2198
+                        echo '<li class="disabled"s><a href="#">'.$i.'</a></li>';
2199 2199
                     }
2200 2200
                     /*if ($i < $survey_data['number_of_questions']) {
2201 2201
                         echo ' | ';
2202 2202
                     }*/
2203 2203
                 }
2204 2204
                 if ($currentQuestion < ($survey_data['number_of_questions'] - 1)) {
2205
-                    echo '<li><a href="' . api_get_path(WEB_CODE_PATH) . 'survey/reporting.php?action=' . $action . '&' . api_get_cidreq() . '&survey_id=' . $surveyId . '&question=' . ($offset + 1) . '">' . get_lang('NextQuestion') . '</li></a>';
2205
+                    echo '<li><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action='.$action.'&'.api_get_cidreq().'&survey_id='.$surveyId.'&question='.($offset + 1).'">'.get_lang('NextQuestion').'</li></a>';
2206 2206
                 }
2207 2207
                 echo '</ul>';
2208 2208
                 echo '</div>';
@@ -2254,19 +2254,19 @@  discard block
 block discarded – undo
2254 2254
                 $sql = "SELECT * FROM $table_survey_answer
2255 2255
                         WHERE
2256 2256
                             c_id = $course_id AND
2257
-                            survey_id='" . intval($_GET['survey_id']) . "' AND
2258
-                            question_id = '" . intval($question['question_id']) . "'";
2257
+                            survey_id='".intval($_GET['survey_id'])."' AND
2258
+                            question_id = '" . intval($question['question_id'])."'";
2259 2259
                 $result = Database::query($sql);
2260 2260
                 while ($row = Database::fetch_array($result)) {
2261
-                    echo $row['option_id'] . '<hr noshade="noshade" size="1" />';
2261
+                    echo $row['option_id'].'<hr noshade="noshade" size="1" />';
2262 2262
                 }
2263 2263
             } else {
2264 2264
                 // Getting the options ORDER BY sort ASC
2265 2265
                 $sql = "SELECT * FROM $table_survey_question_option
2266 2266
                         WHERE
2267 2267
                             c_id = $course_id AND
2268
-                            survey_id='" . intval($_GET['survey_id']) . "'
2269
-                            AND question_id = '" . intval($question['question_id']) . "'
2268
+                            survey_id='".intval($_GET['survey_id'])."'
2269
+                            AND question_id = '" . intval($question['question_id'])."'
2270 2270
                         ORDER BY sort ASC";
2271 2271
                 $result = Database::query($sql);
2272 2272
                 while ($row = Database::fetch_array($result)) {
@@ -2276,8 +2276,8 @@  discard block
 block discarded – undo
2276 2276
                 $sql = "SELECT *, count(answer_id) as total FROM $table_survey_answer
2277 2277
                         WHERE
2278 2278
                             c_id = $course_id AND
2279
-                            survey_id='" . intval($_GET['survey_id']) . "'
2280
-                            AND question_id = '" . intval($question['question_id']) . "'
2279
+                            survey_id='".intval($_GET['survey_id'])."'
2280
+                            AND question_id = '" . intval($question['question_id'])."'
2281 2281
                         GROUP BY option_id, value";
2282 2282
                 $result = Database::query($sql);
2283 2283
                 $number_of_answers = array();
@@ -2294,8 +2294,7 @@  discard block
 block discarded – undo
2294 2294
                     $optionText = strip_tags($option['option_text']);
2295 2295
                     $optionText = html_entity_decode($optionText);
2296 2296
                     $votes = isset($data[$option['question_option_id']]['total']) ?
2297
-                        $data[$option['question_option_id']]['total'] :
2298
-                        '0';
2297
+                        $data[$option['question_option_id']]['total'] : '0';
2299 2298
                     array_push($chartData, array('option' => $optionText, 'votes' => $votes));
2300 2299
                 }
2301 2300
                 $chartContainerId = 'chartContainer'.$question['question_id'];
@@ -2307,9 +2306,9 @@  discard block
 block discarded – undo
2307 2306
                 echo '<table class="display-survey table">';
2308 2307
                 echo '	<tr>';
2309 2308
                 echo '		<th>&nbsp;</th>';
2310
-                echo '		<th>' . get_lang('AbsoluteTotal') . '</th>';
2311
-                echo '		<th>' . get_lang('Percentage') . '</th>';
2312
-                echo '		<th>' . get_lang('VisualRepresentation') . '</th>';
2309
+                echo '		<th>'.get_lang('AbsoluteTotal').'</th>';
2310
+                echo '		<th>'.get_lang('Percentage').'</th>';
2311
+                echo '		<th>'.get_lang('VisualRepresentation').'</th>';
2313 2312
                 echo '	<tr>';
2314 2313
 
2315 2314
                 // Displaying the table: the content
@@ -2328,22 +2327,22 @@  discard block
 block discarded – undo
2328 2327
                             $answers_number = $absolute_number / $number_of_answers[$option['question_id']] * 100;
2329 2328
                         }
2330 2329
                         echo '	<tr>';
2331
-                        echo '		<td class="center">' . $value['option_text'] . '</td>';
2330
+                        echo '		<td class="center">'.$value['option_text'].'</td>';
2332 2331
                         echo '		<td class="center">';
2333 2332
                         if ($absolute_number != 0) {
2334
-                            echo '<a href="' . api_get_path(WEB_CODE_PATH) . 'survey/reporting.php?action=' . $action . '&survey_id=' . $surveyId . '&question=' . $offset . '&viewoption=' . $value['question_option_id'] . '">' . $absolute_number . '</a>';
2333
+                            echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action='.$action.'&survey_id='.$surveyId.'&question='.$offset.'&viewoption='.$value['question_option_id'].'">'.$absolute_number.'</a>';
2335 2334
                         } else {
2336 2335
                             echo '0';
2337 2336
                         }
2338 2337
 
2339 2338
                         echo '      </td>';
2340
-                        echo '		<td class="center">' . round($answers_number, 2) . ' %</td>';
2339
+                        echo '		<td class="center">'.round($answers_number, 2).' %</td>';
2341 2340
                         echo '		<td class="center">';
2342 2341
                         $size = $answers_number * 2;
2343 2342
                         if ($size > 0) {
2344
-                            echo '<div style="border:1px solid #264269; background-color:#aecaf4; height:10px; width:' . $size . 'px">&nbsp;</div>';
2343
+                            echo '<div style="border:1px solid #264269; background-color:#aecaf4; height:10px; width:'.$size.'px">&nbsp;</div>';
2345 2344
                         } else {
2346
-                            echo '<div style="text-align: left;">' . get_lang("NoDataAvailable") . '</div>';
2345
+                            echo '<div style="text-align: left;">'.get_lang("NoDataAvailable").'</div>';
2347 2346
                         }
2348 2347
                         echo ' </td>';
2349 2348
                         echo ' </tr>';
@@ -2351,8 +2350,8 @@  discard block
 block discarded – undo
2351 2350
                 }
2352 2351
                 // displaying the table: footer (totals)
2353 2352
                 echo '	<tr>';
2354
-                echo '		<td class="total"><b>' . get_lang('Total') . '</b></td>';
2355
-                echo '		<td class="total"><b>' . ($number_of_answers[$option['question_id']] == 0 ? '0' : $number_of_answers[$option['question_id']]) . '</b></td>';
2353
+                echo '		<td class="total"><b>'.get_lang('Total').'</b></td>';
2354
+                echo '		<td class="total"><b>'.($number_of_answers[$option['question_id']] == 0 ? '0' : $number_of_answers[$option['question_id']]).'</b></td>';
2356 2355
                 echo '		<td class="total">&nbsp;</td>';
2357 2356
                 echo '		<td class="total">&nbsp;</td>';
2358 2357
                 echo '	</tr>';
@@ -2396,8 +2395,8 @@  discard block
 block discarded – undo
2396 2395
     public static function display_question_report_score($survey_data, $question, $offset)
2397 2396
     {
2398 2397
         // Database table definitions
2399
-        $table_survey_question_option 	= Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION);
2400
-        $table_survey_answer 			= Database :: get_course_table(TABLE_SURVEY_ANSWER);
2398
+        $table_survey_question_option = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION);
2399
+        $table_survey_answer = Database :: get_course_table(TABLE_SURVEY_ANSWER);
2401 2400
 
2402 2401
         $course_id = api_get_course_int_id();
2403 2402
 
@@ -2467,9 +2466,9 @@  discard block
 block discarded – undo
2467 2466
                 echo '		<td>'.$value['option_text'].'</td>';
2468 2467
                 echo '		<td>'.$i.'</td>';
2469 2468
                 echo '		<td><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action='.$action.'&survey_id='.Security::remove_XSS($_GET['survey_id']).'&question='.Security::remove_XSS($offset).'&viewoption='.$value['question_option_id'].'&value='.$i.'">'.$absolute_number.'</a></td>';
2470
-                echo '		<td>'.round($absolute_number/$number_of_answers*100, 2).' %</td>';
2469
+                echo '		<td>'.round($absolute_number / $number_of_answers * 100, 2).' %</td>';
2471 2470
                 echo '		<td>';
2472
-                $size = ($absolute_number/$number_of_answers*100*2);
2471
+                $size = ($absolute_number / $number_of_answers * 100 * 2);
2473 2472
                 if ($size > 0) {
2474 2473
                     echo '			<div style="border:1px solid #264269; background-color:#aecaf4; height:10px; width:'.$size.'px">&nbsp;</div>';
2475 2474
                 }
@@ -2506,11 +2505,11 @@  discard block
 block discarded – undo
2506 2505
         // Actions bar
2507 2506
         echo '<div class="actions">';
2508 2507
         echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?survey_id='.Security::remove_XSS($_GET['survey_id']).'">
2509
-		'.Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('ReportingOverview'),'',ICON_SIZE_MEDIUM).'</a>';
2508
+		'.Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('ReportingOverview'), '', ICON_SIZE_MEDIUM).'</a>';
2510 2509
         echo '<a class="survey_export_link" href="javascript: void(0);" onclick="document.form1a.submit();">
2511
-		'.Display::return_icon('export_csv.png',get_lang('ExportAsCSV'),'',ICON_SIZE_MEDIUM).'</a>';
2510
+		'.Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), '', ICON_SIZE_MEDIUM).'</a>';
2512 2511
         echo '<a class="survey_export_link" href="javascript: void(0);" onclick="document.form1b.submit();">
2513
-		'.Display::return_icon('export_excel.png',get_lang('ExportAsXLS'),'',ICON_SIZE_MEDIUM).'</a>';
2512
+		'.Display::return_icon('export_excel.png', get_lang('ExportAsXLS'), '', ICON_SIZE_MEDIUM).'</a>';
2514 2513
         echo '</div>';
2515 2514
 
2516 2515
         // The form
@@ -2543,8 +2542,8 @@  discard block
 block discarded – undo
2543 2542
             // Show user fields section with a big th colspan that spans over all fields
2544 2543
             $extra_user_fields = UserManager::get_extra_fields(0, 0, 5, 'ASC', false, true);
2545 2544
             $num = count($extra_user_fields);
2546
-            if ($num > 0 ) {
2547
-                echo '<th '.($num>0?' colspan="'.$num.'"':'').'>';
2545
+            if ($num > 0) {
2546
+                echo '<th '.($num > 0 ? ' colspan="'.$num.'"' : '').'>';
2548 2547
                 echo '<label><input type="checkbox" name="fields_filter" value="1" checked="checked"/> ';
2549 2548
                 echo get_lang('UserFields');
2550 2549
                 echo '</label>';
@@ -2609,7 +2608,7 @@  discard block
 block discarded – undo
2609 2608
         if (!(isset($_POST['submit_question_filter']) && $_POST['submit_question_filter'] ||
2610 2609
                 isset($_POST['export_report']) && $_POST['export_report']) || !empty($_POST['fields_filter'])) {
2611 2610
             //show the fields names for user fields
2612
-            foreach($extra_user_fields as & $field) {
2611
+            foreach ($extra_user_fields as & $field) {
2613 2612
                 echo '<th>'.$field[3].'</th>';
2614 2613
             }
2615 2614
         }
@@ -2629,7 +2628,7 @@  discard block
 block discarded – undo
2629 2628
 				ORDER BY sq.sort ASC, sqo.sort ASC";
2630 2629
         $result = Database::query($sql);
2631 2630
 
2632
-        $display_percentage_header = 1;	// in order to display only once the cell option (and not 100 times)
2631
+        $display_percentage_header = 1; // in order to display only once the cell option (and not 100 times)
2633 2632
         while ($row = Database::fetch_array($result)) {
2634 2633
             // We show the options if
2635 2634
             // 1. there is no question filter and the export button has not been clicked
@@ -2689,7 +2688,7 @@  discard block
 block discarded – undo
2689 2688
                     $questions,
2690 2689
                     $display_extra_user_fields
2691 2690
                 );
2692
-                $answers_of_user=array();
2691
+                $answers_of_user = array();
2693 2692
             }
2694 2693
             if (isset($questions[$row['question_id']]) && $questions[$row['question_id']]['type'] != 'open') {
2695 2694
                 $answers_of_user[$row['question_id']][$row['option_id']] = $row;
@@ -2751,7 +2750,7 @@  discard block
 block discarded – undo
2751 2750
                 echo '<th>'.$user.'</th>'; // the user column
2752 2751
             }
2753 2752
         } else {
2754
-            echo '<th>' . get_lang('Anonymous') . ' ' . $user . '</th>';
2753
+            echo '<th>'.get_lang('Anonymous').' '.$user.'</th>';
2755 2754
         }
2756 2755
 
2757 2756
         if ($display_extra_user_fields) {
@@ -2847,10 +2846,10 @@  discard block
 block discarded – undo
2847 2846
                 // We do not show comment and pagebreak question types
2848 2847
                 if ($row['type'] != 'comment' && $row['type'] != 'pagebreak') {
2849 2848
                     if ($row['number_of_options'] == 0 && $row['type'] == 'open') {
2850
-                        $return .= str_replace("\r\n",'  ', api_html_entity_decode(strip_tags($row['survey_question']), ENT_QUOTES)).';';
2849
+                        $return .= str_replace("\r\n", '  ', api_html_entity_decode(strip_tags($row['survey_question']), ENT_QUOTES)).';';
2851 2850
                     } else {
2852 2851
                         for ($ii = 0; $ii < $row['number_of_options']; $ii++) {
2853
-                            $return .= str_replace("\r\n",'  ', api_html_entity_decode(strip_tags($row['survey_question']), ENT_QUOTES)).';';
2852
+                            $return .= str_replace("\r\n", '  ', api_html_entity_decode(strip_tags($row['survey_question']), ENT_QUOTES)).';';
2854 2853
                         }
2855 2854
                     }
2856 2855
                 }
@@ -2864,7 +2863,7 @@  discard block
 block discarded – undo
2864 2863
         // Show the fields names for user fields
2865 2864
         if (!empty($extra_user_fields)) {
2866 2865
             foreach ($extra_user_fields as & $field) {
2867
-                $return .= '"'.str_replace("\r\n",'  ',api_html_entity_decode(strip_tags($field[3]), ENT_QUOTES)).'";';
2866
+                $return .= '"'.str_replace("\r\n", '  ', api_html_entity_decode(strip_tags($field[3]), ENT_QUOTES)).'";';
2868 2867
             }
2869 2868
         }
2870 2869
 
@@ -2899,7 +2898,7 @@  discard block
 block discarded – undo
2899 2898
             ) {
2900 2899
                 // We do not show comment and pagebreak question types
2901 2900
                 if ($row['type'] != 'comment' && $row['type'] != 'pagebreak') {
2902
-                    $row['option_text'] = str_replace(array("\r","\n"),array('',''),$row['option_text']);
2901
+                    $row['option_text'] = str_replace(array("\r", "\n"), array('', ''), $row['option_text']);
2903 2902
                     $return .= api_html_entity_decode(strip_tags($row['option_text']), ENT_QUOTES).';';
2904 2903
                     $possible_answers[$row['question_id']][$row['question_option_id']] = $row['question_option_id'];
2905 2904
                     $possible_answers_type[$row['question_id']] = $row['type'];
@@ -2929,9 +2928,9 @@  discard block
 block discarded – undo
2929 2928
                     $old_user,
2930 2929
                     true
2931 2930
                 );
2932
-                $answers_of_user=array();
2931
+                $answers_of_user = array();
2933 2932
             }
2934
-            if($possible_answers_type[$row['question_id']] == 'open') {
2933
+            if ($possible_answers_type[$row['question_id']] == 'open') {
2935 2934
                 $temp_id = 'open'.$open_question_iterator;
2936 2935
                 $answers_of_user[$row['question_id']][$temp_id] = $row;
2937 2936
                 $open_question_iterator++;
@@ -2990,7 +2989,7 @@  discard block
 block discarded – undo
2990 2989
 
2991 2990
         if ($display_extra_user_fields) {
2992 2991
             // Show user fields data, if any, for this user
2993
-            $user_fields_values = UserManager::get_extra_user_data($user,false,false, false, true);
2992
+            $user_fields_values = UserManager::get_extra_user_data($user, false, false, false, true);
2994 2993
             foreach ($user_fields_values as & $value) {
2995 2994
                 $return .= '"'.str_replace('"', '""', api_html_entity_decode(strip_tags($value), ENT_QUOTES)).'";';
2996 2995
             }
@@ -3089,9 +3088,9 @@  discard block
 block discarded – undo
3089 3088
                                 ENT_QUOTES
3090 3089
                             )
3091 3090
                         );
3092
-                        $column ++;
3091
+                        $column++;
3093 3092
                     } else {
3094
-                        for ($ii = 0; $ii < $row['number_of_options']; $ii ++) {
3093
+                        for ($ii = 0; $ii < $row['number_of_options']; $ii++) {
3095 3094
                             $worksheet->SetCellValueByColumnAndRow(
3096 3095
                                 $line,
3097 3096
                                 $column,
@@ -3100,7 +3099,7 @@  discard block
 block discarded – undo
3100 3099
                                     ENT_QUOTES
3101 3100
                                 )
3102 3101
                             );
3103
-                            $column ++;
3102
+                            $column++;
3104 3103
                         }
3105 3104
                     }
3106 3105
                 }
@@ -3160,7 +3159,7 @@  discard block
 block discarded – undo
3160 3159
         }
3161 3160
 
3162 3161
         // Getting all the answers of the users
3163
-        $line ++;
3162
+        $line++;
3164 3163
         $column = 0;
3165 3164
         $old_user = '';
3166 3165
         $answers_of_user = array();
@@ -3169,7 +3168,7 @@  discard block
 block discarded – undo
3169 3168
         if ($user_id != 0) {
3170 3169
             $sql .= "AND user='".intval($user_id)."' ";
3171 3170
         }
3172
-        $sql .=	"ORDER BY user ASC";
3171
+        $sql .= "ORDER BY user ASC";
3173 3172
 
3174 3173
         $open_question_iterator = 1;
3175 3174
         $result = Database::query($sql);
@@ -3244,7 +3243,7 @@  discard block
 block discarded – undo
3244 3243
                         FROM '.Database::get_main_table(TABLE_MAIN_USER).'
3245 3244
                         WHERE user_id='.intval($user);
3246 3245
                 $rs = Database::query($sql);
3247
-                if($row = Database::fetch_array($rs)) {
3246
+                if ($row = Database::fetch_array($rs)) {
3248 3247
                     $user_displayed = api_get_person_name($row['firstname'], $row['lastname']);
3249 3248
                 } else {
3250 3249
                     $user_displayed = '-';
@@ -3259,8 +3258,8 @@  discard block
 block discarded – undo
3259 3258
 
3260 3259
         if ($display_extra_user_fields) {
3261 3260
             //show user fields data, if any, for this user
3262
-            $user_fields_values = UserManager::get_extra_user_data(intval($user),false,false, false, true);
3263
-            foreach($user_fields_values as $value) {
3261
+            $user_fields_values = UserManager::get_extra_user_data(intval($user), false, false, false, true);
3262
+            foreach ($user_fields_values as $value) {
3264 3263
                 $return[] = api_html_entity_decode(strip_tags($value), ENT_QUOTES);
3265 3264
             }
3266 3265
         }
@@ -3269,7 +3268,7 @@  discard block
 block discarded – undo
3269 3268
             foreach ($possible_options as $question_id => & $possible_option) {
3270 3269
                 if (is_array($possible_option) && count($possible_option) > 0) {
3271 3270
                     foreach ($possible_option as $option_id => & $value) {
3272
-                        $my_answers_of_user = ($answers_of_user[$question_id]==null) ? array() : $answers_of_user[$question_id];
3271
+                        $my_answers_of_user = ($answers_of_user[$question_id] == null) ? array() : $answers_of_user[$question_id];
3273 3272
                         $key = array_keys($my_answers_of_user);
3274 3273
                         if (substr($key[0], 0, 4) == 'open') {
3275 3274
                             $return[] = api_html_entity_decode(strip_tags($answers_of_user[$question_id][$key[0]]['option_id']), ENT_QUOTES);
@@ -3319,7 +3318,7 @@  discard block
 block discarded – undo
3319 3318
         // Actions bar
3320 3319
         echo '<div class="actions">';
3321 3320
         echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?survey_id='.intval($_GET['survey_id']).'">'.
3322
-                Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('ReportingOverview'),'',ICON_SIZE_MEDIUM).'</a>';
3321
+                Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('ReportingOverview'), '', ICON_SIZE_MEDIUM).'</a>';
3323 3322
         echo '</div>';
3324 3323
 
3325 3324
         // Displaying an information message that only the questions with predefined answers can be used in a comparative report
@@ -3384,25 +3383,25 @@  discard block
 block discarded – undo
3384 3383
 
3385 3384
             $xOptions = array();
3386 3385
             // The header
3387
-            $tableHtml .=  '	<tr>';
3386
+            $tableHtml .= '	<tr>';
3388 3387
             for ($ii = 0; $ii <= count($question_x['answers']); $ii++) {
3389 3388
                 if ($ii == 0) {
3390
-                    $tableHtml .=  '		<th>&nbsp;</th>';
3389
+                    $tableHtml .= '		<th>&nbsp;</th>';
3391 3390
                 } else {
3392 3391
                     if ($question_x['type'] == 'score') {
3393 3392
                         for ($x = 1; $x <= $question_x['maximum_score']; $x++) {
3394
-                            $tableHtml .= '		<th>'.$question_x['answers'][($ii-1)].'<br />'.$x.'</th>';
3393
+                            $tableHtml .= '		<th>'.$question_x['answers'][($ii - 1)].'<br />'.$x.'</th>';
3395 3394
                         }
3396 3395
                         $x = '';
3397 3396
                     } else {
3398
-                        $tableHtml .= '		<th>'.$question_x['answers'][($ii-1)].'</th>';
3397
+                        $tableHtml .= '		<th>'.$question_x['answers'][($ii - 1)].'</th>';
3399 3398
                     }
3400
-                    $optionText = strip_tags($question_x['answers'][$ii-1]);
3399
+                    $optionText = strip_tags($question_x['answers'][$ii - 1]);
3401 3400
                     $optionText = html_entity_decode($optionText);
3402 3401
                     array_push($xOptions, trim($optionText));
3403 3402
                 }
3404 3403
             }
3405
-            $tableHtml .=  '	</tr>';
3404
+            $tableHtml .= '	</tr>';
3406 3405
             $chartData = array();
3407 3406
 
3408 3407
             // The main part
@@ -3412,15 +3411,15 @@  discard block
 block discarded – undo
3412 3411
                 // The Y axis is a scoring question type so we have more rows than the options (actually options * maximum score)
3413 3412
                 if ($question_y['type'] == 'score') {
3414 3413
                     for ($y = 1; $y <= $question_y['maximum_score']; $y++) {
3415
-                        $tableHtml .=  '	<tr>';
3414
+                        $tableHtml .= '	<tr>';
3416 3415
                         for ($ii = 0; $ii <= count($question_x['answers']); $ii++) {
3417 3416
                             if ($question_x['type'] == 'score') {
3418 3417
                                 for ($x = 1; $x <= $question_x['maximum_score']; $x++) {
3419 3418
                                     if ($ii == 0) {
3420
-                                        $tableHtml .=  ' <th>'.$question_y['answers'][($ij)].' '.$y.'</th>';
3419
+                                        $tableHtml .= ' <th>'.$question_y['answers'][($ij)].' '.$y.'</th>';
3421 3420
                                         break;
3422 3421
                                     } else {
3423
-                                        $tableHtml .=  ' <td align="center">';
3422
+                                        $tableHtml .= ' <td align="center">';
3424 3423
                                         $votes = SurveyUtil::comparative_check(
3425 3424
                                             $answers_x,
3426 3425
                                             $answers_y,
@@ -3429,23 +3428,23 @@  discard block
 block discarded – undo
3429 3428
                                             $x,
3430 3429
                                             $y
3431 3430
                                         );
3432
-                                        $tableHtml .=  $votes;
3431
+                                        $tableHtml .= $votes;
3433 3432
                                         array_push(
3434 3433
                                             $chartData,
3435 3434
                                             array(
3436
-                                                'serie' => array($currentYQuestion, $xOptions[$ii-1]),
3435
+                                                'serie' => array($currentYQuestion, $xOptions[$ii - 1]),
3437 3436
                                                 'option' => $x,
3438 3437
                                                 'votes' => $votes
3439 3438
                                             )
3440 3439
                                         );
3441
-                                        $tableHtml .=  '</td>';
3440
+                                        $tableHtml .= '</td>';
3442 3441
                                     }
3443 3442
                                 }
3444 3443
                             } else {
3445 3444
                                 if ($ii == 0) {
3446
-                                    $tableHtml .=  '<th>'.$question_y['answers'][$ij].' '.$y.'</th>';
3445
+                                    $tableHtml .= '<th>'.$question_y['answers'][$ij].' '.$y.'</th>';
3447 3446
                                 } else {
3448
-                                    $tableHtml .=  '<td align="center">';
3447
+                                    $tableHtml .= '<td align="center">';
3449 3448
                                     $votes = SurveyUtil::comparative_check(
3450 3449
                                         $answers_x,
3451 3450
                                         $answers_y,
@@ -3458,65 +3457,65 @@  discard block
 block discarded – undo
3458 3457
                                     array_push(
3459 3458
                                         $chartData,
3460 3459
                                         array(
3461
-                                            'serie' => array($currentYQuestion, $xOptions[$ii-1]),
3460
+                                            'serie' => array($currentYQuestion, $xOptions[$ii - 1]),
3462 3461
                                             'option' => $y,
3463 3462
                                             'votes' => $votes
3464 3463
                                         )
3465 3464
                                     );
3466
-                                    $tableHtml .=  '</td>';
3465
+                                    $tableHtml .= '</td>';
3467 3466
                                 }
3468 3467
                             }
3469 3468
                         }
3470
-                        $tableHtml .=  '	</tr>';
3469
+                        $tableHtml .= '	</tr>';
3471 3470
                     }
3472 3471
                 }
3473 3472
                 // The Y axis is NOT a score question type so the number of rows = the number of options
3474 3473
                 else {
3475
-                    $tableHtml .=  '	<tr>';
3474
+                    $tableHtml .= '	<tr>';
3476 3475
                     for ($ii = 0; $ii <= count($question_x['answers']); $ii++) {
3477 3476
                         if ($question_x['type'] == 'score') {
3478 3477
                             for ($x = 1; $x <= $question_x['maximum_score']; $x++) {
3479 3478
                                 if ($ii == 0) {
3480
-                                    $tableHtml .=  '		<th>'.$question_y['answers'][$ij].'</th>';
3479
+                                    $tableHtml .= '		<th>'.$question_y['answers'][$ij].'</th>';
3481 3480
                                     break;
3482 3481
                                 } else {
3483
-                                    $tableHtml .=  '		<td align="center">';
3484
-                                    $votes =  SurveyUtil::comparative_check($answers_x, $answers_y, $question_x['answersid'][($ii-1)], $question_y['answersid'][($ij)], $x, 0);
3482
+                                    $tableHtml .= '		<td align="center">';
3483
+                                    $votes = SurveyUtil::comparative_check($answers_x, $answers_y, $question_x['answersid'][($ii - 1)], $question_y['answersid'][($ij)], $x, 0);
3485 3484
                                     $tableHtml .= $votes;
3486 3485
                                     array_push(
3487 3486
                                         $chartData,
3488 3487
                                         array(
3489
-                                            'serie' => array($currentYQuestion, $xOptions[$ii-1]),
3488
+                                            'serie' => array($currentYQuestion, $xOptions[$ii - 1]),
3490 3489
                                             'option' => $x,
3491 3490
                                             'votes' => $votes
3492 3491
                                         )
3493 3492
                                     );
3494
-                                    $tableHtml .=  '</td>';
3493
+                                    $tableHtml .= '</td>';
3495 3494
                                 }
3496 3495
                             }
3497 3496
                         } else {
3498 3497
                             if ($ii == 0) {
3499
-                                $tableHtml .=  '		<th>'.$question_y['answers'][($ij)].'</th>';
3498
+                                $tableHtml .= '		<th>'.$question_y['answers'][($ij)].'</th>';
3500 3499
                             } else {
3501
-                                $tableHtml .=  '		<td align="center">';
3502
-                                $votes = SurveyUtil::comparative_check($answers_x, $answers_y, $question_x['answersid'][($ii-1)], $question_y['answersid'][($ij)]);
3500
+                                $tableHtml .= '		<td align="center">';
3501
+                                $votes = SurveyUtil::comparative_check($answers_x, $answers_y, $question_x['answersid'][($ii - 1)], $question_y['answersid'][($ij)]);
3503 3502
                                 $tableHtml .= $votes;
3504 3503
                                 array_push(
3505 3504
                                     $chartData,
3506 3505
                                     array(
3507
-                                        'serie' => $xOptions[$ii-1],
3506
+                                        'serie' => $xOptions[$ii - 1],
3508 3507
                                         'option' => $currentYQuestion,
3509 3508
                                         'votes' => $votes
3510 3509
                                     )
3511 3510
                                 );
3512
-                                $tableHtml .=  '</td>';
3511
+                                $tableHtml .= '</td>';
3513 3512
                             }
3514 3513
                         }
3515 3514
                     }
3516
-                    $tableHtml .=  '	</tr>';
3515
+                    $tableHtml .= '	</tr>';
3517 3516
                 }
3518 3517
             }
3519
-            $tableHtml .=  '</table>';
3518
+            $tableHtml .= '</table>';
3520 3519
             echo '<div id="chartContainer" class="col-md-12">';
3521 3520
             echo self::drawChart($chartData, true);
3522 3521
             echo '</div>';
@@ -3656,7 +3655,7 @@  discard block
 block discarded – undo
3656 3655
                     survey_id='".intval($_GET['survey_id'])."' AND
3657 3656
                     session_id='".api_get_session_id()."' ";
3658 3657
         $res = Database::query($sql);
3659
-        $row = Database::fetch_array($res,'ASSOC');
3658
+        $row = Database::fetch_array($res, 'ASSOC');
3660 3659
 
3661 3660
         return $row['total'];
3662 3661
     }
@@ -3731,7 +3730,7 @@  discard block
 block discarded – undo
3731 3730
             $exclude_users = SurveyManager::get_people_who_filled_survey($_GET['survey_id']);
3732 3731
         }
3733 3732
 
3734
-        $counter = 0;  // Nr of invitations "sent" (if sendmail option)
3733
+        $counter = 0; // Nr of invitations "sent" (if sendmail option)
3735 3734
         $course_id = api_get_course_int_id();
3736 3735
         $session_id = api_get_session_id();
3737 3736
 
@@ -3887,7 +3886,7 @@  discard block
 block discarded – undo
3887 3886
         $text_link = '<a href="'.$survey_link.'">'.get_lang('ClickHereToAnswerTheSurvey')."</a><br />\r\n<br />\r\n".get_lang('OrCopyPasteTheFollowingUrl')." <br />\r\n ".$survey_link;
3888 3887
 
3889 3888
         $replace_count = 0;
3890
-        $full_invitation_text = api_str_ireplace('**link**', $text_link ,$invitation_text, $replace_count);
3889
+        $full_invitation_text = api_str_ireplace('**link**', $text_link, $invitation_text, $replace_count);
3891 3890
         if ($replace_count < 1) {
3892 3891
             $full_invitation_text = $full_invitation_text."<br />\r\n<br />\r\n".$text_link;
3893 3892
         }
@@ -3959,8 +3958,8 @@  discard block
 block discarded – undo
3959 3958
         $course_id = api_get_course_int_id();
3960 3959
 
3961 3960
         // Database table definition
3962
-        $table_survey_invitation 	= Database :: get_course_table(TABLE_SURVEY_INVITATION);
3963
-        $table_survey 				= Database :: get_course_table(TABLE_SURVEY);
3961
+        $table_survey_invitation = Database :: get_course_table(TABLE_SURVEY_INVITATION);
3962
+        $table_survey = Database :: get_course_table(TABLE_SURVEY);
3964 3963
 
3965 3964
         // Counting the number of people that are invited
3966 3965
         $sql = "SELECT count(user) as total
@@ -4074,7 +4073,7 @@  discard block
 block discarded – undo
4074 4073
     {
4075 4074
         $course_id = api_get_course_int_id();
4076 4075
         // Database table definition
4077
-        $table_survey_invitation 	= Database :: get_course_table(TABLE_SURVEY_INVITATION);
4076
+        $table_survey_invitation = Database :: get_course_table(TABLE_SURVEY_INVITATION);
4078 4077
 
4079 4078
         $sql = "SELECT * FROM $table_survey_invitation
4080 4079
 		        WHERE
@@ -4210,7 +4209,7 @@  discard block
 block discarded – undo
4210 4209
     function display_survey_list_for_coach()
4211 4210
     {
4212 4211
         $parameters = array();
4213
-        $parameters['cidReq']=api_get_course_id();
4212
+        $parameters['cidReq'] = api_get_course_id();
4214 4213
         if (isset($_GET['do_search'])) {
4215 4214
             $message = get_lang('DisplaySearchResults').'<br />';
4216 4215
             $message .= '<a href="'.api_get_self().'?'.api_get_cidreq().'">'.get_lang('DisplayAll').'</a>';
@@ -4254,17 +4253,17 @@  discard block
 block discarded – undo
4254 4253
 
4255 4254
         if ($drh) {
4256 4255
             return '<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?'.api_get_cidreq().'&survey_id='.$survey_id.'">'.
4257
-            Display::return_icon('stats.png', get_lang('Reporting'),'',ICON_SIZE_SMALL).'</a>';
4256
+            Display::return_icon('stats.png', get_lang('Reporting'), '', ICON_SIZE_SMALL).'</a>';
4258 4257
         }
4259 4258
 
4260 4259
         // Coach can see that only if the survey is in his session
4261 4260
         if (api_is_allowed_to_edit() ||
4262 4261
             api_is_element_in_the_session(TOOL_SURVEY, $survey_id)
4263 4262
         ) {
4264
-            $return .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/create_new_survey.php?'.api_get_cidreq().'&action=edit&survey_id='.$survey_id.'">'.Display::return_icon('edit.png', get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>';
4263
+            $return .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/create_new_survey.php?'.api_get_cidreq().'&action=edit&survey_id='.$survey_id.'">'.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>';
4265 4264
             if (SurveyManager::survey_generation_hash_available()) {
4266
-                $return .=  Display::url(
4267
-                    Display::return_icon('new_link.png', get_lang('GenerateSurveyAccessLink'),'',ICON_SIZE_SMALL),
4265
+                $return .= Display::url(
4266
+                    Display::return_icon('new_link.png', get_lang('GenerateSurveyAccessLink'), '', ICON_SIZE_SMALL),
4268 4267
                     api_get_path(WEB_CODE_PATH).'survey/generate_link.php?survey_id='.$survey_id.'&'.api_get_cidreq()
4269 4268
                 );
4270 4269
             }
@@ -4274,20 +4273,20 @@  discard block
 block discarded – undo
4274 4273
             );
4275 4274
 
4276 4275
             $return .= ' <a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_list.php?'.api_get_cidreq().'&action=empty&survey_id='.$survey_id.'" onclick="javascript: if(!confirm(\''.addslashes(api_htmlentities(get_lang("EmptySurvey").'?')).'\')) return false;">'.
4277
-                Display::return_icon('clean.png', get_lang('EmptySurvey'),'',ICON_SIZE_SMALL).'</a>&nbsp;';
4276
+                Display::return_icon('clean.png', get_lang('EmptySurvey'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
4278 4277
         }
4279 4278
         $return .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/preview.php?'.api_get_cidreq().'&survey_id='.$survey_id.'">'.
4280
-            Display::return_icon('preview_view.png', get_lang('Preview'),'',ICON_SIZE_SMALL).'</a>&nbsp;';
4279
+            Display::return_icon('preview_view.png', get_lang('Preview'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
4281 4280
         $return .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_invite.php?'.api_get_cidreq().'&survey_id='.$survey_id.'">'.
4282
-            Display::return_icon('mail_send.png', get_lang('Publish'),'',ICON_SIZE_SMALL).'</a>&nbsp;';
4281
+            Display::return_icon('mail_send.png', get_lang('Publish'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
4283 4282
         $return .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?'.api_get_cidreq().'&survey_id='.$survey_id.'">'.
4284
-            Display::return_icon('stats.png', get_lang('Reporting'),'',ICON_SIZE_SMALL).'</a>';
4283
+            Display::return_icon('stats.png', get_lang('Reporting'), '', ICON_SIZE_SMALL).'</a>';
4285 4284
 
4286 4285
         if (api_is_allowed_to_edit() ||
4287 4286
             api_is_element_in_the_session(TOOL_SURVEY, $survey_id)
4288 4287
         ) {
4289 4288
             $return .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_list.php?'.api_get_cidreq().'&action=delete&survey_id='.$survey_id.'" onclick="javascript: if(!confirm(\''.addslashes(api_htmlentities(get_lang("DeleteSurvey").'?', ENT_QUOTES)).'\')) return false;">'.
4290
-                Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>&nbsp;';
4289
+                Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
4291 4290
         }
4292 4291
 
4293 4292
         return $return;
@@ -4300,9 +4299,9 @@  discard block
 block discarded – undo
4300 4299
         //$return .= '<a href="survey_list.php?'.api_get_cidreq().'&action=delete&survey_id='.$survey_id.'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang("DeleteSurvey").'?', ENT_QUOTES)).'\')) return false;">'.Display::return_icon('delete.gif', get_lang('Delete')).'</a>';
4301 4300
         //$return .= '<a href="create_survey_in_another_language.php?id_survey='.$survey_id.'">'.Display::return_icon('copy.gif', get_lang('Copy')).'</a>';
4302 4301
         //$return .= '<a href="survey.php?survey_id='.$survey_id.'">'.Display::return_icon('add.gif', get_lang('Add')).'</a>';
4303
-        $return = '<a href="'.api_get_path(WEB_CODE_PATH).'survey/preview.php?'.api_get_cidreq().'&survey_id='.$survey_id.'">'.Display::return_icon('preview_view.png', get_lang('Preview'),'',ICON_SIZE_SMALL).'</a>&nbsp;';
4304
-        $return .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_invite.php?'.api_get_cidreq().'&survey_id='.$survey_id.'">'.Display::return_icon('mail_send.png', get_lang('Publish'),'',ICON_SIZE_SMALL).'</a>&nbsp;';
4305
-        $return .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_list.php?'.api_get_cidreq().'&action=empty&survey_id='.$survey_id.'" onclick="javascript: if(!confirm(\''.addslashes(api_htmlentities(get_lang("EmptySurvey").'?', ENT_QUOTES)).'\')) return false;">'.Display::return_icon('clean.png', get_lang('EmptySurvey'),'',ICON_SIZE_SMALL).'</a>&nbsp;';
4302
+        $return = '<a href="'.api_get_path(WEB_CODE_PATH).'survey/preview.php?'.api_get_cidreq().'&survey_id='.$survey_id.'">'.Display::return_icon('preview_view.png', get_lang('Preview'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
4303
+        $return .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_invite.php?'.api_get_cidreq().'&survey_id='.$survey_id.'">'.Display::return_icon('mail_send.png', get_lang('Publish'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
4304
+        $return .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_list.php?'.api_get_cidreq().'&action=empty&survey_id='.$survey_id.'" onclick="javascript: if(!confirm(\''.addslashes(api_htmlentities(get_lang("EmptySurvey").'?', ENT_QUOTES)).'\')) return false;">'.Display::return_icon('clean.png', get_lang('EmptySurvey'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
4306 4305
         //$return .= '<a href="reporting.php?'.api_get_cidreq().'&survey_id='.$survey_id.'">'.Display::return_icon('statistics.gif', get_lang('Reporting')).'</a>';
4307 4306
         return $return;
4308 4307
     }
@@ -4457,7 +4456,7 @@  discard block
 block discarded – undo
4457 4456
 
4458 4457
             // Validation when belonging to a session
4459 4458
             $session_img = api_get_session_image($survey['session_id'], $_user['status']);
4460
-            $array[2] = $survey[2] . $session_img;
4459
+            $array[2] = $survey[2].$session_img;
4461 4460
             $array[3] = $survey[3];
4462 4461
             $array[4] = $survey[4];
4463 4462
             $array[5] = $survey[5];
@@ -4491,10 +4490,10 @@  discard block
 block discarded – undo
4491 4490
         $last_version_surveys = $survey_tree->get_last_children_from_branch($survey_tree->surveylist);
4492 4491
         $list = array();
4493 4492
         foreach ($last_version_surveys as & $survey) {
4494
-            $list[]=$survey['id'];
4493
+            $list[] = $survey['id'];
4495 4494
         }
4496 4495
         if (count($list) > 0) {
4497
-            $list_condition = " AND survey.survey_id IN (".implode(',',$list).") ";
4496
+            $list_condition = " AND survey.survey_id IN (".implode(',', $list).") ";
4498 4497
         } else {
4499 4498
             $list_condition = '';
4500 4499
         }
@@ -4506,9 +4505,9 @@  discard block
 block discarded – undo
4506 4505
             $direction = 'asc';
4507 4506
         }
4508 4507
 
4509
-        $table_survey 			= Database :: get_course_table(TABLE_SURVEY);
4510
-        $table_survey_question 	= Database :: get_course_table(TABLE_SURVEY_QUESTION);
4511
-        $table_user 			= Database :: get_main_table(TABLE_MAIN_USER);
4508
+        $table_survey = Database :: get_course_table(TABLE_SURVEY);
4509
+        $table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION);
4510
+        $table_user = Database :: get_main_table(TABLE_MAIN_USER);
4512 4511
 
4513 4512
         $course_id = api_get_course_int_id();
4514 4513
 
@@ -4623,16 +4622,16 @@  discard block
 block discarded – undo
4623 4622
                     )
4624 4623
             ";
4625 4624
             $result_answer = Database::query($sql);
4626
-            $row_answer = Database::fetch_array($result_answer,'ASSOC');
4625
+            $row_answer = Database::fetch_array($result_answer, 'ASSOC');
4627 4626
             echo '<tr>';
4628 4627
             if ($row['answered'] == 0) {
4629 4628
                 echo '<td>';
4630
-                echo Display::return_icon('statistics.png', get_lang('CreateNewSurvey'),array('style'=>'inline-block'),ICON_SIZE_TINY);
4629
+                echo Display::return_icon('statistics.png', get_lang('CreateNewSurvey'), array('style'=>'inline-block'), ICON_SIZE_TINY);
4631 4630
                 echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/fillsurvey.php?course='.$_course['sysCode'].'&invitationcode='.$row['invitation_code'].'&cidReq='.$_course['sysCode'].'">'.$row['title'].'</a></td>';
4632 4631
             } else {
4633 4632
                 //echo '<td>'.$row['title'].'</td>';
4634 4633
                 echo '<td>';
4635
-                echo Display::return_icon('statistics_na.png', get_lang('CreateNewSurvey'),array('style'=>'inline-block'),ICON_SIZE_TINY);
4634
+                echo Display::return_icon('statistics_na.png', get_lang('CreateNewSurvey'), array('style'=>'inline-block'), ICON_SIZE_TINY);
4636 4635
                 echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action=questionreport&cidReq='.$_course['sysCode'].'&id_session='.$row['session_id'].'&gidReq='.'0'.'&origin='.''.'&survey_id='.$row['survey_id'].'">'.$row['title'].'</a></td>';
4637 4636
             }
4638 4637
             echo '<td class="center">';
@@ -4644,7 +4643,7 @@  discard block
 block discarded – undo
4644 4643
             } else {
4645 4644
                 $current_user_id = api_get_user_id();
4646 4645
             }
4647
-            $link_available = self::show_link_available(api_get_user_id(),$row['code'],$current_user_id);
4646
+            $link_available = self::show_link_available(api_get_user_id(), $row['code'], $current_user_id);
4648 4647
             //todo check this link
4649 4648
             if ($link_add === true && $link_available === true) {
4650 4649
                 //echo '<tr><td><a href="fillsurvey.php?user_id='.api_get_user_id().'&course='.$_course['sysCode'].'&invitationcode='.$row['invitation_code'].'&cidReq='.$_course['sysCode'].'">'.get_lang('CompleteTheSurveysQuestions').'</a></td><td></td></tr>';
@@ -4789,7 +4788,7 @@  discard block
 block discarded – undo
4789 4788
                     if ($field_details[7] == 0) {
4790 4789
                         $field_list_array['extra_'.$field_details[1]]['visibility'] = 0;
4791 4790
                     } else {
4792
-                        $field_list_array['extra_'.$field_details[1]]['visibility']=1;
4791
+                        $field_list_array['extra_'.$field_details[1]]['visibility'] = 1;
4793 4792
                     }
4794 4793
                     break;
4795 4794
                 case UserManager::USER_FIELD_TYPE_DIVIDER:
@@ -4856,7 +4855,7 @@  discard block
 block discarded – undo
4856 4855
         $htmlChart = '';
4857 4856
         if (api_browser_support("svg")) {
4858 4857
             $htmlChart .= api_get_js("d3/d3.v3.5.4.min.js");
4859
-            $htmlChart .= api_get_js("dimple.v2.1.2.min.js") . '
4858
+            $htmlChart .= api_get_js("dimple.v2.1.2.min.js").'
4860 4859
             <script type="text/javascript">
4861 4860
             var svg = dimple.newSvg("#'.$chartContainerId.'", "100%", 400);
4862 4861
             var data = [';
@@ -4865,40 +4864,40 @@  discard block
 block discarded – undo
4865 4864
             foreach ($chartData as $chartDataElement) {
4866 4865
                 $htmlChart .= '{"';
4867 4866
                 if (!$hasSerie) {
4868
-                    $htmlChart .= get_lang("Option") . '":"' . $chartDataElement['option'] . '", "';
4867
+                    $htmlChart .= get_lang("Option").'":"'.$chartDataElement['option'].'", "';
4869 4868
                     array_push($order, $chartDataElement['option']);
4870 4869
                 } else {
4871 4870
                     if (!is_array($chartDataElement['serie'])) {
4872
-                        $htmlChart .= get_lang("Option") . '":"' . $chartDataElement['serie'] . '", "' .
4873
-                            get_lang("Score") . '":"' . $chartDataElement['option'] . '", "';
4871
+                        $htmlChart .= get_lang("Option").'":"'.$chartDataElement['serie'].'", "'.
4872
+                            get_lang("Score").'":"'.$chartDataElement['option'].'", "';
4874 4873
                         array_push($serie, $chartDataElement['serie']);
4875 4874
                     } else {
4876
-                        $htmlChart .= get_lang("Serie") . '":"' . $chartDataElement['serie'][0] . '", "' .
4877
-                            get_lang("Option") . '":"' . $chartDataElement['serie'][1] . '", "' .
4878
-                            get_lang("Score") . '":"' . $chartDataElement['option'] . '", "';
4875
+                        $htmlChart .= get_lang("Serie").'":"'.$chartDataElement['serie'][0].'", "'.
4876
+                            get_lang("Option").'":"'.$chartDataElement['serie'][1].'", "'.
4877
+                            get_lang("Score").'":"'.$chartDataElement['option'].'", "';
4879 4878
                     }
4880 4879
                 }
4881
-                $htmlChart .= get_lang("Votes") . '":"' . $chartDataElement['votes'] .
4880
+                $htmlChart .= get_lang("Votes").'":"'.$chartDataElement['votes'].
4882 4881
                     '"},';
4883 4882
             }
4884 4883
             rtrim($htmlChart, ",");
4885 4884
             $htmlChart .= '];
4886 4885
                 var myChart = new dimple.chart(svg, data);
4887
-                myChart.addMeasureAxis("y", "' . get_lang("Votes") . '");';
4886
+                myChart.addMeasureAxis("y", "' . get_lang("Votes").'");';
4888 4887
             if (!$hasSerie) {
4889
-                $htmlChart .= 'var xAxisCategory = myChart.addCategoryAxis("x", "' . get_lang("Option") . '");
4890
-                    xAxisCategory.addOrderRule(' . json_encode($order) . ');
4891
-                    myChart.addSeries("' . get_lang("Option") . '", dimple.plot.bar);';
4888
+                $htmlChart .= 'var xAxisCategory = myChart.addCategoryAxis("x", "'.get_lang("Option").'");
4889
+                    xAxisCategory.addOrderRule(' . json_encode($order).');
4890
+                    myChart.addSeries("' . get_lang("Option").'", dimple.plot.bar);';
4892 4891
             } else {
4893 4892
                 if (!is_array($chartDataElement['serie'])) {
4894 4893
                     $serie = array_values(array_unique($serie));
4895
-                    $htmlChart .= 'var xAxisCategory = myChart.addCategoryAxis("x", ["' . get_lang("Option") . '","' . get_lang("Score") . '"]);
4896
-                        xAxisCategory.addOrderRule(' . json_encode($serie) . ');
4897
-                        xAxisCategory.addGroupOrderRule("' . get_lang("Score") . '");
4898
-                        myChart.addSeries("' . get_lang("Option") . '", dimple.plot.bar);';
4894
+                    $htmlChart .= 'var xAxisCategory = myChart.addCategoryAxis("x", ["'.get_lang("Option").'","'.get_lang("Score").'"]);
4895
+                        xAxisCategory.addOrderRule(' . json_encode($serie).');
4896
+                        xAxisCategory.addGroupOrderRule("' . get_lang("Score").'");
4897
+                        myChart.addSeries("' . get_lang("Option").'", dimple.plot.bar);';
4899 4898
                 } else {
4900
-                    $htmlChart .= 'myChart.addCategoryAxis("x", ["' . get_lang("Option") . '","' . get_lang("Score") . '"]);
4901
-                        myChart.addSeries("' . get_lang("Serie") . '", dimple.plot.bar);';
4899
+                    $htmlChart .= 'myChart.addCategoryAxis("x", ["'.get_lang("Option").'","'.get_lang("Score").'"]);
4900
+                        myChart.addSeries("' . get_lang("Serie").'", dimple.plot.bar);';
4902 4901
                 }
4903 4902
             }
4904 4903
             $htmlChart .= 'myChart.draw();
Please login to merge, or discard this patch.
main/survey/survey_invitation.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -21,11 +21,11 @@  discard block
 block discarded – undo
21 21
 
22 22
 // Database table definitions
23 23
 $table_survey 					= Database :: get_course_table(TABLE_SURVEY);
24
-$table_survey_question 			= Database :: get_course_table(TABLE_SURVEY_QUESTION);
25
-$table_survey_question_option 	= Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION);
24
+$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION);
25
+$table_survey_question_option = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION);
26 26
 $table_course 					= Database :: get_main_table(TABLE_MAIN_COURSE);
27
-$table_user 					= Database :: get_main_table(TABLE_MAIN_USER);
28
-$table_survey_invitation 		= Database :: get_course_table(TABLE_SURVEY_INVITATION);
27
+$table_user = Database :: get_main_table(TABLE_MAIN_USER);
28
+$table_survey_invitation = Database :: get_course_table(TABLE_SURVEY_INVITATION);
29 29
 
30 30
 $tool_name = get_lang('SurveyInvitations');
31 31
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 }
78 78
 
79 79
 if (!isset($_GET['view']) OR $_GET['view'] == 'invited') {
80
-	echo get_lang('ViewInvited'). ' | ';
80
+	echo get_lang('ViewInvited').' | ';
81 81
 } else {
82 82
 	echo '	<a href="'.api_get_self().'?survey_id='.$survey_id.'&amp;view=invited">'.get_lang('ViewInvited').'</a> |';
83 83
 }
Please login to merge, or discard this patch.
main/survey/survey.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 require_once '../inc/global.inc.php';
13 13
 
14 14
 $this_section = SECTION_COURSES;
15
-$current_course_tool  = TOOL_SURVEY;
15
+$current_course_tool = TOOL_SURVEY;
16 16
 
17 17
 api_protect_course_script(true);
18 18
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 // Getting the survey information
59 59
 if (!empty($_GET['survey_id'])) {
60 60
 	$course_code = api_get_course_id();
61
-	if ($course_code!=-1) {
61
+	if ($course_code != -1) {
62 62
 		$survey_data = SurveyManager::get_survey($survey_id);
63 63
 	} else {
64 64
 		Display :: display_header(get_lang('ToolSurvey'));
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 			Database::query('UPDATE '.$table_survey_question_group.' SET description = \''.Database::escape_string($_POST['description']).'\'
89 89
 			                 WHERE c_id = '.$course_id.' AND id = \''.Database::escape_string($_POST['group_id']).'\'');
90 90
 			$sendmsg = 'GroupUpdatedSuccessfully';
91
-		} elseif(!empty($_POST['name'])) {
91
+		} elseif (!empty($_POST['name'])) {
92 92
 			Database::query('INSERT INTO '.$table_survey_question_group.' (c_id, name,description,survey_id) values ('.$course_id.', \''.Database::escape_string($_POST['name']).'\',\''.Database::escape_string($_POST['description']).'\',\''.Database::escape_string($survey_id).'\') ');
93 93
 			$sendmsg = 'GroupCreatedSuccessfully';
94 94
 		} else {
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 
117 117
 if (isset($action)) {
118 118
 	if (($action == 'moveup' || $action == 'movedown') && isset($_GET['question_id'])) {
119
-		SurveyManager::move_survey_question($my_action_survey,$my_question_id_survey,$my_survey_id_survey);
119
+		SurveyManager::move_survey_question($my_action_survey, $my_question_id_survey, $my_survey_id_survey);
120 120
 		Display::display_confirmation_message(get_lang('SurveyQuestionMoved'));
121 121
 	}
122 122
 	if ($action == 'delete' AND is_numeric($_GET['question_id'])) {
@@ -130,12 +130,12 @@  discard block
 block discarded – undo
130 130
 SurveyUtil::check_first_last_question($_GET['survey_id']);
131 131
 
132 132
 // Action links
133
-$survey_actions = '<a href="'.api_get_path(WEB_CODE_PATH).'survey/create_new_survey.php?'.api_get_cidreq().'&amp;action=edit&amp;survey_id='.$survey_id.'">'.Display::return_icon('edit.png', get_lang('EditSurvey'),'',ICON_SIZE_MEDIUM).'</a>';
134
-$survey_actions .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_list.php?'.api_get_cidreq().'&amp;action=delete&amp;survey_id='.$survey_id.'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('DeleteSurvey').'?', ENT_QUOTES)).'\')) return false;">'.Display::return_icon('delete.png', get_lang('DeleteSurvey'),'',ICON_SIZE_MEDIUM).'</a>';
133
+$survey_actions = '<a href="'.api_get_path(WEB_CODE_PATH).'survey/create_new_survey.php?'.api_get_cidreq().'&amp;action=edit&amp;survey_id='.$survey_id.'">'.Display::return_icon('edit.png', get_lang('EditSurvey'), '', ICON_SIZE_MEDIUM).'</a>';
134
+$survey_actions .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_list.php?'.api_get_cidreq().'&amp;action=delete&amp;survey_id='.$survey_id.'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('DeleteSurvey').'?', ENT_QUOTES)).'\')) return false;">'.Display::return_icon('delete.png', get_lang('DeleteSurvey'), '', ICON_SIZE_MEDIUM).'</a>';
135 135
 //$survey_actions .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/create_survey_in_another_language.php?id_survey='.$survey_id.'">'.Display::return_icon('copy.gif', get_lang('Copy')).'</a>';
136
-$survey_actions .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/preview.php?'.api_get_cidreq().'&amp;survey_id='.$survey_id.'">'.Display::return_icon('preview_view.png', get_lang('Preview'),'',ICON_SIZE_MEDIUM).'</a>';
137
-$survey_actions .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_invite.php?'.api_get_cidreq().'&amp;survey_id='.$survey_id.'">'.Display::return_icon('mail_send.png', get_lang('Publish'),'',ICON_SIZE_MEDIUM).'</a>';
138
-$survey_actions .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?'.api_get_cidreq().'&amp;survey_id='.$survey_id.'">'.Display::return_icon('stats.png', get_lang('Reporting'),'',ICON_SIZE_MEDIUM).'</a>';
136
+$survey_actions .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/preview.php?'.api_get_cidreq().'&amp;survey_id='.$survey_id.'">'.Display::return_icon('preview_view.png', get_lang('Preview'), '', ICON_SIZE_MEDIUM).'</a>';
137
+$survey_actions .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_invite.php?'.api_get_cidreq().'&amp;survey_id='.$survey_id.'">'.Display::return_icon('mail_send.png', get_lang('Publish'), '', ICON_SIZE_MEDIUM).'</a>';
138
+$survey_actions .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?'.api_get_cidreq().'&amp;survey_id='.$survey_id.'">'.Display::return_icon('stats.png', get_lang('Reporting'), '', ICON_SIZE_MEDIUM).'</a>';
139 139
 echo '<div class="actions">'.$survey_actions.'</div>';
140 140
 
141 141
 if ($survey_data['survey_type'] == 0) {
@@ -217,24 +217,24 @@  discard block
 block discarded – undo
217 217
 	echo '	<td>'.$tool_name.'</td>';
218 218
 	echo '	<td>'.$row['number_of_options'].'</td>';
219 219
 	echo '	<td>';
220
-	echo '		<a href="'.api_get_path(WEB_CODE_PATH).'survey/question.php?'.api_get_cidreq().'&amp;action=edit&amp;type='.$row['type'].'&amp;survey_id='.$survey_id.'&amp;question_id='.$row['question_id'].'">'.Display::return_icon('edit.png', get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>';
221
-	echo '		<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?'.api_get_cidreq().'&amp;action=delete&amp;survey_id='.$survey_id.'&amp;question_id='.$row['question_id'].'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang("DeleteSurveyQuestion").'?',ENT_QUOTES,$charset)).'\')) return false;">'.Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>';
220
+	echo '		<a href="'.api_get_path(WEB_CODE_PATH).'survey/question.php?'.api_get_cidreq().'&amp;action=edit&amp;type='.$row['type'].'&amp;survey_id='.$survey_id.'&amp;question_id='.$row['question_id'].'">'.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>';
221
+	echo '		<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?'.api_get_cidreq().'&amp;action=delete&amp;survey_id='.$survey_id.'&amp;question_id='.$row['question_id'].'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang("DeleteSurveyQuestion").'?', ENT_QUOTES, $charset)).'\')) return false;">'.Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>';
222 222
 	if ($question_counter > 1) {
223
-		echo '		<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?'.api_get_cidreq().'&amp;action=moveup&amp;survey_id='.$survey_id.'&amp;question_id='.$row['question_id'].'">'.Display::return_icon('up.png', get_lang('MoveUp'),'',ICON_SIZE_SMALL).'</a>';
223
+		echo '		<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?'.api_get_cidreq().'&amp;action=moveup&amp;survey_id='.$survey_id.'&amp;question_id='.$row['question_id'].'">'.Display::return_icon('up.png', get_lang('MoveUp'), '', ICON_SIZE_SMALL).'</a>';
224 224
 	} else {
225
-		Display::display_icon('up_na.png','&nbsp;','',ICON_SIZE_SMALL);
225
+		Display::display_icon('up_na.png', '&nbsp;', '', ICON_SIZE_SMALL);
226 226
 	}
227 227
 	if ($question_counter < $question_counter_max) {
228
-		echo '		<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?'.api_get_cidreq().'&amp;action=movedown&amp;survey_id='.$survey_id.'&amp;question_id='.$row['question_id'].'">'.Display::return_icon('down.png', get_lang('MoveDown'),'',ICON_SIZE_SMALL).'</a>';
228
+		echo '		<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?'.api_get_cidreq().'&amp;action=movedown&amp;survey_id='.$survey_id.'&amp;question_id='.$row['question_id'].'">'.Display::return_icon('down.png', get_lang('MoveDown'), '', ICON_SIZE_SMALL).'</a>';
229 229
 	} else {
230
-		Display::display_icon('down_na.png','&nbsp;','',ICON_SIZE_SMALL);
230
+		Display::display_icon('down_na.png', '&nbsp;', '', ICON_SIZE_SMALL);
231 231
 	}
232 232
 	echo '	</td>';
233 233
 	$question_counter++;
234 234
 
235 235
 	if ($is_survey_type_1) {
236
-    	echo '<td>'.(($row['survey_group_pri']==0)?get_lang('Secondary'):get_lang('Primary')).'</td>';
237
-        echo '<td>'.(($row['survey_group_pri']==0)?$groups[$row['survey_group_sec1']].'-'.$groups[$row['survey_group_sec2']]:$groups[$row['survey_group_pri']]).'</td>';
236
+    	echo '<td>'.(($row['survey_group_pri'] == 0) ? get_lang('Secondary') : get_lang('Primary')).'</td>';
237
+        echo '<td>'.(($row['survey_group_pri'] == 0) ? $groups[$row['survey_group_sec1']].'-'.$groups[$row['survey_group_sec2']] : $groups[$row['survey_group_pri']]).'</td>';
238 238
     }
239 239
 	echo '</tr>';
240 240
 }
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 		echo Display::display_confirmation_message(get_lang($_GET['sendmsg']), false);
249 249
 	}
250 250
 
251
-	if (in_array($_GET['sendmsg'], array('GroupNeedName'))){
251
+	if (in_array($_GET['sendmsg'], array('GroupNeedName'))) {
252 252
 		echo Display::display_warning_message(get_lang($_GET['sendmsg']), false);
253 253
 	}
254 254
 	echo '<table border="0"><tr><td width="100">'.get_lang('Name').'</td><td>'.get_lang('Description').'</td></tr></table>';
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 	if ($_GET['action'] == 'editgroup') {
257 257
 		$sql = 'SELECT name,description FROM '.$table_survey_question_group.' WHERE id = '.intval($_GET['gid']).' AND survey_id = '.intval($survey_id).' limit 1';
258 258
 		$rs = Database::query($sql);
259
-		$editedrow = Database::fetch_array($rs,'ASSOC');
259
+		$editedrow = Database::fetch_array($rs, 'ASSOC');
260 260
 		echo	'<input type="text" maxlength="20" name="name" value="'.$editedrow['name'].'" size="10" disabled>';
261 261
 		echo	'<input type="text" maxlength="150" name="description" value="'.$editedrow['description'].'" size="40">';
262 262
 		echo	'<input type="hidden" name="group_id" value="'.Security::remove_XSS($_GET['gid']).'">';
@@ -278,12 +278,12 @@  discard block
 block discarded – undo
278 278
 	$sql = 'SELECT id,name,description FROM '.$table_survey_question_group.' WHERE c_id = '.$course_id.' AND survey_id = '.intval($survey_id).' ORDER BY name';
279 279
 
280 280
 	$rs = Database::query($sql);
281
-	while($row = Database::fetch_array($rs,ASSOC)){
281
+	while ($row = Database::fetch_array($rs, ASSOC)) {
282 282
 		$grouplist .= '<tr><td>'.$row['name'].'</td><td>'.$row['description'].'</td><td>'.
283 283
 		'<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?survey_id='.$survey_id.'&gid='.$row['id'].'&action=editgroup">'.
284
-		Display::return_icon('edit.png', get_lang('Edit'),'',ICON_SIZE_SMALL).'</a> '.
285
-		'<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?survey_id='.$survey_id.'&gid='.$row['id'].'&action=deletegroup" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('DeleteSurveyGroup'),$row['name']).'?',ENT_QUOTES)).'\')) return false;">'.
286
-		Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'.
284
+		Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a> '.
285
+		'<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?survey_id='.$survey_id.'&gid='.$row['id'].'&action=deletegroup" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('DeleteSurveyGroup'), $row['name']).'?', ENT_QUOTES)).'\')) return false;">'.
286
+		Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'.
287 287
 		'</td></tr>';
288 288
 	}
289 289
 	echo $grouplist.'</table>';
Please login to merge, or discard this patch.
main/survey/link.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 if (!SurveyManager::survey_generation_hash_available()) {
12 12
     api_not_allowed(true);
13 13
 }
14
-$course_info  = api_get_course_info_by_id($_REQUEST['c']);
14
+$course_info = api_get_course_info_by_id($_REQUEST['c']);
15 15
 
16 16
 $hash_is_valid = SurveyManager::validate_survey_hash(
17 17
     $survey_id,
Please login to merge, or discard this patch.
main/survey/ch_percentage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
             $options[$key] = $value;
22 22
         }
23 23
 
24
-        $name = 'question' . $questionData['question_id'];
24
+        $name = 'question'.$questionData['question_id'];
25 25
 
26 26
         $form->addSelect(
27 27
             $name, null, $options
Please login to merge, or discard this patch.
main/survey/survey_question.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         if ($surveyData['survey_type'] == 1) {
65 65
             $table_survey_question_group = Database::get_course_table(TABLE_SURVEY_QUESTION_GROUP);
66 66
             $sql = 'SELECT id,name FROM '.$table_survey_question_group.'
67
-                    WHERE survey_id = '.(int)$_GET['survey_id'].'
67
+                    WHERE survey_id = '.(int) $_GET['survey_id'].'
68 68
                     ORDER BY name';
69 69
             $rs = Database::query($sql);
70 70
             $glist = null;
@@ -75,15 +75,15 @@  discard block
 block discarded – undo
75 75
             $grouplist = $grouplist1 = $grouplist2 = $glist;
76 76
 
77 77
             if (!empty($formData['assigned'])) {
78
-                $grouplist = str_replace('<option value="'.$formData['assigned'].'"','<option value="'.$formData['assigned'].'" selected',$glist);
78
+                $grouplist = str_replace('<option value="'.$formData['assigned'].'"', '<option value="'.$formData['assigned'].'" selected', $glist);
79 79
             }
80 80
 
81 81
             if (!empty($formData['assigned1'])) {
82
-                $grouplist1 = str_replace('<option value="'.$formData['assigned1'].'"','<option value="'.$formData['assigned1'].'" selected',$glist);
82
+                $grouplist1 = str_replace('<option value="'.$formData['assigned1'].'"', '<option value="'.$formData['assigned1'].'" selected', $glist);
83 83
             }
84 84
 
85 85
             if (!empty($formData['assigned2'])) {
86
-                $grouplist2 = str_replace('<option value="'.$formData['assigned2'].'"','<option value="'.$formData['assigned2'].'" selected',$glist);
86
+                $grouplist2 = str_replace('<option value="'.$formData['assigned2'].'"', '<option value="'.$formData['assigned2'].'" selected', $glist);
87 87
             }
88 88
 
89 89
             $this->html .= '	<tr><td colspan="">
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
             $this->html .= '
97 97
 			<b>'.get_lang('Secondary').'</b><br />
98
-			'.'<input type="radio" name="choose" value="2" '.(($formData['choose']==2)?'checked':'').
98
+			'.'<input type="radio" name="choose" value="2" '.(($formData['choose'] == 2) ? 'checked' : '').
99 99
                 '><select name="assigned1">'.$grouplist1.'</select> '.
100 100
                 '<select name="assigned2">'.$grouplist2.'</select>'
101 101
                 .'</fieldset><br />';
Please login to merge, or discard this patch.
main/survey/copy_survey.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 
7 7
 // Setting the global file that gets the general configuration, the databases, the languages, ...
8 8
 require_once '../inc/global.inc.php';
9
-$current_course_tool  = TOOL_COURSE_MAINTENANCE;
9
+$current_course_tool = TOOL_COURSE_MAINTENANCE;
10 10
 api_protect_course_script(true);
11 11
 
12 12
 // Notice for unauthorized people.
Please login to merge, or discard this patch.
main/survey/preview.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 }
43 43
 
44 44
 // We exit here if there is no valid $_GET parameter
45
-if (!isset($_GET['survey_id']) || !is_numeric($_GET['survey_id'])){
45
+if (!isset($_GET['survey_id']) || !is_numeric($_GET['survey_id'])) {
46 46
 	Display::display_header(get_lang('SurveyPreview'));
47 47
 	Display::display_error_message(get_lang('InvallidSurvey'), false);
48 48
 	Display::display_footer();
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 						survey_question_option.c_id = $course_id
161 161
 					WHERE
162 162
 					    survey_question.survey_id = '".intval($survey_id)."' AND
163
-						survey_question.question_id IN (".Database::escape_string(implode(',',$paged_questions[$_GET['show']]), null, false).") AND
163
+						survey_question.question_id IN (".Database::escape_string(implode(',', $paged_questions[$_GET['show']]), null, false).") AND
164 164
 						survey_question.c_id =  $course_id
165 165
 					ORDER BY survey_question.sort, survey_question_option.sort ASC";
166 166
 
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 
198 198
 	// Displaying the form with the questions
199 199
 	if (isset($_GET['show'])) {
200
-		$show = (int)$_GET['show'] + 1;
200
+		$show = (int) $_GET['show'] + 1;
201 201
 	} else {
202 202
 		$show = 0;
203 203
 	}
Please login to merge, or discard this patch.
main/survey/ch_score.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
             $options = array(
39 39
                 '--' => '--'
40 40
             );
41
-            for ($i=1; $i <= $questionData['maximum_score']; $i++) {
41
+            for ($i = 1; $i <= $questionData['maximum_score']; $i++) {
42 42
                 $options[$i] = $i;
43 43
             }
44 44
 
Please login to merge, or discard this patch.