from . import * from otree.api import Bot class PlayerBot(Bot): def play_round(self): if self.round_number == 1: yield (Introduction) if self.player.role == Constants.row_role: yield (Main, {'choice': 'Extreme'}) assert self.player.payoff == 10 else: yield (Main, {'choice': 'Challenge'}) assert self.player.payoff == -10 yield (Results) if self.round_number == 5: assert ( 'You won' in self.html if self.player.role == Constants.row_role else 'You did not win' in self.html ) yield (Final)