Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
grade

Functions

 lti_add_instance ($lti, $mform)
 Given an object containing all the necessary data, (defined by the form in mod.html) this function will create a new instance and return the id number of the new instance.
 
 lti_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.
 
 lti_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 ...
 
 lti_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.
 
 lti_get_course_content_items (\core_course\local\entity\content_item $defaultmodulecontentitem, stdClass $user, stdClass $course)
 Return the preconfigured tools which are configured for inclusion in the activity picker.
 
 lti_get_coursemodule_info ($coursemodule)
 Given a coursemodule object, this function returns the extra information needed to print this activity in various places.
 
 lti_get_lti_types ()
 Returns available Basic LTI types.
 
 lti_get_lti_types_from_proxy_id ($toolproxyid)
 Returns available Basic LTI types that match the given tool proxy id.
 
 lti_get_post_actions ()
 Log post actions.
 
 lti_get_view_actions ()
 Log view actions.
 
 lti_grade_item_delete ($basiclti)
 Delete grade item for given basiclti.
 
 lti_grade_item_update ($basiclti, $grades=null)
 Create grade item for given basiclti.
 
 lti_grades ($basicltiid)
 Must return an array of grades for a given instance of this module, indexed by user.
 
 lti_install ()
 Execute post-install custom actions for the module This function was added in 1.9.
 
 lti_print_recent_activity ($course, $isteacher, $timestart)
 Given a course and a time, this module should find recent activity that has occurred in basiclti activities and print it out.
 
 lti_scale_used ()
 
 lti_scale_used_anywhere ($scaleid)
 Checks if scale is being used by any instance of basiclti.
 
 lti_supports ($feature)
 List of features supported in URL module.
 
 lti_uninstall ()
 Execute post-uninstall custom actions for the module This function was added in 1.9.
 
 lti_update_grades ($basiclti, $userid=0, $nullifnone=true)
 Update activity grades.
 
 lti_update_instance ($lti, $mform)
 Given an object containing all the necessary data, (defined by the form in mod.html) this function will update an existing instance with new data.
 
 lti_user_complete ($course, $user, $mod, $basiclti)
 Print a detailed representation of what a user has done with a given particular instance of this module, for user activity reports.
 
 lti_user_outline ($course, $user, $mod, $basiclti)
 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.
 
 lti_view ($lti, $course, $cm, $context)
 Mark the activity completed (if required) and trigger the course_module_viewed event.
 
 mod_lti_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_lti_extend_navigation_course ($navigation, $course, $context)
 Extend the course navigation with an "LTI External tools" link which redirects to a list of all tools available for course use.
 
 mod_lti_get_all_content_items (\core_course\local\entity\content_item $defaultmodulecontentitem)
 Return all content items which can be added to any course.
 
 mod_lti_get_fontawesome_icon_map ()
 Get icon mapping for font-awesome.
 

Detailed Description

Function Documentation

◆ lti_add_instance()

lti_add_instance ( $lti,
$mform )

Given an object containing all the necessary data, (defined by the form in mod.html) this function will create a new instance and return the id number of the new instance.

Parameters
object$instanceAn object from the form in mod.html
Return values
intThe id of the newly inserted basiclti record

◆ lti_check_updates_since()

lti_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.

Parameters
cm_info$cmcourse module data
int$fromthe time to check updates from
array$filterif we need to check only specific updates
Return values
stdClassan object with the different type of areas indicating if they were updated or not
Since
Moodle 3.2

◆ lti_cron()

lti_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 ...

@uses $CFG

Return values
boolean

◆ lti_delete_instance()

lti_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.

Parameters
int$idId of the module instance
Return values
booleanSuccess/Failure

◆ lti_get_course_content_items()

lti_get_course_content_items ( \core_course\local\entity\content_item $defaultmodulecontentitem,
stdClass $user,
stdClass $course )

Return the preconfigured tools which are configured for inclusion in the activity picker.

Parameters
core_course\local\entity\content_item$defaultmodulecontentitemreference to the content item for the LTI module.
stdClass$userthe user object, to use for cap checks if desired.
stdClass$coursethe course to scope items to.
Return values
arraythe array of content items.

◆ lti_get_coursemodule_info()

lti_get_coursemodule_info ( $coursemodule)

Given a coursemodule object, this function returns the extra information needed to print this activity in various places.

For this module we just need to support external urls as activity icons

Parameters
stdClass$coursemodule
Return values
cached_cm_infoinfo

◆ lti_get_lti_types()

lti_get_lti_types ( )

Returns available Basic LTI types.

Return values
arrayof basicLTI types

◆ lti_get_lti_types_from_proxy_id()

lti_get_lti_types_from_proxy_id ( $toolproxyid)

