Esempio n. 1
0
    def get(self, exploration_id):
        """Handles GET requests."""
        try:
            current_exploration = (
                exp_services.get_exploration_by_id(exploration_id))
        except:
            raise self.PageNotFoundException

        self.render_json({
            'answers': stats_services.get_top_state_answer_stats_multi(
                exploration_id, current_exploration.states)
        })
Esempio n. 2
0
    def get(self, exploration_id):
        """Handles GET requests."""
        current_exploration = exp_fetchers.get_exploration_by_id(exploration_id)

        top_state_answers = stats_services.get_top_state_answer_stats_multi(
            exploration_id, current_exploration.states)
        top_state_interaction_ids = {
            state_name: current_exploration.states[state_name].interaction.id
            for state_name in top_state_answers
        }
        self.render_json({
            'answers': top_state_answers,
            'interaction_ids': top_state_interaction_ids,
        })