def _emit_problem_submitted_event(kwargs):
 root_type = get_event_transaction_type()
 if (not root_type):
  root_id = get_event_transaction_id()
  if (not root_id):
   root_id = create_new_event_transaction_id()
  set_event_transaction_type(PROBLEM_SUBMITTED_EVENT_TYPE)
  tracker.emit(unicode(PROBLEM_SUBMITTED_EVENT_TYPE), {'user_id': unicode(kwargs['user_id']), 'course_id': unicode(kwargs['course_id']), 'problem_id': unicode(kwargs['usage_id']), 'event_transaction_id': unicode(root_id), 'event_transaction_type': unicode(PROBLEM_SUBMITTED_EVENT_TYPE), 'weighted_earned': kwargs.get('weighted_earned'), 'weighted_possible': kwargs.get('weighted_possible')})

def _emit_problem_submitted_event ( kwargs ) : root_type = get_event_transaction_type ( ) if ( not root_type ) : root_id = get_event_transaction_id ( ) if ( not root_id ) : root_id = create_new_event_transaction_id ( ) set_event_transaction_type ( PROBLEM_SUBMITTED_EVENT_TYPE ) tracker . emit ( unicode ( PROBLEM_SUBMITTED_EVENT_TYPE ) , { 'user_id' : unicode ( kwargs [ 'user_id' ] ) , 'course_id' : unicode ( kwargs [ 'course_id' ] ) , 'problem_id' : unicode ( kwargs [ 'usage_id' ] ) , 'event_transaction_id' : unicode ( root_id ) , 'event_transaction_type' : unicode ( PROBLEM_SUBMITTED_EVENT_TYPE ) , 'weighted_earned' : kwargs . get ( 'weighted_earned' ) , 'weighted_possible' : kwargs . get ( 'weighted_possible' ) } )
emits a problem submitted event only if there is no current event transaction type .