Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
|
Files | |
file | access.php |
Capability definitions for the lesson module. | |
file | activity.php |
Search area for mod_lesson activities. | |
file | activity_base.php |
Activity base class. | |
file | backup_lesson_activity_task.class.php |
This file contains the backup task for the lesson module. | |
file | backup_lesson_stepslib.php |
This file contains the backup structure for the lesson module. | |
file | branchtable.php |
Branch Table. | |
file | cluster.php |
Cluster. | |
file | cognitive_depth.php |
Cognitive depth indicator - lesson. | |
file | content_page_viewed.php |
The mod_lesson content page viewed event class. | |
file | course_module_instance_list_viewed.php |
The mod_lesson instance list viewed event. | |
file | course_module_viewed.php |
The mod_lesson course module viewed event. | |
file | editpage_form.php |
Generic forms used for page selection. | |
file | endofbranch.php |
End of branch table. | |
file | endofcluster.php |
End of cluster. | |
file | essay.php |
Essay. | |
file | essay_assessed.php |
The mod_lesson essay assessed event. | |
file | essay_attempt_viewed.php |
The mod_lesson essay attempt viewed event. | |
file | essay_form.php |
Essay grading form. | |
file | events.php |
Add event handlers for the lesson. | |
file | external.php |
Lesson external API. | |
file | file_info.php |
File browsing support. | |
file | format.php |
format.php - Default format class for file imports/exports. | |
file | group_observers.php |
Group observers. | |
file | group_override_created.php |
The mod_lesson group override created event. | |
file | group_override_deleted.php |
The mod_lesson group override deleted event. | |
file | group_override_updated.php |
The mod_lesson group override updated event. | |
file | helper.php |
Lesson's numeric helper lib. | |
file | highscore_added.php |
The mod_lesson highscore added event. | |
file | highscores_viewed.php |
The mod_lesson highscores viewed. | |
file | import_form.php |
Form used to select a file and file format for the import. | |
file | lesson_ended.php |
The mod_lesson lesson ended event. | |
file | lesson_restarted.php |
The mod_lesson lesson restarted event class. | |
file | lesson_resumed.php |
The mod_lesson lesson resumed event class. | |
file | lesson_started.php |
The mod_lesson lesson started event. | |
file | lesson_summary_exporter.php |
Class for exporting partial lesson data. | |
file | lib.php |
Provides support for the conversion of moodle1 backup to the moodle2 format. | |
file | lib.php |
Standard library of functions and constants for lesson. | |
file | lib.php |
mod_lesson data generator. | |
file | locallib.php |
Local library file for Lesson. | |
file | log.php |
Definition of log events. | |
file | matching.php |
Matching. | |
file | mod_form.php |
Form to define a new instance of lesson or edit an instance. | |
file | multichoice.php |
Multichoice. | |
file | numerical.php |
Numerical. | |
file | override_form.php |
Settings form for overrides in the lesson module. | |
file | page_created.php |
The mod_lesson page_added event class. | |
file | page_deleted.php |
The mod_lesson page_added event class. | |
file | page_moved.php |
The mod_lesson page_moved event class. | |
file | page_updated.php |
The mod_lesson page_added event class. | |
file | provider.php |
Data provider. | |
file | question_answered.php |
The mod_lesson true / false question answered event class. | |
file | question_viewed.php |
The mod_lesson true / false question viewed event class. | |
file | renderer.php |
Moodle renderer used to display special elements of the lesson module. | |
file | restore_lesson_activity_task.class.php |
@subpackage backup-moodle2 | |
file | restore_lesson_stepslib.php |
@subpackage backup-moodle2 | |
file | services.php |
Lesson external functions and service definitions. | |
file | settings.php |
Settings used by the lesson module, were moved from mod_edit. | |
file | shortanswer.php |
Short answer. | |
file | social_breadth.php |
Social breadth indicator - lesson. | |
file | tabs.php |
Sets up the tabs used by the lesson pages for teachers. | |
file | truefalse.php |
True/false. | |
file | upgrade.php |
This file keeps track of upgrades to the lesson module. | |
file | user_override_created.php |
The mod_lesson user override created event. | |
file | user_override_deleted.php |
The mod_lesson user override deleted event. | |
file | user_override_updated.php |
The mod_lesson user override updated event. | |
file | version.php |
Version information. | |
file | view_form.php |
Lesson page without answers. | |
Namespaces | |
namespace | mod_lesson |
| |
namespace | mod_lesson\analytics\indicator |
| |
namespace | mod_lesson\event |
| |
namespace | mod_lesson\external |
| |
namespace | mod_lesson\local\numeric |
| |
namespace | mod_lesson\privacy |
| |
namespace | mod_lesson\search |
| |
Functions | |
lesson_add_fake_blocks ($page, $cm, $lesson, $timer=null) | |
lesson_add_header_buttons ($cm, $context, $extraeditbuttons=false, $lessonpageid=null) | |
Adds header buttons to the page for the lesson. More... | |
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()) | |
lesson_clock_block_contents ($cmid, $lesson, $timer, $page) | |
If a timed lesson and not a teacher, then return a block_contents containing the clock. More... | |
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_display_teacher_warning ($lesson) | |
Any other lesson functions go here. More... | |
lesson_displayleftif ($lesson) | |
Determines if a user can view the left menu. 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... | |
object | lesson_get_media_html ($lesson, $context) |
This is a function used to detect media types and generate html code. More... | |
lesson_get_overview_report_table_and_data (lesson $lesson, $currentgroup) | |
Return the overview report table and data. More... | |
lesson_get_post_actions () | |
List the actions that correspond to a post of this module. More... | |
lesson_get_user_deadline ($courseid) | |
Return user's deadline for all lessons in a course, hereby taking into account group and user overrides. More... | |
lesson_get_user_detailed_report_data (lesson $lesson, $userid, $attempt) | |
Return information about one user attempt (including answers) 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 ($lesson, $ntries, $userid=0) | |
Calculates a user's grade for a lesson. More... | |
lesson_grade_item_update ($lesson, $grades=null) | |
lesson_import_question_files ($field, $data, $answer, $contextid) | |
Import files embedded into answer or response. More... | |
lesson_mediafile_block_contents ($cmid, $lesson) | |
If there is a media file associated with this lesson, return a block_contents that displays it. More... | |
lesson_menu_block_contents ($cmid, $lesson) | |
If left menu is turned on, then this will print the menu in a block. More... | |
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 () | |
lesson_process_group_deleted_in_course ($courseid, $groupid=null) | |
Logic to happen when a/some group(s) has/have been deleted in a course. More... | |
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_random_question_jump ($lesson, $pageid) | |
Handles the random jump between a branch table and end of branch or end of lesson (LESSON_RANDOMPAGE). 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_save_question_options ($question, $lesson, $contextid) | |
Given some question info and some data about the the answers this function parses, organises and saves the question. 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_unseen_branch_jump ($lesson, $userid) | |
Handles the unseen branch table jump. More... | |
lesson_unseen_question_jump ($lesson, $user, $pageid) | |
Interprets the LESSON_UNSEENBRANCHPAGE jump. 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. | |
stdClass | xmldb_lesson_upgrade ($oldversion) |
$CFG @global moodle_database $DB More... | |
Variables | |
$attemptscount = $DB->count_records('lesson_grades', array('lessonid'=>$lesson->id)) | |
user attempt count for reports link hover (completed attempts - much faster) | |
$capabilities | |
global | $DB |
This file to be included so we can assume config.php has already been included. | |
$functions | |
$logs | |
$messageproviders | |
$observers | |
$plugin = 2020060900 | |
$row [] = new tabobject('view', "$CFG->wwwroot/mod/lesson/view.php?id=$cm->id", get_string('preview', 'lesson'), get_string('previewlesson', 'lesson', format_string($lesson->name))) | |
if(empty( $lesson)) if(!isset($currenttab)) if(!isset( $cm)) if(!isset($course)) | $tabs = $row = $inactive = $activated = array() |
if(has_capability( 'mod/lesson:viewreports', $context)) if(has_capability('mod/lesson:grade', $context)) | $tabs [] = $row |
$plugin | component = 'mod_lesson' |
$plugin | cron = 0 |
const | LESSON_ANSWER_HTML "HTML" |
Answer format is HTML. | |
const | LESSON_CLUSTERJUMP -80 |
Cluster Jump. | |
const | LESSON_EOL -9 |
End of Lesson. | |
const | LESSON_EVENT_TYPE_CLOSE 'close' |
const | LESSON_EVENT_TYPE_OPEN 'open' |
const | LESSON_MAX_EVENT_LENGTH "432000" |
LESSON_MAX_EVENT_LENGTH = 432000 ; 5 days maximum. | |
const | LESSON_NEXTPAGE -1 |
Jump to Next Page. | |
const | LESSON_OTHER_ANSWERS "@#wronganswer#@" |
Placeholder answer for all other answers. | |
const | LESSON_PAGE_BRANCHTABLE "20" |
Branch Table page. | |
const | LESSON_PAGE_CLUSTER "30" |
Start of Cluster page. | |
const | LESSON_PAGE_ENDOFBRANCH "21" |
End of Branch page. | |
const | LESSON_PAGE_ENDOFCLUSTER "31" |
End of Cluster page. | |
const | LESSON_PAGE_ESSAY "10" |
Essay question type. | |
const | LESSON_PAGE_MATCHING "5" |
Matching question type. | |
const | LESSON_PAGE_MULTICHOICE "3" |
Multichoice question type. | |
const | LESSON_PAGE_NUMERICAL "8" |
Numerical question type. | |
const | LESSON_PAGE_SHORTANSWER "1" |
Short answer question type. | |
const | LESSON_PAGE_TRUEFALSE "2" |
True/False question type. | |
const | LESSON_PREVIOUSPAGE -40 |
Jump to Previous Page. | |
const | LESSON_RANDOMBRANCH -70 |
Jump to a random Branch. | |
const | LESSON_RANDOMPAGE -60 |
Jump to a random page within a branch and end of branch or end of lesson. | |
const | LESSON_THISPAGE 0 |
Include the files that are required by this module. More... | |
const | LESSON_UNANSWEREDPAGE 2 |
Next page -> any page not answered correctly. | |
const | LESSON_UNDEFINED -99 |
Undefined. | |
const | LESSON_UNSEENBRANCHPAGE -50 |
Jump to an unseen page within a branch and end of branch or end of lesson. | |
const | LESSON_UNSEENPAGE 1 |
Next page -> any page not seen before. | |
$plugin | version = 2020061500 |
lesson_add_fake_blocks | ( | $page, | |
$cm, | |||
$lesson, | |||
$timer = null |
|||
) |
$cm | |
$lesson | |
$page |
unknown_type |
lesson_add_header_buttons | ( | $cm, | |
$context, | |||
$extraeditbuttons = false , |
|||
$lessonpageid = null |
|||
) |
Adds header buttons to the page for the lesson.
object | $cm | |
object | $context | |
bool | $extraeditbuttons | |
int | $lessonpageid |
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.
@global object
object | $lesson | Lesson post data from the form |
int |
lesson_clock_block_contents | ( | $cmid, | |
$lesson, | |||
$timer, | |||
$page | |||
) |
If a timed lesson and not a teacher, then return a block_contents containing the clock.
int | $cmid | Course Module ID for this lesson |
object | $lesson | Full lesson record object |
object | $timer | Full timer record object |
block_contents |
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 ...
bool | true |
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.
int | $id |
bool |
lesson_display_teacher_warning | ( | $lesson | ) |
Any other lesson functions go here.
Each of them must have a name that starts with lesson_ Checks to see if a LESSON_CLUSTERJUMP or a LESSON_UNSEENBRANCHPAGE is used in a lesson.
This function is only executed when a teacher is checking the navigation for a lesson.
stdClass | $lesson | Id of the lesson that is to be checked. |
boolean | True or false. |
lesson_displayleftif | ( | $lesson | ) |
Determines if a user can view the left menu.
The determining factor is whether a user has a grade greater than or equal to the lesson setting of displayleftif
object | $lesson | Lesson object of the current lesson |
boolean | 0 if the user cannot see, or $lesson->displayleft to keep displayleft unchanged |
lesson_extend_settings_navigation | ( | $settings, | |
$lessonnode | |||
) |
This function extends the settings navigation block for the site.
It is safe to rely on PAGE here as we will only ever be within the module context when this is called
settings_navigation | $settings | |
navigation_node | $lessonnode |
lesson_get_completion_state | ( | $course, | |
$cm, | |||
$userid, | |||
$type | |||
) |
Obtains the automatic completion state for this lesson based on any conditions in lesson settings.
object | $course | Course |
object | $cm | course-module |
int | $userid | User ID |
bool | $type | Type of comparison (or/and; can be used as return value if no conditions) |
bool | True if completed, false if not, $type if conditions not set. |
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).
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 | An object on information that the courses will know about (most noticeably, an icon). |
lesson_get_group_override_priorities | ( | $lessonid | ) |
Calculates the priorities of timeopen and timeclose values for group overrides for a lesson.
int | $lessonid | The lesson ID. |
array|null | Array of group override priorities for open and close times. Null if there are no group overrides. |
lesson_get_import_export_formats | ( | $type | ) |
Get list of available import or export formats.
Copied and modified from lib/questionlib.php
string | $type | 'import' if import list, otherwise export list assumed |
array | sorted list of import/export formats available |
object lesson_get_media_html | ( | $lesson, | |
$context | |||
) |
This is a function used to detect media types and generate html code.
$CFG @global object $PAGE
object | $lesson | |
object | $context |
string::$code | the html code of media |
lesson_get_overview_report_table_and_data | ( | lesson | $lesson, |
$currentgroup | |||
) |
Return the overview report table and data.
lesson | $lesson | lesson instance |
mixed | $currentgroup | false if not group used, 0 for all groups, group id (int) to filter by that groups |
mixed | false if there is no information otherwise html_table and stdClass with the table and data |
lesson_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 |
lesson_get_user_deadline | ( | $courseid | ) |
Return user's deadline for all lessons in a course, hereby taking into account group and user overrides.
int | $courseid | the course id. |
object | An object with of all lessonsids and close unixdates in this course, taking into account the most lenient overrides, if existing and 0 if no close date is set. |
lesson_get_user_detailed_report_data | ( | lesson | $lesson, |
$userid, | |||
$attempt | |||
) |
Return information about one user attempt (including answers)
lesson | $lesson | lesson instance |
int | $userid | the user id |
int | $attempt | the attempt number |
array | the user answers (array) and user data stats (object) |
stdClass lesson_get_user_grades | ( | $lesson, | |
$userid = 0 |
|||
) |
Return grade for given user or all users.
@global object
int | $lessonid | id of lesson |
int | $userid | optional user id, 0 means all users |
array | array of grades, false if none |
lesson_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 |
lesson_grade | ( | $lesson, | |
$ntries, | |||
$userid = 0 |
|||
) |
Calculates a user's grade for a lesson.
object | $lesson | The lesson that the user is taking. |
int | $retries | The attempt number. |
int | $userid | Id of the user (optional, default current user). |
object | { nquestions => number of questions answered attempts => number of question attempts total => max points possible earned => points earned by student grade => calculated percentage grade nmanual => number of manually graded questions manualpoints => point value for manually graded questions } |
lesson_import_question_files | ( | $field, | |
$data, | |||
$answer, | |||
$contextid | |||
) |
Import files embedded into answer or response.
string | $field | nfield name (answer or response) |
array | $data | imported data |
object | $answer | answer object |
int | $contextid |
lesson_mediafile_block_contents | ( | $cmid, | |
$lesson | |||
) |
If there is a media file associated with this lesson, return a block_contents that displays it.
int | $cmid | Course Module ID for this lesson |
object | $lesson | Full lesson record object |
block_contents |
lesson_menu_block_contents | ( | $cmid, | |
$lesson | |||
) |
If left menu is turned on, then this will print the menu in a block.
int | $cmid | Course Module ID for this lesson |
lesson | $lesson | Full lesson record object |
void |
lesson_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 |
lesson_print_overview | ( | ) |
lesson_process_group_deleted_in_course | ( | $courseid, | |
$groupid = null |
|||
) |
Logic to happen when a/some group(s) has/have been deleted in a course.
int | $courseid | The course ID. |
int | $groupid | The group id if it is known |
void |
object lesson_process_post_save | ( | & | $lesson | ) |
Runs any processes that must be run after a lesson insert/update.
object | $lesson | Lesson form data |
void |
object lesson_process_pre_save | ( | & | $lesson | ) |
Runs any processes that must run before a lesson insert/update.
object | $lesson | Lesson form data |
void |
lesson_random_question_jump | ( | $lesson, | |
$pageid | |||
) |
Handles the random jump between a branch table and end of branch or end of lesson (LESSON_RANDOMPAGE).
lesson | $lesson | |
int | $pageid | The id of the page that we are jumping from (?) |
int | The pageid of a random page that is within a branch table |
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.
If courseid = 0, then every lesson event in the site is checked, else only lesson events belonging to the course specified are checked. This function is used, in its new format, by restore_refresh_events()
int | $courseid | |
int | stdClass | $instance | Lesson module instance or ID. |
int | stdClass | $cm | Course module object or ID (not used in this module). |
bool |
lesson_reset_course_form_defaults | ( | $course | ) |
Course reset form defaults.
object | $course |
array |
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.
$mform | form passed by reference |
stdClass lesson_reset_gradebook | ( | $courseid, | |
$type = '' |
|||
) |
Removes all grades from gradebook.
@global object
int | $courseid | |
string | optional type |
stdClass lesson_reset_userdata | ( | $data | ) |
Actual implementation of the reset course functionality, delete all the lesson attempts for course $data->courseid.
@global object
object | $data | the data submitted from the reset course. |
array | status array |
lesson_save_question_options | ( | $question, | |
$lesson, | |||
$contextid | |||
) |
Given some question info and some data about the the answers this function parses, organises and saves the question.
This is only used when IMPORTING questions and is only called from format.php Lifted from mod/quiz/lib.php -
object | $question | Contains question data like question, type and answers. |
object | $lesson | |
int | $contextid |
object | Returns $result->error or $result->notice. |
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
string | $feature | FEATURE_xx constant for requested feature |
mixed | True if module supports feature, false if not, null if doesn't know |
lesson_unseen_branch_jump | ( | $lesson, | |
$userid | |||
) |
Handles the unseen branch table jump.
lesson | $lesson | |
int | $userid | User id. |
int | Will return the page id of a branch table or end of lesson |
lesson_unseen_question_jump | ( | $lesson, | |
$user, | |||
$pageid | |||
) |
Interprets the LESSON_UNSEENBRANCHPAGE jump.
will return the pageid of a random unseen page that is within a branch
lesson | $lesson | |
int | $userid | Id of the user. |
int | $pageid | Id of the page from which we are jumping. |
int | Id of the next page. |
lesson_update_events | ( | $lesson, | |
$override = null |
|||
) |
This function updates the events associated to the lesson.
If $override is non-zero, then it updates only the events associated with the specified override.
@uses LESSON_MAX_EVENT_LENGTH
object | $lesson | the lesson object. |
object | $override | (optional) limit to a specific override |
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.
object | $lesson | Lesson post data from the form |
boolean |
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.
int | $lessonid | the lesson id |
stdClass | $context | the context |
int | $draftitemid | the draft item |
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.
object | $course | |
object | $user | |
object | $mod | |
object | $lesson |
bool |
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.
$return->time = the time they did it $return->info = a short text description
object | $course | |
object | $user | |
object | $mod | |
object | $lesson |
object |
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.
It will set the available or deadline value of the lesson instance according to the type of event provided.
moodle_exception |
calendar_event | $event | |
stdClass | $lesson | The module instance to get the range from |
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.
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 start date'], [1506741172, 'The due date must be before the cutoff date'] ]
calendar_event | $event | The calendar event to get the time range for |
stdClass | $instance | The module instance to get the range from |
array |
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.
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_lesson_get_completion_active_rule_descriptions | ( | $cm | ) |
Callback which returns human-readable strings describing the active completion custom rules for the module instance.
cm_info | stdClass | $cm | object with fields ->completion and ->customdata['customcompletionrules'] |
array::$descriptions | the array of descriptions for the custom rules. |
stdClass xmldb_lesson_upgrade | ( | $oldversion | ) |
$logs |
$messageproviders |
$observers |
const LESSON_THISPAGE 0 |
Include the files that are required by this module.
This page