from otree.api import Currency as c, currency_range, expect, Bot, Submission from . import * from random import choice class PlayerBot(Bot): def play_round(self): const = Constants participant = self.participant if not (participant.no_consent or participant.dropout): for page in page_sequence: if page == Unmatched: if self.participant.vars.get('unmatched'): yield page else: page_fields = page.form_fields fields = dict() for field in page_fields: decision = choice(const.peq[field].get('choices', ['comment'])) if type(decision) is tuple: decision = decision[0] fields.update({field: decision}) yield page, fields