from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants # Transition to Questions class Question1(Page): form_model = 'player' # def before_next_page(self): # self.player.set_MCF() # Other Scholarship or groups class Question2(Page): form_model = 'player' form_fields = ['OtherScholar'] def is_displayed(self): return self.player.participant.vars['is_mcf'] class Group_on_campus(Page): form_model = 'player' form_fields = ['Group_on_campus'] class Question3(Page): form_model = 'player' form_fields = ['Question_3', 'Question_3_other'] #class Question4_when_group(Page): # form_model = 'player' # form_fields = ['Q4_religion', 'Q4_country', 'Q4_gender', 'Q4_ethnic'] # def is_displayed(self): # return self.player.Question_3 == 1 class Question5(Page): form_model = 'player' form_fields = ['Question_5'] # def is_displayed(self): # return self.player.Question_3 == 1 class Question6(Page): form_model = 'player' form_fields = ['Question_6'] class Question7(Page): form_model = 'player' form_fields = ['Question_7'] class Question8(Page): form_model = 'player' form_fields = ['Question_8'] class Question9(Page): form_model = 'player' form_fields = ['differences', 'diff_hinder'] class Question11(Page): form_model = 'player' form_fields = ['Q11_education', 'Q11_wealth', 'Q11_status' , 'Q11_gender', 'Q11_young', 'Q11_political', 'Q11_religion', 'Q11_ethnic'] def is_displayed(self): return self.player.diff_hinder == 1 # def error_message(self, values): # if ((values['Q11_education'] + values['Q11_wealth'] + values['Q11_status'] + values['Q11_gender'] + # values['Q11_young'] + values['Q11_political'] + values['Q11_religion'] + # values['Q11_ethnic']) > 1 & values['Q11_notsay'] ==1): # return 'If you chose Prefer not to say, the other differences should be marked to No' class Question12(Page): form_model = 'player' form_fields = ['communicated'] class Transition_to_risk_questions(Page): form_model = 'player' form_fields = [] class Risk1(Page): form_model = 'player' form_fields = ['risk1'] class Risk2(Page): form_model = 'player' form_fields = ['risk2', 'risk3','risk4', 'risk5','risk6', 'risk7'] class Trust0(Page): form_model = 'player' form_fields = ['trust_people', 'trust_scale_general', 'trust_scale_family', 'trust_scale_students'] class Trust2(Page): form_model = 'player' form_fields = ['trust1', 'trust2', 'trust3', 'trust4'] class TrustGroup(Page): form_model = 'player' form_fields = ['trust_group'] class Reciproc1(Page): form_model = 'player' form_fields = ['reciproc1', 'reciproc2', 'reciproc3' , 'reciproc4' ] class CovidHelp(Page): form_model = 'player' form_fields = ['covid_help' ] class YouHelped(Page): form_model = 'player' form_fields = ['you_helped' ] class GroupCooperate(Page): form_model = 'player' form_fields = ['group_cooperate' ] class ContributeTime(Page): form_model = 'player' form_fields = ['contribute_time' ] class ContributeMaterial(Page): form_model = 'player' form_fields = ['contribute_material' ] class Demographics(Page): form_model = 'player' form_fields = ['age', 'gender', 'ethnicity', 'country', 'society'] class Demographics2(Page): form_model = 'player' form_fields = ['size_family', 'education', 'status', 'elections', 'political', 'religion'] # page_sequence = [Question1, Question2, Question3, Question4_when_group, # Question5_when_group, Question6_when_group, Question7_when_group, # Question8_when_group, Questions_on_participants_and_their_relations , Demographics] page_sequence = [ Question1, Question2, Group_on_campus, Question3 , # Question4_when_group, Question5, Question6, Question7, Question8, Question9, Question11, Question12, Transition_to_risk_questions, Risk1, Risk2, Trust0, # Trust1, Trust2, TrustGroup, Reciproc1, CovidHelp, YouHelped, GroupCooperate, ContributeTime, ContributeMaterial, Demographics, Demographics2 ]