from otree.api import Currency as c, currency_range from . import pages from ._builtin import Bot from .models import Constants class PlayerBot(Bot): def play_round(self): if self.player.id_in_group % 4 != 0: if self.round_number == 1: yield (pages.InstructionPage) yield(pages.InstructionQuizPage) for i in range(10): yield(pages.QuizPage, {'solution' : self.player.participant.vars['random_answer']}) yield (pages.Results) i = i+1 # else: # yield (pages.InstructionPage) # yield(pages.InstructionQuizPage) # for i in range(4): # yield(pages.QuizPage, {'solution' : self.player.participant.vars['random_answer']}) # yield (pages.Results) # i = i+1 else: if self.round_number == 1: yield (pages.InstructionPage) yield(pages.InstructionQuizPage) for i in range(10): yield(pages.QuizPage, {'solution' : 9}) yield (pages.Results) i += 1 if self.round_number == 2: yield (pages.InstructionPage) yield(pages.InstructionQuizPage) for i in range(10): yield(pages.QuizPage, {'solution' : 1}) yield (pages.Results) i += 1