def process_submitted_answer(exploration_id, unused_exploration_version, state_name, rule_spec_string, answer):
 answer_log = StateRuleAnswerLogModel.get_or_create(exploration_id, state_name, rule_spec_string)
 if (answer in answer_log.answers):
  answer_log.answers[answer] += 1
 else:
  answer_log.answers[answer] = 1
 try:
  answer_log.put()
 except Exception as e:
  logging.error(e)

def process_submitted_answer ( exploration_id , unused_exploration_version , state_name , rule_spec_string , answer ) : answer_log = StateRuleAnswerLogModel . get_or_create ( exploration_id , state_name , rule_spec_string ) if ( answer in answer_log . answers ) : answer_log . answers [ answer ] += 1 else : answer_log . answers [ answer ] = 1 try : answer_log . put ( ) except Exception as e : logging . error ( e )
adds an answer to the answer log for the rule it hits .