Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Functions | Variables
lib.php File Reference

Standard library of functions and constants for lesson. More...

Functions

object lesson_add_instance ($data, $mform)
 Given an object containing all the necessary data, (defined by the form in mod_form.php) this function will create a new instance and return the id number of the new instance. More...
 
 lesson_check_updates_since (cm_info $cm, $from, $filter=array())
 
stdClass lesson_cron ()
 Function to be run periodically according to the moodle cron This function searches for things that need to be done, such as sending out mail, toggling flags etc ... More...
 
object lesson_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. More...
 
 lesson_extend_settings_navigation ($settings, $lessonnode)
 This function extends the settings navigation block for the site. More...
 
 lesson_get_completion_state ($course, $cm, $userid, $type)
 Obtains the automatic completion state for this lesson based on any conditions in lesson settings. More...
 
 lesson_get_coursemodule_info ($coursemodule)
 Add a get_coursemodule_info function in case any lesson type wants to add 'extra' information for the course (see resource). More...
 
 lesson_get_file_areas ()
 
stdClass lesson_get_file_info ($browser, $areas, $course, $cm, $context, $filearea, $itemid, $filepath, $filename)
 
 lesson_get_group_override_priorities ($lessonid)
 Calculates the priorities of timeopen and timeclose values for group overrides for a lesson. More...
 
 lesson_get_import_export_formats ($type)
 Get list of available import or export formats. More...
 
 lesson_get_post_actions ()
 List the actions that correspond to a post of this module. More...
 
stdClass lesson_get_user_grades ($lesson, $userid=0)
 Return grade for given user or all users. More...
 
 lesson_get_view_actions ()
 List the actions that correspond to a view of this module. More...
 
 lesson_grade_item_update ($lesson, $grades=null)
 
 lesson_page_type_list ($pagetype, $parentcontext, $currentcontext)
 Return a list of page types. More...
 
 lesson_pluginfile ($course, $cm, $context, $filearea, $args, $forcedownload, array $options=array())
 
 lesson_print_overview ()
 
object lesson_process_post_save (&$lesson)
 Runs any processes that must be run after a lesson insert/update. More...
 
object lesson_process_pre_save (&$lesson)
 Runs any processes that must run before a lesson insert/update. More...
 
 lesson_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. More...
 
 lesson_reset_course_form_defaults ($course)
 Course reset form defaults. More...
 
 lesson_reset_course_form_definition (&$mform)
 Implementation of the function for printing the form elements that control whether the course reset functionality affects the lesson. More...
 
stdClass lesson_reset_gradebook ($courseid, $type='')
 Removes all grades from gradebook. More...
 
stdClass lesson_reset_userdata ($data)
 Actual implementation of the reset course functionality, delete all the lesson attempts for course $data->courseid. More...
 
 lesson_supports ($feature)
 @uses FEATURE_GROUPS @uses FEATURE_GROUPINGS @uses FEATURE_MOD_INTRO @uses FEATURE_COMPLETION_TRACKS_VIEWS @uses FEATURE_GRADE_HAS_GRADE @uses FEATURE_GRADE_OUTCOMES More...
 
 lesson_update_events ($lesson, $override=null)
 This function updates the events associated to the lesson. More...
 
 lesson_update_grades ($lesson, $userid=0, $nullifnone=true)
 
object lesson_update_instance ($data, $mform)
 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. More...
 
 lesson_update_media_file ($lessonid, $context, $draftitemid)
 Update the lesson activity to include any file that was uploaded, or if there is none, set the mediafile field to blank. More...
 
object lesson_user_complete ($course, $user, $mod, $lesson)
 Print a detailed representation of what a user has done with a given particular instance of this module, for user activity reports. More...
 
object lesson_user_outline ($course, $user, $mod, $lesson)
 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. More...
 
 mod_lesson_core_calendar_event_timestart_updated (\calendar_event $event, stdClass $lesson)
 This function will update the lesson module according to the event that has been modified. More...
 
 mod_lesson_core_calendar_get_valid_event_timestart_range (\calendar_event $event, stdClass $instance)
 This function calculates the minimum and maximum cutoff values for the timestart of the given event. More...
 
 mod_lesson_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. More...
 
 mod_lesson_get_completion_active_rule_descriptions ($cm)
 Callback which returns human-readable strings describing the active completion custom rules for the module instance. More...
 
 mod_lesson_get_fontawesome_icon_map ()
 Get icon mapping for font-awesome.
 

Variables

const LESSON_EVENT_TYPE_CLOSE 'close'
 
const LESSON_EVENT_TYPE_OPEN 'open'
 

Detailed Description

Standard library of functions and constants for lesson.

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