from otree.api import Currency as c, currency_range, expect, Bot from . import * import random class PlayerBot(Bot): def play_round(self): #print('id in group: {self.player.id_in_group}') print(f'######## round_number: {self.round_number}\n###### id_in_group: {self.player.id_in_group}') if self.round_number == 1: yield Instrucciones yield Instrucciones1 questions = ['s2t100', 's2t101', 's2t102', 's2t103', 's2t104', 's2t105', 's2t106', 's2t107', 's2t108', 's2t109', 's2t110', 's2t111', 's2t112', 's2t113', 's2t114', 's2t115', 's2t116', 's2t117', 's2t118', 's2t119', 's2t120', 's2t121'] # Esta no es una representación realista de como son las decisions pero no me importa cutoff_value = random.randint(0, len(questions)) answers = [1 for _ in range(cutoff_value + 1)] + [2 for _ in range(21 - cutoff_value)] yield table1, dict(zip(questions, answers)) if self.round_number == 2: yield Instrucciones2 questions = ['s2t200', 's2t201', 's2t202', 's2t203', 's2t204', 's2t205', 's2t206', 's2t207', 's2t208', 's2t209','s2t210', 's2t211', 's2t212', 's2t213', 's2t214', 's2t215', 's2t216', 's2t217', 's2t218', 's2t219', 's2t220', 's2t221'] # Esta no es una representación realista de como son las decisions pero no me importa cutoff_value = random.randint(0, len(questions)) answers = [1 for _ in range(cutoff_value + 1)] + [2 for _ in range(21 - cutoff_value)] yield table2, dict(zip(questions, answers))