def get(self, exploration_id, escaped_state_name): """Handles GET requests.""" try: exploration = exp_services.get_exploration_by_id(exploration_id) except: raise self.PageNotFoundException state_name = self.unescape_state_name(escaped_state_name) if state_name not in exploration.states: logging.error('Could not find state: %s' % state_name) logging.error('Available states: %s' % exploration.states.keys()) raise self.PageNotFoundException self.render_json({ 'rules_stats': stats_services.get_state_rules_stats(exploration_id, state_name) })
def get(self, exploration_id, escaped_state_name): """Handles GET requests.""" try: exploration = exp_services.get_exploration_by_id(exploration_id) except: raise self.PageNotFoundException state_name = self.unescape_state_name(escaped_state_name) if state_name not in exploration.states: logging.error('Could not find state: %s' % state_name) logging.error('Available states: %s' % exploration.states.keys()) raise self.PageNotFoundException self.render_json({ 'rules_stats': stats_services.get_state_rules_stats( exploration_id, state_name) })
def get(self, exploration_id, state_name): """Handles GET requests.""" self.render_json({ 'rules_stats': stats_services.get_state_rules_stats( exploration_id, state_name) })
def get(self, exploration_id, state_name): """Handles GET requests.""" self.render_json({ 'rules_stats': stats_services.get_state_rules_stats(exploration_id, state_name) })