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

Course external functions. More...

Inheritance diagram for core_course_external:

Static Public Member Functions

static add_content_item_to_user_favourites (string $componentname, int $contentitemid)
 Add a content item to a user's favourites.
 
static add_content_item_to_user_favourites_parameters ()
 Returns description of method parameters.
 
static add_content_item_to_user_favourites_returns ()
 Returns description of method result value.
 
static check_updates ($courseid, $tocheck, $filter=array())
 Check if there is updates affecting the user for the given course and contexts.
 
static check_updates_parameters ()
 Returns description of method parameters.
 
static check_updates_returns ()
 Returns description of method result value.
 
static create_categories ($categories)
 Create categories.
 
static create_categories_parameters ()
 Returns description of method parameters.
 
static create_categories_returns ()
 Returns description of method parameters.
 
static create_courses ($courses)
 Create courses.
 
static create_courses_parameters ()
 Returns description of method parameters.
 
static create_courses_returns ()
 Returns description of method result value.
 
static delete_categories ($categories)
 Delete categories.
 
static delete_categories_parameters ()
 Returns description of method parameters.
 
static delete_categories_returns ()
 Returns description of method parameters.
 
static delete_courses ($courseids)
 Delete courses.
 
static delete_courses_parameters ()
 Returns description of method parameters.
 
static delete_courses_returns ()
 Returns description of method result value.
 
static delete_modules ($cmids)
 Deletes a list of provided module instances.
 
static delete_modules_parameters ()
 Describes the parameters for delete_modules.
 
static delete_modules_returns ()
 Describes the delete_modules return value.
 
static duplicate_course ($courseid, $fullname, $shortname, $categoryid, $visible=1, $options=array())
 Duplicate a course.
 
static duplicate_course_parameters ()
 Returns description of method parameters.
 
static duplicate_course_returns ()
 Returns description of method result value.
 
static edit_module ($action, $id, $sectionreturn=null)
 Performs one of the edit module actions and return new html for AJAX.
 
static edit_module_parameters ()
 Parameters for function edit_module()
 
static edit_module_returns ()
 Return structure for edit_module()
 
static edit_section ($action, $id, $sectionreturn)
 Performs one of the edit section actions.
 
static edit_section_parameters ()
 Parameters for function edit_section()
 
static edit_section_returns ()
 Return structure for edit_section()
 
static get_activity_chooser_footer (int $courseid, int $sectionid)
 Given a course ID we need to build up a footre for the chooser.
 
static get_activity_chooser_footer_parameters ()
 Returns description of method parameters.
 
static get_activity_chooser_footer_returns ()
 Returns description of method result value.
 
static get_categories ($criteria=array(), $addsubcategories=true)
 Get categories.
 
static get_categories_parameters ()
 Returns description of method parameters.
 
static get_categories_returns ()
 Returns description of method result value.
 
static get_course_content_items (int $courseid)
 Given a course ID fetch all accessible modules for that course.
 
static get_course_content_items_parameters ()
 Returns description of method parameters.
 
static get_course_content_items_returns ()
 Returns description of method result value.
 
static get_course_contents ($courseid, $options=array())
 Get course contents.
 
static get_course_contents_parameters ()
 Returns description of method parameters.
 
static get_course_contents_returns ()
 Returns description of method result value.
 
static get_course_module ($cmid)
 Return information about a course module.
 
static get_course_module_by_instance ($module, $instance)
 Return information about a course module.
 
static get_course_module_by_instance_parameters ()
 Returns description of method parameters.
 
static get_course_module_by_instance_returns ()
 Returns description of method result value.
 
static get_course_module_parameters ()
 Returns description of method parameters.
 
static get_course_module_returns ()
 Returns description of method result value.
 
static get_courses ($options=array())
 Get courses.
 
static get_courses_by_field ($field='', $value='')
 Get courses matching a specific field (id/s, shortname, idnumber, category)
 
static get_courses_by_field_parameters ()
 Returns description of method parameters.
 
static get_courses_by_field_returns ()
 Returns description of method result value.
 
static get_courses_parameters ()
 Returns description of method parameters.
 
