from otree.api import * doc = """ This application provides a webpage instructing participants how to get paid. Examples are given for the lab and Amazon Mechanical Turk (AMT). """ class C(BaseConstants): NAME_IN_URL = 'payment_info' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): first_name = models.StringField( label = 'Vorname:', blank = True ) last_name = models.StringField( label = 'Nachname:', blank = True ) paypal = models.StringField( label = 'PayPal Mail-Adresse oder Handynummer:', blank = True ) transfer1=models.StringField( label = 'IBAN:', blank = True ) transfer2 = models.IntegerField( label= 'BIC (optional):', blank= True ) post1= models.StringField( label='Straße + Hausnummer:', blank = True ) post2= models.IntegerField( label='Postleitzahl:', blank = True ) post3 = models.StringField( label= 'Stadt:', blank = True ) contact = models.StringField( label = 'Telefonnummer (optional):', blank = True ) consent = models.BooleanField() tax = models.BooleanField() # FUNCTIONS # PAGES class PaymentConsent(Page): form_model ='player' form_fields = ['consent'] class PaymentInfo(Page): @staticmethod def vars_for_template(player: Player): participant = player.participant return dict(redemption_code=participant.label or participant.code) form_model = 'player' form_fields = ['first_name', 'last_name', 'paypal', 'transfer1', 'transfer2', 'post1', 'post2', 'post3', 'contact', 'consent', 'tax'] class Ende(Page): form_model='player' form_fields = [] page_sequence = [PaymentInfo, Ende]