@@ -1869,7 +1869,7 @@ discard block |
||
| 1869 | 1869 | |
| 1870 | 1870 | /** |
| 1871 | 1871 | * Get the extra terms (tags) that identify this item |
| 1872 | - * @return mixed |
|
| 1872 | + * @return string |
|
| 1873 | 1873 | */ |
| 1874 | 1874 | public function get_terms() |
| 1875 | 1875 | { |
@@ -2069,7 +2069,7 @@ discard block |
||
| 2069 | 2069 | |
| 2070 | 2070 | /** |
| 2071 | 2071 | * Opens/launches the item. Initialises runtime values. |
| 2072 | - * @return boolean True on success, false on failure. |
|
| 2072 | + * @return boolean|null True on success, false on failure. |
|
| 2073 | 2073 | */ |
| 2074 | 2074 | public function open($allow_new_attempt = false) |
| 2075 | 2075 | { |
@@ -3504,7 +3504,7 @@ discard block |
||
| 3504 | 3504 | |
| 3505 | 3505 | /** |
| 3506 | 3506 | * Checks if the current status is part of the list of status given |
| 3507 | - * @param array $list An array of status to check for. |
|
| 3507 | + * @param string[] $list An array of status to check for. |
|
| 3508 | 3508 | * If the current status is one of the strings, return true |
| 3509 | 3509 | * |
| 3510 | 3510 | * @return boolean True if the status was one of the given strings, |
@@ -3681,7 +3681,7 @@ discard block |
||
| 3681 | 3681 | /** |
| 3682 | 3682 | * Write objectives to DB. This method is separate from write_to_db() because otherwise |
| 3683 | 3683 | * objectives are lost as a side effect to AJAX and session concurrent access |
| 3684 | - * @return boolean True or false on error |
|
| 3684 | + * @return boolean|null True or false on error |
|
| 3685 | 3685 | */ |
| 3686 | 3686 | public function write_objectives_to_db() |
| 3687 | 3687 | { |
@@ -4322,7 +4322,7 @@ discard block |
||
| 4322 | 4322 | * Removes the relation between the current item and an audio file. The file |
| 4323 | 4323 | * is only removed from the lp_item table, but remains in the document table |
| 4324 | 4324 | * and directory |
| 4325 | - * @return bool |
|
| 4325 | + * @return false|null |
|
| 4326 | 4326 | */ |
| 4327 | 4327 | public function remove_audio() |
| 4328 | 4328 | { |
@@ -3386,7 +3386,7 @@ discard block |
||
| 3386 | 3386 | |
| 3387 | 3387 | // TODO: Validate csv string. |
| 3388 | 3388 | $terms = Database::escape_string(api_htmlentities($new_terms_string, ENT_QUOTES, $charset)); |
| 3389 | - $sql = "UPDATE $lp_item |
|
| 3389 | + $sql = "update $lp_item |
|
| 3390 | 3390 | SET terms = '$terms' |
| 3391 | 3391 | WHERE |
| 3392 | 3392 | c_id = $course_id AND |
@@ -3653,7 +3653,7 @@ discard block |
||
| 3653 | 3653 | if ($this->seriousgame_mode != 1 || |
| 3654 | 3654 | !in_array($row['status'], $case_completed) |
| 3655 | 3655 | ) { |
| 3656 | - $sql = "UPDATE $item_view_table |
|
| 3656 | + $sql = "update $item_view_table |
|
| 3657 | 3657 | SET total_time = '$total_time' |
| 3658 | 3658 | WHERE |
| 3659 | 3659 | c_id = $course_id AND |
@@ -3733,7 +3733,7 @@ discard block |
||
| 3733 | 3733 | // Update (or don't). |
| 3734 | 3734 | $iva_row = Database::fetch_array($iva_res); |
| 3735 | 3735 | $iva_id = $iva_row[0]; |
| 3736 | - $ivau_sql = "UPDATE $iva_table ". |
|
| 3736 | + $ivau_sql = "update $iva_table ". |
|
| 3737 | 3737 | "SET objective_id = '".Database::escape_string($objective[0])."',". |
| 3738 | 3738 | "status = '".Database::escape_string($objective[1])."',". |
| 3739 | 3739 | "score_raw = '".Database::escape_string($objective[2])."',". |
@@ -3756,7 +3756,7 @@ discard block |
||
| 3756 | 3756 | |
| 3757 | 3757 | $insertId = Database::insert($iva_table, $params); |
| 3758 | 3758 | |
| 3759 | - $sql = "UPDATE $iva_table SET id = iid WHERE iid = $insertId"; |
|
| 3759 | + $sql = "update $iva_table SET id = iid WHERE iid = $insertId"; |
|
| 3760 | 3760 | Database::query($sql); |
| 3761 | 3761 | } |
| 3762 | 3762 | } |
@@ -3862,7 +3862,7 @@ discard block |
||
| 3862 | 3862 | $this->db_item_view_id = Database::insert($item_view_table, $params); |
| 3863 | 3863 | |
| 3864 | 3864 | if ($this->db_item_view_id) { |
| 3865 | - $sql = "UPDATE $item_view_table SET id = iid |
|
| 3865 | + $sql = "update $item_view_table SET id = iid |
|
| 3866 | 3866 | WHERE iid = ".$this->db_item_view_id; |
| 3867 | 3867 | Database::query($sql); |
| 3868 | 3868 | $inserted = true; |
@@ -3911,7 +3911,7 @@ discard block |
||
| 3911 | 3911 | $this->db_item_view_id = Database::insert($item_view_table, $params); |
| 3912 | 3912 | |
| 3913 | 3913 | if ($this->db_item_view_id) { |
| 3914 | - $sql = "UPDATE $item_view_table SET id = iid |
|
| 3914 | + $sql = "update $item_view_table SET id = iid |
|
| 3915 | 3915 | WHERE iid = ".$this->db_item_view_id; |
| 3916 | 3916 | Database::query($sql); |
| 3917 | 3917 | } |
@@ -4058,7 +4058,7 @@ discard block |
||
| 4058 | 4058 | //IF scorm scorm_update_time has already updated total_time in db |
| 4059 | 4059 | //" . //start_time = ".$this->get_current_start_time().", " . //scorm_init_time does it |
| 4060 | 4060 | ////" max_time_allowed = '".$this->get_max_time_allowed()."'," . |
| 4061 | - $sql = "UPDATE $item_view_table SET |
|
| 4061 | + $sql = "update $item_view_table SET |
|
| 4062 | 4062 | score = ".$this->get_score().", |
| 4063 | 4063 | $my_status |
| 4064 | 4064 | max_score = '".$this->get_max()."', |
@@ -4072,7 +4072,7 @@ discard block |
||
| 4072 | 4072 | |
| 4073 | 4073 | } else { |
| 4074 | 4074 | //" max_time_allowed = '".$this->get_max_time_allowed()."'," . |
| 4075 | - $sql = "UPDATE $item_view_table SET |
|
| 4075 | + $sql = "update $item_view_table SET |
|
| 4076 | 4076 | $total_time |
| 4077 | 4077 | start_time = ".$this->get_current_start_time().", |
| 4078 | 4078 | score = " . $this->get_score().", |
@@ -4198,7 +4198,7 @@ discard block |
||
| 4198 | 4198 | |
| 4199 | 4199 | $insertId = Database::insert($iva_table, $params); |
| 4200 | 4200 | if ($insertId) { |
| 4201 | - $sql = "UPDATE $iva_table SET id = iid |
|
| 4201 | + $sql = "update $iva_table SET id = iid |
|
| 4202 | 4202 | WHERE iid = $insertId"; |
| 4203 | 4203 | Database::query($sql); |
| 4204 | 4204 | } |
@@ -4284,7 +4284,7 @@ discard block |
||
| 4284 | 4284 | |
| 4285 | 4285 | // Store the mp3 file in the lp_item table. |
| 4286 | 4286 | $tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM); |
| 4287 | - $sql = "UPDATE $tbl_lp_item SET |
|
| 4287 | + $sql = "update $tbl_lp_item SET |
|
| 4288 | 4288 | audio = '".Database::escape_string($file_path)."' |
| 4289 | 4289 | WHERE |
| 4290 | 4290 | c_id = {$course_info['real_id']} AND |
@@ -4312,7 +4312,7 @@ discard block |
||
| 4312 | 4312 | $file_path = basename($document_data['path']); |
| 4313 | 4313 | // Store the mp3 file in the lp_item table. |
| 4314 | 4314 | $tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM); |
| 4315 | - $sql = "UPDATE $tbl_lp_item SET |
|
| 4315 | + $sql = "update $tbl_lp_item SET |
|
| 4316 | 4316 | audio = '".Database::escape_string($file_path)."' |
| 4317 | 4317 | WHERE |
| 4318 | 4318 | c_id = {$course_info['real_id']} AND |
@@ -4335,7 +4335,7 @@ discard block |
||
| 4335 | 4335 | if (empty($this->db_id)) { |
| 4336 | 4336 | return false; |
| 4337 | 4337 | } |
| 4338 | - $sql = "UPDATE $tbl_lp_item SET |
|
| 4338 | + $sql = "update $tbl_lp_item SET |
|
| 4339 | 4339 | audio = '' |
| 4340 | 4340 | WHERE c_id = $course_id AND id IN (".$this->db_id.")"; |
| 4341 | 4341 | Database::query($sql); |
@@ -745,7 +745,8 @@ discard block |
||
| 745 | 745 | public function get_lesson_mode() |
| 746 | 746 | { |
| 747 | 747 | $mode = 'normal'; |
| 748 | - if ($this->get_prevent_reinit() != 0) { // If prevent_reinit == 0 |
|
| 748 | + if ($this->get_prevent_reinit() != 0) { |
|
| 749 | +// If prevent_reinit == 0 |
|
| 749 | 750 | $my_status = $this->get_status(); |
| 750 | 751 | if ($my_status != $this->possible_status[0] |
| 751 | 752 | && $my_status != $this->possible_status[1]) { |
@@ -2037,11 +2038,13 @@ discard block |
||
| 2037 | 2038 | $restart = 1; |
| 2038 | 2039 | $mystatus = $this->get_status(true); |
| 2039 | 2040 | if ($this->get_prevent_reinit() > 0 |
| 2040 | - ) { // If prevent_reinit == 1 (or more) |
|
| 2041 | + ) { |
|
| 2042 | +// If prevent_reinit == 1 (or more) |
|
| 2041 | 2043 | // If status is not attempted or incomplete, authorize retaking (of the same) anyway. Otherwise: |
| 2042 | 2044 | if ($mystatus != $this->possible_status[0] && $mystatus != $this->possible_status[1]) { |
| 2043 | 2045 | $restart = -1; |
| 2044 | - } else { //status incompleted or not attempted |
|
| 2046 | + } else { |
|
| 2047 | +//status incompleted or not attempted |
|
| 2045 | 2048 | $restart = 0; |
| 2046 | 2049 | } |
| 2047 | 2050 | } else { |
@@ -2982,7 +2985,8 @@ discard block |
||
| 2982 | 2985 | // Do nothing, just let the local attributes be used. |
| 2983 | 2986 | } |
| 2984 | 2987 | } |
| 2985 | - } else { // If not SCO, such messages should not be expected. |
|
| 2988 | + } else { |
|
| 2989 | +// If not SCO, such messages should not be expected. |
|
| 2986 | 2990 | $type = strtolower($this->type); |
| 2987 | 2991 | switch ($type) { |
| 2988 | 2992 | case 'asset': |
@@ -1207,7 +1207,7 @@ discard block |
||
| 1207 | 1207 | ); |
| 1208 | 1208 | } |
| 1209 | 1209 | } elseif (strpos($second_part, '=') > 0) { |
| 1210 | - if (substr($second_part,0,1) === '/') { |
|
| 1210 | + if (substr($second_part, 0, 1) === '/') { |
|
| 1211 | 1211 | // Link starts with a /, making it absolute (relative to DocumentRoot). |
| 1212 | 1212 | $files_list[] = array( |
| 1213 | 1213 | $second_part, |
@@ -1251,7 +1251,7 @@ discard block |
||
| 1251 | 1251 | } |
| 1252 | 1252 | } else { |
| 1253 | 1253 | // No starting '/', making it relative to current document's path. |
| 1254 | - if (substr($second_part, 0,2) == './') { |
|
| 1254 | + if (substr($second_part, 0, 2) == './') { |
|
| 1255 | 1255 | $second_part = substr( |
| 1256 | 1256 | $second_part, |
| 1257 | 1257 | 2 |
@@ -995,7 +995,7 @@ discard block |
||
| 995 | 995 | /** |
| 996 | 996 | * Get pictureUri |
| 997 | 997 | * |
| 998 | - * @return Media |
|
| 998 | + * @return string |
|
| 999 | 999 | */ |
| 1000 | 1000 | public function getPictureUri() |
| 1001 | 1001 | { |
@@ -1303,7 +1303,7 @@ discard block |
||
| 1303 | 1303 | } |
| 1304 | 1304 | |
| 1305 | 1305 | /** |
| 1306 | - * @return Media |
|
| 1306 | + * @return string |
|
| 1307 | 1307 | */ |
| 1308 | 1308 | public function getAvatar() |
| 1309 | 1309 | { |
@@ -2078,7 +2078,7 @@ discard block |
||
| 2078 | 2078 | /** |
| 2079 | 2079 | * Returns the user roles |
| 2080 | 2080 | * |
| 2081 | - * @return array The roles |
|
| 2081 | + * @return string[] The roles |
|
| 2082 | 2082 | */ |
| 2083 | 2083 | public function getRoles() |
| 2084 | 2084 | { |
@@ -2403,7 +2403,7 @@ discard block |
||
| 2403 | 2403 | /** |
| 2404 | 2404 | * Check if the user has the skill |
| 2405 | 2405 | * @param Skill $skill The skill |
| 2406 | - * @return boolean |
|
| 2406 | + * @return boolean|null |
|
| 2407 | 2407 | */ |
| 2408 | 2408 | public function hasSkill(Skill $skill) |
| 2409 | 2409 | { |
@@ -1891,11 +1891,11 @@ discard block |
||
| 1891 | 1891 | return $this->locale; |
| 1892 | 1892 | } |
| 1893 | 1893 | |
| 1894 | - /** |
|
| 1895 | - * @param string $timezone |
|
| 1896 | - * |
|
| 1897 | - * @return User |
|
| 1898 | - */ |
|
| 1894 | + /** |
|
| 1895 | + * @param string $timezone |
|
| 1896 | + * |
|
| 1897 | + * @return User |
|
| 1898 | + */ |
|
| 1899 | 1899 | public function setTimezone($timezone) |
| 1900 | 1900 | { |
| 1901 | 1901 | $this->timezone = $timezone; |
@@ -2073,11 +2073,11 @@ discard block |
||
| 2073 | 2073 | } |
| 2074 | 2074 | } |
| 2075 | 2075 | |
| 2076 | - /** |
|
| 2077 | - * Returns the user roles |
|
| 2078 | - * |
|
| 2079 | - * @return array The roles |
|
| 2080 | - */ |
|
| 2076 | + /** |
|
| 2077 | + * Returns the user roles |
|
| 2078 | + * |
|
| 2079 | + * @return array The roles |
|
| 2080 | + */ |
|
| 2081 | 2081 | public function getRoles() |
| 2082 | 2082 | { |
| 2083 | 2083 | $roles = $this->roles; |
@@ -97,7 +97,7 @@ |
||
| 97 | 97 | // Theme calls |
| 98 | 98 | $show_learn_path = true; |
| 99 | 99 | if (isset($_SESSION['oLP']) && is_object($_SESSION['oLP'])) { |
| 100 | - $lp_theme_css = $_SESSION['oLP']->get_theme(); |
|
| 100 | + $lp_theme_css = $_SESSION['oLP']->get_theme(); |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | if ($mode == 'fullpage') { |
@@ -53,8 +53,8 @@ |
||
| 53 | 53 | $result .= '<table>'; |
| 54 | 54 | foreach ($output as $line) { |
| 55 | 55 | $result .= '<tr>'; |
| 56 | - $result .= '<td class="filler-report-data-init">'.$line['line-init'].' </td><td class="filler-report-data">'.$line['line-info'].'</td>'; |
|
| 57 | - $result .= '</tr>'; |
|
| 56 | + $result .= '<td class="filler-report-data-init">'.$line['line-init'].' </td><td class="filler-report-data">'.$line['line-info'].'</td>'; |
|
| 57 | + $result .= '</tr>'; |
|
| 58 | 58 | } |
| 59 | 59 | $result .= '</table>'; |
| 60 | 60 | $result .= '</div>'; |
@@ -20,8 +20,8 @@ |
||
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | 22 | * Class constructor |
| 23 | - * @param $username |
|
| 24 | - * @param $apiKey |
|
| 23 | + * @param string $username |
|
| 24 | + * @param string $apiKey |
|
| 25 | 25 | */ |
| 26 | 26 | protected function __construct($username, $apiKey) |
| 27 | 27 | { |
@@ -318,7 +318,6 @@ |
||
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | /** |
| 321 | - * @param int $courseId |
|
| 322 | 321 | * @return array |
| 323 | 322 | * @throws Exception |
| 324 | 323 | */ |
@@ -809,7 +809,8 @@ |
||
| 809 | 809 | * @param string $encoded |
| 810 | 810 | * @return array |
| 811 | 811 | */ |
| 812 | - public static function decodeParams($encoded) { |
|
| 812 | + public static function decodeParams($encoded) |
|
| 813 | + { |
|
| 813 | 814 | $decoded = str_replace(['-', '_', '.'], ['+', '/', '='], $encoded); |
| 814 | 815 | $mod4 = strlen($decoded) % 4; |
| 815 | 816 | |
@@ -483,7 +483,7 @@ |
||
| 483 | 483 | $notebooks = $notebooksRepo->findByUser($this->user, $this->course, $this->session); |
| 484 | 484 | |
| 485 | 485 | return array_map( |
| 486 | - function (CNotebook $notebook) { |
|
| 486 | + function(CNotebook $notebook) { |
|
| 487 | 487 | return [ |
| 488 | 488 | 'id' => $notebook->getIid(), |
| 489 | 489 | 'title' => $notebook->getTitle(), |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |
| 48 | - * @return array |
|
| 48 | + * @return string[] |
|
| 49 | 49 | */ |
| 50 | 50 | public static function getFoldersToDelete() |
| 51 | 51 | { |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | /** |
| 98 | - * @return array |
|
| 98 | + * @return string[] |
|
| 99 | 99 | */ |
| 100 | 100 | public static function getFilesToDelete() |
| 101 | 101 | { |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | /** |
| 26 | 26 | * Get the class instance |
| 27 | 27 | * @staticvar MsiLtiPlugin $result |
| 28 | - * @return MsiLtiPlugin |
|
| 28 | + * @return ImsLtiPlugin |
|
| 29 | 29 | */ |
| 30 | 30 | public static function create() |
| 31 | 31 | { |
@@ -20,6 +20,9 @@ |
||
| 20 | 20 | return $this->id; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | + /** |
|
| 24 | + * @return string |
|
| 25 | + */ |
|
| 23 | 26 | public function getName() |
| 24 | 27 | { |
| 25 | 28 | return $this->name; |