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): if self.player.participant.vars['nextq0'] != 1 and self.player.participant.vars['treatment'] == 2: # # yield (pages.Quiz1, { # 'q_a1':7, # 'q_a2':28, # # }) # # yield (pages.Quiz2, { # 'q_b1':11, # 'q_b2':12 # # }) # # yield (pages.MyPage1, { # 'choice1': random.randint(1, 7), # }) yield (pages.pagenext) yield (pages.MyPage2, { 'playagain': random.randint(0, 1), }) if self.player.playagain == 1: yield (pages.MyPage3, { 'choice2': random.randint(1, 7), }) # # yield (pages.Results, { # # })