static get_courses_returns ()
 Returns description of method result value.
 
static get_editable_customfields (\context $context, int $courseid=0)
 Return array of all editable course custom fields indexed by their shortname.
 
static get_enrolled_courses_by_timeline_classification (string $classification, int $limit=0, int $offset=0, string $sort=null, string $customfieldname=null, string $customfieldvalue=null, string $searchvalue=null)
 Get courses matching the given timeline classification.
 
static get_enrolled_courses_by_timeline_classification_parameters ()
 Returns description of method parameters.
 
static get_enrolled_courses_by_timeline_classification_returns ()
 Returns description of method result value.
 
static get_enrolled_users_by_cmid (int $cmid, int $groupid=0, bool $onlyactive=false)
 Get all users in a course for a given cmid.
 
static get_enrolled_users_by_cmid_parameters ()
 Returns description of method parameters.
 
static get_enrolled_users_by_cmid_returns ()
 Returns description of method result value.
 
static get_module ($id, $sectionreturn=null)
 Returns html for displaying one activity module on course page.
 
static get_module_parameters ()
 Parameters for function get_module()
 
static get_module_returns ()
 Return structure for get_module()
 
static get_recent_courses (int $userid=0, int $limit=0, int $offset=0, string $sort=null)
 Get last accessed courses adding additional course information like images.
 
static get_recent_courses_parameters ()
 Returns description of method parameters.
 
static get_recent_courses_returns ()
 Returns description of method result value.
 
static get_updates_since ($courseid, $since, $filter=array())
 Check if there are updates affecting the user for the given course since the given time stamp.
 
static get_updates_since_parameters ()
 Returns description of method parameters.
 
static get_updates_since_returns ()
 Returns description of method result value.
 
static get_user_administration_options ($courseids)
 Return a list of administration options in a set of courses that are available or not for the current user.
 
static get_user_administration_options_parameters ()
 Returns description of method parameters.
 
static get_user_administration_options_returns ()
 Returns description of method result value.
 
static get_user_navigation_options ($courseids)
 Return a list of navigation options in a set of courses that are avaialable or not for the current user.
 
static get_user_navigation_options_parameters ()
 Returns description of method parameters.
 
static get_user_navigation_options_returns ()
 Returns description of method result value.
 
static import_course ($importfrom, $importto, $deletecontent=0, $options=array())
 Imports a course.
 
static import_course_parameters ()
 Returns description of method parameters for import_course.
 
static import_course_returns ()
 Returns description of method result value.
 
static remove_content_item_from_user_favourites (string $componentname, int $contentitemid)
 Remove a content item from a user's favourites.
 
static remove_content_item_from_user_favourites_parameters ()
 Returns description of method parameters.
 
static remove_content_item_from_user_favourites_returns ()
 Returns description of method result value.
 
static search_courses ($criterianame, $criteriavalue, $page=0, $perpage=0, $requiredcapabilities=array(), $limittoenrolled=0, $onlywithcompletion=0)
 Search courses following the specified criteria.
 
static search_courses_parameters ()
 Returns description of method parameters.
 
static search_courses_returns ()
 Returns description of method result value.
 
static set_favourite_courses (array $courses)
 Set the course favourite status for an array of courses.
 
static set_favourite_courses_parameters ()
 Returns description of method parameters.
 
static set_favourite_courses_returns ()
 Returns description of method result value.
 
static toggle_activity_recommendation (string $area, int $id)
 Update the recommendation for an activity item.
 
static toggle_activity_recommendation_parameters ()
 Returns description of method parameters.
 
static toggle_activity_recommendation_returns ()
 Returns warnings.
 
static update_categories ($categories)
 Update categories.
 
static update_categories_parameters ()
 Returns description of method parameters.
 
static update_categories_returns ()
 Returns description of method result value.
 
static update_courses ($courses)
 Update courses.
 
static update_courses_parameters ()
 Update courses.
 
static update_courses_returns ()
 Returns description of method result value.
 
static user_description ()
 Create user return value description.
 
static view_course ($courseid, $sectionnumber=0)
 Trigger the course viewed event.
 
