def track_voted_event(request, course, obj, vote_value, undo_vote=False):
 if isinstance(obj, cc.Thread):
  obj_type = 'thread'
 else:
  obj_type = 'response'
 event_name = _EVENT_NAME_TEMPLATE.format(obj_type=obj_type, action_name='voted')
 event_data = {'commentable_id': obj.commentable_id, 'target_username': obj.get('username'), 'undo_vote': undo_vote, 'vote_value': vote_value}
 track_forum_event(request, event_name, course, obj, event_data)

def track_voted_event ( request , course , obj , vote_value , undo_vote = False ) : if isinstance ( obj , cc . Thread ) : obj_type = 'thread' else : obj_type = 'response' event_name = _EVENT_NAME_TEMPLATE . format ( obj_type = obj_type , action_name = 'voted' ) event_data = { 'commentable_id' : obj . commentable_id , 'target_username' : obj . get ( 'username' ) , 'undo_vote' : undo_vote , 'vote_value' : vote_value } track_forum_event ( request , event_name , course , obj , event_data )
send analytics event for a vote on a thread or response .