[ Index ] |
PHP Cross Reference of Unnamed Project |
[Source view] [Print] [Project Stats]
LTI enrolment plugin helper.
Copyright: | 2016 Mark Nelson <markn@moodle.com> |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 383 lines (13 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
helper:: (9 methods):
create_username()
assign_user_tool_data()
user_match()
update_user_profile_image()
enrol_user()
get_lti_tool()
get_lti_tools()
count_lti_tools()
create_service_body()
create_username($consumerkey, $ltiuserid) X-Ref |
Creates a unique username. param: string $consumerkey Consumer key param: string $ltiuserid External tool user id return: string The new username |
assign_user_tool_data($tool, $user) X-Ref |
Adds default values for the user object based on the tool provided. param: \stdClass $tool param: \stdClass $user return: \stdClass The $user class with added default values |
user_match($newuser, $olduser) X-Ref |
Compares two users. param: \stdClass $newuser The new user param: \stdClass $olduser The old user return: bool True if both users are the same |
update_user_profile_image($userid, $url) X-Ref |
Updates the users profile image. param: int $userid the id of the user param: string $url the url of the image return: bool|string true if successful, else a string explaining why it failed |
enrol_user($tool, $userid) X-Ref |
Enrol a user in a course. param: \stdclass $tool The tool object (retrieved using self::get_lti_tool() or self::get_lti_tools()) param: int $userid The user id return: bool|string returns true if successful, else an error code |
get_lti_tool($toolid) X-Ref |
Returns the LTI tool. param: int $toolid return: \stdClass the tool |
get_lti_tools($params = array() X-Ref |
Returns the LTI tools requested. param: array $params The list of SQL params (eg. array('columnname' => value, 'columnname2' => value)). param: int $limitfrom return a subset of records, starting at this point (optional). param: int $limitnum return a subset comprising this many records in total return: array of tools |
count_lti_tools($params = array() X-Ref |
Returns the number of LTI tools. param: array $params The list of SQL params (eg. array('columnname' => value, 'columnname2' => value)). return: int The number of tools |
create_service_body($source, $grade) X-Ref |
Create a IMS POX body request for sync grades. param: string $source Sourceid required for the request param: float $grade User final grade return: string |
Generated: Thu Aug 11 10:00:09 2016 | Cross-referenced by PHPXref 0.7.1 |