static view_course_parameters ()
 Returns description of method parameters.
 
static view_course_returns ()
 Returns description of method result value.
 

Static Protected Member Functions

static get_activitybadge_structure ()
 Returns description of activitybadge data.
 
static get_course_public_information (core_course_list_element $course, $coursecontext)
 Return the course information that is public (visible by every one)
 
static get_course_structure ($onlypublicdata=true)
 Returns a course structure definition.
 

Detailed Description

Course external functions.

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

Member Function Documentation

◆ add_content_item_to_user_favourites()

static core_course_external::add_content_item_to_user_favourites ( string $componentname,
int $contentitemid )
static

Add a content item to a user's favourites.

Parameters
string$componentnamethe name of the component from which this content item originates.
int$contentitemidthe id of the content item.
Return values
stdClassthe exporter content item.

◆ add_content_item_to_user_favourites_parameters()

static core_course_external::add_content_item_to_user_favourites_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters

◆ add_content_item_to_user_favourites_returns()

static core_course_external::add_content_item_to_user_favourites_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description

◆ check_updates()

static core_course_external::check_updates ( $courseid,
$tocheck,
$filter = array() )
static

Check if there is updates affecting the user for the given course and contexts.

Right now only modules are supported. This WS calls mod_check_updates_since for each module to check if there is any update the user should we aware of.

Parameters
int$courseidthe list of modules to check
array$tocheckthe list of modules to check
array$filtercheck only for updates in these areas
Return values
arraylist of updates and warnings
Exceptions
moodle_exception
Since
Moodle 3.2

◆ check_updates_parameters()

static core_course_external::check_updates_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.2

◆ check_updates_returns()

static core_course_external::check_updates_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description
Since
Moodle 3.2

◆ create_categories()

static core_course_external::create_categories ( $categories)
static

Create categories.

Parameters
array$categories- see create_categories_parameters() for the array structure
Return values
array- see create_categories_returns() for the array structure
Since
Moodle 2.3

◆ create_categories_parameters()

static core_course_external::create_categories_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 2.3

◆ create_categories_returns()

static core_course_external::create_categories_returns ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 2.3

◆ create_courses()

static core_course_external::create_courses ( $courses)
static

Create courses.

Parameters
array$courses
Return values
arraycourses (id and shortname only)
Since
Moodle 2.2

◆ create_courses_parameters()

static core_course_external::create_courses_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 2.2

◆ create_courses_returns()

static core_course_external::create_courses_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description
Since
Moodle 2.2

◆ delete_categories()

static core_course_external::delete_categories ( $categories)
static

Delete categories.

Parameters
array$categoriesA list of category ids
Return values
array
Since
Moodle 2.3

◆ delete_categories_parameters()

static core_course_external::delete_categories_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 2.3

◆ delete_categories_returns()

static core_course_external::delete_categories_returns ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 2.3

◆ delete_courses()

static core_course_external::delete_courses ( $courseids)
static

Delete courses.

Parameters
array$courseidsA list of course ids
Since
Moodle 2.2

◆ delete_courses_parameters()

static core_course_external::delete_courses_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 2.2

◆ delete_courses_returns()

static core_course_external::delete_courses_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description
Since
Moodle 2.2

◆ delete_modules()

static core_course_external::delete_modules ( $cmids)
static

Deletes a list of provided module instances.

Parameters
array$cmidsthe course module ids
Since
Moodle 2.5

◆ delete_modules_parameters()

static core_course_external::delete_modules_parameters ( )
static

Describes the parameters for delete_modules.

Return values
external_function_parameters
Since
Moodle 2.5

◆ delete_modules_returns()

static core_course_external::delete_modules_returns ( )
static

Describes the delete_modules return value.

Return values
external_single_structure
Since
Moodle 2.5

◆ duplicate_course()

static core_course_external::duplicate_course ( $courseid,
$fullname,
$shortname,
$categoryid,
$visible = 1,
$options = array() )
static

Duplicate a course.

