Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
|
Functions | |
mod_workshop_core_calendar_event_timestart_updated (\calendar_event $event, stdClass $workshop) | |
This function will update the workshop module according to the event that has been modified. | |
mod_workshop_core_calendar_get_event_action_string ($eventtype) | |
Callback to fetch the activity event type lang string. | |
mod_workshop_core_calendar_get_valid_event_timestart_range (\calendar_event $event, stdClass $workshop) | |
This function calculates the minimum and maximum cutoff values for the timestart of the given event. | |
mod_workshop_core_calendar_provide_event_action (calendar_event $event, core_calendar\action_factory $factory, int $userid=0) | |
This function receives a calendar event and returns the action associated with it, or null if there is none. | |
mod_workshop_get_fontawesome_icon_map () | |
Get icon mapping for font-awesome. | |
mod_workshop_get_path_from_pluginfile (string $filearea, array $args) | |
Given an array with a file path, it returns the itemid and the filepath for the defined filearea. | |
mod_workshop_user_preferences () | |
Get the current user preferences that are available. | |
workshop_add_instance (stdclass $workshop) | |
Saves a new instance of the workshop into the database. | |
workshop_calendar_update (stdClass $workshop, $cmid) | |
Updates the calendar events associated to the given workshop. | |
workshop_check_updates_since (cm_info $cm, $from, $filter=array()) | |
Check if the module has any update that affects the current user since a given time. | |
workshop_delete_instance ($id) | |
Given an ID of an instance of this module, this function will permanently delete the instance and any data that depends on it. | |
workshop_extend_navigation (navigation_node $navref, stdclass $course, stdclass $module, cm_info $cm) | |
Extends the global navigation tree by adding workshop nodes if there is a relevant content. | |
workshop_extend_settings_navigation (settings_navigation $settingsnav, navigation_node $workshopnode=null) | |
Extends the settings navigation with the Workshop settings. | |
workshop_get_coursemodule_info ($coursemodule) | |
Add a get_coursemodule_info function in case any feedback type wants to add 'extra' information for the course (see resource). | |
workshop_get_file_areas ($course, $cm, $context) | |
Returns the lists of all browsable file areas within the given module context. | |
workshop_get_file_info ($browser, $areas, $course, $cm, $context, $filearea, $itemid, $filepath, $filename) | |
File browsing support for workshop file areas. | |
workshop_get_post_actions () | |
List the actions that correspond to a post of this module. | |
workshop_get_recent_mod_activity (&$activities, &$index, $timestart, $courseid, $cmid, $userid=0, $groupid=0) | |
Returns all activity in course workshops since a given time. | |
workshop_get_view_actions () | |
List the actions that correspond to a view of this module. | |
workshop_grade_item_category_update ($workshop) | |
Update the grade items categories if they are changed via mod_form.php. | |
workshop_grade_item_update (stdclass $workshop, $submissiongrades=null, $assessmentgrades=null) | |
Creates or updates grade items for the give workshop instance. | |
workshop_page_type_list ($pagetype, $parentcontext, $currentcontext) | |
Return a list of page types. | |
workshop_pluginfile ($course, $cm, $context, $filearea, array $args, $forcedownload, array $options=array()) | |
Serves the files from the workshop file areas. | |
workshop_print_recent_activity ($course, $viewfullnames, $timestart) | |
Given a course and a time, this module should find recent activity that has occurred in workshop activities and print it out. | |
workshop_print_recent_mod_activity ($activity, $courseid, $detail, $modnames, $viewfullnames) | |
Print single activity item prepared by {. | |
workshop_refresh_events ($courseid=0, $instance=null, $cm=null) | |
This standard function will check all instances of this module and make sure there are up-to-date events created for each of them. | |
workshop_reset_course_form_defaults (stdClass $course) | |
Provides default values for the workshop settings in the course reset form. | |
workshop_reset_course_form_definition ($mform) | |
Extends the course reset form with workshop specific settings. | |
workshop_reset_userdata (stdClass $data) | |
Performs the reset of all workshop instances in the course. | |
workshop_scale_used () | |
workshop_scale_used_anywhere ($scaleid) | |
Is a given scale used by any instance of workshop? | |
workshop_supports ($feature) | |
Returns the information if the module supports a feature. | |
workshop_update_grades (stdclass $workshop, $userid=0) | |
Update workshop grades in the gradebook. | |
workshop_update_instance (stdclass $workshop) | |
Given an object containing all the necessary data, (defined by the form in mod_form.php) this function will update an existing instance with new data. | |
workshop_user_complete ($course, $user, $mod, $workshop) | |
Print a detailed representation of what a user has done with a given particular instance of this module, for user activity reports. | |
workshop_user_outline ($course, $user, $mod, $workshop) | |
Return a small object with summary information about what a user has done with a given particular instance of this module Used for user activity reports. | |
mod_workshop_core_calendar_event_timestart_updated | ( | \calendar_event | $event, |
stdClass | $workshop ) |
This function will update the workshop module according to the event that has been modified.
calendar_event | $event | |
stdClass | $workshop | The module instance to get the range from |
mod_workshop_core_calendar_get_event_action_string | ( | $eventtype | ) |
Callback to fetch the activity event type lang string.
string | $eventtype | The event type. |
lang_string | The event type lang string. |
mod_workshop_core_calendar_get_valid_event_timestart_range | ( | \calendar_event | $event, |
stdClass | $workshop ) |
This function calculates the minimum and maximum cutoff values for the timestart of the given event.
It will return an array with two values, the first being the minimum cutoff value and the second being the maximum cutoff value. Either or both values can be null, which indicates there is no minimum or maximum, respectively.
If a cutoff is required then the function must return an array containing the cutoff timestamp and error string to display to the user if the cutoff value is violated.
A minimum and maximum cutoff return value will look like: [ [1505704373, 'The date must be after this date'], [1506741172, 'The date must be before this date'] ]
calendar_event | $event | The calendar event to get the time range for |
stdClass | $workshop | The module instance to get the range from |
array | Returns an array with min and max date. |
mod_workshop_core_calendar_provide_event_action | ( | calendar_event | $event, |
core_calendar\action_factory | $factory, | ||
int | $userid = 0 ) |
This function receives a calendar event and returns the action associated with it, or null if there is none.
This is used by block_myoverview in order to display the event appropriately. If null is returned then the event is not displayed on the block.
calendar_event | $event | |
core_calendar\action_factory | $factory | |
int | $userid | User id to use for all capability checks, etc. Set to 0 for current user (default). |
core_calendar\local\event\entities\action_interface|null |
mod_workshop_get_path_from_pluginfile | ( | string | $filearea, |
array | $args ) |
Given an array with a file path, it returns the itemid and the filepath for the defined filearea.
string | $filearea | The filearea. |
array | $args | The path (the part after the filearea and before the filename). |
array|null | The itemid and the filepath inside the $args path, for the defined filearea. |
mod_workshop_user_preferences | ( | ) |
Get the current user preferences that are available.
array[] |
workshop_add_instance | ( | stdclass | $workshop | ) |
Saves a new instance of the workshop into the database.
Given an object containing all the necessary data, (defined by the form in mod_form.php) this function will save a new instance and return the id number of the new instance.
stdClass | $workshop | An object from the form in mod_form.php |
int | The id of the newly inserted workshop record |
workshop_calendar_update | ( | stdClass | $workshop, |
$cmid ) |
Updates the calendar events associated to the given workshop.
stdClass | $workshop | the workshop instance record |
int | $cmid | course module id |
workshop_check_updates_since | ( | cm_info | $cm, |
$from, | |||
$filter = array() ) |
Check if the module has any update that affects the current user since a given time.
cm_info | $cm | course module data |
int | $from | the time to check updates from |
array | $filter | if we need to check only specific updates |
stdClass | an object with the different type of areas indicating if they were updated or not |
workshop_delete_instance | ( | $id | ) |
Given an ID of an instance of this module, this function will permanently delete the instance and any data that depends on it.
int | $id | Id of the module instance |
boolean | Success/Failure |
workshop_extend_navigation | ( | navigation_node | $navref, |
stdclass | $course, | ||
stdclass | $module, | ||
cm_info | $cm ) |
Extends the global navigation tree by adding workshop nodes if there is a relevant content.
This can be called by an AJAX request so do not rely on $PAGE as it might not be set up properly.
navigation_node | $navref | An object representing the navigation tree node of the workshop module instance |
stdClass | $course | |
stdClass | $module | |
cm_info | $cm |
workshop_extend_settings_navigation | ( | settings_navigation | $settingsnav, |
navigation_node | $workshopnode = null ) |
Extends the settings navigation with the Workshop settings.
This function is called when the context for the page is a workshop module. This is not called by AJAX so it is safe to rely on the $PAGE.
settings_navigation | $settingsnav | settings_navigation |
navigation_node | $workshopnode | navigation_node |
workshop_get_coursemodule_info | ( | $coursemodule | ) |
Add a get_coursemodule_info function in case any feedback type wants to add 'extra' information for the course (see resource).
Given a course_module object, this function returns any "extra" information that may be needed when printing this activity in a course listing. See get_array_of_activities() in course/lib.php.
stdClass | $coursemodule | The coursemodule object (record). |
cached_cm_info|false | An object on information that the courses will know about (most noticeably, an icon). |
workshop_get_file_areas | ( | $course, | |
$cm, | |||
$context ) |
Returns the lists of all browsable file areas within the given module context.
The file area workshop_intro for the activity introduction field is added automatically by file_browser::get_file_info_context_module()
stdClass | $course | |
stdClass | $cm | |
stdClass | $context |
array | of [(string)filearea] => (string)description |
workshop_get_file_info | ( | $browser, | |
$areas, | |||
$course, | |||
$cm, | |||
$context, | |||
$filearea, | |||
$itemid, | |||
$filepath, | |||
$filename ) |
File browsing support for workshop file areas.
file_browser | $browser | |
array | $areas | |
stdClass | $course | |
stdClass | $cm | |
stdClass | $context | |
string | $filearea | |
int | $itemid | |
string | $filepath | |
string | $filename |
file_info | instance or null if not found |
workshop_get_post_actions | ( | ) |
List the actions that correspond to a post of this module.
This is used by the participation report.
Note: This is not used by new logging system. Event with crud = ('c' || 'u' || 'd') and edulevel = LEVEL_PARTICIPATING will be considered as post action.
array |
workshop_get_recent_mod_activity | ( | & | $activities, |
& | $index, | ||
$timestart, | |||
$courseid, | |||
$cmid, | |||
$userid = 0, | |||
$groupid = 0 ) |
Returns all activity in course workshops since a given time.
array | $activities | sequentially indexed array of objects |
int | $index | |
int | $timestart | |
int | $courseid | |
int | $cmid | |
int | $userid | defaults to 0 |
int | $groupid | defaults to 0 |
void | adds items into $activities and increases $index |
workshop_get_view_actions | ( | ) |
List the actions that correspond to a view of this module.
This is used by the participation report.
Note: This is not used by new logging system. Event with crud = 'r' and edulevel = LEVEL_PARTICIPATING will be considered as view action.
array |
workshop_grade_item_category_update | ( | $workshop | ) |
Update the grade items categories if they are changed via mod_form.php.
We must do it manually here in the workshop module because modedit supports only single grade item while we use two.
stdClass | $workshop | An object from the form in mod_form.php |
workshop_grade_item_update | ( | stdclass | $workshop, |
$submissiongrades = null, | |||
$assessmentgrades = null ) |
Creates or updates grade items for the give workshop instance.
Needed by grade_update_mod_grades() in lib/gradelib.php. Also used by workshop_update_grades().
stdClass | $workshop | instance object with extra cmidnumber property |
stdClass | $submissiongrades | data for the first grade item |
stdClass | $assessmentgrades | data for the second grade item |
void |
workshop_page_type_list | ( | $pagetype, | |
$parentcontext, | |||
$currentcontext ) |
Return a list of page types.
string | $pagetype | current page type |
stdClass | $parentcontext | Block's parent context |
stdClass | $currentcontext | Current context of block |
workshop_pluginfile | ( | $course, | |
$cm, | |||
$context, | |||
$filearea, | |||
array | $args, | ||
$forcedownload, | |||
array | $options = array() ) |
Serves the files from the workshop file areas.
Apart from module intro (handled by pluginfile.php automatically), workshop files may be media inserted into submission content (like images) and submission attachments. For these two, the fileareas submission_content and submission_attachment are used. Besides that, areas instructauthors, instructreviewers and conclusion contain the media embedded using the mod_form.php.
stdClass | $course | the course object |
stdClass | $cm | the course module object |
stdClass | $context | the workshop's context |
string | $filearea | the name of the file area |
array | $args | extra arguments (itemid, path) |
bool | $forcedownload | whether or not force download |
array | $options | additional options affecting the file serving |
bool | false if the file not found, just send the file otherwise and do not return anything |
workshop_print_recent_activity | ( | $course, | |
$viewfullnames, | |||
$timestart ) |
Given a course and a time, this module should find recent activity that has occurred in workshop activities and print it out.
Return true if there was output, or false is there was none.
stdClass | $course | |
bool | $viewfullnames | |
int | $timestart |
boolean |
workshop_print_recent_mod_activity | ( | $activity, | |
$courseid, | |||
$detail, | |||
$modnames, | |||
$viewfullnames ) |
Print single activity item prepared by {.
workshop_refresh_events | ( | $courseid = 0, | |
$instance = null, | |||
$cm = null ) |
This standard function will check all instances of this module and make sure there are up-to-date events created for each of them.
If courseid = 0, then every workshop event in the site is checked, else only workshop events belonging to the course specified are checked.
integer | $courseid | The Course ID. |
int | stdClass | $instance | workshop module instance or ID. |
int | stdClass | $cm | Course module object or ID. |
bool | Returns true if the calendar events were successfully updated. |
workshop_reset_course_form_defaults | ( | stdClass | $course | ) |
Provides default values for the workshop settings in the course reset form.
stdClass | $course | The course to be reset. |
workshop_reset_course_form_definition | ( | $mform | ) |
Extends the course reset form with workshop specific settings.
MoodleQuickForm | $mform |
workshop_reset_userdata | ( | stdClass | $data | ) |
Performs the reset of all workshop instances in the course.
stdClass | $data | The actual course reset settings. |
array | List of results, each being array[(string)component, (string)item, (string)error] |
workshop_scale_used | ( | ) |
workshop_scale_used_anywhere | ( | $scaleid | ) |
Is a given scale used by any instance of workshop?
The function asks all installed grading strategy subplugins. The workshop core itself does not use scales. Both grade for submission and grade for assessments do not use scales.
int | $scaleid | id of the scale to check |
bool |
workshop_supports | ( | $feature | ) |
Returns the information if the module supports a feature.
string | $feature | FEATURE_xx constant for requested feature |
mixed | True if module supports feature, false if not, null if doesn't know or string for the module purpose. |
workshop_update_grades | ( | stdclass | $workshop, |
$userid = 0 ) |
Update workshop grades in the gradebook.
Needed by grade_update_mod_grades() in lib/gradelib.php
stdClass | $workshop | instance object with extra cmidnumber and modname property |
int | $userid | update grade of specific user only, 0 means all participants |
void |
workshop_update_instance | ( | stdclass | $workshop | ) |
Given an object containing all the necessary data, (defined by the form in mod_form.php) this function will update an existing instance with new data.
stdClass | $workshop | An object from the form in mod_form.php |
bool | success |
workshop_user_complete | ( | $course, | |
$user, | |||
$mod, | |||
$workshop ) |
Print a detailed representation of what a user has done with a given particular instance of this module, for user activity reports.
stdClass | $course | The course record. |
stdClass | $user | The user record. |
cm_info | stdClass | $mod | The course module info object or record. |
stdClass | $workshop | The workshop instance record. |
string | HTML |
workshop_user_outline | ( | $course, | |
$user, | |||
$mod, | |||
$workshop ) |
Return a small object with summary information about what a user has done with a given particular instance of this module Used for user activity reports.
$return->time = the time they did it $return->info = a short text description
stdClass | $course | The course record. |
stdClass | $user | The user record. |
cm_info | stdClass | $mod | The course module info object or record. |
stdClass | $workshop | The workshop instance record. |
stdclass|null |