from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants class Instructions(Page): pass class Description(Page): form_model = 'player' form_fields = ['age', 'gender', 'education', 'bodymass'] def before_next_page(self): self.participant.vars['age'] = self.player.age self.participant.vars['gender'] = self.player.gender self.participant.vars['education'] = self.player.education self.participant.vars['bodymass'] = self.player.bodymass class ConfirmDescription(Page): form_model = 'player' form_fields = ['age', 'gender', 'education', 'bodymass'] def before_next_page(self): self.participant.vars['age'] = self.player.age self.participant.vars['gender'] = self.player.gender self.participant.vars['education'] = self.player.education self.participant.vars['bodymass'] = self.player.bodymass class Image(Page): form_model = 'player' form_fields = ['include'] def vars_for_template(self): image = self.participant.vars['images'] return {'img_to_show': image} def before_next_page(self): self.participant.vars['include'] = self.player.include page_sequence = [ Instructions, Description, ConfirmDescription, Image ]