Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
core_rating_external Class Reference

Rating external functions. More...

Inheritance diagram for core_rating_external:

Static Public Member Functions

static add_rating ($contextlevel, $instanceid, $component, $ratingarea, $itemid, $scaleid, $rating, $rateduserid, $aggregation=RATING_AGGREGATE_NONE)
 Adds a rating to an item.
 
static add_rating_parameters ()
 Returns description of add_rating parameters.
 
static add_rating_returns ()
 Returns description of add_rating result values.
 
static get_item_ratings ($contextlevel, $instanceid, $component, $ratingarea, $itemid, $scaleid, $sort)
 Retrieve a list of ratings for a given item (forum post etc)
 
static get_item_ratings_parameters ()
 Returns description of get_item_ratings parameters.
 
static get_item_ratings_returns ()
 Returns description of get_item_ratings result values.
 

Detailed Description

Rating external functions.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Since
Moodle 2.9

Member Function Documentation

◆ add_rating()

static core_rating_external::add_rating ( $contextlevel,
$instanceid,
$component,
$ratingarea,
$itemid,
$scaleid,
$rating,
$rateduserid,
$aggregation = RATING_AGGREGATE_NONE )
static

Adds a rating to an item.

Parameters
string$contextlevelcourse, module, user...
int$instanceidthe instance if for the context element
string$componentthe name of the component
string$ratingarearating area
int$itemidthe item id
int$scaleidthe scale id
int$ratingthe user rating
int$rateduseridthe rated user id
int$aggregationthe aggregation method
Return values
arrayresult and possible warnings
Exceptions
moodle_exception
Since
Moodle 3.2

◆ add_rating_parameters()

static core_rating_external::add_rating_parameters ( )
static

Returns description of add_rating parameters.

Return values
external_function_parameters
Since
Moodle 3.2

◆ add_rating_returns()

static core_rating_external::add_rating_returns ( )
static

Returns description of add_rating result values.

Return values
external_single_structure
Since
Moodle 3.2

◆ get_item_ratings()

static core_rating_external::get_item_ratings ( $contextlevel,
$instanceid,
$component,
$ratingarea,
$itemid,
$scaleid,
$sort )
static

Retrieve a list of ratings for a given item (forum post etc)

Parameters
string$contextlevelcourse, module, user...
int$instanceidthe instance if for the context element
string$componentthe name of the component
string$ratingarearating area
int$itemidthe item id
int$scaleidthe scale id
string$sortsql order (firstname, rating or timemodified)
Return values
arrayResult and possible warnings
Exceptions
moodle_exception
Since
Moodle 2.9

◆ get_item_ratings_parameters()

static core_rating_external::get_item_ratings_parameters ( )
static

Returns description of get_item_ratings parameters.

Return values
external_function_parameters
Since
Moodle 2.9

◆ get_item_ratings_returns()

static core_rating_external::get_item_ratings_returns ( )
static

Returns description of get_item_ratings result values.

Return values
external_single_structure
Since
Moodle 2.9

The documentation for this class was generated from the following file: