diff --git a/lib/classes/grades_external.php b/lib/classes/grades_external.php index 565f268a854..f2a0e6d3739 100644 --- a/lib/classes/grades_external.php +++ b/lib/classes/grades_external.php @@ -38,6 +38,8 @@ class core_grades_external extends external_api { * * @return external_function_parameters * @since Moodle 2.7 + * @deprecated Moodle 3.2 MDL-51373 - Please do not call this function any more. + * @see gradereport_user_external::get_grades_table for a similar function */ public static function get_grades_parameters() { return new external_function_parameters( @@ -65,6 +67,8 @@ class core_grades_external extends external_api { * @param array $userids Array of user ids * @return array Array of grades * @since Moodle 2.7 + * @deprecated Moodle 3.2 MDL-51373 - Please do not call this function any more. + * @see gradereport_user_external::get_grades_table for a similar function */ public static function get_grades($courseid, $component = null, $activityid = null, $userids = array()) { global $CFG, $USER, $DB; @@ -293,6 +297,8 @@ class core_grades_external extends external_api { * @param int $iteminstance Item instance * @param int $itemnumber Item number * @return grade_item A grade_item instance + * @deprecated Moodle 3.2 MDL-51373 - Please do not call this function any more. + * @see gradereport_user_external::get_grades_table for a similar function */ private static function get_grade_item($courseid, $itemtype, $itemmodule = null, $iteminstance = null, $itemnumber = null) { $gradeiteminstance = null; @@ -311,6 +317,8 @@ class core_grades_external extends external_api { * * @return external_description * @since Moodle 2.7 + * @deprecated Moodle 3.2 MDL-51373 - Please do not call this function any more. + * @see gradereport_user_external::get_grades_table for a similar function */ public static function get_grades_returns() { return new external_single_structure( @@ -405,6 +413,15 @@ class core_grades_external extends external_api { } + /** + * Marking the method as deprecated. + * + * @return bool + */ + public static function get_grades_is_deprecated() { + return true; + } + /** * Returns description of method parameters * diff --git a/lib/db/services.php b/lib/db/services.php index 0cc944328e6..31486466b40 100644 --- a/lib/db/services.php +++ b/lib/db/services.php @@ -393,7 +393,8 @@ $functions = array( 'core_grades_get_grades' => array( 'classname' => 'core_grades_external', 'methodname' => 'get_grades', - 'description' => 'Returns student course total grade and grades for activities. + 'description' => '** DEPRECATED ** Please do not call this function any more. + Returns student course total grade and grades for activities. This function does not return category or manual items. This function is suitable for managers or teachers not students.', 'type' => 'read', diff --git a/lib/upgrade.txt b/lib/upgrade.txt index a8cccd770e4..f8398e260cd 100644 --- a/lib/upgrade.txt +++ b/lib/upgrade.txt @@ -13,6 +13,9 @@ information provided here is intended especially for developers. - get_user_max_upload_file_size() * The following functions have been removed and should not be used any more: - file_modify_html_header() - See MDL-29738 for more information. +* core_grades_external::get_grades has been deprecated. Please do not call this function any more. + External function gradereport_user_external::get_grades_table can be used for retrieving the course grades table. + Please note that the information returned from that WS is intended for displaying (not for data consumption). === 3.1 ===