예제 #1
0
파일: editor.py 프로젝트: okchip/oppia
    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)
        })
예제 #2
0
    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)
        })
예제 #3
0
 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)
     })
예제 #4
0
 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)
     })