'Emits an edx.grades.subsection.grade_calculated event
with data from the passed grade.'

@staticmethod
def _emit_grade_calculated_event(grade):

    event_name = u'edx.grades.subsection.grade_calculated'
    context = contexts.course_context_from_course_id(grade.course_id)
    with tracker.get_tracker().context(event_name, context):
        tracker.emit(event_name, {'user_id': unicode(grade.user_id), 'course_id': unicode(grade.course_id), 'block_id': unicode(grade.usage_key), 'course_version': unicode(grade.course_version), 'weighted_total_earned': grade.earned_all, 'weighted_total_possible': grade.possible_all, 'weighted_graded_earned': grade.earned_graded, 'weighted_graded_possible': grade.possible_graded, 'first_attempted': unicode(grade.first_attempted), 'subtree_edited_timestamp': unicode(grade.subtree_edited_timestamp), 'event_transaction_id': unicode(get_event_transaction_id()), 'event_transaction_type': unicode(get_event_transaction_type()), 'visible_blocks_hash': unicode(grade.visible_blocks_id)})
