def get_exps_unresolved_answers_for_default_rule(exp_ids):
 def _get_explorations_states_tuples_by_ids(exp_ids):
  "Returns a list of all (exp_id, state_name) tuples for the given\n        exp_ids.\n        E.g. - [\n          ('eid1', 'Introduction'),\n          ('eid1', 'End'),\n          ('eid2', 'Introduction'),\n          ('eid3', 'Introduction')\n        ]\n        when exp_ids = ['eid1', 'eid2', 'eid3'].\n        "
  explorations = exp_services.get_multiple_explorations_by_id(exp_ids, strict=False)
  return [(exploration.id, state_name) for exploration in explorations.values() for state_name in exploration.states]
 explorations_states_tuples = _get_explorations_states_tuples_by_ids(exp_ids)
 exploration_states_answers_list = get_top_state_rule_answers_multi(explorations_states_tuples, [exp_domain.DEFAULT_RULESPEC_STR])
 exps_answers_mapping = {}
 for (ind, statewise_answers) in enumerate(exploration_states_answers_list):
  exp_id = explorations_states_tuples[ind][0]
  if (exp_id not in exps_answers_mapping):
   exps_answers_mapping[exp_id] = {'count': 0, 'unresolved_answers': []}
  for answer in statewise_answers:
   exps_answers_mapping[exp_id]['count'] += answer['count']
   answer['state'] = explorations_states_tuples[ind][1]
  exps_answers_mapping[exp_id]['unresolved_answers'].extend(statewise_answers)
 for exp_id in exps_answers_mapping:
  exps_answers_mapping[exp_id]['unresolved_answers'] = sorted(exps_answers_mapping[exp_id]['unresolved_answers'], key=(lambda a: a['count']), reverse=True)
 return exps_answers_mapping

def get_exps_unresolved_answers_for_default_rule ( exp_ids ) : def _get_explorations_states_tuples_by_ids ( exp_ids ) : explorations = exp_services . get_multiple_explorations_by_id ( exp_ids , strict = False ) return [ ( exploration . id , state_name ) for exploration in explorations . values ( ) for state_name in exploration . states ] explorations_states_tuples = _get_explorations_states_tuples_by_ids ( exp_ids ) exploration_states_answers_list = get_top_state_rule_answers_multi ( explorations_states_tuples , [ exp_domain . DEFAULT_RULESPEC_STR ] ) exps_answers_mapping = { } for ( ind , statewise_answers ) in enumerate ( exploration_states_answers_list ) : exp_id = explorations_states_tuples [ ind ] [ 0 ] if ( exp_id not in exps_answers_mapping ) : exps_answers_mapping [ exp_id ] = { 'count' : 0 , 'unresolved_answers' : [ ] } for answer in statewise_answers : exps_answers_mapping [ exp_id ] [ 'count' ] += answer [ 'count' ] answer [ 'state' ] = explorations_states_tuples [ ind ] [ 1 ] exps_answers_mapping [ exp_id ] [ 'unresolved_answers' ] . extend ( statewise_answers ) for exp_id in exps_answers_mapping : exps_answers_mapping [ exp_id ] [ 'unresolved_answers' ] = sorted ( exps_answers_mapping [ exp_id ] [ 'unresolved_answers' ] , key = ( lambda a : a [ 'count' ] ) , reverse = True ) return exps_answers_mapping
gets unresolved answers per exploration for default rule across all states for explorations with ids in exp_ids .