from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants class Demographics(Page): form_model = 'player' form_fields = ['age', 'gender', 'nationality', 'race', 'education', #basics 'employed', 'occupation', 'yearsOfEmployment'] #employment class IncomeAndDonations(Page): form_model = 'player' form_fields = ['income', #income 'pastDonationsMonthly', 'pastDonationsFreq', 'otherPastDonationsMonthly', 'otherPastDonationsFreq'] #previous donation activity class AttentionCheck(Page): form_model = 'player' form_fields = ['treeAttentionCheck'] def before_next_page(self): if self.player.treeAttentionCheck == 100: self.participant.vars['treeAttnCheck'] = True else: self.participant.vars['treeAttnCheck'] = False class Consent(Page): form_model = 'player' def before_next_page(self): self.participant.vars['treeAttnCheck'] = True self.participant.vars['onlineStudyAttnCheck'] = True self.participant.vars['goodBadAttnCheck'] = True page_sequence = [Consent, Demographics, AttentionCheck, IncomeAndDonations]