Parameters
int$courseid
string$fullnameDuplicated course fullname
string$shortnameDuplicated course shortname
int$categoryidDuplicated course parent category id
int$visibleDuplicated course availability
array$optionsList of backup options
Return values
arrayNew course info
Since
Moodle 2.3

◆ duplicate_course_parameters()

static core_course_external::duplicate_course_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 2.3

◆ duplicate_course_returns()

static core_course_external::duplicate_course_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description
Since
Moodle 2.3

◆ edit_module()

static core_course_external::edit_module ( $action,
$id,
$sectionreturn = null )
static

Performs one of the edit module actions and return new html for AJAX.

Returns html to replace the current module html with, for example:

  • empty string for "delete" action,
  • two modules html for "duplicate" action
  • updated module html for everything else

Throws exception if operation is not permitted/possible

Since
Moodle 3.3
Parameters
string$action
int$id
null | int$sectionreturn
Return values
string

◆ edit_module_parameters()

static core_course_external::edit_module_parameters ( )
static

Parameters for function edit_module()

Since
Moodle 3.3
Return values
external_function_parameters

◆ edit_module_returns()

static core_course_external::edit_module_returns ( )
static

Return structure for edit_module()

Since
Moodle 3.3
Return values
core_external\external_description

◆ edit_section()

static core_course_external::edit_section ( $action,
$id,
$sectionreturn )
static

Performs one of the edit section actions.

Since
Moodle 3.3
Parameters
string$action
int$idsection id
int$sectionreturnsection to return to
Return values
string

◆ edit_section_parameters()

static core_course_external::edit_section_parameters ( )
static

Parameters for function edit_section()

Since
Moodle 3.3
Return values
external_function_parameters

◆ edit_section_returns()

static core_course_external::edit_section_returns ( )
static

Return structure for edit_section()

Since
Moodle 3.3
Return values
core_external\external_description

◆ get_activity_chooser_footer()

static core_course_external::get_activity_chooser_footer ( int $courseid,
int $sectionid )
static

Given a course ID we need to build up a footre for the chooser.

Parameters
int$courseidThe course we want to fetch the modules for
int$sectionidThe section we want to fetch the modules for
Return values
array

◆ get_activity_chooser_footer_parameters()

static core_course_external::get_activity_chooser_footer_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters

◆ get_activity_chooser_footer_returns()

static core_course_external::get_activity_chooser_footer_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description

◆ get_activitybadge_structure()

static core_course_external::get_activitybadge_structure ( )
staticprotected

Returns description of activitybadge data.

Return values
external_description

◆ get_categories()

static core_course_external::get_categories ( $criteria = array(),
$addsubcategories = true )
static

Get categories.

Parameters
array$criteriaCriteria to match the results
booln$addsubcategoriesobtain only the category (false) or its subcategories (true - default)
Return values
arraylist of categories
Since
Moodle 2.3

◆ get_categories_parameters()

static core_course_external::get_categories_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 2.3

◆ get_categories_returns()

static core_course_external::get_categories_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description
Since
Moodle 2.3

◆ get_course_content_items()

static core_course_external::get_course_content_items ( int $courseid)
static

Given a course ID fetch all accessible modules for that course.

Parameters
int$courseidThe course we want to fetch the modules for
Return values
arrayContains array of modules and their metadata

◆ get_course_content_items_parameters()

static core_course_external::get_course_content_items_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters

◆ get_course_content_items_returns()

static core_course_external::get_course_content_items_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description

◆ get_course_contents()

static core_course_external::get_course_contents ( $courseid,
$options = array() )
static

Get course contents.

Parameters
int$courseidcourse id
array$optionsOptions for filtering the results, used since Moodle 2.9
Return values
array
Since
Moodle 2.9 Options available
Moodle 2.2

◆ get_course_contents_parameters()

static core_course_external::get_course_contents_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 2.9 Options available
Moodle 2.2

◆ get_course_contents_returns()

static core_course_external::get_course_contents_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description
Since
Moodle 2.2

◆ get_course_module()

static core_course_external::get_course_module ( $cmid)
static

Return information about a course module.

