@@ -19,6 +19,7 @@ discard block |
||
| 19 | 19 | * @param int Visibility (0 hidden, 1 shown) |
| 20 | 20 | * @param int Session ID (optional or 0 if not defined) |
| 21 | 21 | * @param int |
| 22 | + * @param integer $resource_type |
|
| 22 | 23 | * @return boolean True on success, false on failure |
| 23 | 24 | */ |
| 24 | 25 | public static function add_resource_to_course_gradebook( |
@@ -117,7 +118,6 @@ discard block |
||
| 117 | 118 | |
| 118 | 119 | /** |
| 119 | 120 | * Builds an img tag for a gradebook item |
| 120 | - * @param string $type value returned by a gradebookitem's get_icon_name() |
|
| 121 | 121 | */ |
| 122 | 122 | public static function build_type_icon_tag($kind, $attributes = array()) |
| 123 | 123 | { |
@@ -572,6 +572,9 @@ discard block |
||
| 572 | 572 | * @param int The user id |
| 573 | 573 | * @param float The score obtained for certified |
| 574 | 574 | * @param Datetime The date when you obtained the certificate |
| 575 | + * @param integer $cat_id |
|
| 576 | + * @param integer $user_id |
|
| 577 | + * @param string $date_certificate |
|
| 575 | 578 | * @return void() |
| 576 | 579 | */ |
| 577 | 580 | public static function register_user_info_about_certificate($cat_id, $user_id, $score_certificate, $date_certificate) |
@@ -950,7 +953,7 @@ discard block |
||
| 950 | 953 | } |
| 951 | 954 | |
| 952 | 955 | /** |
| 953 | - * @param array $list_values |
|
| 956 | + * @param string[] $list_values |
|
| 954 | 957 | * @return string |
| 955 | 958 | */ |
| 956 | 959 | public static function score_badges($list_values) |
@@ -1010,7 +1013,7 @@ discard block |
||
| 1010 | 1013 | } |
| 1011 | 1014 | |
| 1012 | 1015 | /** |
| 1013 | - * @param $result |
|
| 1016 | + * @param Doctrine\DBAL\Driver\Statement|null $result |
|
| 1014 | 1017 | * @return array |
| 1015 | 1018 | */ |
| 1016 | 1019 | public static function get_user_array_from_sql_result($result) |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | * Deletes all survey invitations of a user |
| 48 | 48 | * @param int $user_id |
| 49 | 49 | * |
| 50 | - * @return boolean |
|
| 50 | + * @return false|null |
|
| 51 | 51 | * @assert ('') === false |
| 52 | 52 | */ |
| 53 | 53 | public static function delete_all_survey_invitations_by_user($user_id) |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | * Retrieves all the survey information |
| 105 | 105 | * |
| 106 | 106 | * @param integer $survey_id the id of the survey |
| 107 | - * @param boolean $shared this parameter determines if |
|
| 107 | + * @param integer $shared this parameter determines if |
|
| 108 | 108 | * we have to get the information of a survey from the central (shared) database or from the |
| 109 | 109 | * course database |
| 110 | 110 | * @param string course code optional |
@@ -571,7 +571,7 @@ discard block |
||
| 571 | 571 | * This function deletes a survey (and also all the question in that survey |
| 572 | 572 | * |
| 573 | 573 | * @param int $survey_id id of the survey that has to be deleted |
| 574 | - * @return true |
|
| 574 | + * @return boolean |
|
| 575 | 575 | * |
| 576 | 576 | * @author Patrick Cool <[email protected]>, Ghent University |
| 577 | 577 | * @version January 2007 |
@@ -756,7 +756,7 @@ discard block |
||
| 756 | 756 | * |
| 757 | 757 | * @param int $survey_id id of the survey that has to be duplicated |
| 758 | 758 | * @param int $courseId id of the course which survey has to be duplicated |
| 759 | - * @return true |
|
| 759 | + * @return boolean |
|
| 760 | 760 | * |
| 761 | 761 | * @author Eric Marguin <[email protected]>, Elixir Interactive |
| 762 | 762 | * @version October 2007 |
@@ -796,7 +796,7 @@ discard block |
||
| 796 | 796 | /** |
| 797 | 797 | * This function recalculates the number of people who have taken the survey (=filled at least one question) |
| 798 | 798 | * |
| 799 | - * @param int $survey_id the id of the survey somebody |
|
| 799 | + * @param int $survey_data the id of the survey somebody |
|
| 800 | 800 | * @return true |
| 801 | 801 | * |
| 802 | 802 | * @author Patrick Cool <[email protected]>, Ghent University |
@@ -1367,7 +1367,7 @@ discard block |
||
| 1367 | 1367 | * This function deletes a shared survey question from the main database and all its options |
| 1368 | 1368 | * |
| 1369 | 1369 | * @param int $question_id the id of the question |
| 1370 | - * @param int $shared |
|
| 1370 | + * @param integer $survey_id |
|
| 1371 | 1371 | * |
| 1372 | 1372 | * @todo delete all the options of this question |
| 1373 | 1373 | * |
@@ -1494,8 +1494,8 @@ discard block |
||
| 1494 | 1494 | * This function deletes all the options of the questions of a given survey |
| 1495 | 1495 | * This function is normally only called when a survey is deleted |
| 1496 | 1496 | * |
| 1497 | - * @param $survey_id the id of the survey that has to be deleted |
|
| 1498 | - * @return true |
|
| 1497 | + * @param integer $survey_id the id of the survey that has to be deleted |
|
| 1498 | + * @return boolean |
|
| 1499 | 1499 | * |
| 1500 | 1500 | * @author Patrick Cool <[email protected]>, Ghent University |
| 1501 | 1501 | * @version January 2007 |
@@ -1561,8 +1561,8 @@ discard block |
||
| 1561 | 1561 | * This function deletes all the answers anyone has given on this survey |
| 1562 | 1562 | * This function is normally only called when a survey is deleted |
| 1563 | 1563 | * |
| 1564 | - * @param $survey_id the id of the survey that has to be deleted |
|
| 1565 | - * @return true |
|
| 1564 | + * @param integer $survey_id the id of the survey that has to be deleted |
|
| 1565 | + * @return boolean |
|
| 1566 | 1566 | * |
| 1567 | 1567 | * @todo write the function |
| 1568 | 1568 | * |
@@ -1804,7 +1804,7 @@ discard block |
||
| 1804 | 1804 | /** |
| 1805 | 1805 | * This function checks the parameters that are used in this page |
| 1806 | 1806 | * |
| 1807 | - * @return string The header, an error and the footer if any parameter fails, else it returns true |
|
| 1807 | + * @return null|boolean The header, an error and the footer if any parameter fails, else it returns true |
|
| 1808 | 1808 | * @author Patrick Cool <[email protected]>, Ghent University |
| 1809 | 1809 | * @version February 2007 |
| 1810 | 1810 | */ |
@@ -2371,6 +2371,7 @@ discard block |
||
| 2371 | 2371 | * Display score data about a survey question |
| 2372 | 2372 | * @param array Question info |
| 2373 | 2373 | * @param integer The offset of results shown |
| 2374 | + * @param integer $offset |
|
| 2374 | 2375 | * @return void (direct output) |
| 2375 | 2376 | */ |
| 2376 | 2377 | public static function display_question_report_score($survey_data, $question, $offset) |
@@ -3208,7 +3209,7 @@ discard block |
||
| 3208 | 3209 | * @param array User's answers |
| 3209 | 3210 | * @param mixed User ID or user details as string - Used as a string in the result string |
| 3210 | 3211 | * @param boolean Whether to display user fields or not |
| 3211 | - * @return string One line of the csv file |
|
| 3212 | + * @return string[] One line of the csv file |
|
| 3212 | 3213 | */ |
| 3213 | 3214 | public static function export_complete_report_row_xls( |
| 3214 | 3215 | $survey_data, |
@@ -3801,7 +3802,7 @@ discard block |
||
| 3801 | 3802 | |
| 3802 | 3803 | /** |
| 3803 | 3804 | * @param $params |
| 3804 | - * @return bool|int |
|
| 3805 | + * @return false|string |
|
| 3805 | 3806 | */ |
| 3806 | 3807 | public static function save_invitation($params) |
| 3807 | 3808 | { |
@@ -3855,6 +3856,7 @@ discard block |
||
| 3855 | 3856 | * |
| 3856 | 3857 | * @param int invitedUser - the userId (course user) or emailaddress of additional user |
| 3857 | 3858 | * $param string $invitation_code - the unique invitation code for the URL |
| 3859 | + * @param string|null $invitation_text |
|
| 3858 | 3860 | * @return void |
| 3859 | 3861 | */ |
| 3860 | 3862 | public static function send_invitation_mail($invitedUser, $invitation_code, $invitation_title, $invitation_text) |
@@ -4783,7 +4785,7 @@ discard block |
||
| 4783 | 4785 | /** |
| 4784 | 4786 | * @author Isaac Flores Paz <[email protected]> |
| 4785 | 4787 | * @param int $user_id - User ID |
| 4786 | - * @param int $user_id_answer - User in survey answer table (user id or anonymus) |
|
| 4788 | + * @param int $user_answer - User in survey answer table (user id or anonymus) |
|
| 4787 | 4789 | * @return boolean |
| 4788 | 4790 | */ |
| 4789 | 4791 | static function show_link_available($user_id, $survey_code, $user_answer) |
@@ -4829,7 +4831,7 @@ discard block |
||
| 4829 | 4831 | * Display survey question chart |
| 4830 | 4832 | * @param array Chart data |
| 4831 | 4833 | * @param boolean Tells if the chart has a serie. False by default |
| 4832 | - * @return void (direct output) |
|
| 4834 | + * @return string (direct output) |
|
| 4833 | 4835 | */ |
| 4834 | 4836 | public static function drawChart($chartData, $hasSerie = false, $chartContainerId = 'chartContainer') |
| 4835 | 4837 | { |
@@ -35,7 +35,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -187,7 +187,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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']], |
@@ -897,7 +897,7 @@ discard block |
||
| 897 | 897 | { |
| 898 | 898 | // Table definitions |
| 899 | 899 | $tbl_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); |
| 900 | - $table_survey_question_option = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION); |
|
| 900 | + $table_survey_question_option = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION); |
|
| 901 | 901 | $course_id = api_get_course_int_id(); |
| 902 | 902 | |
| 903 | 903 | $sql = "SELECT * FROM $tbl_survey_question |
@@ -923,7 +923,7 @@ discard block |
||
| 923 | 923 | // Getting the information of the question |
| 924 | 924 | |
| 925 | 925 | $result = Database::query($sql); |
| 926 | - $row = Database::fetch_array($result,'ASSOC'); |
|
| 926 | + $row = Database::fetch_array($result, 'ASSOC'); |
|
| 927 | 927 | |
| 928 | 928 | $return['survey_id'] = $row['survey_id']; |
| 929 | 929 | $return['question_id'] = $row['question_id']; |
@@ -971,8 +971,8 @@ discard block |
||
| 971 | 971 | public static function get_questions($survey_id, $course_id = '') |
| 972 | 972 | { |
| 973 | 973 | // Table definitions |
| 974 | - $tbl_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); |
|
| 975 | - $table_survey_question_option = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION); |
|
| 974 | + $tbl_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); |
|
| 975 | + $table_survey_question_option = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION); |
|
| 976 | 976 | |
| 977 | 977 | if (empty($course_id)) { |
| 978 | 978 | $course_id = api_get_course_int_id(); |
@@ -1076,7 +1076,7 @@ discard block |
||
| 1076 | 1076 | FROM $tbl_survey_question |
| 1077 | 1077 | WHERE c_id = $course_id AND survey_id='".intval($form_content['survey_id'])."'"; |
| 1078 | 1078 | $result = Database::query($sql); |
| 1079 | - $row = Database::fetch_array($result,'ASSOC'); |
|
| 1079 | + $row = Database::fetch_array($result, 'ASSOC'); |
|
| 1080 | 1080 | $max_sort = $row['max_sort']; |
| 1081 | 1081 | |
| 1082 | 1082 | // Some variables defined for survey-test type |
@@ -1213,7 +1213,7 @@ discard block |
||
| 1213 | 1213 | WHERE survey_id='".intval($survey_data['survey_share'])."' |
| 1214 | 1214 | AND code='".Database::escape_string($_course['id'])."'"; |
| 1215 | 1215 | $result = Database::query($sql); |
| 1216 | - $row = Database::fetch_array($result,'ASSOC'); |
|
| 1216 | + $row = Database::fetch_array($result, 'ASSOC'); |
|
| 1217 | 1217 | $max_sort = $row['max_sort']; |
| 1218 | 1218 | |
| 1219 | 1219 | // Adding the question to the survey_question table |
@@ -1223,11 +1223,11 @@ discard block |
||
| 1223 | 1223 | '".Database::escape_string($form_content['question_comment'])."', |
| 1224 | 1224 | '".Database::escape_string($form_content['type'])."', |
| 1225 | 1225 | '".Database::escape_string($form_content['horizontalvertical'])."', |
| 1226 | - '".Database::escape_string($max_sort+1)."', |
|
| 1226 | + '".Database::escape_string($max_sort + 1)."', |
|
| 1227 | 1227 | '".Database::escape_string($_course['id'])."')"; |
| 1228 | 1228 | Database::query($sql); |
| 1229 | 1229 | $shared_question_id = Database::insert_id(); |
| 1230 | - } else { |
|
| 1230 | + } else { |
|
| 1231 | 1231 | // Updating an existing question |
| 1232 | 1232 | // adding the question to the survey_question table |
| 1233 | 1233 | $sql = "UPDATE $tbl_survey_question SET |
@@ -1257,7 +1257,7 @@ discard block |
||
| 1257 | 1257 | public static function move_survey_question($direction, $survey_question_id, $survey_id) |
| 1258 | 1258 | { |
| 1259 | 1259 | // Table definition |
| 1260 | - $table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); |
|
| 1260 | + $table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); |
|
| 1261 | 1261 | $course_id = api_get_course_int_id(); |
| 1262 | 1262 | |
| 1263 | 1263 | if ($direction == 'moveup') { |
@@ -1309,11 +1309,11 @@ discard block |
||
| 1309 | 1309 | $course_id = api_get_course_int_id(); |
| 1310 | 1310 | |
| 1311 | 1311 | // Table definitions |
| 1312 | - $table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); |
|
| 1312 | + $table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); |
|
| 1313 | 1313 | $course_condition = " c_id = $course_id AND "; |
| 1314 | 1314 | if ($shared) { |
| 1315 | 1315 | $course_condition = ""; |
| 1316 | - $table_survey_question = Database :: get_main_table(TABLE_MAIN_SHARED_SURVEY_QUESTION); |
|
| 1316 | + $table_survey_question = Database :: get_main_table(TABLE_MAIN_SHARED_SURVEY_QUESTION); |
|
| 1317 | 1317 | } |
| 1318 | 1318 | |
| 1319 | 1319 | $sql = "DELETE FROM $table_survey_question |
@@ -1346,7 +1346,7 @@ discard block |
||
| 1346 | 1346 | { |
| 1347 | 1347 | $course_id = api_get_course_int_id(); |
| 1348 | 1348 | // Table definitions |
| 1349 | - $table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); |
|
| 1349 | + $table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); |
|
| 1350 | 1350 | if ($shared) { |
| 1351 | 1351 | SurveyManager::delete_shared_survey_question($survey_id, $question_id); |
| 1352 | 1352 | } |
@@ -1408,7 +1408,7 @@ discard block |
||
| 1408 | 1408 | $course_id = api_get_course_int_id(); |
| 1409 | 1409 | // A percentage question type has options 1 -> 100 |
| 1410 | 1410 | if ($form_content['type'] == 'percentage') { |
| 1411 | - for($i = 1; $i < 101; $i++) { |
|
| 1411 | + for ($i = 1; $i < 101; $i++) { |
|
| 1412 | 1412 | $form_content['answers'][] = $i; |
| 1413 | 1413 | } |
| 1414 | 1414 | } |
@@ -1588,7 +1588,7 @@ discard block |
||
| 1588 | 1588 | { |
| 1589 | 1589 | $table_survey_answer = Database :: get_course_table(TABLE_SURVEY_ANSWER); |
| 1590 | 1590 | |
| 1591 | - $user_id = intval($user_id); |
|
| 1591 | + $user_id = intval($user_id); |
|
| 1592 | 1592 | $course_id = intval($course_id); |
| 1593 | 1593 | $survey_id = intval($survey_id); |
| 1594 | 1594 | |
@@ -1746,7 +1746,7 @@ discard block |
||
| 1746 | 1746 | static function remove_answer($user, $survey_id, $question_id, $course_id) { |
| 1747 | 1747 | $course_id = intval($course_id); |
| 1748 | 1748 | // table definition |
| 1749 | - $table_survey_answer = Database :: get_course_table(TABLE_SURVEY_ANSWER); |
|
| 1749 | + $table_survey_answer = Database :: get_course_table(TABLE_SURVEY_ANSWER); |
|
| 1750 | 1750 | $sql = "DELETE FROM $table_survey_answer |
| 1751 | 1751 | WHERE |
| 1752 | 1752 | c_id = $course_id AND |
@@ -1919,16 +1919,16 @@ discard block |
||
| 1919 | 1919 | */ |
| 1920 | 1920 | function delete_user_report($survey_id, $user_id) |
| 1921 | 1921 | { |
| 1922 | - $table_survey_answer = Database :: get_course_table(TABLE_SURVEY_ANSWER); |
|
| 1923 | - $table_survey_invitation = Database :: get_course_table(TABLE_SURVEY_INVITATION); |
|
| 1924 | - $table_survey = Database :: get_course_table(TABLE_SURVEY); |
|
| 1922 | + $table_survey_answer = Database :: get_course_table(TABLE_SURVEY_ANSWER); |
|
| 1923 | + $table_survey_invitation = Database :: get_course_table(TABLE_SURVEY_INVITATION); |
|
| 1924 | + $table_survey = Database :: get_course_table(TABLE_SURVEY); |
|
| 1925 | 1925 | |
| 1926 | 1926 | $course_id = api_get_course_int_id(); |
| 1927 | 1927 | |
| 1928 | 1928 | if (!empty($survey_id) && !empty($user_id)) { |
| 1929 | 1929 | // delete data from survey_answer by user_id and survey_id |
| 1930 | 1930 | $sql = "DELETE FROM $table_survey_answer |
| 1931 | - WHERE c_id = $course_id AND survey_id = '".(int)$survey_id."' AND user = '".(int)$user_id."'"; |
|
| 1931 | + WHERE c_id = $course_id AND survey_id = '".(int) $survey_id."' AND user = '".(int) $user_id."'"; |
|
| 1932 | 1932 | Database::query($sql); |
| 1933 | 1933 | // update field answered from survey_invitation by user_id and survey_id |
| 1934 | 1934 | $sql = "UPDATE $table_survey_invitation SET answered = '0' |
@@ -1938,9 +1938,9 @@ discard block |
||
| 1938 | 1938 | SELECT code FROM $table_survey |
| 1939 | 1939 | WHERE |
| 1940 | 1940 | c_id = $course_id AND |
| 1941 | - survey_id = '".(int)$survey_id."' |
|
| 1941 | + survey_id = '".(int) $survey_id."' |
|
| 1942 | 1942 | ) AND |
| 1943 | - user = '".(int)$user_id."'"; |
|
| 1943 | + user = '".(int) $user_id."'"; |
|
| 1944 | 1944 | $result = Database::query($sql); |
| 1945 | 1945 | } |
| 1946 | 1946 | |
@@ -1970,19 +1970,19 @@ discard block |
||
| 1970 | 1970 | // Actions bar |
| 1971 | 1971 | echo '<div class="actions">'; |
| 1972 | 1972 | echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?survey_id='.Security::remove_XSS($_GET['survey_id']).'">'. |
| 1973 | - Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('ReportingOverview'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
| 1973 | + Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('ReportingOverview'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
| 1974 | 1974 | if (isset($_GET['user'])) { |
| 1975 | 1975 | if (api_is_allowed_to_edit()) { |
| 1976 | 1976 | // The delete link |
| 1977 | 1977 | 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']).'" >'. |
| 1978 | - Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
| 1978 | + Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
| 1979 | 1979 | } |
| 1980 | 1980 | |
| 1981 | 1981 | // Export the user report |
| 1982 | 1982 | echo '<a href="javascript: void(0);" onclick="document.form1a.submit();">'. |
| 1983 | - Display::return_icon('export_csv.png', get_lang('ExportAsCSV'),'',ICON_SIZE_MEDIUM).'</a> '; |
|
| 1983 | + Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), '', ICON_SIZE_MEDIUM).'</a> '; |
|
| 1984 | 1984 | echo '<a href="javascript: void(0);" onclick="document.form1b.submit();">'. |
| 1985 | - Display::return_icon('export_excel.png', get_lang('ExportAsXLS'),'',ICON_SIZE_MEDIUM).'</a> '; |
|
| 1985 | + Display::return_icon('export_excel.png', get_lang('ExportAsXLS'), '', ICON_SIZE_MEDIUM).'</a> '; |
|
| 1986 | 1986 | 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']).'">'; |
| 1987 | 1987 | echo '<input type="hidden" name="export_report" value="export_report">'; |
| 1988 | 1988 | echo '<input type="hidden" name="export_format" value="csv">'; |
@@ -2015,7 +2015,7 @@ discard block |
||
| 2015 | 2015 | $name = $person['invited_user']; |
| 2016 | 2016 | } |
| 2017 | 2017 | } else { |
| 2018 | - $name = get_lang('Anonymous') . ' ' . ($key + 1); |
|
| 2018 | + $name = get_lang('Anonymous').' '.($key + 1); |
|
| 2019 | 2019 | $id = $person; |
| 2020 | 2020 | } |
| 2021 | 2021 | 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).'" '; |
@@ -2145,9 +2145,9 @@ discard block |
||
| 2145 | 2145 | $singlePage = isset($_GET['single_page']) ? intval($_GET['single_page']) : 0; |
| 2146 | 2146 | $course_id = api_get_course_int_id(); |
| 2147 | 2147 | // Database table definitions |
| 2148 | - $table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); |
|
| 2149 | - $table_survey_question_option = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION); |
|
| 2150 | - $table_survey_answer = Database :: get_course_table(TABLE_SURVEY_ANSWER); |
|
| 2148 | + $table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); |
|
| 2149 | + $table_survey_question_option = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION); |
|
| 2150 | + $table_survey_answer = Database :: get_course_table(TABLE_SURVEY_ANSWER); |
|
| 2151 | 2151 | |
| 2152 | 2152 | // Determining the offset of the sql statement (the n-th question of the survey) |
| 2153 | 2153 | $offset = !isset($_GET['question']) ? 0 : intval($_GET['question']); |
@@ -2158,7 +2158,7 @@ discard block |
||
| 2158 | 2158 | |
| 2159 | 2159 | echo '<div class="actions">'; |
| 2160 | 2160 | echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?survey_id='.$surveyId.'">'. |
| 2161 | - Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('ReportingOverview'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
| 2161 | + Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('ReportingOverview'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
| 2162 | 2162 | echo '</div>'; |
| 2163 | 2163 | |
| 2164 | 2164 | if ($survey_data['number_of_questions'] > 0) { |
@@ -2168,21 +2168,21 @@ discard block |
||
| 2168 | 2168 | /* echo '<ul><li class="disabled"><a href="#">'.get_lang('Question').'</a></li>'; */ |
| 2169 | 2169 | |
| 2170 | 2170 | if ($currentQuestion != 0) { |
| 2171 | - 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>'; |
|
| 2171 | + 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>'; |
|
| 2172 | 2172 | } |
| 2173 | 2173 | |
| 2174 | 2174 | for ($i = 1; $i <= $survey_data['number_of_questions']; $i++) { |
| 2175 | 2175 | if ($offset != $i - 1) { |
| 2176 | - 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>'; |
|
| 2176 | + 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>'; |
|
| 2177 | 2177 | } else { |
| 2178 | - echo '<li class="disabled"s><a href="#">' . $i . '</a></li>'; |
|
| 2178 | + echo '<li class="disabled"s><a href="#">'.$i.'</a></li>'; |
|
| 2179 | 2179 | } |
| 2180 | 2180 | /*if ($i < $survey_data['number_of_questions']) { |
| 2181 | 2181 | echo ' | '; |
| 2182 | 2182 | }*/ |
| 2183 | 2183 | } |
| 2184 | 2184 | if ($currentQuestion < ($survey_data['number_of_questions'] - 1)) { |
| 2185 | - 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>'; |
|
| 2185 | + 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>'; |
|
| 2186 | 2186 | } |
| 2187 | 2187 | echo '</ul>'; |
| 2188 | 2188 | echo '</div>'; |
@@ -2234,19 +2234,19 @@ discard block |
||
| 2234 | 2234 | $sql = "SELECT * FROM $table_survey_answer |
| 2235 | 2235 | WHERE |
| 2236 | 2236 | c_id = $course_id AND |
| 2237 | - survey_id='" . intval($_GET['survey_id']) . "' AND |
|
| 2238 | - question_id = '" . intval($question['question_id']) . "'"; |
|
| 2237 | + survey_id='".intval($_GET['survey_id'])."' AND |
|
| 2238 | + question_id = '" . intval($question['question_id'])."'"; |
|
| 2239 | 2239 | $result = Database::query($sql); |
| 2240 | 2240 | while ($row = Database::fetch_array($result)) { |
| 2241 | - echo $row['option_id'] . '<hr noshade="noshade" size="1" />'; |
|
| 2241 | + echo $row['option_id'].'<hr noshade="noshade" size="1" />'; |
|
| 2242 | 2242 | } |
| 2243 | 2243 | } else { |
| 2244 | 2244 | // Getting the options ORDER BY sort ASC |
| 2245 | 2245 | $sql = "SELECT * FROM $table_survey_question_option |
| 2246 | 2246 | WHERE |
| 2247 | 2247 | c_id = $course_id AND |
| 2248 | - survey_id='" . intval($_GET['survey_id']) . "' |
|
| 2249 | - AND question_id = '" . intval($question['question_id']) . "' |
|
| 2248 | + survey_id='".intval($_GET['survey_id'])."' |
|
| 2249 | + AND question_id = '" . intval($question['question_id'])."' |
|
| 2250 | 2250 | ORDER BY sort ASC"; |
| 2251 | 2251 | $result = Database::query($sql); |
| 2252 | 2252 | while ($row = Database::fetch_array($result)) { |
@@ -2256,8 +2256,8 @@ discard block |
||
| 2256 | 2256 | $sql = "SELECT *, count(answer_id) as total FROM $table_survey_answer |
| 2257 | 2257 | WHERE |
| 2258 | 2258 | c_id = $course_id AND |
| 2259 | - survey_id='" . intval($_GET['survey_id']) . "' |
|
| 2260 | - AND question_id = '" . intval($question['question_id']) . "' |
|
| 2259 | + survey_id='".intval($_GET['survey_id'])."' |
|
| 2260 | + AND question_id = '" . intval($question['question_id'])."' |
|
| 2261 | 2261 | GROUP BY option_id, value"; |
| 2262 | 2262 | $result = Database::query($sql); |
| 2263 | 2263 | $number_of_answers = array(); |
@@ -2274,8 +2274,7 @@ discard block |
||
| 2274 | 2274 | $optionText = strip_tags($option['option_text']); |
| 2275 | 2275 | $optionText = html_entity_decode($optionText); |
| 2276 | 2276 | $votes = isset($data[$option['question_option_id']]['total']) ? |
| 2277 | - $data[$option['question_option_id']]['total'] : |
|
| 2278 | - '0'; |
|
| 2277 | + $data[$option['question_option_id']]['total'] : '0'; |
|
| 2279 | 2278 | array_push($chartData, array('option' => $optionText, 'votes' => $votes)); |
| 2280 | 2279 | } |
| 2281 | 2280 | $chartContainerId = 'chartContainer'.$question['question_id']; |
@@ -2287,9 +2286,9 @@ discard block |
||
| 2287 | 2286 | echo '<table class="display-survey table">'; |
| 2288 | 2287 | echo ' <tr>'; |
| 2289 | 2288 | echo ' <th> </th>'; |
| 2290 | - echo ' <th>' . get_lang('AbsoluteTotal') . '</th>'; |
|
| 2291 | - echo ' <th>' . get_lang('Percentage') . '</th>'; |
|
| 2292 | - echo ' <th>' . get_lang('VisualRepresentation') . '</th>'; |
|
| 2289 | + echo ' <th>'.get_lang('AbsoluteTotal').'</th>'; |
|
| 2290 | + echo ' <th>'.get_lang('Percentage').'</th>'; |
|
| 2291 | + echo ' <th>'.get_lang('VisualRepresentation').'</th>'; |
|
| 2293 | 2292 | echo ' <tr>'; |
| 2294 | 2293 | |
| 2295 | 2294 | // Displaying the table: the content |
@@ -2308,22 +2307,22 @@ discard block |
||
| 2308 | 2307 | $answers_number = $absolute_number / $number_of_answers[$option['question_id']] * 100; |
| 2309 | 2308 | } |
| 2310 | 2309 | echo ' <tr>'; |
| 2311 | - echo ' <td class="center">' . $value['option_text'] . '</td>'; |
|
| 2310 | + echo ' <td class="center">'.$value['option_text'].'</td>'; |
|
| 2312 | 2311 | echo ' <td class="center">'; |
| 2313 | 2312 | if ($absolute_number != 0) { |
| 2314 | - 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>'; |
|
| 2313 | + 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>'; |
|
| 2315 | 2314 | } else { |
| 2316 | 2315 | echo '0'; |
| 2317 | 2316 | } |
| 2318 | 2317 | |
| 2319 | 2318 | echo ' </td>'; |
| 2320 | - echo ' <td class="center">' . round($answers_number, 2) . ' %</td>'; |
|
| 2319 | + echo ' <td class="center">'.round($answers_number, 2).' %</td>'; |
|
| 2321 | 2320 | echo ' <td class="center">'; |
| 2322 | 2321 | $size = $answers_number * 2; |
| 2323 | 2322 | if ($size > 0) { |
| 2324 | - echo '<div style="border:1px solid #264269; background-color:#aecaf4; height:10px; width:' . $size . 'px"> </div>'; |
|
| 2323 | + echo '<div style="border:1px solid #264269; background-color:#aecaf4; height:10px; width:'.$size.'px"> </div>'; |
|
| 2325 | 2324 | } else { |
| 2326 | - echo '<div style="text-align: left;">' . get_lang("NoDataAvailable") . '</div>'; |
|
| 2325 | + echo '<div style="text-align: left;">'.get_lang("NoDataAvailable").'</div>'; |
|
| 2327 | 2326 | } |
| 2328 | 2327 | echo ' </td>'; |
| 2329 | 2328 | echo ' </tr>'; |
@@ -2331,8 +2330,8 @@ discard block |
||
| 2331 | 2330 | } |
| 2332 | 2331 | // displaying the table: footer (totals) |
| 2333 | 2332 | echo ' <tr>'; |
| 2334 | - echo ' <td class="total"><b>' . get_lang('Total') . '</b></td>'; |
|
| 2335 | - echo ' <td class="total"><b>' . ($number_of_answers[$option['question_id']] == 0 ? '0' : $number_of_answers[$option['question_id']]) . '</b></td>'; |
|
| 2333 | + echo ' <td class="total"><b>'.get_lang('Total').'</b></td>'; |
|
| 2334 | + echo ' <td class="total"><b>'.($number_of_answers[$option['question_id']] == 0 ? '0' : $number_of_answers[$option['question_id']]).'</b></td>'; |
|
| 2336 | 2335 | echo ' <td class="total"> </td>'; |
| 2337 | 2336 | echo ' <td class="total"> </td>'; |
| 2338 | 2337 | echo ' </tr>'; |
@@ -2376,8 +2375,8 @@ discard block |
||
| 2376 | 2375 | public static function display_question_report_score($survey_data, $question, $offset) |
| 2377 | 2376 | { |
| 2378 | 2377 | // Database table definitions |
| 2379 | - $table_survey_question_option = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION); |
|
| 2380 | - $table_survey_answer = Database :: get_course_table(TABLE_SURVEY_ANSWER); |
|
| 2378 | + $table_survey_question_option = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION); |
|
| 2379 | + $table_survey_answer = Database :: get_course_table(TABLE_SURVEY_ANSWER); |
|
| 2381 | 2380 | |
| 2382 | 2381 | $course_id = api_get_course_int_id(); |
| 2383 | 2382 | |
@@ -2447,9 +2446,9 @@ discard block |
||
| 2447 | 2446 | echo ' <td>'.$value['option_text'].'</td>'; |
| 2448 | 2447 | echo ' <td>'.$i.'</td>'; |
| 2449 | 2448 | 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>'; |
| 2450 | - echo ' <td>'.round($absolute_number/$number_of_answers*100, 2).' %</td>'; |
|
| 2449 | + echo ' <td>'.round($absolute_number / $number_of_answers * 100, 2).' %</td>'; |
|
| 2451 | 2450 | echo ' <td>'; |
| 2452 | - $size = ($absolute_number/$number_of_answers*100*2); |
|
| 2451 | + $size = ($absolute_number / $number_of_answers * 100 * 2); |
|
| 2453 | 2452 | if ($size > 0) { |
| 2454 | 2453 | echo ' <div style="border:1px solid #264269; background-color:#aecaf4; height:10px; width:'.$size.'px"> </div>'; |
| 2455 | 2454 | } |
@@ -2486,11 +2485,11 @@ discard block |
||
| 2486 | 2485 | // Actions bar |
| 2487 | 2486 | echo '<div class="actions">'; |
| 2488 | 2487 | echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?survey_id='.Security::remove_XSS($_GET['survey_id']).'"> |
| 2489 | - '.Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('ReportingOverview'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
| 2488 | + '.Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('ReportingOverview'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
| 2490 | 2489 | echo '<a class="survey_export_link" href="javascript: void(0);" onclick="document.form1a.submit();"> |
| 2491 | - '.Display::return_icon('export_csv.png',get_lang('ExportAsCSV'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
| 2490 | + '.Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
| 2492 | 2491 | echo '<a class="survey_export_link" href="javascript: void(0);" onclick="document.form1b.submit();"> |
| 2493 | - '.Display::return_icon('export_excel.png',get_lang('ExportAsXLS'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
| 2492 | + '.Display::return_icon('export_excel.png', get_lang('ExportAsXLS'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
| 2494 | 2493 | echo '</div>'; |
| 2495 | 2494 | |
| 2496 | 2495 | // The form |
@@ -2523,8 +2522,8 @@ discard block |
||
| 2523 | 2522 | // Show user fields section with a big th colspan that spans over all fields |
| 2524 | 2523 | $extra_user_fields = UserManager::get_extra_fields(0, 0, 5, 'ASC', false, true); |
| 2525 | 2524 | $num = count($extra_user_fields); |
| 2526 | - if ($num > 0 ) { |
|
| 2527 | - echo '<th '.($num>0?' colspan="'.$num.'"':'').'>'; |
|
| 2525 | + if ($num > 0) { |
|
| 2526 | + echo '<th '.($num > 0 ? ' colspan="'.$num.'"' : '').'>'; |
|
| 2528 | 2527 | echo '<label><input type="checkbox" name="fields_filter" value="1" checked="checked"/> '; |
| 2529 | 2528 | echo get_lang('UserFields'); |
| 2530 | 2529 | echo '</label>'; |
@@ -2589,7 +2588,7 @@ discard block |
||
| 2589 | 2588 | if (!(isset($_POST['submit_question_filter']) && $_POST['submit_question_filter'] || |
| 2590 | 2589 | isset($_POST['export_report']) && $_POST['export_report']) || !empty($_POST['fields_filter'])) { |
| 2591 | 2590 | //show the fields names for user fields |
| 2592 | - foreach($extra_user_fields as & $field) { |
|
| 2591 | + foreach ($extra_user_fields as & $field) { |
|
| 2593 | 2592 | echo '<th>'.$field[3].'</th>'; |
| 2594 | 2593 | } |
| 2595 | 2594 | } |
@@ -2609,7 +2608,7 @@ discard block |
||
| 2609 | 2608 | ORDER BY sq.sort ASC, sqo.sort ASC"; |
| 2610 | 2609 | $result = Database::query($sql); |
| 2611 | 2610 | |
| 2612 | - $display_percentage_header = 1; // in order to display only once the cell option (and not 100 times) |
|
| 2611 | + $display_percentage_header = 1; // in order to display only once the cell option (and not 100 times) |
|
| 2613 | 2612 | while ($row = Database::fetch_array($result)) { |
| 2614 | 2613 | // We show the options if |
| 2615 | 2614 | // 1. there is no question filter and the export button has not been clicked |
@@ -2669,7 +2668,7 @@ discard block |
||
| 2669 | 2668 | $questions, |
| 2670 | 2669 | $display_extra_user_fields |
| 2671 | 2670 | ); |
| 2672 | - $answers_of_user=array(); |
|
| 2671 | + $answers_of_user = array(); |
|
| 2673 | 2672 | } |
| 2674 | 2673 | if (isset($questions[$row['question_id']]) && $questions[$row['question_id']]['type'] != 'open') { |
| 2675 | 2674 | $answers_of_user[$row['question_id']][$row['option_id']] = $row; |
@@ -2731,7 +2730,7 @@ discard block |
||
| 2731 | 2730 | echo '<th>'.$user.'</th>'; // the user column |
| 2732 | 2731 | } |
| 2733 | 2732 | } else { |
| 2734 | - echo '<th>' . get_lang('Anonymous') . ' ' . $user . '</th>'; |
|
| 2733 | + echo '<th>'.get_lang('Anonymous').' '.$user.'</th>'; |
|
| 2735 | 2734 | } |
| 2736 | 2735 | |
| 2737 | 2736 | if ($display_extra_user_fields) { |
@@ -2827,10 +2826,10 @@ discard block |
||
| 2827 | 2826 | // We do not show comment and pagebreak question types |
| 2828 | 2827 | if ($row['type'] != 'comment' && $row['type'] != 'pagebreak') { |
| 2829 | 2828 | if ($row['number_of_options'] == 0 && $row['type'] == 'open') { |
| 2830 | - $return .= str_replace("\r\n",' ', api_html_entity_decode(strip_tags($row['survey_question']), ENT_QUOTES)).';'; |
|
| 2829 | + $return .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($row['survey_question']), ENT_QUOTES)).';'; |
|
| 2831 | 2830 | } else { |
| 2832 | 2831 | for ($ii = 0; $ii < $row['number_of_options']; $ii++) { |
| 2833 | - $return .= str_replace("\r\n",' ', api_html_entity_decode(strip_tags($row['survey_question']), ENT_QUOTES)).';'; |
|
| 2832 | + $return .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($row['survey_question']), ENT_QUOTES)).';'; |
|
| 2834 | 2833 | } |
| 2835 | 2834 | } |
| 2836 | 2835 | } |
@@ -2844,7 +2843,7 @@ discard block |
||
| 2844 | 2843 | // Show the fields names for user fields |
| 2845 | 2844 | if (!empty($extra_user_fields)) { |
| 2846 | 2845 | foreach ($extra_user_fields as & $field) { |
| 2847 | - $return .= '"'.str_replace("\r\n",' ',api_html_entity_decode(strip_tags($field[3]), ENT_QUOTES)).'";'; |
|
| 2846 | + $return .= '"'.str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($field[3]), ENT_QUOTES)).'";'; |
|
| 2848 | 2847 | } |
| 2849 | 2848 | } |
| 2850 | 2849 | |
@@ -2879,7 +2878,7 @@ discard block |
||
| 2879 | 2878 | ) { |
| 2880 | 2879 | // We do not show comment and pagebreak question types |
| 2881 | 2880 | if ($row['type'] != 'comment' && $row['type'] != 'pagebreak') { |
| 2882 | - $row['option_text'] = str_replace(array("\r","\n"),array('',''),$row['option_text']); |
|
| 2881 | + $row['option_text'] = str_replace(array("\r", "\n"), array('', ''), $row['option_text']); |
|
| 2883 | 2882 | $return .= api_html_entity_decode(strip_tags($row['option_text']), ENT_QUOTES).';'; |
| 2884 | 2883 | $possible_answers[$row['question_id']][$row['question_option_id']] = $row['question_option_id']; |
| 2885 | 2884 | $possible_answers_type[$row['question_id']] = $row['type']; |
@@ -2909,9 +2908,9 @@ discard block |
||
| 2909 | 2908 | $old_user, |
| 2910 | 2909 | true |
| 2911 | 2910 | ); |
| 2912 | - $answers_of_user=array(); |
|
| 2911 | + $answers_of_user = array(); |
|
| 2913 | 2912 | } |
| 2914 | - if($possible_answers_type[$row['question_id']] == 'open') { |
|
| 2913 | + if ($possible_answers_type[$row['question_id']] == 'open') { |
|
| 2915 | 2914 | $temp_id = 'open'.$open_question_iterator; |
| 2916 | 2915 | $answers_of_user[$row['question_id']][$temp_id] = $row; |
| 2917 | 2916 | $open_question_iterator++; |
@@ -2970,7 +2969,7 @@ discard block |
||
| 2970 | 2969 | |
| 2971 | 2970 | if ($display_extra_user_fields) { |
| 2972 | 2971 | // Show user fields data, if any, for this user |
| 2973 | - $user_fields_values = UserManager::get_extra_user_data($user,false,false, false, true); |
|
| 2972 | + $user_fields_values = UserManager::get_extra_user_data($user, false, false, false, true); |
|
| 2974 | 2973 | foreach ($user_fields_values as & $value) { |
| 2975 | 2974 | $return .= '"'.str_replace('"', '""', api_html_entity_decode(strip_tags($value), ENT_QUOTES)).'";'; |
| 2976 | 2975 | } |
@@ -3069,9 +3068,9 @@ discard block |
||
| 3069 | 3068 | ENT_QUOTES |
| 3070 | 3069 | ) |
| 3071 | 3070 | ); |
| 3072 | - $column ++; |
|
| 3071 | + $column++; |
|
| 3073 | 3072 | } else { |
| 3074 | - for ($ii = 0; $ii < $row['number_of_options']; $ii ++) { |
|
| 3073 | + for ($ii = 0; $ii < $row['number_of_options']; $ii++) { |
|
| 3075 | 3074 | $worksheet->SetCellValueByColumnAndRow( |
| 3076 | 3075 | $line, |
| 3077 | 3076 | $column, |
@@ -3080,7 +3079,7 @@ discard block |
||
| 3080 | 3079 | ENT_QUOTES |
| 3081 | 3080 | ) |
| 3082 | 3081 | ); |
| 3083 | - $column ++; |
|
| 3082 | + $column++; |
|
| 3084 | 3083 | } |
| 3085 | 3084 | } |
| 3086 | 3085 | } |
@@ -3140,7 +3139,7 @@ discard block |
||
| 3140 | 3139 | } |
| 3141 | 3140 | |
| 3142 | 3141 | // Getting all the answers of the users |
| 3143 | - $line ++; |
|
| 3142 | + $line++; |
|
| 3144 | 3143 | $column = 0; |
| 3145 | 3144 | $old_user = ''; |
| 3146 | 3145 | $answers_of_user = array(); |
@@ -3149,7 +3148,7 @@ discard block |
||
| 3149 | 3148 | if ($user_id != 0) { |
| 3150 | 3149 | $sql .= "AND user='".intval($user_id)."' "; |
| 3151 | 3150 | } |
| 3152 | - $sql .= "ORDER BY user ASC"; |
|
| 3151 | + $sql .= "ORDER BY user ASC"; |
|
| 3153 | 3152 | |
| 3154 | 3153 | $open_question_iterator = 1; |
| 3155 | 3154 | $result = Database::query($sql); |
@@ -3224,7 +3223,7 @@ discard block |
||
| 3224 | 3223 | FROM '.Database::get_main_table(TABLE_MAIN_USER).' |
| 3225 | 3224 | WHERE user_id='.intval($user); |
| 3226 | 3225 | $rs = Database::query($sql); |
| 3227 | - if($row = Database::fetch_array($rs)) { |
|
| 3226 | + if ($row = Database::fetch_array($rs)) { |
|
| 3228 | 3227 | $user_displayed = api_get_person_name($row['firstname'], $row['lastname']); |
| 3229 | 3228 | } else { |
| 3230 | 3229 | $user_displayed = '-'; |
@@ -3239,8 +3238,8 @@ discard block |
||
| 3239 | 3238 | |
| 3240 | 3239 | if ($display_extra_user_fields) { |
| 3241 | 3240 | //show user fields data, if any, for this user |
| 3242 | - $user_fields_values = UserManager::get_extra_user_data(intval($user),false,false, false, true); |
|
| 3243 | - foreach($user_fields_values as $value) { |
|
| 3241 | + $user_fields_values = UserManager::get_extra_user_data(intval($user), false, false, false, true); |
|
| 3242 | + foreach ($user_fields_values as $value) { |
|
| 3244 | 3243 | $return[] = api_html_entity_decode(strip_tags($value), ENT_QUOTES); |
| 3245 | 3244 | } |
| 3246 | 3245 | } |
@@ -3249,7 +3248,7 @@ discard block |
||
| 3249 | 3248 | foreach ($possible_options as $question_id => & $possible_option) { |
| 3250 | 3249 | if (is_array($possible_option) && count($possible_option) > 0) { |
| 3251 | 3250 | foreach ($possible_option as $option_id => & $value) { |
| 3252 | - $my_answers_of_user = ($answers_of_user[$question_id]==null) ? array() : $answers_of_user[$question_id]; |
|
| 3251 | + $my_answers_of_user = ($answers_of_user[$question_id] == null) ? array() : $answers_of_user[$question_id]; |
|
| 3253 | 3252 | $key = array_keys($my_answers_of_user); |
| 3254 | 3253 | if (substr($key[0], 0, 4) == 'open') { |
| 3255 | 3254 | $return[] = api_html_entity_decode(strip_tags($answers_of_user[$question_id][$key[0]]['option_id']), ENT_QUOTES); |
@@ -3299,7 +3298,7 @@ discard block |
||
| 3299 | 3298 | // Actions bar |
| 3300 | 3299 | echo '<div class="actions">'; |
| 3301 | 3300 | echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?survey_id='.intval($_GET['survey_id']).'">'. |
| 3302 | - Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('ReportingOverview'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
| 3301 | + Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('ReportingOverview'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
| 3303 | 3302 | echo '</div>'; |
| 3304 | 3303 | |
| 3305 | 3304 | // Displaying an information message that only the questions with predefined answers can be used in a comparative report |
@@ -3364,25 +3363,25 @@ discard block |
||
| 3364 | 3363 | |
| 3365 | 3364 | $xOptions = array(); |
| 3366 | 3365 | // The header |
| 3367 | - $tableHtml .= ' <tr>'; |
|
| 3366 | + $tableHtml .= ' <tr>'; |
|
| 3368 | 3367 | for ($ii = 0; $ii <= count($question_x['answers']); $ii++) { |
| 3369 | 3368 | if ($ii == 0) { |
| 3370 | - $tableHtml .= ' <th> </th>'; |
|
| 3369 | + $tableHtml .= ' <th> </th>'; |
|
| 3371 | 3370 | } else { |
| 3372 | 3371 | if ($question_x['type'] == 'score') { |
| 3373 | 3372 | for ($x = 1; $x <= $question_x['maximum_score']; $x++) { |
| 3374 | - $tableHtml .= ' <th>'.$question_x['answers'][($ii-1)].'<br />'.$x.'</th>'; |
|
| 3373 | + $tableHtml .= ' <th>'.$question_x['answers'][($ii - 1)].'<br />'.$x.'</th>'; |
|
| 3375 | 3374 | } |
| 3376 | 3375 | $x = ''; |
| 3377 | 3376 | } else { |
| 3378 | - $tableHtml .= ' <th>'.$question_x['answers'][($ii-1)].'</th>'; |
|
| 3377 | + $tableHtml .= ' <th>'.$question_x['answers'][($ii - 1)].'</th>'; |
|
| 3379 | 3378 | } |
| 3380 | - $optionText = strip_tags($question_x['answers'][$ii-1]); |
|
| 3379 | + $optionText = strip_tags($question_x['answers'][$ii - 1]); |
|
| 3381 | 3380 | $optionText = html_entity_decode($optionText); |
| 3382 | 3381 | array_push($xOptions, trim($optionText)); |
| 3383 | 3382 | } |
| 3384 | 3383 | } |
| 3385 | - $tableHtml .= ' </tr>'; |
|
| 3384 | + $tableHtml .= ' </tr>'; |
|
| 3386 | 3385 | $chartData = array(); |
| 3387 | 3386 | |
| 3388 | 3387 | // The main part |
@@ -3392,15 +3391,15 @@ discard block |
||
| 3392 | 3391 | // The Y axis is a scoring question type so we have more rows than the options (actually options * maximum score) |
| 3393 | 3392 | if ($question_y['type'] == 'score') { |
| 3394 | 3393 | for ($y = 1; $y <= $question_y['maximum_score']; $y++) { |
| 3395 | - $tableHtml .= ' <tr>'; |
|
| 3394 | + $tableHtml .= ' <tr>'; |
|
| 3396 | 3395 | for ($ii = 0; $ii <= count($question_x['answers']); $ii++) { |
| 3397 | 3396 | if ($question_x['type'] == 'score') { |
| 3398 | 3397 | for ($x = 1; $x <= $question_x['maximum_score']; $x++) { |
| 3399 | 3398 | if ($ii == 0) { |
| 3400 | - $tableHtml .= ' <th>'.$question_y['answers'][($ij)].' '.$y.'</th>'; |
|
| 3399 | + $tableHtml .= ' <th>'.$question_y['answers'][($ij)].' '.$y.'</th>'; |
|
| 3401 | 3400 | break; |
| 3402 | 3401 | } else { |
| 3403 | - $tableHtml .= ' <td align="center">'; |
|
| 3402 | + $tableHtml .= ' <td align="center">'; |
|
| 3404 | 3403 | $votes = SurveyUtil::comparative_check( |
| 3405 | 3404 | $answers_x, |
| 3406 | 3405 | $answers_y, |
@@ -3409,23 +3408,23 @@ discard block |
||
| 3409 | 3408 | $x, |
| 3410 | 3409 | $y |
| 3411 | 3410 | ); |
| 3412 | - $tableHtml .= $votes; |
|
| 3411 | + $tableHtml .= $votes; |
|
| 3413 | 3412 | array_push( |
| 3414 | 3413 | $chartData, |
| 3415 | 3414 | array( |
| 3416 | - 'serie' => array($currentYQuestion, $xOptions[$ii-1]), |
|
| 3415 | + 'serie' => array($currentYQuestion, $xOptions[$ii - 1]), |
|
| 3417 | 3416 | 'option' => $x, |
| 3418 | 3417 | 'votes' => $votes |
| 3419 | 3418 | ) |
| 3420 | 3419 | ); |
| 3421 | - $tableHtml .= '</td>'; |
|
| 3420 | + $tableHtml .= '</td>'; |
|
| 3422 | 3421 | } |
| 3423 | 3422 | } |
| 3424 | 3423 | } else { |
| 3425 | 3424 | if ($ii == 0) { |
| 3426 | - $tableHtml .= '<th>'.$question_y['answers'][$ij].' '.$y.'</th>'; |
|
| 3425 | + $tableHtml .= '<th>'.$question_y['answers'][$ij].' '.$y.'</th>'; |
|
| 3427 | 3426 | } else { |
| 3428 | - $tableHtml .= '<td align="center">'; |
|
| 3427 | + $tableHtml .= '<td align="center">'; |
|
| 3429 | 3428 | $votes = SurveyUtil::comparative_check( |
| 3430 | 3429 | $answers_x, |
| 3431 | 3430 | $answers_y, |
@@ -3438,65 +3437,65 @@ discard block |
||
| 3438 | 3437 | array_push( |
| 3439 | 3438 | $chartData, |
| 3440 | 3439 | array( |
| 3441 | - 'serie' => array($currentYQuestion, $xOptions[$ii-1]), |
|
| 3440 | + 'serie' => array($currentYQuestion, $xOptions[$ii - 1]), |
|
| 3442 | 3441 | 'option' => $y, |
| 3443 | 3442 | 'votes' => $votes |
| 3444 | 3443 | ) |
| 3445 | 3444 | ); |
| 3446 | - $tableHtml .= '</td>'; |
|
| 3445 | + $tableHtml .= '</td>'; |
|
| 3447 | 3446 | } |
| 3448 | 3447 | } |
| 3449 | 3448 | } |
| 3450 | - $tableHtml .= ' </tr>'; |
|
| 3449 | + $tableHtml .= ' </tr>'; |
|
| 3451 | 3450 | } |
| 3452 | 3451 | } |
| 3453 | 3452 | // The Y axis is NOT a score question type so the number of rows = the number of options |
| 3454 | 3453 | else { |
| 3455 | - $tableHtml .= ' <tr>'; |
|
| 3454 | + $tableHtml .= ' <tr>'; |
|
| 3456 | 3455 | for ($ii = 0; $ii <= count($question_x['answers']); $ii++) { |
| 3457 | 3456 | if ($question_x['type'] == 'score') { |
| 3458 | 3457 | for ($x = 1; $x <= $question_x['maximum_score']; $x++) { |
| 3459 | 3458 | if ($ii == 0) { |
| 3460 | - $tableHtml .= ' <th>'.$question_y['answers'][$ij].'</th>'; |
|
| 3459 | + $tableHtml .= ' <th>'.$question_y['answers'][$ij].'</th>'; |
|
| 3461 | 3460 | break; |
| 3462 | 3461 | } else { |
| 3463 | - $tableHtml .= ' <td align="center">'; |
|
| 3464 | - $votes = SurveyUtil::comparative_check($answers_x, $answers_y, $question_x['answersid'][($ii-1)], $question_y['answersid'][($ij)], $x, 0); |
|
| 3462 | + $tableHtml .= ' <td align="center">'; |
|
| 3463 | + $votes = SurveyUtil::comparative_check($answers_x, $answers_y, $question_x['answersid'][($ii - 1)], $question_y['answersid'][($ij)], $x, 0); |
|
| 3465 | 3464 | $tableHtml .= $votes; |
| 3466 | 3465 | array_push( |
| 3467 | 3466 | $chartData, |
| 3468 | 3467 | array( |
| 3469 | - 'serie' => array($currentYQuestion, $xOptions[$ii-1]), |
|
| 3468 | + 'serie' => array($currentYQuestion, $xOptions[$ii - 1]), |
|
| 3470 | 3469 | 'option' => $x, |
| 3471 | 3470 | 'votes' => $votes |
| 3472 | 3471 | ) |
| 3473 | 3472 | ); |
| 3474 | - $tableHtml .= '</td>'; |
|
| 3473 | + $tableHtml .= '</td>'; |
|
| 3475 | 3474 | } |
| 3476 | 3475 | } |
| 3477 | 3476 | } else { |
| 3478 | 3477 | if ($ii == 0) { |
| 3479 | - $tableHtml .= ' <th>'.$question_y['answers'][($ij)].'</th>'; |
|
| 3478 | + $tableHtml .= ' <th>'.$question_y['answers'][($ij)].'</th>'; |
|
| 3480 | 3479 | } else { |
| 3481 | - $tableHtml .= ' <td align="center">'; |
|
| 3482 | - $votes = SurveyUtil::comparative_check($answers_x, $answers_y, $question_x['answersid'][($ii-1)], $question_y['answersid'][($ij)]); |
|
| 3480 | + $tableHtml .= ' <td align="center">'; |
|
| 3481 | + $votes = SurveyUtil::comparative_check($answers_x, $answers_y, $question_x['answersid'][($ii - 1)], $question_y['answersid'][($ij)]); |
|
| 3483 | 3482 | $tableHtml .= $votes; |
| 3484 | 3483 | array_push( |
| 3485 | 3484 | $chartData, |
| 3486 | 3485 | array( |
| 3487 | - 'serie' => $xOptions[$ii-1], |
|
| 3486 | + 'serie' => $xOptions[$ii - 1], |
|
| 3488 | 3487 | 'option' => $currentYQuestion, |
| 3489 | 3488 | 'votes' => $votes |
| 3490 | 3489 | ) |
| 3491 | 3490 | ); |
| 3492 | - $tableHtml .= '</td>'; |
|
| 3491 | + $tableHtml .= '</td>'; |
|
| 3493 | 3492 | } |
| 3494 | 3493 | } |
| 3495 | 3494 | } |
| 3496 | - $tableHtml .= ' </tr>'; |
|
| 3495 | + $tableHtml .= ' </tr>'; |
|
| 3497 | 3496 | } |
| 3498 | 3497 | } |
| 3499 | - $tableHtml .= '</table>'; |
|
| 3498 | + $tableHtml .= '</table>'; |
|
| 3500 | 3499 | echo '<div id="chartContainer" class="col-md-12">'; |
| 3501 | 3500 | echo self::drawChart($chartData, true); |
| 3502 | 3501 | echo '</div>'; |
@@ -3636,7 +3635,7 @@ discard block |
||
| 3636 | 3635 | survey_id='".intval($_GET['survey_id'])."' AND |
| 3637 | 3636 | session_id='".api_get_session_id()."' "; |
| 3638 | 3637 | $res = Database::query($sql); |
| 3639 | - $row = Database::fetch_array($res,'ASSOC'); |
|
| 3638 | + $row = Database::fetch_array($res, 'ASSOC'); |
|
| 3640 | 3639 | |
| 3641 | 3640 | return $row['total']; |
| 3642 | 3641 | } |
@@ -3711,7 +3710,7 @@ discard block |
||
| 3711 | 3710 | $exclude_users = SurveyManager::get_people_who_filled_survey($_GET['survey_id']); |
| 3712 | 3711 | } |
| 3713 | 3712 | |
| 3714 | - $counter = 0; // Nr of invitations "sent" (if sendmail option) |
|
| 3713 | + $counter = 0; // Nr of invitations "sent" (if sendmail option) |
|
| 3715 | 3714 | $course_id = api_get_course_int_id(); |
| 3716 | 3715 | $session_id = api_get_session_id(); |
| 3717 | 3716 | |
@@ -3867,7 +3866,7 @@ discard block |
||
| 3867 | 3866 | $text_link = '<a href="'.$survey_link.'">'.get_lang('ClickHereToAnswerTheSurvey')."</a><br />\r\n<br />\r\n".get_lang('OrCopyPasteTheFollowingUrl')." <br />\r\n ".$survey_link; |
| 3868 | 3867 | |
| 3869 | 3868 | $replace_count = 0; |
| 3870 | - $full_invitation_text = api_str_ireplace('**link**', $text_link ,$invitation_text, $replace_count); |
|
| 3869 | + $full_invitation_text = api_str_ireplace('**link**', $text_link, $invitation_text, $replace_count); |
|
| 3871 | 3870 | if ($replace_count < 1) { |
| 3872 | 3871 | $full_invitation_text = $full_invitation_text."<br />\r\n<br />\r\n".$text_link; |
| 3873 | 3872 | } |
@@ -3939,8 +3938,8 @@ discard block |
||
| 3939 | 3938 | $course_id = api_get_course_int_id(); |
| 3940 | 3939 | |
| 3941 | 3940 | // Database table definition |
| 3942 | - $table_survey_invitation = Database :: get_course_table(TABLE_SURVEY_INVITATION); |
|
| 3943 | - $table_survey = Database :: get_course_table(TABLE_SURVEY); |
|
| 3941 | + $table_survey_invitation = Database :: get_course_table(TABLE_SURVEY_INVITATION); |
|
| 3942 | + $table_survey = Database :: get_course_table(TABLE_SURVEY); |
|
| 3944 | 3943 | |
| 3945 | 3944 | // Counting the number of people that are invited |
| 3946 | 3945 | $sql = "SELECT count(user) as total |
@@ -4054,7 +4053,7 @@ discard block |
||
| 4054 | 4053 | { |
| 4055 | 4054 | $course_id = api_get_course_int_id(); |
| 4056 | 4055 | // Database table definition |
| 4057 | - $table_survey_invitation = Database :: get_course_table(TABLE_SURVEY_INVITATION); |
|
| 4056 | + $table_survey_invitation = Database :: get_course_table(TABLE_SURVEY_INVITATION); |
|
| 4058 | 4057 | |
| 4059 | 4058 | $sql = "SELECT * FROM $table_survey_invitation |
| 4060 | 4059 | WHERE |
@@ -4190,7 +4189,7 @@ discard block |
||
| 4190 | 4189 | function display_survey_list_for_coach() |
| 4191 | 4190 | { |
| 4192 | 4191 | $parameters = array(); |
| 4193 | - $parameters['cidReq']=api_get_course_id(); |
|
| 4192 | + $parameters['cidReq'] = api_get_course_id(); |
|
| 4194 | 4193 | if (isset($_GET['do_search'])) { |
| 4195 | 4194 | $message = get_lang('DisplaySearchResults').'<br />'; |
| 4196 | 4195 | $message .= '<a href="'.api_get_self().'?'.api_get_cidreq().'">'.get_lang('DisplayAll').'</a>'; |
@@ -4234,17 +4233,17 @@ discard block |
||
| 4234 | 4233 | |
| 4235 | 4234 | if ($drh) { |
| 4236 | 4235 | return '<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?'.api_get_cidreq().'&survey_id='.$survey_id.'">'. |
| 4237 | - Display::return_icon('stats.png', get_lang('Reporting'),'',ICON_SIZE_SMALL).'</a>'; |
|
| 4236 | + Display::return_icon('stats.png', get_lang('Reporting'), '', ICON_SIZE_SMALL).'</a>'; |
|
| 4238 | 4237 | } |
| 4239 | 4238 | |
| 4240 | 4239 | // Coach can see that only if the survey is in his session |
| 4241 | 4240 | if (api_is_allowed_to_edit() || |
| 4242 | 4241 | api_is_element_in_the_session(TOOL_SURVEY, $survey_id) |
| 4243 | 4242 | ) { |
| 4244 | - $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>'; |
|
| 4243 | + $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>'; |
|
| 4245 | 4244 | if (SurveyManager::survey_generation_hash_available()) { |
| 4246 | - $return .= Display::url( |
|
| 4247 | - Display::return_icon('new_link.png', get_lang('GenerateSurveyAccessLink'),'',ICON_SIZE_SMALL), |
|
| 4245 | + $return .= Display::url( |
|
| 4246 | + Display::return_icon('new_link.png', get_lang('GenerateSurveyAccessLink'), '', ICON_SIZE_SMALL), |
|
| 4248 | 4247 | api_get_path(WEB_CODE_PATH).'survey/generate_link.php?survey_id='.$survey_id.'&'.api_get_cidreq() |
| 4249 | 4248 | ); |
| 4250 | 4249 | } |
@@ -4254,20 +4253,20 @@ discard block |
||
| 4254 | 4253 | ); |
| 4255 | 4254 | |
| 4256 | 4255 | $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;">'. |
| 4257 | - Display::return_icon('clean.png', get_lang('EmptySurvey'),'',ICON_SIZE_SMALL).'</a> '; |
|
| 4256 | + Display::return_icon('clean.png', get_lang('EmptySurvey'), '', ICON_SIZE_SMALL).'</a> '; |
|
| 4258 | 4257 | } |
| 4259 | 4258 | $return .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/preview.php?'.api_get_cidreq().'&survey_id='.$survey_id.'">'. |
| 4260 | - Display::return_icon('preview_view.png', get_lang('Preview'),'',ICON_SIZE_SMALL).'</a> '; |
|
| 4259 | + Display::return_icon('preview_view.png', get_lang('Preview'), '', ICON_SIZE_SMALL).'</a> '; |
|
| 4261 | 4260 | $return .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_invite.php?'.api_get_cidreq().'&survey_id='.$survey_id.'">'. |
| 4262 | - Display::return_icon('mail_send.png', get_lang('Publish'),'',ICON_SIZE_SMALL).'</a> '; |
|
| 4261 | + Display::return_icon('mail_send.png', get_lang('Publish'), '', ICON_SIZE_SMALL).'</a> '; |
|
| 4263 | 4262 | $return .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?'.api_get_cidreq().'&survey_id='.$survey_id.'">'. |
| 4264 | - Display::return_icon('stats.png', get_lang('Reporting'),'',ICON_SIZE_SMALL).'</a>'; |
|
| 4263 | + Display::return_icon('stats.png', get_lang('Reporting'), '', ICON_SIZE_SMALL).'</a>'; |
|
| 4265 | 4264 | |
| 4266 | 4265 | if (api_is_allowed_to_edit() || |
| 4267 | 4266 | api_is_element_in_the_session(TOOL_SURVEY, $survey_id) |
| 4268 | 4267 | ) { |
| 4269 | 4268 | $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;">'. |
| 4270 | - Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a> '; |
|
| 4269 | + Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a> '; |
|
| 4271 | 4270 | } |
| 4272 | 4271 | |
| 4273 | 4272 | return $return; |
@@ -4280,9 +4279,9 @@ discard block |
||
| 4280 | 4279 | //$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>'; |
| 4281 | 4280 | //$return .= '<a href="create_survey_in_another_language.php?id_survey='.$survey_id.'">'.Display::return_icon('copy.gif', get_lang('Copy')).'</a>'; |
| 4282 | 4281 | //$return .= '<a href="survey.php?survey_id='.$survey_id.'">'.Display::return_icon('add.gif', get_lang('Add')).'</a>'; |
| 4283 | - $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> '; |
|
| 4284 | - $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> '; |
|
| 4285 | - $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> '; |
|
| 4282 | + $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> '; |
|
| 4283 | + $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> '; |
|
| 4284 | + $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> '; |
|
| 4286 | 4285 | //$return .= '<a href="reporting.php?'.api_get_cidreq().'&survey_id='.$survey_id.'">'.Display::return_icon('statistics.gif', get_lang('Reporting')).'</a>'; |
| 4287 | 4286 | return $return; |
| 4288 | 4287 | } |
@@ -4437,7 +4436,7 @@ discard block |
||
| 4437 | 4436 | |
| 4438 | 4437 | // Validation when belonging to a session |
| 4439 | 4438 | $session_img = api_get_session_image($survey['session_id'], $_user['status']); |
| 4440 | - $array[2] = $survey[2] . $session_img; |
|
| 4439 | + $array[2] = $survey[2].$session_img; |
|
| 4441 | 4440 | $array[3] = $survey[3]; |
| 4442 | 4441 | $array[4] = $survey[4]; |
| 4443 | 4442 | $array[5] = $survey[5]; |
@@ -4471,10 +4470,10 @@ discard block |
||
| 4471 | 4470 | $last_version_surveys = $survey_tree->get_last_children_from_branch($survey_tree->surveylist); |
| 4472 | 4471 | $list = array(); |
| 4473 | 4472 | foreach ($last_version_surveys as & $survey) { |
| 4474 | - $list[]=$survey['id']; |
|
| 4473 | + $list[] = $survey['id']; |
|
| 4475 | 4474 | } |
| 4476 | 4475 | if (count($list) > 0) { |
| 4477 | - $list_condition = " AND survey.survey_id IN (".implode(',',$list).") "; |
|
| 4476 | + $list_condition = " AND survey.survey_id IN (".implode(',', $list).") "; |
|
| 4478 | 4477 | } else { |
| 4479 | 4478 | $list_condition = ''; |
| 4480 | 4479 | } |
@@ -4486,9 +4485,9 @@ discard block |
||
| 4486 | 4485 | $direction = 'asc'; |
| 4487 | 4486 | } |
| 4488 | 4487 | |
| 4489 | - $table_survey = Database :: get_course_table(TABLE_SURVEY); |
|
| 4490 | - $table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); |
|
| 4491 | - $table_user = Database :: get_main_table(TABLE_MAIN_USER); |
|
| 4488 | + $table_survey = Database :: get_course_table(TABLE_SURVEY); |
|
| 4489 | + $table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); |
|
| 4490 | + $table_user = Database :: get_main_table(TABLE_MAIN_USER); |
|
| 4492 | 4491 | |
| 4493 | 4492 | $course_id = api_get_course_int_id(); |
| 4494 | 4493 | |
@@ -4603,16 +4602,16 @@ discard block |
||
| 4603 | 4602 | ) |
| 4604 | 4603 | "; |
| 4605 | 4604 | $result_answer = Database::query($sql); |
| 4606 | - $row_answer = Database::fetch_array($result_answer,'ASSOC'); |
|
| 4605 | + $row_answer = Database::fetch_array($result_answer, 'ASSOC'); |
|
| 4607 | 4606 | echo '<tr>'; |
| 4608 | 4607 | if ($row['answered'] == 0) { |
| 4609 | 4608 | echo '<td>'; |
| 4610 | - echo Display::return_icon('statistics.png', get_lang('CreateNewSurvey'),array('style'=>'inline-block'),ICON_SIZE_TINY); |
|
| 4609 | + echo Display::return_icon('statistics.png', get_lang('CreateNewSurvey'), array('style'=>'inline-block'), ICON_SIZE_TINY); |
|
| 4611 | 4610 | 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>'; |
| 4612 | 4611 | } else { |
| 4613 | 4612 | //echo '<td>'.$row['title'].'</td>'; |
| 4614 | 4613 | echo '<td>'; |
| 4615 | - echo Display::return_icon('statistics_na.png', get_lang('CreateNewSurvey'),array('style'=>'inline-block'),ICON_SIZE_TINY); |
|
| 4614 | + echo Display::return_icon('statistics_na.png', get_lang('CreateNewSurvey'), array('style'=>'inline-block'), ICON_SIZE_TINY); |
|
| 4616 | 4615 | 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>'; |
| 4617 | 4616 | } |
| 4618 | 4617 | echo '<td class="center">'; |
@@ -4624,7 +4623,7 @@ discard block |
||
| 4624 | 4623 | } else { |
| 4625 | 4624 | $current_user_id = api_get_user_id(); |
| 4626 | 4625 | } |
| 4627 | - $link_available = self::show_link_available(api_get_user_id(),$row['code'],$current_user_id); |
|
| 4626 | + $link_available = self::show_link_available(api_get_user_id(), $row['code'], $current_user_id); |
|
| 4628 | 4627 | //todo check this link |
| 4629 | 4628 | if ($link_add === true && $link_available === true) { |
| 4630 | 4629 | //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>'; |
@@ -4769,7 +4768,7 @@ discard block |
||
| 4769 | 4768 | if ($field_details[7] == 0) { |
| 4770 | 4769 | $field_list_array['extra_'.$field_details[1]]['visibility'] = 0; |
| 4771 | 4770 | } else { |
| 4772 | - $field_list_array['extra_'.$field_details[1]]['visibility']=1; |
|
| 4771 | + $field_list_array['extra_'.$field_details[1]]['visibility'] = 1; |
|
| 4773 | 4772 | } |
| 4774 | 4773 | break; |
| 4775 | 4774 | case UserManager::USER_FIELD_TYPE_DIVIDER: |
@@ -4836,7 +4835,7 @@ discard block |
||
| 4836 | 4835 | $htmlChart = ''; |
| 4837 | 4836 | if (api_browser_support("svg")) { |
| 4838 | 4837 | $htmlChart .= api_get_js("d3/d3.v3.5.4.min.js"); |
| 4839 | - $htmlChart .= api_get_js("dimple.v2.1.2.min.js") . ' |
|
| 4838 | + $htmlChart .= api_get_js("dimple.v2.1.2.min.js").' |
|
| 4840 | 4839 | <script type="text/javascript"> |
| 4841 | 4840 | var svg = dimple.newSvg("#'.$chartContainerId.'", "100%", 400); |
| 4842 | 4841 | var data = ['; |
@@ -4845,40 +4844,40 @@ discard block |
||
| 4845 | 4844 | foreach ($chartData as $chartDataElement) { |
| 4846 | 4845 | $htmlChart .= '{"'; |
| 4847 | 4846 | if (!$hasSerie) { |
| 4848 | - $htmlChart .= get_lang("Option") . '":"' . $chartDataElement['option'] . '", "'; |
|
| 4847 | + $htmlChart .= get_lang("Option").'":"'.$chartDataElement['option'].'", "'; |
|
| 4849 | 4848 | array_push($order, $chartDataElement['option']); |
| 4850 | 4849 | } else { |
| 4851 | 4850 | if (!is_array($chartDataElement['serie'])) { |
| 4852 | - $htmlChart .= get_lang("Option") . '":"' . $chartDataElement['serie'] . '", "' . |
|
| 4853 | - get_lang("Score") . '":"' . $chartDataElement['option'] . '", "'; |
|
| 4851 | + $htmlChart .= get_lang("Option").'":"'.$chartDataElement['serie'].'", "'. |
|
| 4852 | + get_lang("Score").'":"'.$chartDataElement['option'].'", "'; |
|
| 4854 | 4853 | array_push($serie, $chartDataElement['serie']); |
| 4855 | 4854 | } else { |
| 4856 | - $htmlChart .= get_lang("Serie") . '":"' . $chartDataElement['serie'][0] . '", "' . |
|
| 4857 | - get_lang("Option") . '":"' . $chartDataElement['serie'][1] . '", "' . |
|
| 4858 | - get_lang("Score") . '":"' . $chartDataElement['option'] . '", "'; |
|
| 4855 | + $htmlChart .= get_lang("Serie").'":"'.$chartDataElement['serie'][0].'", "'. |
|
| 4856 | + get_lang("Option").'":"'.$chartDataElement['serie'][1].'", "'. |
|
| 4857 | + get_lang("Score").'":"'.$chartDataElement['option'].'", "'; |
|
| 4859 | 4858 | } |
| 4860 | 4859 | } |
| 4861 | - $htmlChart .= get_lang("Votes") . '":"' . $chartDataElement['votes'] . |
|
| 4860 | + $htmlChart .= get_lang("Votes").'":"'.$chartDataElement['votes']. |
|
| 4862 | 4861 | '"},'; |
| 4863 | 4862 | } |
| 4864 | 4863 | rtrim($htmlChart, ","); |
| 4865 | 4864 | $htmlChart .= ']; |
| 4866 | 4865 | var myChart = new dimple.chart(svg, data); |
| 4867 | - myChart.addMeasureAxis("y", "' . get_lang("Votes") . '");'; |
|
| 4866 | + myChart.addMeasureAxis("y", "' . get_lang("Votes").'");'; |
|
| 4868 | 4867 | if (!$hasSerie) { |
| 4869 | - $htmlChart .= 'var xAxisCategory = myChart.addCategoryAxis("x", "' . get_lang("Option") . '"); |
|
| 4870 | - xAxisCategory.addOrderRule(' . json_encode($order) . '); |
|
| 4871 | - myChart.addSeries("' . get_lang("Option") . '", dimple.plot.bar);'; |
|
| 4868 | + $htmlChart .= 'var xAxisCategory = myChart.addCategoryAxis("x", "'.get_lang("Option").'"); |
|
| 4869 | + xAxisCategory.addOrderRule(' . json_encode($order).'); |
|
| 4870 | + myChart.addSeries("' . get_lang("Option").'", dimple.plot.bar);'; |
|
| 4872 | 4871 | } else { |
| 4873 | 4872 | if (!is_array($chartDataElement['serie'])) { |
| 4874 | 4873 | $serie = array_values(array_unique($serie)); |
| 4875 | - $htmlChart .= 'var xAxisCategory = myChart.addCategoryAxis("x", ["' . get_lang("Option") . '","' . get_lang("Score") . '"]); |
|
| 4876 | - xAxisCategory.addOrderRule(' . json_encode($serie) . '); |
|
| 4877 | - xAxisCategory.addGroupOrderRule("' . get_lang("Score") . '"); |
|
| 4878 | - myChart.addSeries("' . get_lang("Option") . '", dimple.plot.bar);'; |
|
| 4874 | + $htmlChart .= 'var xAxisCategory = myChart.addCategoryAxis("x", ["'.get_lang("Option").'","'.get_lang("Score").'"]); |
|
| 4875 | + xAxisCategory.addOrderRule(' . json_encode($serie).'); |
|
| 4876 | + xAxisCategory.addGroupOrderRule("' . get_lang("Score").'"); |
|
| 4877 | + myChart.addSeries("' . get_lang("Option").'", dimple.plot.bar);'; |
|
| 4879 | 4878 | } else { |
| 4880 | - $htmlChart .= 'myChart.addCategoryAxis("x", ["' . get_lang("Option") . '","' . get_lang("Score") . '"]); |
|
| 4881 | - myChart.addSeries("' . get_lang("Serie") . '", dimple.plot.bar);'; |
|
| 4879 | + $htmlChart .= 'myChart.addCategoryAxis("x", ["'.get_lang("Option").'","'.get_lang("Score").'"]); |
|
| 4880 | + myChart.addSeries("' . get_lang("Serie").'", dimple.plot.bar);'; |
|
| 4882 | 4881 | } |
| 4883 | 4882 | } |
| 4884 | 4883 | $htmlChart .= 'myChart.draw(); |
@@ -63,52 +63,52 @@ discard block |
||
| 63 | 63 | if (isset($_GET['details'])) { |
| 64 | 64 | if ($origin == 'user_course') { |
| 65 | 65 | if (empty ($cidReq)) { |
| 66 | - $interbreadcrumb[] = array ( |
|
| 67 | - "url" => api_get_path(WEB_COURSE_PATH) . $courseInfo['directory'], |
|
| 66 | + $interbreadcrumb[] = array( |
|
| 67 | + "url" => api_get_path(WEB_COURSE_PATH).$courseInfo['directory'], |
|
| 68 | 68 | 'name' => $courseInfo['title'] |
| 69 | 69 | ); |
| 70 | 70 | } |
| 71 | - $interbreadcrumb[] = array ( |
|
| 72 | - "url" => "../user/user.php?cidReq=" . $course_code, |
|
| 71 | + $interbreadcrumb[] = array( |
|
| 72 | + "url" => "../user/user.php?cidReq=".$course_code, |
|
| 73 | 73 | "name" => get_lang("Users") |
| 74 | 74 | ); |
| 75 | 75 | } else |
| 76 | 76 | if ($origin == 'tracking_course') { |
| 77 | - $interbreadcrumb[] = array ( |
|
| 78 | - "url" => "../tracking/courseLog.php?cidReq=".$course_code.'&id_session=' . api_get_session_id(), |
|
| 77 | + $interbreadcrumb[] = array( |
|
| 78 | + "url" => "../tracking/courseLog.php?cidReq=".$course_code.'&id_session='.api_get_session_id(), |
|
| 79 | 79 | "name" => get_lang("Tracking") |
| 80 | 80 | ); |
| 81 | 81 | } else |
| 82 | 82 | if ($origin == 'resume_session') { |
| 83 | - $interbreadcrumb[] = array ( |
|
| 83 | + $interbreadcrumb[] = array( |
|
| 84 | 84 | 'url' => "../session/session_list.php", |
| 85 | 85 | "name" => get_lang('SessionList') |
| 86 | 86 | ); |
| 87 | - $interbreadcrumb[] = array ( |
|
| 88 | - 'url' => "../session/resume_session.php?id_session=" . $sessionId, |
|
| 87 | + $interbreadcrumb[] = array( |
|
| 88 | + 'url' => "../session/resume_session.php?id_session=".$sessionId, |
|
| 89 | 89 | "name" => get_lang('SessionOverview') |
| 90 | 90 | ); |
| 91 | 91 | } else { |
| 92 | - $interbreadcrumb[] = array ( |
|
| 92 | + $interbreadcrumb[] = array( |
|
| 93 | 93 | "url" => "index.php", |
| 94 | 94 | "name" => get_lang('MySpace') |
| 95 | 95 | ); |
| 96 | 96 | if (isset ($_GET['id_coach']) && intval($_GET['id_coach']) != 0) { |
| 97 | - $interbreadcrumb[] = array ( |
|
| 98 | - "url" => "student.php?id_coach=" . Security :: remove_XSS($_GET['id_coach']), |
|
| 97 | + $interbreadcrumb[] = array( |
|
| 98 | + "url" => "student.php?id_coach=".Security :: remove_XSS($_GET['id_coach']), |
|
| 99 | 99 | "name" => get_lang("CoachStudents") |
| 100 | 100 | ); |
| 101 | - $interbreadcrumb[] = array ( |
|
| 102 | - "url" => "myStudents.php?student=" . Security :: remove_XSS($_GET['student']) . '&id_coach=' . Security :: remove_XSS($_GET['id_coach']), |
|
| 101 | + $interbreadcrumb[] = array( |
|
| 102 | + "url" => "myStudents.php?student=".Security :: remove_XSS($_GET['student']).'&id_coach='.Security :: remove_XSS($_GET['id_coach']), |
|
| 103 | 103 | "name" => get_lang("StudentDetails") |
| 104 | 104 | ); |
| 105 | 105 | } else { |
| 106 | - $interbreadcrumb[] = array ( |
|
| 106 | + $interbreadcrumb[] = array( |
|
| 107 | 107 | "url" => "student.php", |
| 108 | 108 | "name" => get_lang("MyStudents") |
| 109 | 109 | ); |
| 110 | - $interbreadcrumb[] = array ( |
|
| 111 | - "url" => "myStudents.php?student=" . Security :: remove_XSS($_GET['student']), |
|
| 110 | + $interbreadcrumb[] = array( |
|
| 111 | + "url" => "myStudents.php?student=".Security :: remove_XSS($_GET['student']), |
|
| 112 | 112 | "name" => get_lang("StudentDetails") |
| 113 | 113 | ); |
| 114 | 114 | } |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | $nameTools = get_lang("DetailsStudentInCourse"); |
| 117 | 117 | } else { |
| 118 | 118 | if ($origin == 'resume_session') { |
| 119 | - $interbreadcrumb[] = array ( |
|
| 119 | + $interbreadcrumb[] = array( |
|
| 120 | 120 | 'url' => "../session/session_list.php", |
| 121 | 121 | "name" => get_lang('SessionList') |
| 122 | 122 | ); |
@@ -127,24 +127,24 @@ discard block |
||
| 127 | 127 | ); |
| 128 | 128 | } |
| 129 | 129 | } else { |
| 130 | - $interbreadcrumb[] = array ( |
|
| 130 | + $interbreadcrumb[] = array( |
|
| 131 | 131 | "url" => "index.php", |
| 132 | 132 | "name" => get_lang('MySpace') |
| 133 | 133 | ); |
| 134 | 134 | if (isset ($_GET['id_coach']) && intval($_GET['id_coach']) != 0) { |
| 135 | 135 | if ($sessionId) { |
| 136 | - $interbreadcrumb[] = array ( |
|
| 137 | - "url" => "student.php?id_coach=" . Security :: remove_XSS($_GET['id_coach']) . "&id_session=" . $sessionId, |
|
| 136 | + $interbreadcrumb[] = array( |
|
| 137 | + "url" => "student.php?id_coach=".Security :: remove_XSS($_GET['id_coach'])."&id_session=".$sessionId, |
|
| 138 | 138 | "name" => get_lang("CoachStudents") |
| 139 | 139 | ); |
| 140 | 140 | } else { |
| 141 | - $interbreadcrumb[] = array ( |
|
| 142 | - "url" => "student.php?id_coach=" . Security :: remove_XSS($_GET['id_coach']), |
|
| 141 | + $interbreadcrumb[] = array( |
|
| 142 | + "url" => "student.php?id_coach=".Security :: remove_XSS($_GET['id_coach']), |
|
| 143 | 143 | "name" => get_lang("CoachStudents") |
| 144 | 144 | ); |
| 145 | 145 | } |
| 146 | 146 | } else { |
| 147 | - $interbreadcrumb[] = array ( |
|
| 147 | + $interbreadcrumb[] = array( |
|
| 148 | 148 | "url" => "student.php", |
| 149 | 149 | "name" => get_lang("MyStudents") |
| 150 | 150 | ); |
@@ -315,28 +315,28 @@ discard block |
||
| 315 | 315 | // Actions bar |
| 316 | 316 | echo '<div class="actions">'; |
| 317 | 317 | echo '<a href="javascript: window.history.go(-1);">'. |
| 318 | - Display::return_icon('back.png', get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
| 318 | + Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
| 319 | 319 | |
| 320 | 320 | echo '<a href="javascript: void(0);" onclick="javascript: window.print();">'. |
| 321 | - Display::return_icon('printer.png', get_lang('Print'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
| 321 | + Display::return_icon('printer.png', get_lang('Print'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
| 322 | 322 | |
| 323 | - echo '<a href="' . api_get_self() . '?' . Security :: remove_XSS($_SERVER['QUERY_STRING']) . '&export=csv">'. |
|
| 324 | - Display::return_icon('export_csv.png', get_lang('ExportAsCSV'),'',ICON_SIZE_MEDIUM).'</a> '; |
|
| 323 | + echo '<a href="'.api_get_self().'?'.Security :: remove_XSS($_SERVER['QUERY_STRING']).'&export=csv">'. |
|
| 324 | + Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), '', ICON_SIZE_MEDIUM).'</a> '; |
|
| 325 | 325 | |
| 326 | - echo '<a href="' . api_get_self() . '?' . Security :: remove_XSS($_SERVER['QUERY_STRING']) . '&export=xls">'. |
|
| 327 | - Display::return_icon('export_excel.png', get_lang('ExportAsXLS'),'',ICON_SIZE_MEDIUM).'</a> '; |
|
| 326 | + echo '<a href="'.api_get_self().'?'.Security :: remove_XSS($_SERVER['QUERY_STRING']).'&export=xls">'. |
|
| 327 | + Display::return_icon('export_excel.png', get_lang('ExportAsXLS'), '', ICON_SIZE_MEDIUM).'</a> '; |
|
| 328 | 328 | |
| 329 | 329 | if (!empty ($user_info['email'])) { |
| 330 | 330 | $send_mail = '<a href="mailto:'.$user_info['email'].'">'. |
| 331 | - Display :: return_icon('mail_send.png', get_lang('SendMail'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
| 331 | + Display :: return_icon('mail_send.png', get_lang('SendMail'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
| 332 | 332 | } else { |
| 333 | - $send_mail = Display :: return_icon('mail_send_na.png', get_lang('SendMail'),'',ICON_SIZE_MEDIUM); |
|
| 333 | + $send_mail = Display :: return_icon('mail_send_na.png', get_lang('SendMail'), '', ICON_SIZE_MEDIUM); |
|
| 334 | 334 | } |
| 335 | 335 | echo $send_mail; |
| 336 | 336 | if (!empty($student_id) && !empty($_GET['course'])) { |
| 337 | 337 | // Only show link to connection details if course and student were defined in the URL |
| 338 | - echo '<a href="access_details.php?student=' . $student_id . '&course=' . Security :: remove_XSS($_GET['course']) . '&origin=' . $origin. '&cidReq='.Security::remove_XSS($_GET['course']).'&id_session='.$sessionId.'">'. |
|
| 339 | - Display :: return_icon('statistics.png', get_lang('AccessDetails'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
| 338 | + echo '<a href="access_details.php?student='.$student_id.'&course='.Security :: remove_XSS($_GET['course']).'&origin='.$origin.'&cidReq='.Security::remove_XSS($_GET['course']).'&id_session='.$sessionId.'">'. |
|
| 339 | + Display :: return_icon('statistics.png', get_lang('AccessDetails'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
| 340 | 340 | } |
| 341 | 341 | if (api_can_login_as($student_id)) { |
| 342 | 342 | echo '<a href="'.api_get_path(WEB_CODE_PATH).'admin/user_list.php?action=login_as&user_id='.$student_id.'&sec_token='.$token.'">'. |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | $csv_content[] = array( |
| 402 | 402 | get_lang('Information', '') |
| 403 | 403 | ); |
| 404 | - $csv_content[] = array ( |
|
| 404 | + $csv_content[] = array( |
|
| 405 | 405 | get_lang('Name', ''), |
| 406 | 406 | get_lang('Email', ''), |
| 407 | 407 | get_lang('Tel', '') |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | strip_tags($first_connection_date), |
| 430 | 430 | strip_tags($last_connection_date), |
| 431 | 431 | $time_spent_on_the_course, |
| 432 | - $avg_student_progress . '%', |
|
| 432 | + $avg_student_progress.'%', |
|
| 433 | 433 | $avg_student_score |
| 434 | 434 | ); |
| 435 | 435 | |
@@ -476,19 +476,19 @@ discard block |
||
| 476 | 476 | </thead> |
| 477 | 477 | <tbody> |
| 478 | 478 | <tr> |
| 479 | - <td><?php echo get_lang('Name') . ' : '.$user_info['complete_name']; ?></td> |
|
| 479 | + <td><?php echo get_lang('Name').' : '.$user_info['complete_name']; ?></td> |
|
| 480 | 480 | </tr> |
| 481 | 481 | <tr> |
| 482 | - <td><?php echo get_lang('Email') . ' : '; |
|
| 482 | + <td><?php echo get_lang('Email').' : '; |
|
| 483 | 483 | if (!empty ($user_info['email'])) { |
| 484 | - echo '<a href="mailto:' . $user_info['email'] . '">' . $user_info['email'] . '</a>'; |
|
| 484 | + echo '<a href="mailto:'.$user_info['email'].'">'.$user_info['email'].'</a>'; |
|
| 485 | 485 | } else { |
| 486 | 486 | echo get_lang('NoEmail'); |
| 487 | 487 | } ?> |
| 488 | 488 | </td> |
| 489 | 489 | </tr> |
| 490 | 490 | <tr> |
| 491 | - <td> <?php echo get_lang('Tel') . ' : '; |
|
| 491 | + <td> <?php echo get_lang('Tel').' : '; |
|
| 492 | 492 | if (!empty ($user_info['phone'])) { |
| 493 | 493 | echo $user_info['phone']; |
| 494 | 494 | } else { |
@@ -498,7 +498,7 @@ discard block |
||
| 498 | 498 | </td> |
| 499 | 499 | </tr> |
| 500 | 500 | <tr> |
| 501 | - <td> <?php echo get_lang('OfficialCode') . ' : '; |
|
| 501 | + <td> <?php echo get_lang('OfficialCode').' : '; |
|
| 502 | 502 | if (!empty ($user_info['official_code'])) { |
| 503 | 503 | echo $user_info['official_code']; |
| 504 | 504 | } else { |
@@ -508,13 +508,13 @@ discard block |
||
| 508 | 508 | </td> |
| 509 | 509 | </tr> |
| 510 | 510 | <tr> |
| 511 | - <td><?php echo get_lang('OnLine') . ' : '.$online; ?> </td> |
|
| 511 | + <td><?php echo get_lang('OnLine').' : '.$online; ?> </td> |
|
| 512 | 512 | </tr> |
| 513 | 513 | <?php |
| 514 | 514 | |
| 515 | 515 | // Display timezone if the user selected one and if the admin allows the use of user's timezone |
| 516 | 516 | $timezone = null; |
| 517 | - $timezone_user = UserManager::get_extra_user_data_by_field($user_info['user_id'],'timezone'); |
|
| 517 | + $timezone_user = UserManager::get_extra_user_data_by_field($user_info['user_id'], 'timezone'); |
|
| 518 | 518 | $use_users_timezone = api_get_setting('use_users_timezone', 'timezones'); |
| 519 | 519 | if ($timezone_user['timezone'] != null && $use_users_timezone == 'true') { |
| 520 | 520 | $timezone = $timezone_user['timezone']; |
@@ -522,7 +522,7 @@ discard block |
||
| 522 | 522 | if ($timezone !== null) { |
| 523 | 523 | ?> |
| 524 | 524 | <tr> |
| 525 | - <td> <?php echo get_lang('Timezone') . ' : '.$timezone; ?> </td> |
|
| 525 | + <td> <?php echo get_lang('Timezone').' : '.$timezone; ?> </td> |
|
| 526 | 526 | </tr> |
| 527 | 527 | <?php |
| 528 | 528 | } |
@@ -554,7 +554,7 @@ discard block |
||
| 554 | 554 | <td align="right"> |
| 555 | 555 | <?php |
| 556 | 556 | echo get_lang('Progress').' '; |
| 557 | - Display :: display_icon('info3.gif', get_lang('ScormAndLPProgressTotalAverage'), array ('align' => 'absmiddle', 'hspace' => '3px'));?> |
|
| 557 | + Display :: display_icon('info3.gif', get_lang('ScormAndLPProgressTotalAverage'), array('align' => 'absmiddle', 'hspace' => '3px')); ?> |
|
| 558 | 558 | </td> |
| 559 | 559 | <td align="left"><?php echo $avg_student_progress.'%' ?></td> |
| 560 | 560 | </tr> |
@@ -562,7 +562,7 @@ discard block |
||
| 562 | 562 | <td align="right"> |
| 563 | 563 | <?php |
| 564 | 564 | echo get_lang('Score').' '; |
| 565 | - Display :: display_icon('info3.gif', get_lang('ScormAndLPTestTotalAverage'), array ('align' => 'absmiddle', 'hspace' => '3px')); ?> |
|
| 565 | + Display :: display_icon('info3.gif', get_lang('ScormAndLPTestTotalAverage'), array('align' => 'absmiddle', 'hspace' => '3px')); ?> |
|
| 566 | 566 | </td> |
| 567 | 567 | <td align="left"><?php |
| 568 | 568 | if (is_numeric($avg_student_score)) { |
@@ -645,9 +645,9 @@ discard block |
||
| 645 | 645 | } |
| 646 | 646 | |
| 647 | 647 | if (!empty($access_start_date) && !empty($access_end_date)) { |
| 648 | - $date_session = get_lang('From') . ' ' . $access_start_date . ' ' . get_lang('Until') . ' ' . $access_end_date; |
|
| 648 | + $date_session = get_lang('From').' '.$access_start_date.' '.get_lang('Until').' '.$access_end_date; |
|
| 649 | 649 | } |
| 650 | - $title = Display::return_icon('session.png', get_lang('Session'), array(), ICON_SIZE_SMALL).' '.$session_name.($date_session?' ('.$date_session.')':''); |
|
| 650 | + $title = Display::return_icon('session.png', get_lang('Session'), array(), ICON_SIZE_SMALL).' '.$session_name.($date_session ? ' ('.$date_session.')' : ''); |
|
| 651 | 651 | } |
| 652 | 652 | |
| 653 | 653 | // Courses |
@@ -702,16 +702,16 @@ discard block |
||
| 702 | 702 | $scoretotal = array(); |
| 703 | 703 | if (isset($cats) && isset($cats[0])) { |
| 704 | 704 | if (!empty($sessionId)) { |
| 705 | - $scoretotal= $cats[0]->calc_score($student_id, null, $courseCodeItem, $sessionId); |
|
| 705 | + $scoretotal = $cats[0]->calc_score($student_id, null, $courseCodeItem, $sessionId); |
|
| 706 | 706 | } else { |
| 707 | - $scoretotal= $cats[0]->calc_score($student_id, null, $courseCodeItem); |
|
| 707 | + $scoretotal = $cats[0]->calc_score($student_id, null, $courseCodeItem); |
|
| 708 | 708 | } |
| 709 | 709 | } |
| 710 | 710 | |
| 711 | 711 | $scoretotal_display = '0/0 (0%)'; |
| 712 | 712 | if (!empty($scoretotal)) { |
| 713 | 713 | $scoretotal_display = |
| 714 | - round($scoretotal[0], 1 ).'/'. |
|
| 714 | + round($scoretotal[0], 1).'/'. |
|
| 715 | 715 | round($scoretotal[1], 1). |
| 716 | 716 | ' ('.round(($scoretotal[0] / $scoretotal[1]) * 100, 2).' %)'; |
| 717 | 717 | } |
@@ -732,9 +732,9 @@ discard block |
||
| 732 | 732 | ); |
| 733 | 733 | |
| 734 | 734 | echo '<tr> |
| 735 | - <td ><a href="' .$courseInfoItem['course_public_url'] .'?id_session=' . $sessionId . '">'. |
|
| 735 | + <td ><a href="' .$courseInfoItem['course_public_url'].'?id_session='.$sessionId.'">'. |
|
| 736 | 736 | $courseInfoItem['title'].'</a></td> |
| 737 | - <td >'.$time_spent_on_course .'</td> |
|
| 737 | + <td >'.$time_spent_on_course.'</td> |
|
| 738 | 738 | <td >'.$progress.'</td> |
| 739 | 739 | <td >'.$score.'</td> |
| 740 | 740 | <td >'.$attendances_faults_avg.'</td> |
@@ -804,7 +804,7 @@ discard block |
||
| 804 | 804 | <table class="table table-striped table-hover"> |
| 805 | 805 | <thead> |
| 806 | 806 | <tr> |
| 807 | - <th><?php echo get_lang('LearningPath');?></th> |
|
| 807 | + <th><?php echo get_lang('LearningPath'); ?></th> |
|
| 808 | 808 | <th> |
| 809 | 809 | <?php |
| 810 | 810 | echo get_lang('Time').' '; |
@@ -879,7 +879,7 @@ discard block |
||
| 879 | 879 | |
| 880 | 880 | if ($progress === null) { |
| 881 | 881 | $progress = '0%'; |
| 882 | - } else { |
|
| 882 | + } else { |
|
| 883 | 883 | $any_result = true; |
| 884 | 884 | } |
| 885 | 885 | |
@@ -906,7 +906,7 @@ discard block |
||
| 906 | 906 | if (!empty($start_time)) { |
| 907 | 907 | $start_time = api_convert_and_format_date($start_time, DATE_TIME_FORMAT_LONG); |
| 908 | 908 | } else { |
| 909 | - $start_time = '-'; |
|
| 909 | + $start_time = '-'; |
|
| 910 | 910 | } |
| 911 | 911 | |
| 912 | 912 | if (!empty($total_time)) $any_result = true; |
@@ -938,11 +938,11 @@ discard block |
||
| 938 | 938 | $i++; |
| 939 | 939 | |
| 940 | 940 | // csv export content |
| 941 | - $csv_content[] = array ( |
|
| 941 | + $csv_content[] = array( |
|
| 942 | 942 | api_html_entity_decode(stripslashes($lp_name), ENT_QUOTES, $charset), |
| 943 | 943 | api_time_to_hms($total_time), |
| 944 | - $score . '%', |
|
| 945 | - $score_latest . '%', |
|
| 944 | + $score.'%', |
|
| 945 | + $score_latest.'%', |
|
| 946 | 946 | $progress.'%', |
| 947 | 947 | $start_time |
| 948 | 948 | ); |
@@ -981,7 +981,7 @@ discard block |
||
| 981 | 981 | if ($any_result === true) { |
| 982 | 982 | $from = ''; |
| 983 | 983 | if ($from_myspace) { |
| 984 | - $from ='&from=myspace'; |
|
| 984 | + $from = '&from=myspace'; |
|
| 985 | 985 | } |
| 986 | 986 | $link = Display::url( |
| 987 | 987 | Display::return_icon('2rightarrow.png', get_lang('Details')), |
@@ -994,14 +994,14 @@ discard block |
||
| 994 | 994 | echo '<td>'; |
| 995 | 995 | if ($any_result === true) { |
| 996 | 996 | echo '<a href="myStudents.php?action=reset_lp&sec_token='.$token.'&cidReq='.Security::remove_XSS($_GET['course']).'&course='.Security::remove_XSS($_GET['course']).'&details='.Security::remove_XSS($_GET['details']).'&origin='.$origin.'&lp_id='.$learnpath->getId().'&student='.$user_info['user_id'].'&details=true&id_session='.$sessionId.'">'; |
| 997 | - echo Display::return_icon('clean.png', get_lang('Clean'),'',ICON_SIZE_SMALL).'</a>'; |
|
| 997 | + echo Display::return_icon('clean.png', get_lang('Clean'), '', ICON_SIZE_SMALL).'</a>'; |
|
| 998 | 998 | echo '</a>'; |
| 999 | 999 | } |
| 1000 | 1000 | echo '</td>'; |
| 1001 | 1001 | echo '</tr>'; |
| 1002 | 1002 | } |
| 1003 | 1003 | $data_learnpath[$i][] = $lp_name; |
| 1004 | - $data_learnpath[$i][] = $progress . '%'; |
|
| 1004 | + $data_learnpath[$i][] = $progress.'%'; |
|
| 1005 | 1005 | } |
| 1006 | 1006 | } |
| 1007 | 1007 | ?> |
@@ -1016,7 +1016,7 @@ discard block |
||
| 1016 | 1016 | <thead> |
| 1017 | 1017 | <tr> |
| 1018 | 1018 | <th><?php echo get_lang('Exercises'); ?></th> |
| 1019 | - <th><?php echo get_lang('LearningPath');?></th> |
|
| 1019 | + <th><?php echo get_lang('LearningPath'); ?></th> |
|
| 1020 | 1020 | <th><?php echo get_lang('AvgCourseScore').' '.Display :: return_icon('info3.gif', get_lang('AverageScore'), array('align' => 'absmiddle', 'hspace' => '3px')) ?></th> |
| 1021 | 1021 | <th><?php echo get_lang('Attempts'); ?></th> |
| 1022 | 1022 | <th><?php echo get_lang('LatestAttempt'); ?></th> |
@@ -1035,7 +1035,7 @@ discard block |
||
| 1035 | 1035 | ); |
| 1036 | 1036 | |
| 1037 | 1037 | $t_quiz = Database :: get_course_table(TABLE_QUIZ_TEST); |
| 1038 | - $sql = "SELECT quiz.title, id FROM " . $t_quiz . " AS quiz |
|
| 1038 | + $sql = "SELECT quiz.title, id FROM ".$t_quiz." AS quiz |
|
| 1039 | 1039 | WHERE |
| 1040 | 1040 | quiz.c_id = ".$courseInfo['real_id']." AND |
| 1041 | 1041 | (quiz.session_id = $sessionId OR quiz.session_id = 0) AND |
@@ -1100,7 +1100,7 @@ discard block |
||
| 1100 | 1100 | echo '<td>'; |
| 1101 | 1101 | |
| 1102 | 1102 | if ($count_attempts > 0) { |
| 1103 | - echo $score_percentage . '%'; |
|
| 1103 | + echo $score_percentage.'%'; |
|
| 1104 | 1104 | } else { |
| 1105 | 1105 | echo '-'; |
| 1106 | 1106 | $score_percentage = 0; |
@@ -1110,7 +1110,7 @@ discard block |
||
| 1110 | 1110 | echo '<td>'.$count_attempts.'</td>'; |
| 1111 | 1111 | echo '<td>'; |
| 1112 | 1112 | |
| 1113 | - $sql = 'SELECT exe_id FROM ' . $tbl_stats_exercices . ' |
|
| 1113 | + $sql = 'SELECT exe_id FROM '.$tbl_stats_exercices.' |
|
| 1114 | 1114 | WHERE |
| 1115 | 1115 | exe_exo_id = "'.$exercise_id.'" AND |
| 1116 | 1116 | exe_user_id ="'.$student_id.'" AND |
@@ -1123,7 +1123,7 @@ discard block |
||
| 1123 | 1123 | if (Database :: num_rows($result_last_attempt) > 0) { |
| 1124 | 1124 | $id_last_attempt = Database :: result($result_last_attempt, 0, 0); |
| 1125 | 1125 | if ($count_attempts > 0) |
| 1126 | - echo '<a href="../exercice/exercise_show.php?id=' . $id_last_attempt . '&cidReq='.$course_code.'&session_id='.$sessionId.'&student='.$student_id.'&origin='.(empty($origin)?'tracking':$origin).'"> |
|
| 1126 | + echo '<a href="../exercice/exercise_show.php?id='.$id_last_attempt.'&cidReq='.$course_code.'&session_id='.$sessionId.'&student='.$student_id.'&origin='.(empty($origin) ? 'tracking' : $origin).'"> |
|
| 1127 | 1127 | '.Display::return_icon('quiz.gif').' |
| 1128 | 1128 | </a>'; |
| 1129 | 1129 | } |
@@ -1131,11 +1131,11 @@ discard block |
||
| 1131 | 1131 | |
| 1132 | 1132 | echo '<td>'; |
| 1133 | 1133 | $all_attempt_url = "../exercice/exercise_report.php?exerciseId=$exercise_id&cidReq=$course_code&filter_by_user=$student_id&id_session=$sessionId"; |
| 1134 | - echo Display::url(Display::return_icon('test_results.png', get_lang('AllAttempts'), array(), ICON_SIZE_SMALL), $all_attempt_url ); |
|
| 1134 | + echo Display::url(Display::return_icon('test_results.png', get_lang('AllAttempts'), array(), ICON_SIZE_SMALL), $all_attempt_url); |
|
| 1135 | 1135 | |
| 1136 | 1136 | echo '</td></tr>'; |
| 1137 | 1137 | $data_exercices[$i][] = $exercices['title']; |
| 1138 | - $data_exercices[$i][] = $score_percentage . '%'; |
|
| 1138 | + $data_exercices[$i][] = $score_percentage.'%'; |
|
| 1139 | 1139 | $data_exercices[$i][] = $count_attempts; |
| 1140 | 1140 | |
| 1141 | 1141 | $csv_content[] = array( |
@@ -1163,7 +1163,7 @@ discard block |
||
| 1163 | 1163 | $survey_list = SurveyManager::get_surveys($course_code, $sessionId); |
| 1164 | 1164 | |
| 1165 | 1165 | $survey_data = array(); |
| 1166 | - foreach($survey_list as $survey) { |
|
| 1166 | + foreach ($survey_list as $survey) { |
|
| 1167 | 1167 | $user_list = SurveyManager::get_people_who_filled_survey($survey['survey_id'], false, $courseInfo['real_id']); |
| 1168 | 1168 | $survey_done = Display::return_icon("accept_na.png", get_lang('NoAnswer'), array(), ICON_SIZE_SMALL); |
| 1169 | 1169 | if (in_array($student_id, $user_list)) { |
@@ -1188,7 +1188,7 @@ discard block |
||
| 1188 | 1188 | $column = 0; |
| 1189 | 1189 | $table->setCellContents($row, $column, $data); |
| 1190 | 1190 | $class = 'class="row_odd"'; |
| 1191 | - if($row % 2) { |
|
| 1191 | + if ($row % 2) { |
|
| 1192 | 1192 | $class = 'class="row_even"'; |
| 1193 | 1193 | } |
| 1194 | 1194 | $table->setRowAttributes($row, $class, true); |