from otree.api import Currency as c, currency_range from . import pages from ._builtin import Bot from .models import Constants import random from otree.api import Submission class PlayerBot(Bot): def play_round(self): if self.player.participant.vars['nextq0'] != 1 and self.player.participant.vars['treatment'] == 2: # yield (pages.P10Task3Instructions) # # yield (pages.P11Task3_qc, { # 'qc_2_a': 600, # }) # # yield (pages.P11BisTask3, { # 'survey1bis': random.randint(0, 10), # }) # # yield (pages.P12Task3, { # 'number1': random.randint(1, 100), # }) # # yield Submission(pages.P12_ResultsWaitPage, {}, # check_html=False # ) yield (pages.pagenext) yield (pages.P13Task4, { 'decision_t4': random.randint(0, 1), }) if self.player.decision_t4 == 1: yield (pages.P14Task4, { 'number2': random.randint(1, 100), }) yield Submission(pages.P14_ResultsWaitPage, {}, check_html=False ) yield (pages.P14Task4Pass)