Parameters
int$cmidthe course module id
Return values
arrayof warnings and the course module
Since
Moodle 3.0
Exceptions
moodle_exception

◆ get_course_module_by_instance()

static core_course_external::get_course_module_by_instance ( $module,
$instance )
static

Return information about a course module.

Parameters
string$modulethe module name
int$instancethe activity instance id
Return values
arrayof warnings and the course module
Since
Moodle 3.0
Exceptions
moodle_exception

◆ get_course_module_by_instance_parameters()

static core_course_external::get_course_module_by_instance_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.0

◆ get_course_module_by_instance_returns()

static core_course_external::get_course_module_by_instance_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description
Since
Moodle 3.0

◆ get_course_module_parameters()

static core_course_external::get_course_module_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.0

◆ get_course_module_returns()

static core_course_external::get_course_module_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description
Since
Moodle 3.0

◆ get_course_public_information()

static core_course_external::get_course_public_information ( core_course_list_element $course,
$coursecontext )
staticprotected

Return the course information that is public (visible by every one)

Parameters
core_course_list_element$coursecourse in list object
stdClass$coursecontextcourse context object
Return values
arraythe course information
Since
Moodle 3.2

◆ get_course_structure()

static core_course_external::get_course_structure ( $onlypublicdata = true)
staticprotected

Returns a course structure definition.

Parameters
boolean$onlypublicdataset to true, to retrieve only fields viewable by anyone when the course is visible
Return values
external_single_structurethe course structure
Since
Moodle 3.2

◆ get_courses()

static core_course_external::get_courses ( $options = array())
static

Get courses.

Parameters
array$optionsIt contains an array (list of ids)
Return values
array
Since
Moodle 2.2

◆ get_courses_by_field()

static core_course_external::get_courses_by_field ( $field = '',
$value = '' )
static

Get courses matching a specific field (id/s, shortname, idnumber, category)

Parameters
string$fieldfield name to search, or empty for all courses
string$valuevalue to search
Return values
arraylist of courses and warnings
Exceptions
invalid_parameter_exception
Since
Moodle 3.2

◆ get_courses_by_field_parameters()

static core_course_external::get_courses_by_field_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.2

◆ get_courses_by_field_returns()

static core_course_external::get_courses_by_field_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description
Since
Moodle 3.2

◆ get_courses_parameters()

static core_course_external::get_courses_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 2.3

◆ get_courses_returns()

static core_course_external::get_courses_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description
Since
Moodle 2.2

◆ get_editable_customfields()

static core_course_external::get_editable_customfields ( \context $context,
int $courseid = 0 )
static

Return array of all editable course custom fields indexed by their shortname.

Parameters
context$context
int$courseid
Return values
core_customfield\field_controller[]

◆ get_enrolled_courses_by_timeline_classification()

static core_course_external::get_enrolled_courses_by_timeline_classification ( string $classification,
int $limit = 0,
int $offset = 0,
string $sort = null,
string $customfieldname = null,
string $customfieldvalue = null,
string $searchvalue = null )
static

Get courses matching the given timeline classification.

NOTE: The offset applies to the unfiltered full set of courses before the classification filtering is done. E.g. If the user is enrolled in 5 courses: c1, c2, c3, c4, and c5 And c4 and c5 are 'future' courses

If a request comes in for future courses with an offset of 1 it will mean that c1 is skipped (because the offset applies before the classification filtering) and c4 and c5 will be return.

Parameters
string$classificationpast, inprogress, or future
int$limitResult set limit
int$offsetOffset the full course set before timeline classification is applied
string$sortSQL sort string for results
string$customfieldname
string$customfieldvalue
string$searchvalue
Return values
arraylist of courses and warnings
Exceptions
invalid_parameter_exception

◆ get_enrolled_courses_by_timeline_classification_parameters()

static core_course_external::get_enrolled_courses_by_timeline_classification_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters

◆ get_enrolled_courses_by_timeline_classification_returns()

static core_course_external::get_enrolled_courses_by_timeline_classification_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description

◆ get_enrolled_users_by_cmid()

static core_course_external::get_enrolled_users_by_cmid ( int $cmid,
int $groupid = 0,
bool $onlyactive = false )
static

