diff --git a/backend/experiment/rules/categorization.py b/backend/experiment/rules/categorization.py index 054f96b48..2399c0bea 100644 --- a/backend/experiment/rules/categorization.py +++ b/backend/experiment/rules/categorization.py @@ -38,14 +38,20 @@ def get_intro_explainer(self): def next_round(self, session: Session): json_data = session.json_data - if not json_data.get("phase"): + if json_data.get("started"): actions = [self.get_intro_explainer()] questions = self.get_open_questions(session) if questions: actions.extend(questions) - json_data = self.plan_experiment(session) + session.save_json_data({"started": True}) return actions + json_data = session.json_data + + # Plan experiment on the first call to next_round + if not json_data.get("phase"): + json_data = self.plan_experiment(session) + # Check if this participant already has a session if json_data == "REPEAT": json_data = {"phase": "REPEAT"} @@ -226,7 +232,6 @@ def next_round(self, session: Session): session=session, final_text=final_text + final_message, total_score=round(score_percent), - rank=rank, points="% correct", ) return final