See Release Notes
Long Term Support Release
Differences Between: [Versions 310 and 401] [Versions 311 and 401] [Versions 39 and 401] [Versions 400 and 401] [Versions 401 and 402] [Versions 401 and 403]
This file contains the moodle hooks for the assign module. It delegates most functions to the assignment class.
Copyright: | 2012 NetSpot {@link http://www.netspot.com.au} |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 1852 lines (67 kb) |
Included or required: | 0 times |
Referenced: | 3 times |
Includes or requires: | 1 file mod/assign/deprecatedlib.php |
assign_add_instance(stdClass $data, mod_assign_mod_form $form = null) X-Ref |
Adds an assignment instance This is done by calling the add_instance() method of the assignment type class param: stdClass $data param: mod_assign_mod_form $form return: int The instance id of the new assignment |
assign_delete_instance($id) X-Ref |
delete an assignment instance param: int $id return: bool |
assign_reset_userdata($data) X-Ref |
This function is used by the reset_course_userdata function in moodlelib. This function will remove all assignment submissions and feedbacks in the database and clean up any related data. param: stdClass $data the data submitted from the reset course. return: array |
assign_refresh_events($courseid = 0, $instance = null, $cm = null) X-Ref |
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 assignment event in the site is checked, else only assignment events belonging to the course specified are checked. param: int $courseid param: int|stdClass $instance Assign module instance or ID. param: int|stdClass $cm Course module object or ID (not used in this module). return: bool |
assign_prepare_update_events($assign, $course = null, $cm = null) X-Ref |
This actually updates the normal and completion calendar events. param: stdClass $assign Assignment object (from DB). param: stdClass $course Course object. param: stdClass $cm Course module object. |
assign_reset_gradebook($courseid, $type='') X-Ref |
Removes all grades from gradebook param: int $courseid The ID of the course to reset param: string $type Optional type of assignment to limit the reset to a particular assignment type |
assign_reset_course_form_definition(&$mform) X-Ref |
Implementation of the function for printing the form elements that control whether the course reset functionality affects the assignment. param: moodleform $mform form passed by reference |
assign_reset_course_form_defaults($course) X-Ref |
Course reset form defaults. param: object $course return: array |
assign_update_instance(stdClass $data, $form) X-Ref |
Update an assignment instance This is done by calling the update_instance() method of the assignment type class param: stdClass $data param: stdClass $form - unused return: object |
assign_update_events($assign, $override = null) X-Ref |
This function updates the events associated to the assign. If $override is non-zero, then it updates only the events associated with the specified override. param: assign $assign the assign object. param: object $override (optional) limit to a specific override |
assign_supports($feature) X-Ref |
Return the list if Moodle features this module supports param: string $feature FEATURE_xx constant for requested feature return: mixed True if module supports feature, false if not, null if doesn't know or string for the module purpose. |
assign_extend_settings_navigation(settings_navigation $settings, navigation_node $navref) X-Ref |
extend an assigment navigation settings param: settings_navigation $settings param: navigation_node $navref return: void |
assign_get_coursemodule_info($coursemodule) X-Ref |
Add a get_coursemodule_info function in case any assignment 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. param: stdClass $coursemodule The coursemodule object (record). return: cached_cm_info An object on information that the courses |
mod_assign_cm_info_dynamic(cm_info $cm) X-Ref |
Sets dynamic information about a course module This function is called from cm_info when displaying the module param: cm_info $cm |
mod_assign_get_completion_active_rule_descriptions($cm) X-Ref |
Callback which returns human-readable strings describing the active completion custom rules for the module instance. param: cm_info|stdClass $cm object with fields ->completion and ->customdata['customcompletionrules'] return: array $descriptions the array of descriptions for the custom rules. |
assign_page_type_list($pagetype, $parentcontext, $currentcontext) X-Ref |
Return a list of page types param: string $pagetype current page type param: stdClass $parentcontext Block's parent context param: stdClass $currentcontext Current context of block |
assign_print_overview() X-Ref |
assign_get_mysubmission_details_for_print_overview() X-Ref |
assign_get_grade_details_for_print_overview() X-Ref |
assign_print_recent_activity($course, $viewfullnames, $timestart) X-Ref |
Print recent activity from all assignments in a given course This is used by the recent activity block param: mixed $course the course to print activity for param: bool $viewfullnames boolean to determine whether to show full names or not param: int $timestart the time the rendering started return: bool true if activity was printed, false otherwise. |
assign_get_recent_mod_activity(&$activities,&$index,$timestart,$courseid,$cmid,$userid=0,$groupid=0) X-Ref |
Returns all assignments since a given time. param: array $activities The activity information is returned in this array param: int $index The current index in the activities array param: int $timestart The earliest activity to show param: int $courseid Limit the search to this course param: int $cmid The course module id param: int $userid Optional user id param: int $groupid Optional group id return: void |
assign_print_recent_mod_activity($activity, $courseid, $detail, $modnames) X-Ref |
Print recent activity from all assignments in a given course This is used by course/recent.php param: stdClass $activity param: int $courseid param: bool $detail param: array $modnames |
assign_scale_used() X-Ref |
assign_scale_used_anywhere($scaleid) X-Ref |
Checks if scale is being used by any instance of assignment This is used to find out if scale used anywhere param: int $scaleid return: boolean True if the scale is used by any assignment |
assign_get_view_actions() X-Ref |
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. return: array |
assign_get_post_actions() X-Ref |
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. return: array |
assign_get_extra_capabilities() X-Ref |
Returns all other capabilities used by this module. return: array Array of capability strings |
assign_grade_item_update($assign, $grades=null) X-Ref |
Create grade item for given assignment. param: stdClass $assign record with extra cmidnumber param: array $grades optional array/object of grade(s); 'reset' means reset grades in gradebook return: int 0 if ok, error code otherwise |
assign_get_user_grades($assign, $userid=0) X-Ref |
Return grade for given user or all users. param: stdClass $assign record of assign with an additional cmidnumber param: int $userid optional user id, 0 means all users return: array array of grades, false if none |
assign_update_grades($assign, $userid=0, $nullifnone=true) X-Ref |
Update activity grades. param: stdClass $assign database record param: int $userid specific user only, 0 means all param: bool $nullifnone - not used |
assign_get_file_areas($course, $cm, $context) X-Ref |
List the file areas that can be browsed. param: stdClass $course param: stdClass $cm param: stdClass $context return: array |
assign_get_file_info($browser,$areas,$course,$cm,$context,$filearea,$itemid,$filepath,$filename) X-Ref |
File browsing support for assign module. param: file_browser $browser param: object $areas param: object $course param: object $cm param: object $context param: string $filearea param: int $itemid param: string $filepath param: string $filename return: object file_info instance or null if not found |
assign_user_complete($course, $user, $coursemodule, $assign) X-Ref |
Prints the complete info about a user's interaction with an assignment. param: stdClass $course param: stdClass $user param: stdClass $coursemodule param: stdClass $assign the database assign record |
assign_rescale_activity_grades($course, $cm, $oldmin, $oldmax, $newmin, $newmax) X-Ref |
Rescale all grades for this activity and push the new grades to the gradebook. param: stdClass $course Course db record param: stdClass $cm Course module db record param: float $oldmin param: float $oldmax param: float $newmin param: float $newmax |
assign_user_outline($course, $user, $coursemodule, $assignment) X-Ref |
Print the grade information for the assignment for this user. param: stdClass $course param: stdClass $user param: stdClass $coursemodule param: stdClass $assignment |
assign_pluginfile($course,$cm,context $context,$filearea,$args,$forcedownload,array $options=array() X-Ref |
Serves intro attachment files. param: mixed $course course or id of the course param: mixed $cm course module or id of the course module param: context $context param: string $filearea param: array $args param: bool $forcedownload param: array $options additional options affecting the file serving return: bool false if file not found, does not return if found - just send the file |
mod_assign_output_fragment_gradingpanel($args) X-Ref |
Serve the grading panel as a fragment. param: array $args List of named arguments for the fragment loader. return: string |
assign_check_updates_since(cm_info $cm, $from, $filter = array() X-Ref |
Check if the module has any update that affects the current user since a given time. param: cm_info $cm course module data param: int $from the time to check updates from param: array $filter if we need to check only specific updates return: stdClass an object with the different type of areas indicating if they were updated or not |
mod_assign_core_calendar_is_event_visible(calendar_event $event, $userid = 0) X-Ref |
Is the event visible? This is used to determine global visibility of an event in all places throughout Moodle. For example, the ASSIGN_EVENT_TYPE_GRADINGDUE event will not be shown to students on their calendar. param: calendar_event $event param: int $userid User id to use for all capability checks, etc. Set to 0 for current user (default). return: bool Returns true if the event is visible to the current user, false otherwise. |
mod_assign_core_calendar_provide_event_action(calendar_event $event,\core_calendar\action_factory $factory,$userid = 0) X-Ref |
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. param: calendar_event $event param: \core_calendar\action_factory $factory param: int $userid User id to use for all capability checks, etc. Set to 0 for current user (default). return: \core_calendar\local\event\entities\action_interface|null |
mod_assign_core_calendar_event_action_shows_item_count(calendar_event $event, $itemcount = 0) X-Ref |
Callback function that determines whether an action event should be showing its item count based on the event type and the item count. param: calendar_event $event The calendar event. param: int $itemcount The item count associated with the action event. return: bool |
mod_assign_core_calendar_get_valid_event_timestart_range(\calendar_event $event, \stdClass $instance) X-Ref |
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 due date must be after the sbumission start date'], [1506741172, 'The due date must be before the cutoff date'] ] If the event does not have a valid timestart range then [false, false] will be returned. param: calendar_event $event The calendar event to get the time range for param: stdClass $instance The module instance to get the range from return: array |
mod_assign_core_calendar_event_timestart_updated(\calendar_event $event, \stdClass $instance) X-Ref |
This function will update the assign module according to the event that has been modified. param: \calendar_event $event param: stdClass $instance The module instance to get the range from |
mod_assign_user_preferences() X-Ref |
Return a list of all the user preferences used by mod_assign. return: array |
mod_assign_get_path_from_pluginfile(string $filearea, array $args) X-Ref |
Given an array with a file path, it returns the itemid and the filepath for the defined filearea. param: string $filearea The filearea. param: array $args The path (the part after the filearea and before the filename). return: array The itemid and the filepath inside the $args path, for the defined filearea. |
mod_assign_core_calendar_get_event_action_string(string $eventtype) X-Ref |
Callback to fetch the activity event type lang string. param: string $eventtype The event type. return: lang_string The event type lang string. |