@@ -242,6 +242,9 @@ |
||
242 | 242 | return $hmac; |
243 | 243 | } |
244 | 244 | |
245 | +/** |
|
246 | + * @param string|false $text |
|
247 | + */ |
|
245 | 248 | function _openid_sha1($text) { |
246 | 249 | $hex = sha1($text); |
247 | 250 | $raw = ''; |
@@ -33,6 +33,7 @@ discard block |
||
33 | 33 | |
34 | 34 | /** |
35 | 35 | * |
36 | + * @param ShibbolethUser $data |
|
36 | 37 | * @return User |
37 | 38 | */ |
38 | 39 | public static function create($data = null) |
@@ -133,6 +134,7 @@ discard block |
||
133 | 134 | |
134 | 135 | /** |
135 | 136 | * |
137 | + * @param string $value |
|
136 | 138 | * @return User |
137 | 139 | */ |
138 | 140 | public function get_by_user_id($value) |
@@ -169,6 +171,7 @@ discard block |
||
169 | 171 | |
170 | 172 | /** |
171 | 173 | * |
174 | + * @param string $value |
|
172 | 175 | * @return bool |
173 | 176 | */ |
174 | 177 | public function username_exists($value) |
@@ -25,6 +25,7 @@ discard block |
||
25 | 25 | * @param int $questionId Question ID |
26 | 26 | * @param int $resultsDisabled |
27 | 27 | * @param string $originalStudentAnswer |
28 | + * @param boolean $showTotalScoreAndUserChoices |
|
28 | 29 | * |
29 | 30 | * @return void |
30 | 31 | */ |
@@ -71,6 +72,11 @@ discard block |
||
71 | 72 | * @param string Answer text |
72 | 73 | * @param int Exercise ID |
73 | 74 | * @param int Question ID |
75 | + * @param integer $feedback_type |
|
76 | + * @param string $answer |
|
77 | + * @param integer $id |
|
78 | + * @param integer $questionId |
|
79 | + * @param boolean|string $showTotalScoreAndUserChoices |
|
74 | 80 | * @return void |
75 | 81 | */ |
76 | 82 | public static function display_calculated_answer( |
@@ -110,6 +116,9 @@ discard block |
||
110 | 116 | * @param string Answer text |
111 | 117 | * @param int Exercise ID |
112 | 118 | * @param int Question ID |
119 | + * @param integer $feedback_type |
|
120 | + * @param integer $exe_id |
|
121 | + * @param integer $questionId |
|
113 | 122 | * @return void |
114 | 123 | */ |
115 | 124 | public static function display_free_answer( |
@@ -139,11 +148,11 @@ discard block |
||
139 | 148 | } |
140 | 149 | |
141 | 150 | /** |
142 | - * @param $feedback_type |
|
151 | + * @param integer $feedback_type |
|
143 | 152 | * @param $answer |
144 | - * @param $id |
|
145 | - * @param $questionId |
|
146 | - * @param null $nano |
|
153 | + * @param integer $id |
|
154 | + * @param integer $questionId |
|
155 | + * @param Nanogong|null $nano |
|
147 | 156 | * @param int $results_disabled |
148 | 157 | */ |
149 | 158 | public static function display_oral_expression_answer( |
@@ -195,6 +204,7 @@ discard block |
||
195 | 204 | * @param string $answerComment |
196 | 205 | * @param int $resultsDisabled |
197 | 206 | * @param int $orderColor |
207 | + * @param boolean $showTotalScoreAndUserChoices |
|
198 | 208 | */ |
199 | 209 | public static function display_hotspot_answer( |
200 | 210 | $feedback_type, |
@@ -279,6 +289,13 @@ discard block |
||
279 | 289 | * @param integer Exercise ID |
280 | 290 | * @param integer Question ID |
281 | 291 | * @param boolean Whether to show the answer comment or not |
292 | + * @param integer $answerType |
|
293 | + * @param string $answer |
|
294 | + * @param string $answerComment |
|
295 | + * @param integer $answerCorrect |
|
296 | + * @param integer $id |
|
297 | + * @param integer $questionId |
|
298 | + * @param boolean $showTotalScoreAndUserChoices |
|
282 | 299 | * @return void |
283 | 300 | */ |
284 | 301 | public static function display_unique_or_multiple_answer( |
@@ -375,6 +392,14 @@ discard block |
||
375 | 392 | * @param integer Exercise ID |
376 | 393 | * @param integer Question ID |
377 | 394 | * @param boolean Whether to show the answer comment or not |
395 | + * @param integer $feedback_type |
|
396 | + * @param integer $answerType |
|
397 | + * @param string $answer |
|
398 | + * @param string $answerComment |
|
399 | + * @param integer $answerCorrect |
|
400 | + * @param integer $id |
|
401 | + * @param integer $questionId |
|
402 | + * @param boolean $showTotalScoreAndUserChoices |
|
378 | 403 | * @return void |
379 | 404 | */ |
380 | 405 | public static function display_multiple_answer_true_false( |
@@ -479,6 +504,14 @@ discard block |
||
479 | 504 | * @param integer Exercise ID |
480 | 505 | * @param integer Question ID |
481 | 506 | * @param boolean Whether to show the answer comment or not |
507 | + * @param integer $feedback_type |
|
508 | + * @param integer $answerType |
|
509 | + * @param string $answer |
|
510 | + * @param string $answerComment |
|
511 | + * @param integer $answerCorrect |
|
512 | + * @param integer $id |
|
513 | + * @param integer $questionId |
|
514 | + * @param boolean $showTotalScoreAndUserChoices |
|
482 | 515 | * @return void |
483 | 516 | */ |
484 | 517 | public static function display_multiple_answer_combination_true_false( |
@@ -437,6 +437,7 @@ discard block |
||
437 | 437 | * If null, the timezone will be determined based on user preference, |
438 | 438 | * or timezone chosen by the admin for the platform. |
439 | 439 | * @param string The timezone to be converted from. If null, UTC will be assumed. |
440 | + * @param string $to_timezone |
|
440 | 441 | * @return string The converted time formatted as Y-m-d H:i:s |
441 | 442 | * |
442 | 443 | * @author Guillaume Viguier <[email protected]> |
@@ -793,6 +794,7 @@ discard block |
||
793 | 794 | * @param mixed The time to be converted |
794 | 795 | * @param mixed Format to be used (TIME_NO_SEC_FORMAT, DATE_FORMAT_SHORT, DATE_FORMAT_LONG, DATE_TIME_FORMAT_LONG) |
795 | 796 | * @param string Timezone to be converted from. If null, UTC will be assumed. |
797 | + * @param string $from_timezone |
|
796 | 798 | * @return string Converted and localized date |
797 | 799 | * |
798 | 800 | * @author Guillaume Viguier <[email protected]> |
@@ -862,7 +864,7 @@ discard block |
||
862 | 864 | * @param int/string $format (optional) The person name format. It may be a pattern-string (for example '%t %l, %f' or '%T %F %L', ...) or some of the constants PERSON_NAME_COMMON_CONVENTION (default), PERSON_NAME_WESTERN_ORDER, PERSON_NAME_EASTERN_ORDER, PERSON_NAME_LIBRARY_ORDER. |
863 | 865 | * @param string $language (optional) The language id. If it is omitted, the current interface language is assumed. This parameter has meaning with the format PERSON_NAME_COMMON_CONVENTION only. |
864 | 866 | * @param string $encoding (optional) The used internally by this function character encoding. If it is omitted, the platform character set will be used by default. |
865 | - * @return bool The result is sort of full name of the person. |
|
867 | + * @return string The result is sort of full name of the person. |
|
866 | 868 | * Sample results: |
867 | 869 | * Peter Ustinoff or Dr. Peter Ustinoff - the Western order |
868 | 870 | * Ustinoff Peter or Dr. Ustinoff Peter - the Eastern order |
@@ -956,7 +958,7 @@ discard block |
||
956 | 958 | |
957 | 959 | /** |
958 | 960 | * Checks whether a given format represents person name in Western order (for which first name is first). |
959 | - * @param int/string $format (optional) The person name format. It may be a pattern-string (for example '%t. %l, %f') or some of the constants PERSON_NAME_COMMON_CONVENTION (default), PERSON_NAME_WESTERN_ORDER, PERSON_NAME_EASTERN_ORDER, PERSON_NAME_LIBRARY_ORDER. |
|
961 | + * @param integer $format (optional) The person name format. It may be a pattern-string (for example '%t. %l, %f') or some of the constants PERSON_NAME_COMMON_CONVENTION (default), PERSON_NAME_WESTERN_ORDER, PERSON_NAME_EASTERN_ORDER, PERSON_NAME_LIBRARY_ORDER. |
|
960 | 962 | * @param string $language (optional) The language id. If it is omitted, the current interface language is assumed. This parameter has meaning with the format PERSON_NAME_COMMON_CONVENTION only. |
961 | 963 | * @return bool The result TRUE means that the order is first_name last_name, FALSE means last_name first_name. |
962 | 964 | * Note: You may use this function for determing the order of the fields or columns "First name" and "Last name" in forms, tables and reports. |
@@ -1184,8 +1186,8 @@ discard block |
||
1184 | 1186 | |
1185 | 1187 | /** |
1186 | 1188 | * This function returns a string or an array with all occurrences of search in subject (ignoring case) replaced with the given replace value. |
1187 | - * @param mixed $search String or array of strings to be found. |
|
1188 | - * @param mixed $replace String or array of strings used for replacement. |
|
1189 | + * @param string $search String or array of strings to be found. |
|
1190 | + * @param string $replace String or array of strings used for replacement. |
|
1189 | 1191 | * @param mixed $subject String or array of strings being searched. |
1190 | 1192 | * @param int $count (optional) The number of matched and replaced needles will be returned in count, which is passed by reference. |
1191 | 1193 | * @param string $encoding (optional) The used internally by this function character encoding. |
@@ -1248,10 +1250,10 @@ discard block |
||
1248 | 1250 | /** |
1249 | 1251 | * Finds first occurrence of a string within another, case insensitive. |
1250 | 1252 | * @param string $haystack The string from which to get the first occurrence. |
1251 | - * @param mixed $needle The string to be found. |
|
1253 | + * @param string $needle The string to be found. |
|
1252 | 1254 | * @param bool $before_needle (optional) Determines which portion of $haystack this function returns. The default value is FALSE. |
1253 | 1255 | * @param string $encoding (optional) The used internally by this function character encoding. If it is omitted, the platform character set will be used by default. |
1254 | - * @return mixed Returns the portion of $haystack, or FALSE if $needle is not found. |
|
1256 | + * @return false|string Returns the portion of $haystack, or FALSE if $needle is not found. |
|
1255 | 1257 | * Notes: |
1256 | 1258 | * If $needle is not a string, it is converted to an integer and applied as the ordinal value (codepoint if the encoding is UTF-8) of a character. |
1257 | 1259 | * If $before_needle is set to TRUE, the function returns all of $haystack from the beginning to the first occurrence of $needle. |
@@ -1307,7 +1309,7 @@ discard block |
||
1307 | 1309 | * @param mixed $needle The string which first character is to be found. |
1308 | 1310 | * @param bool $before_needle (optional) Determines which portion of $haystack this function returns. The default value is FALSE. |
1309 | 1311 | * @param string $encoding (optional) The used internally by this function character encoding. If it is omitted, the platform character set will be used by default. |
1310 | - * @return mixed Returns the portion of $haystack, or FALSE if the first character from $needle is not found. |
|
1312 | + * @return false|string Returns the portion of $haystack, or FALSE if the first character from $needle is not found. |
|
1311 | 1313 | * Notes: |
1312 | 1314 | * If $needle is not a string, it is converted to an integer and applied as the ordinal value (codepoint if the encoding is UTF-8) of a character. |
1313 | 1315 | * If $before_needle is set to TRUE, the function returns all of $haystack from the beginning to the first occurrence. |
@@ -1374,7 +1376,7 @@ discard block |
||
1374 | 1376 | * @param mixed $needle The string to be found. |
1375 | 1377 | * @param bool $before_needle (optional) Determines which portion of $haystack this function returns. The default value is FALSE. |
1376 | 1378 | * @param string $encoding (optional) The used internally by this function character encoding. If it is omitted, the platform character set will be used by default. |
1377 | - * @return mixed Returns the portion of $haystack, or FALSE if $needle is not found. |
|
1379 | + * @return false|string Returns the portion of $haystack, or FALSE if $needle is not found. |
|
1378 | 1380 | * Notes: |
1379 | 1381 | * If $needle is not a string, it is converted to an integer and applied as the ordinal value (codepoint if the encoding is UTF-8) of a character. |
1380 | 1382 | * If $before_needle is set to TRUE, the function returns all of $haystack from the beginning to the first occurrence of $needle. |
@@ -1517,7 +1519,7 @@ discard block |
||
1517 | 1519 | * Note that this changes the return value in an array where every element is an array consisting of the matched string at index 0 and its string offset into subject at index 1. |
1518 | 1520 | * @param int $offset (optional) Normally, the search starts from the beginning of the subject string. The optional parameter offset can be used to specify the alternate place from which to start the search. |
1519 | 1521 | * @param string $encoding (optional) The used internally by this function character encoding. If it is omitted, the platform character set will be used by default. |
1520 | - * @return int|boolean Returns the number of times pattern matches or FALSE if an error occurred. |
|
1522 | + * @return integer Returns the number of times pattern matches or FALSE if an error occurred. |
|
1521 | 1523 | * @link http://php.net/preg_match |
1522 | 1524 | */ |
1523 | 1525 | function api_preg_match($pattern, $subject, &$matches = null, $flags = 0, $offset = 0, $encoding = null) { |
@@ -1540,7 +1542,7 @@ discard block |
||
1540 | 1542 | * If no order flag is given, PREG_PATTERN_ORDER is assumed. |
1541 | 1543 | * @param int $offset (optional) Normally, the search starts from the beginning of the subject string. The optional parameter offset can be used to specify the alternate place from which to start the search. |
1542 | 1544 | * @param string $encoding (optional) The used internally by this function character encoding. If it is omitted, the platform character set will be used by default. |
1543 | - * @return int|boolean Returns the number of full pattern matches (which might be zero), or FALSE if an error occurred. |
|
1545 | + * @return integer Returns the number of full pattern matches (which might be zero), or FALSE if an error occurred. |
|
1544 | 1546 | * @link http://php.net/preg_match_all |
1545 | 1547 | */ |
1546 | 1548 | function api_preg_match_all($pattern, $subject, &$matches, $flags = PREG_PATTERN_ORDER, $offset = 0, $encoding = null) { |
@@ -1555,8 +1557,8 @@ discard block |
||
1555 | 1557 | |
1556 | 1558 | /** |
1557 | 1559 | * Performs a regular expression search and replace, UTF-8 aware when it is applicable. |
1558 | - * @param string|array $pattern The pattern to search for. It can be either a string or an array with strings. |
|
1559 | - * @param string|array $replacement The string or an array with strings to replace. |
|
1560 | + * @param string $pattern The pattern to search for. It can be either a string or an array with strings. |
|
1561 | + * @param string $replacement The string or an array with strings to replace. |
|
1560 | 1562 | * @param string|array $subject The string or an array with strings to search and replace. |
1561 | 1563 | * @param int $limit The maximum possible replacements for each pattern in each subject string. Defaults to -1 (no limit). |
1562 | 1564 | * @param int &$count If specified, this variable will be filled with the number of replacements done. |
@@ -1808,6 +1810,7 @@ discard block |
||
1808 | 1810 | /** |
1809 | 1811 | * Checks a string for UTF-8 validity. |
1810 | 1812 | * |
1813 | + * @param string $string |
|
1811 | 1814 | */ |
1812 | 1815 | function api_is_valid_utf8(&$string) |
1813 | 1816 | { |
@@ -1950,7 +1953,7 @@ discard block |
||
1950 | 1953 | /** |
1951 | 1954 | * Replaces non-valid formats for person names with the default (English) format. |
1952 | 1955 | * @param string $format The input format to be verified. |
1953 | - * @return bool Returns the same format if is is valid, otherwise returns a valid English format. |
|
1956 | + * @return string Returns the same format if is is valid, otherwise returns a valid English format. |
|
1954 | 1957 | */ |
1955 | 1958 | function _api_validate_person_name_format($format) { |
1956 | 1959 | if (empty($format) || stripos($format, '%f') === false || stripos($format, '%l') === false) { |
@@ -2077,6 +2080,9 @@ discard block |
||
2077 | 2080 | |
2078 | 2081 | // This function checks whether the function _api_convert_encoding() (the php- |
2079 | 2082 | // implementation) is able to convert from/to a given encoding. |
2083 | +/** |
|
2084 | + * @param string $encoding |
|
2085 | + */ |
|
2080 | 2086 | function _api_convert_encoding_supports($encoding) { |
2081 | 2087 | static $supports = array(); |
2082 | 2088 | if (!isset($supports[$encoding])) { |
@@ -91,7 +91,7 @@ |
||
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
94 | - * @param array $array |
|
94 | + * @param string[] $array |
|
95 | 95 | */ |
96 | 96 | public function set_tools_to_build($array) |
97 | 97 | { |
@@ -1212,6 +1212,7 @@ |
||
1212 | 1212 | * Restore a forum-post |
1213 | 1213 | * @TODO Restore tree-structure of posts. For example: attachments to posts. |
1214 | 1214 | * @param false|string $topic_id |
1215 | + * @param false|string $forum_id |
|
1215 | 1216 | */ |
1216 | 1217 | public function restore_post($id, $topic_id, $forum_id, $sessionId = 0) |
1217 | 1218 | { |
@@ -267,7 +267,7 @@ |
||
267 | 267 | * @param string $author |
268 | 268 | * @param string $filename |
269 | 269 | * @param int $filesize |
270 | - * @param array $recipient_ids |
|
270 | + * @param unknown_type|null $recipient_ids |
|
271 | 271 | */ |
272 | 272 | public function _createNewSentWork($uploader_id, $title, $description, $author, $filename, $filesize, $recipient_ids) |
273 | 273 | { |
@@ -72,6 +72,7 @@ discard block |
||
72 | 72 | /** |
73 | 73 | * Return the XML flow for the possible answers. |
74 | 74 | * |
75 | + * @param string $questionStatment |
|
75 | 76 | */ |
76 | 77 | public function imsExportResponses($questionIdent, $questionStatment) |
77 | 78 | { |
@@ -147,6 +148,7 @@ discard block |
||
147 | 148 | * Export the text with missing words. |
148 | 149 | * |
149 | 150 | * |
151 | + * @param string $questionStatment |
|
150 | 152 | */ |
151 | 153 | public function imsExportResponses($questionIdent, $questionStatment) |
152 | 154 | { |
@@ -204,6 +206,7 @@ discard block |
||
204 | 206 | { |
205 | 207 | /** |
206 | 208 | * Export the question part as a matrix-choice, with only one possible answer per line. |
209 | + * @param string $questionStatment |
|
207 | 210 | */ |
208 | 211 | public function imsExportResponses($questionIdent, $questionStatment) |
209 | 212 | { |
@@ -295,6 +298,7 @@ discard block |
||
295 | 298 | /** |
296 | 299 | * TODO update this to match hot spots instead of copying matching |
297 | 300 | * Export the question part as a matrix-choice, with only one possible answer per line. |
301 | + * @param string $questionStatment |
|
298 | 302 | */ |
299 | 303 | public function imsExportResponses($questionIdent, $questionStatment, $questionDesc='', $questionMedia='') |
300 | 304 | { |
@@ -382,6 +386,7 @@ discard block |
||
382 | 386 | /** |
383 | 387 | * TODO implement |
384 | 388 | * Export the question part as a matrix-choice, with only one possible answer per line. |
389 | + * @param string $questionStatment |
|
385 | 390 | */ |
386 | 391 | public function imsExportResponses($questionIdent, $questionStatment, $questionDesc='', $questionMedia='') |
387 | 392 | { |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | * @param reference Reference to the array to search |
260 | 260 | * @param string Node we are looking for in the array |
261 | 261 | * @param string $node |
262 | - * @return mixed Node name or false if not found |
|
262 | + * @return false|string Node name or false if not found |
|
263 | 263 | */ |
264 | 264 | function myarraysearch(&$array, $node) |
265 | 265 | { |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | * Searches an image name into an array. |
281 | 281 | * @param reference Reference to an array to search |
282 | 282 | * @param string String to look for |
283 | - * @return mixed String given if found, false otherwise |
|
283 | + * @return false|string String given if found, false otherwise |
|
284 | 284 | * @uses myarraysearch This function is just an additional layer on the myarraysearch() function |
285 | 285 | */ |
286 | 286 | function CheckImageName(&$imgparams, $string) |