lms.djangoapps.badges.events package#
Submodules#
lms.djangoapps.badges.events.course_complete module#
Helper functions for the course complete event that was originally included with the Badging MVP.
- lms.djangoapps.badges.events.course_complete.badge_description(course, mode)#
Returns a description for the earned badge.
- lms.djangoapps.badges.events.course_complete.course_slug(course_key, mode)#
Legacy: Not to be used as a model for constructing badge slugs. Included for compatibility with the original badge type, awarded on course completion.
Slug ought to be deterministic and limited in size so it’s not too big for Badgr.
Badgr’s max slug length is 255.
- lms.djangoapps.badges.events.course_complete.criteria(course_key)#
Constructs the ‘criteria’ URL from the course about page.
- lms.djangoapps.badges.events.course_complete.evidence_url(user_id, course_key)#
Generates a URL to the user’s Certificate HTML view, along with a GET variable that will signal the evidence visit event.
- lms.djangoapps.badges.events.course_complete.get_completion_badge(course_id, user)#
Given a course key and a user, find the user’s enrollment mode and get the Course Completion badge.
lms.djangoapps.badges.events.course_meta module#
Events which have to do with a user doing something with more than one course, such as enrolling in a certain number, completing a certain number, or completing a specific set of courses.
- lms.djangoapps.badges.events.course_meta.award_badge(config, count, user)#
Given one of the configurations for enrollments or completions, award the appropriate badge if one is configured.
config is a dictionary with integer keys and course keys as values. count is the key to retrieve from this dictionary. user is the user to award the badge to.
- Example config:
{3: ‘slug_for_badge_for_three_enrollments’, 5: ‘slug_for_badge_with_five_enrollments’}
- lms.djangoapps.badges.events.course_meta.award_enrollment_badge(user)#
Awards badges based on the number of courses a user is enrolled in.