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): priceChoice = list() for i in range(0, 9): priceChoice.append(random.randint(0, 1)) if self.round_number == 1: yield(pages.A_Intro_Title) yield(pages.C_Intro_General) yield(pages.D_Description_Lotteries_seq) yield(pages.E_Description_Choice), dict(ControlQuestion1=1,ControlQuestion2=1,ControlQuestion3=1,ControlQuestion4=1,counterWrong=0,) yield(pages.F_Description_RLIM) yield(pages.Question), dict(pricechoice = priceChoice[self.round_number-1]) if self.round_number == Constants.num_rounds: yield(pages.preDecision) if self.player.in_round(self.player.payoffrelevant_round_part2).pricechoice == 1: yield (pages.Decision_Delegation) if self.player.in_round(self.player.payoffrelevant_round_part2).pricechoice == 0: yield (pages.Decision_Self), dict(lotterychoice_auto=random.randint(0, 1)) if self.round_number == Constants.num_rounds: yield(pages.Z_prolificPart3) yield(pages.Z_prolificQ1), dict(employmentStatus=1) yield(pages.Z_prolificQ2), dict(exclusion=0, attentioncheck1=1) yield(pages.Z_prolificQ3) yield (pages.ZZ_Feedback1), dict(Feedback1_11 = 1,Feedback1_12 = 1,Feedback1_3 = 1) yield (pages.ZZ_Feedback2), dict(Feedback1_4 = 1,Feedback1_5 = 1,Feedback2_11 = 1, Feedback2_12 = 1, Feedback_Rationale_Part1 = 1) yield (pages.ZZ_Feedback3), dict(Feedback2_3 = 1, Feedback2_4 = 1, Feedback_Rationale_Part2 = 1) yield (pages.Payoff_Screen)