from . import models from ._builtin import Page, WaitPage from otree.api import Currency as c, currency_range from .models import Constants class DemographicsNL(Page): form_model = models.Player form_fields = ['age', 'gender', 'education', 'worksituation', 'profession', 'income'] #class Siblings(Page): # def is_displayed(self): # return self.player.siblings == True # form_model = models.Player # form_fields = ['brothers', # 'sisters', # 'position'] class openvraag(Page): form_model = models.Player form_fields = ['openvraag'] class Debriefing(Page): pass def before_next_page(self): if self.participant.payoff <= c(0): self.participant.payoff = c(0) if self.participant.payoff > c(0): self.participant.payoff = self.participant.payoff #class RemainSeated(Page): # def is_displayed(self): # return self.player.id_in_group == 2 or self.player.id_in_group == 3 # # def vars_for_template(self): # return { # 'totalpayoff': self.participant.payoff_plus_participation_fee(), # 'participationfee': self.session.config['participation_fee'] # } #form_model = models.Player #form_fields = ['secretcode'] # def error_message(self, values): # print('values is', values) # if values["secretcode"] != 999: # return 'That is the incorrect code.' class Ganaarproefleider(Page): pass # def is_displayed(self): # return self.player.id_in_group == 1 def vars_for_template(self): return { 'totalpayoff': self.participant.payoff_plus_participation_fee(), 'participationfee': self.session.config['participation_fee'] } #form_model = models.Player #form_fields = ['secretcode'] #def error_message(self, values): # print('values is', values) # if values["secretcode"] != 999: # return 'That is the incorrect code.' #class Participantnumber(Page): # form_model = models.Player # form_fields = ['ppnr'] #class Opendoor(Page): # def vars_for_template(self): # return { # 'totalpayoff': self.participant.payoff_plus_participation_fee, # 'participationfee': self.session.config['participation_fee'] # } #class redirect(Page): # pass page_sequence = [DemographicsNL, #Siblings, openvraag, Debriefing, #RemainSeated, Ganaarproefleider #Participantnumber, # Opendoor #redirect ]