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): yield (pages.P1Bienvenue,{ 'agree':1, }) yield (pages.Questionnaire0,{ }) yield (pages.Questionnaire0Bis,{ }) if self.player.nextq0 != 1: yield (pages.P25QuestionnaireFinal, { 'q_a': random.randint(0, 3), 'q_b': random.randint(18, 70), 'q_c': random.randint(1, 11), }) yield (pages.Questionnaire5, { 'b5': 1, }) if self.player.b5 == 1: yield (pages.Questionnaire5Bis) # # if self.player.nextq0 != 1 and self.player.treatment == 1 and self.player.b5 == 1: # yield (pages.P2Instructions) # yield (pages.P4Qc, { # 'qc_a': 30, # 'qc_b': 551, # }) # yield (pages.P6Survey, { # 'survey1': random.randint(0, 10), # }) # yield (pages.P7Task1, { # 'quantity1': random.randint(0, 100), # }) # # yield Submission(pages.P7_ResultsWaitPage, check_html=False) # # yield (pages.P8Task2, { # 'decision_t2': random.randint(0, 1), # }) # if self.player.decision_t2 == 1: # yield (pages.P9Task2, { # 'quantity2': random.randint(0, 100) # }) # yield Submission(pages.P9_ResultsWaitPage, check_html=False) # # yield (pages.P9Task2Pass) #