Insights generator.
Copyright: | 2019 David Monllao {@link http://www.davidmonllao.com} |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 275 lines (10 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
insights_generator:: (6 methods):
__construct()
generate()
notification()
get_context_courseid()
prediction_info()
set_notification_language()
Class: insights_generator - X-Ref
Insights generator.__construct(int $modelid, \core_analytics\local\target\base $target) X-Ref |
Constructor. param: int $modelid param: \core_analytics\local\target\base $target |
generate($samplecontexts, $predictions) X-Ref |
Generates insight notifications. param: array $samplecontexts The contexts these predictions belong to param: \core_analytics\prediction[] $predictions The prediction records return: null |
notification(\context $context, \stdClass $user, \moodle_url $insighturl, string $fullmessage, string $fullmessagehtml) X-Ref |
Generates a insight notification for the user. param: \context $context param: \stdClass $user param: \moodle_url $insighturl The insight URL param: string $fullmessage param: string $fullmessagehtml return: null |
get_context_courseid(\context $context) X-Ref |
Returns the course context of the provided context reading an internal cache first. param: \context $context return: int |
prediction_info(\core_analytics\prediction $prediction, \context $context, \stdClass $user) X-Ref |
Extracts info from the prediction for display purposes. param: \core_analytics\prediction $prediction param: \context $context param: \stdClass $user return: array Three items array with formats [\moodle_url, string, string] |
set_notification_language($user) X-Ref |
Sets the session language to the language used by the notification receiver. param: \stdClass $user The user who will receive the message return: null |