I am currently working on openbadges project http://docs.moodle.org/dev/openbadges aiming at integrating it into Moodle core. In brief, it is about issuing badges to users for various achievements (like course completions, social activity, etc) or based on some criteria.
Ideally, I would like to issue badges instantly when something that might trigger badge award happens in the system. My question is what is the best approach to catch this "something"? For example, if I want to award a badge when user fills out their complete profile information. Is it better to include one line function call somewhere in user profile or catch an event "user_updated"? Just looking at lib/db/events.php I understand that core is not the best place to subscribe for events... Another problem is that some of my criteria are not even triggering any events (like, activity completion or posting to forums) and I wonder if I should use events at all.
Would appreciate any advice on this.