Returns available Basic LTI types that match the given tool proxy id.

Parameters
int$toolproxyidTool proxy id
Return values
arrayof basicLTI types

◆ lti_get_post_actions()

lti_get_post_actions ( )

Log post actions.

Return values
array

◆ lti_get_view_actions()

lti_get_view_actions ( )

Log view actions.

Return values
array

◆ lti_grade_item_delete()

lti_grade_item_delete ( $basiclti)

Delete grade item for given basiclti.

Parameters
object$basicltiobject
Return values
objectbasiclti

◆ lti_grade_item_update()

lti_grade_item_update ( $basiclti,
$grades = null )

Create grade item for given basiclti.

Parameters
object$basicltiobject with extra cmidnumber
mixedoptional array/object of grade(s); 'reset' means reset grades in gradebook
Return values
int0 if ok, error code otherwise

◆ lti_grades()

lti_grades ( $basicltiid)

Must return an array of grades for a given instance of this module, indexed by user.

It also returns a maximum allowed grade.

Example: $return->grades = array of grades; $return->maxgrade = maximum allowed grade;

return $return;

Parameters
int$basicltiidID of an instance of this module
Return values
mixedNull or object with an array of grades and with the maximum grade

@TODO: implement this moodle function (if needed)

◆ lti_install()

lti_install ( )

Execute post-install custom actions for the module This function was added in 1.9.

Return values
booleantrue if success, false on error

◆ lti_print_recent_activity()

lti_print_recent_activity ( $course,
$isteacher,
$timestart )

Given a course and a time, this module should find recent activity that has occurred in basiclti activities and print it out.

Return true if there was output, or false is there was none.

@uses $CFG

Return values
boolean@TODO: implement this moodle function

◆ lti_scale_used()

lti_scale_used ( )
Deprecated
since Moodle 3.8

◆ lti_scale_used_anywhere()

lti_scale_used_anywhere ( $scaleid)

Checks if scale is being used by any instance of basiclti.

This function was added in 1.9

This is used to find out if scale used anywhere

Parameters
$scaleidint
Return values
booleanTrue if the scale is used by any basiclti

◆ lti_supports()

lti_supports ( $feature)

List of features supported in URL module.

Parameters
string$featureFEATURE_xx constant for requested feature
Return values
mixedTrue if module supports feature, false if not, null if doesn't know or string for the module purpose.

◆ lti_uninstall()

lti_uninstall ( )

Execute post-uninstall custom actions for the module This function was added in 1.9.

Return values
booleantrue if success, false on error

◆ lti_update_grades()

lti_update_grades ( $basiclti,
$userid = 0,
$nullifnone = true )

Update activity grades.

Parameters
stdClass$basicltiThe LTI instance
int$useridSpecific user only, 0 means all.
bool$nullifnoneNot used

◆ lti_update_instance()

lti_update_instance ( $lti,
$mform )

Given an object containing all the necessary data, (defined by the form in mod.html) this function will update an existing instance with new data.

Parameters
object$instanceAn object from the form in mod.html
Return values
booleanSuccess/Fail

◆ lti_user_complete()

lti_user_complete ( $course,
$user,
$mod,
$basiclti )

Print a detailed representation of what a user has done with a given particular instance of this module, for user activity reports.

Return values
boolean@TODO: implement this moodle function (if needed)

◆ lti_user_outline()

lti_user_outline ( $course,
$user,
$mod,
$basiclti )

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

Return values
null@TODO: implement this moodle function (if needed)

◆ lti_view()

lti_view ( $lti,
$course,
$cm,
$context )

Mark the activity completed (if required) and trigger the course_module_viewed event.

Parameters
stdClass$ltilti object
stdClass$coursecourse object
stdClass$cmcourse module object
stdClass$contextcontext object
Since
Moodle 3.0

◆ mod_lti_core_calendar_provide_event_action()

mod_lti_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.

Parameters
calendar_event$event
core_calendar\action_factory$factory
int$useridUser id to use for all capability checks, etc. Set to 0 for current user (default).
Return values
core_calendar\local\event\entities\action_interface|null

◆ mod_lti_extend_navigation_course()

mod_lti_extend_navigation_course ( $navigation,
$course,
$context )

Extend the course navigation with an "LTI External tools" link which redirects to a list of all tools available for course use.

Parameters
settings_navigation$navigationThe settings navigation object
stdClass$courseThe course
stdclass$contextCourse context
Return values
void

◆ mod_lti_get_all_content_items()

mod_lti_get_all_content_items ( \core_course\local\entity\content_item $defaultmodulecontentitem)

Return all content items which can be added to any course.

Parameters
core_course\local\entity\content_item$defaultmodulecontentitem
Return values
arraythe array of content items.