Get all users in a course for a given cmid.

Parameters
int$cmidCourse Module id from which the users will be obtained
int$groupidGroup id from which the users will be obtained
bool$onlyactiveWhether to return only the active enrolled users or all enrolled users in the course.
Return values
arrayList of users
Exceptions
invalid_parameter_exception

◆ get_enrolled_users_by_cmid_parameters()

static core_course_external::get_enrolled_users_by_cmid_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters

◆ get_enrolled_users_by_cmid_returns()

static core_course_external::get_enrolled_users_by_cmid_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description

◆ get_module()

static core_course_external::get_module ( $id,
$sectionreturn = null )
static

Returns html for displaying one activity module on course page.

Since
Moodle 3.3
Parameters
int$id
null | int$sectionreturn
Return values
string

◆ get_module_parameters()

static core_course_external::get_module_parameters ( )
static

Parameters for function get_module()

Since
Moodle 3.3
Return values
external_function_parameters

◆ get_module_returns()

static core_course_external::get_module_returns ( )
static

Return structure for get_module()

Since
Moodle 3.3
Return values
core_external\external_description

◆ get_recent_courses()

static core_course_external::get_recent_courses ( int $userid = 0,
int $limit = 0,
int $offset = 0,
string $sort = null )
static

Get last accessed courses adding additional course information like images.

Parameters
int$useridUser id from which the courses will be obtained
int$limitRestrict result set to this amount
int$offsetSkip this number of records from the start of the result set
string | null$sortSQL string for sorting
Return values
arrayList of courses
Exceptions
invalid_parameter_exception

◆ get_recent_courses_parameters()

static core_course_external::get_recent_courses_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.6

◆ get_recent_courses_returns()

static core_course_external::get_recent_courses_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description
Since
Moodle 3.6

◆ get_updates_since()

static core_course_external::get_updates_since ( $courseid,
$since,
$filter = array() )
static

Check if there are updates affecting the user for the given course since the given time stamp.

This function is a wrapper of self\check_updates for retrieving all the updates since a given time for all the activities.

Parameters
int$courseidthe list of modules to check
int$sincecheck updates since this time stamp
array$filtercheck only for updates in these areas
Return values
arraylist of updates and warnings
Exceptions
moodle_exception
Since
Moodle 3.3

◆ get_updates_since_parameters()

static core_course_external::get_updates_since_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.3

◆ get_updates_since_returns()

static core_course_external::get_updates_since_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description
Since
Moodle 3.3

◆ get_user_administration_options()

static core_course_external::get_user_administration_options ( $courseids)
static

Return a list of administration options in a set of courses that are available or not for the current user.

Parameters
array$courseidsa list of course ids
Return values
arrayof warnings and the options availability
Since
Moodle 3.2
Exceptions
moodle_exception

◆ get_user_administration_options_parameters()

static core_course_external::get_user_administration_options_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.2

◆ get_user_administration_options_returns()

static core_course_external::get_user_administration_options_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description
Since
Moodle 3.2

◆ get_user_navigation_options()

static core_course_external::get_user_navigation_options ( $courseids)
static

Return a list of navigation options in a set of courses that are avaialable or not for the current user.

Parameters
array$courseidsa list of course ids
Return values
arrayof warnings and the options availability
Since
Moodle 3.2
Exceptions
moodle_exception

◆ get_user_navigation_options_parameters()

static core_course_external::get_user_navigation_options_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.2

◆ get_user_navigation_options_returns()

static core_course_external::get_user_navigation_options_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description
Since
Moodle 3.2

◆ import_course()

static core_course_external::import_course ( $importfrom,
$importto,
$deletecontent = 0,
$options = array() )
static

Imports a course.

Parameters
int$importfromThe id of the course we are importing from
int$importtoThe id of the course we are importing to
bool$deletecontentWhether to delete the course we are importing to content
array$optionsList of backup options
Return values
null
Since
Moodle 2.4

◆ import_course_parameters()

static core_course_external::import_course_parameters ( )
static

Returns description of method parameters for import_course.

