from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage import random class Intro(Page): def is_displayed(self): return self.round_number ==1 def vars_for_template(self): self.player.round1_payoff = self.participant.vars['round1_payoffs'] self.player.round1_stage = self.participant.vars['round1_stage'] self.player.round2_payoff = self.participant.vars['round2_payoffs'] self.player.round2_stage = self.participant.vars['round2_stage'] self.player.round3_payoff = self.participant.vars['round3_payoffs'] self.player.round3_stage = self.participant.vars['round3_stage'] self.player.introduction_payoff = self.participant.vars['introduction_payoffs'] self.player.total = self.player.round1_payoff + self.player.round2_payoff + self.player.round3_payoff + self.player.introduction_payoff class Page1(Page): form_model = 'player' form_fields = ['age','student','studentstudy','studentyear', 'notstudent', 'region','sex','income','spending', 'risk', 'econview','political'] class Question14(Page): form_model = 'player' form_fields = ['sex14','ability14','group14','connection14','honesty14','education14', 'luck14','work14','inherited14','appearance14','risk14'] class Question15(Page): form_model = 'player' form_fields = ['sex15','ability15','group15','connection15','honesty15','education15', 'luck15','work15','inherited15','appearance15','risk15'] class Page4(Page): form_model = 'player' form_fields = ['instructions','comments'] class Finished(Page): def is_displayed(self): return self.round_number ==1 page_sequence = [ Intro, Page1, Question14, Question15, Page4, Finished, ]