from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants class tussenpage(Page): pass class survey_demograp(Page): form_model = 'player' form_fields = [ "age", "gender", "education", "occupation", "income", "self_risk"] class Survey_1(Page): form_model = "player" form_fields = [ "exchange_Q1", "exchange_Q2", "exchange_Q2_2", "exchange_Q3", "exchange_Q4", "exchange_Q5", "exchange_Q6", "exchange_Q7", ] def error_message(self, values): print('values is', values) if values["exchange_Q2"] == None: return 'Please fill in your estimate of the approximate cost of withdrawing 50 USD!' def error_message(self, values): print('values is', values) if ((values["exchange_Q3"] is True) and (values["exchange_Q4"] == None) ): return 'Please fill in question 4, which currency do you typically choose!' # def vars_for_template(self): # if self.participant.vars['dcc'] == True: # message = True # else: # message = False # # return { # 'message': message, # } class survey__intelligence(Page): form_model = "player" form_fields = [ "cognitive_Q1", "cognitive_Q2", "cognitive_Q3", "cognitive_Q4", "cognitive_Q5", "cognitive_Q6", "cognitive_Q7", "cognitive_Q8", ] class survey_finlit(Page): form_model = "player" form_fields = [ "fin_literacy_Q1", "fin_literacy_Q2", "fin_literacy_Q3", "fin_literacy_Q4", "fin_literacy_Q5", "fin_literacy_Q6", ] class survey_trustcons(Page): form_model = "player" form_fields = [ "trust_Q1", "trust_Q2", "trust_Q3", "trust_Q4", "consciousness_Q1", "consciousness_Q2", "consciousness_Q3", "consciousness_Q4", "consciousness_Q5", ] class eindpagina(Page): pass page_sequence = [ tussenpage, Survey_1, survey__intelligence, survey_finlit, survey_trustcons, ]