Return values
external_function_parameters
Since
Moodle 2.4

◆ import_course_returns()

static core_course_external::import_course_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description
Since
Moodle 2.4

◆ remove_content_item_from_user_favourites()

static core_course_external::remove_content_item_from_user_favourites ( string $componentname,
int $contentitemid )
static

Remove a content item from a user's favourites.

Parameters
string$componentnamethe name of the component from which this content item originates.
int$contentitemidthe id of the content item.
Return values
stdClassthe exported content item.

◆ remove_content_item_from_user_favourites_parameters()

static core_course_external::remove_content_item_from_user_favourites_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters

◆ remove_content_item_from_user_favourites_returns()

static core_course_external::remove_content_item_from_user_favourites_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description

◆ search_courses()

static core_course_external::search_courses ( $criterianame,
$criteriavalue,
$page = 0,
$perpage = 0,
$requiredcapabilities = array(),
$limittoenrolled = 0,
$onlywithcompletion = 0 )
static

Search courses following the specified criteria.

Parameters
string$criterianameCriteria name (search, modulelist (only admins), blocklist (only admins), tagid)
string$criteriavalueCriteria value
int$pagePage number (for pagination)
int$perpageItems per page
array$requiredcapabilitiesOptional list of required capabilities (used to filter the list).
int$limittoenrolledLimit to only enrolled courses
intonlywithcompletion Limit to only courses where completion is enabled
Return values
arrayof course objects and warnings
Since
Moodle 3.0
Exceptions
moodle_exception

◆ search_courses_parameters()

static core_course_external::search_courses_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.0

◆ search_courses_returns()

static core_course_external::search_courses_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description
Since
Moodle 3.0

◆ set_favourite_courses()

static core_course_external::set_favourite_courses ( array $courses)
static

Set the course favourite status for an array of courses.

Parameters
array$coursesList with course id's and favourite status.
Return values
arrayArray with an array of favourite courses.

◆ set_favourite_courses_parameters()

static core_course_external::set_favourite_courses_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters

◆ set_favourite_courses_returns()

static core_course_external::set_favourite_courses_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description

◆ toggle_activity_recommendation()

static core_course_external::toggle_activity_recommendation ( string $area,
int $id )
static

Update the recommendation for an activity item.

Parameters
string$areaidentifier for this activity.
int$idAssociated id. This is needed in conjunction with the area to find the recommendation.
Return values
arraysome warnings or something.

◆ toggle_activity_recommendation_parameters()

static core_course_external::toggle_activity_recommendation_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters

◆ toggle_activity_recommendation_returns()

static core_course_external::toggle_activity_recommendation_returns ( )
static

Returns warnings.

Return values
core_external\external_description

◆ update_categories()

static core_course_external::update_categories ( $categories)
static

Update categories.

Parameters
array$categoriesThe list of categories to update
Return values
null
Since
Moodle 2.3

◆ update_categories_parameters()

static core_course_external::update_categories_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 2.3

◆ update_categories_returns()

static core_course_external::update_categories_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description
Since
Moodle 2.3

◆ update_courses()

static core_course_external::update_courses ( $courses)
static

Update courses.

Parameters
array$courses
Since
Moodle 2.5

◆ update_courses_parameters()

static core_course_external::update_courses_parameters ( )
static

Update courses.

Return values
external_function_parameters
Since
Moodle 2.5

◆ update_courses_returns()

static core_course_external::update_courses_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description
Since
Moodle 2.5

◆ user_description()

static core_course_external::user_description ( )
static

Create user return value description.

Return values
core_external\external_description

◆ view_course()

static core_course_external::view_course ( $courseid,
$sectionnumber = 0 )
static

Trigger the course viewed event.

Parameters
int$courseidid of course
int$sectionnumbersectionnumber (0, 1, 2...)
Return values
arrayof warnings and status result
Since
Moodle 2.9
Exceptions
moodle_exception

◆ view_course_parameters()

static core_course_external::view_course_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 2.9

◆ view_course_returns()

static core_course_external::view_course_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description
Since
Moodle 2.9

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