from otree.api import Currency as c, currency_range from . import pages from ._builtin import Bot from .models import Constants import random class PlayerBot(Bot): def play_round(self): yield (pages.SocialConfidence, {'social_confidence': random.randint(0,1)}) yield (pages.Introduction) yield (pages.ComprehensionCheck, {'comp_checkA': random.randint(0,1), 'comp_checkB': random.randint(0,1), 'comp_checkC': random.randint(0,1), 'comp_checkD': random.randint(0,1), 'comp_checkE': random.randint(0,1)}) if self.player.comp_checkA == 0 or self.player.comp_checkB == 1 or self.player.comp_checkC == 0 or self.player.comp_checkD == 0 or self.player.comp_checkE == 0: yield (pages.ComprehensionCheckFail) yield (pages.Choice, {'team_selection': random.randint(0,1)}) else: yield (pages.Choice, {'team_selection': random.randint(0,1)}) yield (pages.SelfConfidence, {'self_confidence': random.randint(0, 10)}) yield (pages.Expectations, {'guess_others': random.randint(0, 10)}) yield (pages.ExpectationsTeam, {'guess_team': random.randint(0, 10)}) yield (pages.End)