mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 01:16:44 +02:00
MDL-66074 core_grade: Documentation
This commit is contained in:
parent
47919bbe78
commit
9f1195fa66
9 changed files with 48 additions and 13 deletions
|
@ -58,6 +58,14 @@ abstract class component_gradeitem {
|
|||
/** @var int The grade itemnumber */
|
||||
protected $itemnumber;
|
||||
|
||||
/**
|
||||
* component_gradeitem constructor.
|
||||
*
|
||||
* @param string $component
|
||||
* @param context $context
|
||||
* @param string $itemname
|
||||
* @throws \coding_exception
|
||||
*/
|
||||
final protected function __construct(string $component, context $context, string $itemname) {
|
||||
$this->component = $component;
|
||||
$this->context = $context;
|
||||
|
@ -364,6 +372,7 @@ abstract class component_gradeitem {
|
|||
*
|
||||
* @param int $gradeid
|
||||
* @return stdClass
|
||||
* @throws \dml_exception
|
||||
*/
|
||||
public function get_grade(int $gradeid): stdClass {
|
||||
global $DB;
|
||||
|
@ -385,7 +394,6 @@ abstract class component_gradeitem {
|
|||
/**
|
||||
* Get grades for all users for the specified gradeitem.
|
||||
*
|
||||
* @param int $itemnumber The specific grade item to fetch for the user
|
||||
* @return stdClass[] The grades
|
||||
*/
|
||||
abstract public function get_all_grades(): array;
|
||||
|
|
|
@ -89,6 +89,11 @@ class fetch extends external_api {
|
|||
* @param string $itemname
|
||||
* @param int $gradeduserid
|
||||
* @return array
|
||||
* @throws \dml_exception
|
||||
* @throws \invalid_parameter_exception
|
||||
* @throws \restricted_context_exception
|
||||
* @throws coding_exception
|
||||
* @throws moodle_exception
|
||||
* @since Moodle 3.8
|
||||
*/
|
||||
public static function execute(string $component, int $contextid, string $itemname, int $gradeduserid): array {
|
||||
|
@ -132,7 +137,7 @@ class fetch extends external_api {
|
|||
/**
|
||||
* Get the data to be fetched.
|
||||
*
|
||||
* @param component_gradeitem $gradeitem
|
||||
* @param stdClass $grade
|
||||
* @return array
|
||||
*/
|
||||
public static function get_fetch_data(stdClass $grade): array {
|
||||
|
|
|
@ -92,7 +92,13 @@ class store extends external_api {
|
|||
* @param int $contextid
|
||||
* @param string $itemname
|
||||
* @param int $gradeduserid
|
||||
* @param string $formdata
|
||||
* @return array
|
||||
* @throws \dml_exception
|
||||
* @throws \invalid_parameter_exception
|
||||
* @throws \restricted_context_exception
|
||||
* @throws coding_exception
|
||||
* @throws moodle_exception
|
||||
* @since Moodle 3.8
|
||||
*/
|
||||
public static function execute(string $component, int $contextid, string $itemname, int $gradeduserid, string $formdata): array {
|
||||
|
|
|
@ -89,6 +89,11 @@ class fetch extends external_api {
|
|||
* @param string $itemname
|
||||
* @param int $gradeduserid
|
||||
* @return array
|
||||
* @throws \dml_exception
|
||||
* @throws \invalid_parameter_exception
|
||||
* @throws \restricted_context_exception
|
||||
* @throws coding_exception
|
||||
* @throws moodle_exception
|
||||
* @since Moodle 3.8
|
||||
*/
|
||||
public static function execute(string $component, int $contextid, string $itemname, int $gradeduserid): array {
|
||||
|
@ -130,7 +135,8 @@ class fetch extends external_api {
|
|||
/**
|
||||
* Get the data to be fetched.
|
||||
*
|
||||
* @param component_gradeitem $gradeitem
|
||||
* @param gradeitem $gradeitem
|
||||
* @param stdClass $gradeduser
|
||||
* @return array
|
||||
*/
|
||||
public static function get_fetch_data(gradeitem $gradeitem, stdClass $gradeduser): array {
|
||||
|
|
|
@ -92,7 +92,13 @@ class store extends external_api {
|
|||
* @param int $contextid
|
||||
* @param string $itemname
|
||||
* @param int $gradeduserid
|
||||
* @param string $formdata
|
||||
* @return array
|
||||
* @throws \dml_exception
|
||||
* @throws \invalid_parameter_exception
|
||||
* @throws \restricted_context_exception
|
||||
* @throws coding_exception
|
||||
* @throws moodle_exception
|
||||
* @since Moodle 3.8
|
||||
*/
|
||||
public static function execute(string $component, int $contextid, string $itemname, int $gradeduserid, string $formdata): array {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue