from otree.api import Currency as c, currency_range, expect from . import pages from ._builtin import Bot from .models import Constants class PlayerBot(Bot): def play_round(self): if self.round_number == 1: yield pages.AllInstructions yield pages.Questions, dict(q1=0,q2=1,q3=0,q4=1, q5a=self.subsession.value,q5b=0, q6a=0,q6b=self.subsession.value, q7a=(self.subsession.value - self.subsession.cost) / 2, q7b=(self.subsession.value - self.subsession.cost) / 2, q8=3) yield pages.Answers yield pages.PracticeDecisions yield pages.DecisionsAttacker, dict(pract_choice_a=1) yield pages.DecisionDefender, dict(pract_choice_d=1) yield pages.Results, dict(pract_rewpun=2) if self.session.config['reward']: yield pages.RewardPunishment if self.round_number == Constants.num_rounds: yield pages.ReadyToStart