from otree.api import * from otree.models import player doc = """ Your app description """ class C(BaseConstants): NAME_IN_URL = 'survey_yes' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): pass #Survey questions: age = models.IntegerField( label = "Please enter your age", min=18, choices = [i for i in range(18,50) ] ) gender = models.StringField( label = "What is your gender?", intial = '--', choices = ['Female', 'Male', 'Other', 'Prefer not to say'] ) educ = models.StringField( label="What is your highest educational qualification?", intial='--', choices = ['less than matric', 'matric', 'matric with certificate', 'matric with diploma', 'bachelors degree', 'post-graduate degree'] ) race = models.StringField( label="What is your race?", intial='--', choices = ['black african', 'indian/asian', 'coloured', 'white', 'other'] ) #### How did you search fields -- NOW search_how1 = models.BooleanField( intial=False, blank=True, label="Registered at an employment agency", ) search_how2 = models.BooleanField( intial=False, blank=True, label="Enquired at workplaces, farms, factories, or called on other possible employers", ) search_how3 = models.BooleanField( intial=False, blank=True, label="Placed advertisement (s)", ) search_how4 = models.BooleanField( intial=False, blank=True, label="Answered advertisement (s)", ) search_how5 = models.BooleanField( intial=False, blank=True, label="Searched through job advertisement (s) on the internet", ) search_how6 = models.BooleanField( intial=False, blank=True, label="Sought assistance from relatives or friends", ) search_how7 = models.BooleanField( intial=False, blank=True, label="Sent or dropped off my CV at prospective employers", ) search_how8 = models.BooleanField( intial=False, blank=True, label="Waited at the side of the road", ) search_how9 = models.BooleanField( intial=False, blank=True, label="Did something else", ) #### How did you search fields -- 3 MONTHS search_how1_3m = models.BooleanField( intial=False, blank=True, label="Registered at an employment agency", ) search_how2_3m = models.BooleanField( intial=False, blank=True, label="Enquired at workplaces, farms, factories, or called on other possible employers", ) search_how3_3m = models.BooleanField( intial=False, blank=True, label="Placed advertisement (s)", ) search_how4_3m = models.BooleanField( intial=False, blank=True, label="Answered advertisement (s)", ) search_how5_3m = models.BooleanField( intial=False, blank=True, label="Searched through job advertisement (s) on the internet", ) search_how6_3m = models.BooleanField( intial=False, blank=True, label="Sought assistance from relatives or friends", ) search_how7_3m = models.BooleanField( intial=False, blank=True, label="Sent or dropped off my CV at prospective employers", ) search_how8_3m = models.BooleanField( intial=False, blank=True, label="Waited at the side of the road", ) search_how9_3m = models.BooleanField( intial=False, blank=True, label="Did something else", ) #### How did you search fields -- 6 months search_how1_6m = models.BooleanField( intial=False, blank=True, label="Registered at an employment agency", ) search_how2_6m = models.BooleanField( intial=False, blank=True, label="Enquired at workplaces, farms, factories, or called on other possible employers", ) search_how3_6m = models.BooleanField( intial=False, blank=True, label="Placed advertisement (s)", ) search_how4_6m = models.BooleanField( intial=False, blank=True, label="Answered advertisement (s)", ) search_how5_6m = models.BooleanField( intial=False, blank=True, label="Searched through job advertisement (s) on the internet", ) search_how6_6m = models.BooleanField( intial=False, blank=True, label="Sought assistance from relatives or friends", ) search_how7_6m = models.BooleanField( intial=False, blank=True, label="Sent or dropped off my CV at prospective employers", ) search_how8_6m = models.BooleanField( intial=False, blank=True, label="Waited at the side of the road", ) search_how9_6m = models.BooleanField( intial=False, blank=True, label="Did something else", ) #### start_job = models.IntegerField( label="How many months ago did you start your job?", intial='--', choices = [i for i in range(0,24) ] ) end_job = models.IntegerField( label="In how many months does your contract end?", intial='--', choices = [i for i in range(0,24) ] ) earn = models.IntegerField( label = "If you are comfortable saying, how much is your monthly take-home pay (after tax and deductions)?", blank=True, intial ='--', min=1000, max=50000 ) pres_activity = models.StringField( label = "What is your current employment status?", intial = '--', choices = ['Employed (permanent contract)', 'Employed (fixed-term contract)', 'Paid internship or learnership', 'In training / studying (unpaid)', 'Self-employed', 'Not employed, NOT looking for work', 'Not employed, looking for work']) emp_experience = models.IntegerField( label="How many months of work experience do you have (EXCLUDING your current job if you're employed)?", intial='--', choices=[i for i in range(0, 60) ]) dur_study = models.IntegerField( label="For how many months have you been in training / studying (unpaid)?", intial='--', choices = [i for i in range(0,60) ] ) dur_selfemp = models.IntegerField( label="For how many months have you been self-employed?", intial='--', choices = [i for i in range(0,60) ] ) dur_notemp = models.IntegerField( label="For how many months have you not been employed?", intial='--', choices = [i for i in range(0,60) ] ) dur_notsearch = models.IntegerField( label="For how many months have you not been searching for a job?", intial='--', choices = [i for i in range(0,60) ] ) pre_emp = models.StringField( label="What were you doing immediately before starting your job?", initial='---', choices=['Employed (permanent contract)', 'Employed (fixed-term contract)', 'Paid internship or learnership', 'In training / studying (unpaid)', 'Self-employed', 'Not employed, NOT looking for work', 'Not employed, looking for work'] ) pre_study = models.StringField( label="What were you doing immediately before starting your studies/training?", initial='---', choices=['Employed (permanent contract)', 'Employed (fixed-term contract)', 'Paid internship or learnership', 'In training / studying (unpaid)', 'Self-employed', 'Not employed, NOT looking for work', 'Not employed, looking for work'] ) pre_selfemp = models.StringField( label="What were you doing immediately before starting your own business?", initial='---', choices=['Employed (permanent contract)', 'Employed (fixed-term contract)', 'Paid internship or learnership', 'In training / studying (unpaid)', 'Self-employed', 'Not employed, NOT looking for work', 'Not employed, looking for work'] ) pre_notemp = models.StringField( label="You don't currently have a job. What were you doing before that?", initial='---', choices=['Employed (permanent contract)', 'Employed (fixed-term contract)', 'Paid internship or learnership', 'In training / studying (unpaid)', 'Self-employed', 'Not employed, NOT looking for work', 'Not employed, looking for work'] ) search_3m = models.StringField( label = "Were you actively searching for a job in the first quarter of this year (January to March)?", intial = '--', choices =['Yes', 'No', "I don't remember"] ) search_now = models.StringField( label = "Are you currently actively searching for a job?", intial = '--', choices = ['Yes', 'No'] ) search_6m = models.StringField( label="Were you actively searching for a job in the second quarter of this year (April to June)?", intial='--', choices=['Yes', 'No', "I don't remember"] ) search_future = models.StringField( label="Do you think you will be actively searching for a job in 3 months time -- in November this year?", intial='--', choices=['Yes', 'No', "I don't know"] ) searchstop = models.StringField( label = "Did you start searching and then stop?", intial = '--', choices = ['Yes', 'No']) searchstop_reason = models.StringField( label = "Why did you start searching and then stop?", intial = '--', choices = ['Yes', 'No']) intensity_now = models.StringField( label = "In the last week, how many hours did you spend searching for a job? For example, looking for job-postings, sending out applications or designing a cv.", initial = '--', choices = ['less than 30 minutes', 'between 30 to 60 minutes', 'between 1 to 2 hours', 'between 2 to 4 hours', 'between 4 to 8 hours', 'over 8 hours', "I can't remember", "I did not search for a job"] ) intensity_3m = models.StringField( label="In the second quarter of this year (April to June) how many hours did you spend searching for a job in an average week?", initial='--', choices=['less than 30 minutes', 'between 30 to 60 minutes', 'between 1 to 2 hours', 'between 2 to 4 hours', 'between 4 to 8 hours', 'over 8 hours', "I can't remember", "I did not search for a job"] ) intensity_6m = models.StringField( label = "In the first quarter of this year (January to March) how many hours did you spend searching for a job in an average week?", initial = '--', choices = ['less than 30 minutes', 'between 30 to 60 minutes', 'between 1 to 2 hours', 'between 2 to 4 hours', 'between 4 to 8 hours', 'over 8 hours', "I can't remember", "I did not search for a job"] ) intensity_future = models.StringField( label = "In 3 months time (November) how many hours a week will you spend searching for a job?", initial = '--', choices = ['less than 30 minutes', 'between 30 to 60 minutes', 'between 1 to 2 hours', 'between 2 to 4 hours', 'between 4 to 8 hours', 'over 8 hours', "I don't know"] ) offers_6m = models.BooleanField( label="In the first quarter of this year (January to March), did you get any job offers?", initial = False, ) offers_3m = models.BooleanField( label="In the second quarter of this year (April to June), did you get any job offers?", initial=False, ) offers_1m = models.BooleanField( label="In August this year, did you get any job offers?", initial=False, ) n_offers_6m = models.IntegerField( label="In the first quarter of this year (January to March), how many job offers did you get?", intial='--', choices = [i for i in range(0,10) ] ) n_offers_3m = models.IntegerField( label="In the second quarter of this year (April to June), how many job offers did you get?", intial='--', choices = [i for i in range(0,10) ] ) n_offers_1m = models.IntegerField( label="In August this year, how many job offers did you get?", intial='--', choices = [i for i in range(0,10) ] ) accept_6m = models.StringField( label="In the first quarter of this year (January to March), did you accept any of the job offers that you received?", intial='--', choices=["Yes - I've already started the job", "Yes - I am waiting to start the job", "No - the wage was too low", "No - I didn't accept for another reason." ] ) accept_3m = models.StringField( label="In the second quarter of this year (April to June), did you accept any of the job offers that you received?", intial='--', choices=["Yes - I've already started the job", "Yes - I am waiting to start the job", "No - the wage was too low", "No - I didn't accept for another reason." ] ) accept_1m = models.StringField( label="In August this year, did you accept any of the job offers that you received?", intial='--', choices=["Yes - I've already started the job", "Yes - I am waiting to start the job", "No - the wage was too low", "No - I didn't accept for another reason." ] ) selfeff_1 = models.IntegerField( label="I will be able to achieve most of the goals that I set for myself.", widget=widgets.RadioSelect, choices=[1, 2, 3, 4, 5] ) selfeff_2 = models.IntegerField( label="When facing difficult tasks, I am certain that I will accomplish them.", widget=widgets.RadioSelect, choices=[1, 2, 3, 4, 5] ) selfeff_3 = models.IntegerField( label="In general, I think that I can obtain outcomes that are important to me.", widget=widgets.RadioSelect, choices=[1, 2, 3, 4, 5] ) selfeff_4 = models.IntegerField( label="I believe I can succeed at almost any endeavor to which I set my mind.", widget=widgets.RadioSelect, choices=[1, 2, 3, 4, 5] ) selfeff_5 = models.IntegerField( label="I will be able to successfully overcome many challenges.", widget=widgets.RadioSelect, choices=[1, 2, 3, 4, 5] ) selfeff_6 = models.IntegerField( label="I am confident that I can perform effectively on many different tasks.", widget=widgets.RadioSelect, choices=[1, 2, 3, 4, 5] ) selfeff_7 = models.IntegerField( label="Compared to other people, I can do most tasks very well.", widget=widgets.RadioSelect, choices=[1, 2, 3, 4, 5] ) selfeff_8 = models.IntegerField( label="Even when things are tough, I can perform quite well.", widget=widgets.RadioSelect, choices=[1, 2, 3, 4, 5] ) #Expectations expect_1 = models.StringField( label="", widget=widgets.RadioSelect, choices=['Strongly agree with Statement 1', 'Agree with Statement 1', 'I feel the same about Statement 1 and 2', 'Agree with Statement 2', 'Strongly agree with Statement 2' ] ) expect_2 = models.StringField( label="", widget=widgets.RadioSelect, choices=['Strongly agree with Statement 1', 'Agree with Statement 1', 'I feel the same about Statement 1 and 2', 'Agree with Statement 2', 'Strongly agree with Statement 2' ] ) expect_3 = models.StringField( label="", widget=widgets.RadioSelect, choices=['Strongly agree with Statement 1', 'Agree with Statement 1', 'I feel the same about Statement 1 and 2', 'Agree with Statement 2', 'Strongly agree with Statement 2' ] ) expect_4 = models.StringField( label="", widget=widgets.RadioSelect, choices=['Strongly agree with Statement 1', 'Agree with Statement 1', 'I feel the same about Statement 1 and 2', 'Agree with Statement 2', 'Strongly agree with Statement 2' ] ) #Ranking relative to peers #Discouragement due to downward revision of job finding rates, or due to own ability expect_a = models.IntegerField( label="I feel optimistic that I will find a decent job if I keep searching.", widget=widgets.RadioSelect, choices=[1,2,3,4,5] ) expect_b = models.IntegerField( label="I struggle to motivate myself to search for jobs.", widget=widgets.RadioSelect, choices=[1,2,3,4,5] ) expect_c = models.IntegerField( label="Although searching for jobs is difficult, I am able to stay motivated.", widget=widgets.RadioSelect, choices=[1,2,3,4,5] ) expect_d = models.IntegerField( label="I didn't expect that finding a job would be so difficult.", widget=widgets.RadioSelect, choices=[1,2,3,4,5] ) expect_emp = models.IntegerField( label="Choose the point on the scale that represents how likely it is that you will be employed one year from now:", widget=widgets.RadioSelect, choices=[1,2,3,4,5,6,7,8,9,10] ) expect_perm = models.IntegerField( label="Choose the point on the scale that represents how likely it is that you will be offered a contract extension:", widget=widgets.RadioSelect, choices=[1,2,3,4,5,6,7,8,9,10] ) #Gambler's / hot hand fallacy gambler = models.IntegerField( label= 'Imagine you flipped a fair coin 5 times, and got heads five times. How likely is it that it will fall on heads when you flip it a 6th time?', widget=widgets.RadioSelect, choices=[1,2,3,4,5,6,7,8,9] ) hothand = models.IntegerField( label = 'Imagine you ask a friend to guess a coin flip, and flip it five times. The results are as follows: heads, heads, tails, heads, tails. Your friend guesses right every time! How likely is it that she will get it right a 6th time?', widget=widgets.RadioSelect, choices=[1, 2, 3, 4, 5, 6, 7, 8, 9] ) #Other consent = models.BooleanField( label="Do you agree to the above?", choices=[ [True, "Yes"], [False, "No"], ] ) email = models.StringField(blank=True, label = "If you would like to be sent a copy of this information please enter your email below (othewise just leave this blank):") prepop = models.StringField(label = "Code", intial = '--', choices = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50']) a = models.StringField() name = models.StringField( label="Please enter your name and surname", ) phone_no = models.StringField( label="
Please enter the cellphone number to which we can send your airtime
(Repeat number to confirm it is correct)
", ) email_2 = models.StringField( label="Please enter your email address", ) mobile_provider = models.StringField( label="Who is your network provider so we can send you the right airtime code?", initial='--', choices=['MTN', 'Cell-C', 'Vodacom', 'Telkom'] ) # PAGES class Consent(Page): form_model = "player" form_fields = ['consent'] def consent_error_message(player, value): if value ==False: return 'If you do not consent, you cannot proceed with the game.' class Details(Page): form_model = "player" form_fields = ["name", "email_2", "phone_no", "mobile_provider"] class Survey1(Page): form_model = "player" form_fields = ['pres_activity'] class Survey_emp(Page): form_model = "player" form_fields = ['start_job', 'end_job', 'earn', 'dur_notemp', 'dur_notsearch', 'dur_selfemp', 'dur_study', 'pre_emp', 'pre_study', 'pre_selfemp', 'pre_notemp'] @staticmethod def get_form_fields(player): if player.pres_activity == 'Employed (permanent contract)': return ['start_job', 'earn', 'pre_emp'] if player.pres_activity == 'Employed (fixed-term contract)': return ['start_job', 'end_job', 'earn', 'pre_emp'] if player.pres_activity == 'Paid internship or learnership': return ['start_job', 'end_job', 'earn', 'pre_emp'] if player.pres_activity == 'In training / studying (unpaid)': return ['dur_study', 'pre_study'] if player.pres_activity == 'Self-employed': return ['dur_selfemp', 'pre_selfemp'] if player.pres_activity == 'Not employed, NOT looking for work': return ['dur_notemp', 'pre_notemp'] if player.pres_activity == 'Not employed, looking for work': return ['dur_notemp', 'pre_notemp'] class Survey2(Page): form_model = "player" form_fields = ["search_now", "search_3m", 'search_6m', 'search_future'] @staticmethod def get_form_fields(player): if player.pres_activity == 'Not employed, NOT looking for work': return ['search_6m', 'search_3m', 'search_future'] else: return ['search_6m', 'search_3m', 'search_now', 'search_future'] class Survey3(Page): #Note: Add option for "as not searching" and add warning message form_model = "player" form_fields = ['intensity_6m', 'offers_6m', 'intensity_3m', 'offers_3m', 'intensity_now', 'offers_1m', 'intensity_future'] @staticmethod def get_form_fields(player): if player.search_now == 'Yes' and player.search_3m == 'Yes' and player.search_6m == 'Yes' and player.search_future == 'Yes': return ['intensity_6m', 'offers_6m', 'intensity_3m', 'offers_3m', 'intensity_now', 'offers_1m', 'intensity_future'] if player.search_now == 'No' and player.search_3m == 'Yes' and player.search_6m == 'Yes' and player.search_future == 'Yes': return ['intensity_6m', 'offers_6m', 'intensity_3m', 'offers_3m', 'intensity_future'] if player.search_now == 'Yes' and (player.search_3m == 'No' or player.search_3m == "I don't remember") and player.search_6m == 'Yes' and player.search_future == 'Yes': return ['intensity_6m', 'offers_6m', 'intensity_now', 'offers_1m', 'intensity_future'] if player.search_now == 'Yes' and player.search_3m == 'Yes' and (player.search_6m == 'No' or player.search_6m == "I don't remember") and player.search_future == 'Yes': return ['intensity_3m', 'offers_3m', 'intensity_now', 'offers_1m', 'intensity_future'] if player.search_now == 'Yes' and player.search_3m == 'Yes' and player.search_6m == 'Yes' and (player.search_future == 'No' or player.search_future == "I don't know"): return ['intensity_6m', 'offers_6m', 'intensity_3m', 'offers_3m', 'intensity_now', 'offers_1m'] if player.search_now == 'No' and (player.search_3m == 'No' or player.search_3m == "I don't remember") and player.search_6m == 'Yes' and player.search_future == 'Yes': return ['intensity_6m', 'offers_6m', 'intensity_future'] if player.search_now == 'Yes' and (player.search_3m == 'No' or player.search_3m == "I don't remember") and (player.search_6m == 'No' or player.search_6m == "I don't remember") and player.search_future == 'Yes': return ['intensity_now', 'offers_1m', 'intensity_future'] if player.search_now == 'Yes' and player.search_3m == 'Yes' and (player.search_6m == 'No' or player.search_6m == "I don't remember") and (player.search_future == 'No' or player.search_future == "I don't know"): return ['intensity_3m', 'offers_3m', 'intensity_now', 'offers_1m'] if player.search_now == 'No' and player.search_3m == 'Yes' and player.search_6m == 'Yes' and (player.search_future == 'No' or player.search_future == "I don't know"): return ['intensity_6m', 'offers_6m', 'intensity_3m', 'offers_3m'] if player.search_now == 'No' and player.search_3m == 'Yes' and (player.search_6m == 'No' or player.search_6m == "I don't remember") and player.search_future == 'Yes': return ['intensity_3m', 'offers_3m', 'intensity_future'] if player.search_now == 'Yes' and (player.search_3m == 'No' or player.search_3m == "I don't remember") and player.search_6m == 'Yes' and (player.search_future == 'No' or player.search_future == "I don't know"): return ['intensity_6m', 'offers_6m', 'intensity_now', 'offers_1m'] if player.search_now == 'No' and (player.search_3m == 'No' or player.search_3m == "I don't remember") and (player.search_6m == 'No' or player.search_6m == "I don't remember") and player.search_future == 'Yes': return ['intensity_future'] if player.search_now == 'No' and (player.search_3m == 'No' or player.search_3m == "I don't remember") and player.search_6m == 'Yes' and (player.search_future == 'No' or player.search_future == "I don't know"): return ['intensity_6m', 'offers_6m'] if player.search_now == 'No' and player.search_3m == 'Yes' and (player.search_6m == 'No' or player.search_6m == "I don't remember") and (player.search_future == 'No' or player.search_future == "I don't know"): return ['intensity_3m', 'offers_3m'] if player.search_now == 'Yes' and (player.search_3m == 'No' or player.search_3m == "I don't remember") and (player.search_6m == 'No' or player.search_6m == "I don't remember") and (player.search_future == 'No' or player.search_future == "I don't know"): return ['intensity_now', 'offers_1m'] @staticmethod def is_displayed(player: Player): return player.search_now == 'Yes' or player.search_3m == 'Yes' or player.search_6m == 'Yes' or player.search_future == 'Yes' class offers(Page): form_model = 'player' form_fields = ['n_offers_1m', 'accept_1m', 'n_offers_3m', 'accept_3m', 'n_offers_6m', 'accept_6m'] @staticmethod def get_form_fields(player): if player.offers_1m == True and player.offers_3m == True and player.offers_6m == True: return ['n_offers_6m', 'accept_6m', 'n_offers_3m', 'accept_3m', 'n_offers_1m', 'accept_1m'] if player.offers_1m == True and player.offers_3m == False and player.offers_6m == True: return [ 'n_offers_6m', 'accept_6m', 'n_offers_1m', 'accept_1m', ] if player.offers_1m == True and player.offers_3m == True and player.offers_6m == False: return ['n_offers_3m', 'accept_3m', 'n_offers_1m', 'accept_1m', ] if player.offers_1m == False and player.offers_3m == True and player.offers_6m == True: return ['n_offers_6m', 'accept_6m', 'n_offers_3m', 'accept_3m'] if player.offers_1m == True and player.offers_3m == False and player.offers_6m == False: return ['n_offers_1m', 'accept_1m'] if player.offers_1m == False and player.offers_3m == False and player.offers_6m == True: return ['n_offers_6m', 'accept_6m' ] if player.offers_1m == False and player.offers_3m == True and player.offers_6m == False: return ['n_offers_3m', 'accept_3m'] @staticmethod def is_displayed(player: Player): return player.field_maybe_none('offers_1m') == True or player.field_maybe_none('offers_3m') == True or player.field_maybe_none('offers_6m') == True class searchhow_now(Page): form_model = 'player' form_fields = ['search_how1', 'search_how2', 'search_how3', 'search_how4', 'search_how5', 'search_how6', 'search_how7', 'search_how8', 'search_how9'] @staticmethod def is_displayed(player: Player): return player.search_now == 'Yes' class searchhow_3m(Page): form_model = 'player' form_fields = ['search_how1_3m', 'search_how2_3m', 'search_how3_3m', 'search_how4_3m', 'search_how5_3m', 'search_how6_3m', 'search_how7_3m', 'search_how8_3m', 'search_how9_3m'] @staticmethod def is_displayed(player: Player): return player.search_3m == 'Yes' class searchhow_6m(Page): form_model = 'player' form_fields = ['search_how1_6m', 'search_how2_6m', 'search_how3_6m', 'search_how4_6m', 'search_how5_6m', 'search_how6_6m', 'search_how7_6m', 'search_how8_6m', 'search_how9_6m'] @staticmethod def is_displayed(player: Player): return player.search_6m == 'Yes' class Survey4(Page): form_model = "player" @staticmethod def get_form_fields(player): if player.pres_activity == 'Employed (permanent contract)': return ["expect_emp"] elif player.pres_activity == 'Employed (fixed-term contract)' or player.pres_activity == 'Paid internship or learnership': return ["expect_emp", "expect_perm"] @staticmethod def is_displayed(player: Player): return player.pres_activity == 'Employed (permanent contract)' or player.pres_activity == 'Employed (fixed-term contract)' or player.pres_activity == 'Paid internship or learnership' class selfeff(Page): form_model = 'player' form_fields = ['selfeff_1', 'selfeff_2', 'selfeff_3', 'selfeff_4', 'selfeff_5', 'selfeff_6', 'selfeff_7','selfeff_8' ] class expect(Page): form_model = 'player' form_fields = ['expect_1', 'expect_2', 'expect_3', 'expect_4' ] class expect_2(Page): form_model = 'player' form_fields = ['expect_a', 'expect_b', 'expect_c', 'expect_d'] class Gambler_HH(Page): form_model = 'player' form_fields = ['gambler', 'hothand'] #######NOTE: When implementing the survey, I can use and expand this code to include pre-filled data class playercode(Page): form_model = "player" form_fields = ["prepop"] class nameandnumber(Page): @staticmethod def vars_for_template(player: Player): thisdict = {"1": " Samuel Maisokotsa Teffu 0763357981", "2": " Sabelo Floyd Khumalo 0786190823 ", "3": " Mabel Keetse Keetse 0765703780 ", "4": " Zama Mzimela 0730474051 ", "5": " Lesedi Masoko 0782587704 ", "6": " Nomfingo Mtotywa 0659637795 ", "7": " Sinethemba Nodada 0728261789 ","8": " Santo Dos Santos 0833209106 ", "9": "Mohau Pheeha 0817159430 ", "10": "Tefo Semase 0717947576 ", "11": "Zihle Jali 0647806034 ", "12": "Mankwane Rebecca Makwela 0713010520", "13": "Zandiswa Goba 071 022 9624", "14": "Muzikawulahlwa Memela 0605202584", "15": "Sharon Marebatane Masemola 0712874952", "16": "Thembakazi Ntetha 073 427 4318", "17": "Wesley Clinton Smith 0620577301", "18": "Vinencia Ngubane 0711449804", "19": "Sandile Frans Tlhakola 0638363993", "20": "Lesego Rachel Letlole 0635696729", "21": "Lindelani Singo 0766044247 ", "22": " Sibusiso Tshabalala 0681571873 ", "23": " Micaula Afrika 0679801895 ", "24": " Mongikazi Bambelani 0784177787 ", "25": " Sharon Maqungo 0797725700 ", "26": " Daniel Makhakhe 0636469537 ", "27": " Nkosenhle Mthunzi 0621275453", "28": " Tshegofatso Pheko 0817721251 ", "29": " Keabetswe Motlhale 0658933888 ", "30": " Teddy Motlhake 060 658 1672 ", "31": " Yanga Nodada 0723075966 ", "32": " Sihle Jozi 0633740385 ", "33": " Reneilwe Melbur Koza 0797427502 ", "34": " Sizwekazi Zoleka Mbokwana 0678609776 ", "35": " Landiwe Ndlozi 0766963831 ", "36": " Nombuso Bhogolo 0764773862 ", "37": " Thembelihle Tyobeka 0629670360 ", "38": " Simwando Siluyasila 0680392657 ", "39": " Anelisiwe Ntlokwana 0842580375 ", "40": " Johannes Phaladi 0792398000 ", "41": " Benedict Rikhotso 0822924057 ", "42": " Zimvo Nonjola 0724592738 ", "43": " Lindiwe Maseko 0798295405 ", "44": " Doreen Sekgoela 0720639964 ", "45": " Refilwe Funzani 0612539064 ", "46": " Makabongwe Cele 0641525623 ", "47": " Lungelo Cebisa 0658629894 ", "48": " Mbheki Romeo Zombe 0839990857 ", "49": " Siyambuka Debese 0730573943", "50": " Nomthandazo Nhleko 0671529109 "} if player.prepop == "1": player.a = thisdict["1"] if player.prepop == "2": player.a = thisdict["2"] if player.prepop == "3": player.a = thisdict["3"] if player.prepop == "4": player.a = thisdict["4"] if player.prepop == "5": player.a = thisdict["5"] if player.prepop == "6": player.a = thisdict["6"] if player.prepop == "7": player.a = thisdict["7"] if player.prepop == "8": player.a = thisdict["8"] if player.prepop == "9": player.a = thisdict["9"] if player.prepop == "10": player.a = thisdict["10"] if player.prepop == "11": player.a = thisdict["11"] if player.prepop == "12": player.a = thisdict["12"] if player.prepop == "13": player.a = thisdict["13"] if player.prepop == "14": player.a = thisdict["14"] if player.prepop == "15": player.a = thisdict["15"] if player.prepop == "16": player.a = thisdict["16"] if player.prepop == "17": player.a = thisdict["17"] if player.prepop == "18": player.a = thisdict["18"] if player.prepop == "19": player.a = thisdict["19"] if player.prepop == "20": player.a = thisdict["20"] if player.prepop == "21": player.a = thisdict["21"] if player.prepop == "22": player.a = thisdict["22"] if player.prepop == "23": player.a = thisdict["23"] if player.prepop == "24": player.a = thisdict["24"] if player.prepop == "25": player.a = thisdict["25"] if player.prepop == "26": player.a = thisdict["26"] if player.prepop == "27": player.a = thisdict["27"] if player.prepop == "28": player.a = thisdict["28"] if player.prepop == "29": player.a = thisdict["29"] if player.prepop == "30": player.a = thisdict["30"] if player.prepop == "31": player.a = thisdict["31"] if player.prepop == "32": player.a = thisdict["32"] if player.prepop == "33": player.a = thisdict["33"] if player.prepop == "34": player.a = thisdict["34"] if player.prepop == "35": player.a = thisdict["35"] if player.prepop == "36": player.a = thisdict["36"] if player.prepop == "37": player.a = thisdict["37"] if player.prepop == "38": player.a = thisdict["38"] if player.prepop == "39": player.a = thisdict["39"] if player.prepop == "40": player.a = thisdict["40"] if player.prepop == "41": player.a = thisdict["41"] if player.prepop == "42": player.a = thisdict["42"] if player.prepop == "43": player.a = thisdict["43"] if player.prepop == "44": player.a = thisdict["44"] if player.prepop == "45": player.a = thisdict["45"] if player.prepop == "46": player.a = thisdict["46"] if player.prepop == "47": player.a = thisdict["47"] if player.prepop == "48": player.a = thisdict["48"] if player.prepop == "49": player.a = thisdict["49"] if player.prepop == "50": player.a = thisdict["50"] class thanks(Page): pass page_sequence = [playercode, nameandnumber, Consent, Details, Survey1, Survey_emp, Survey2, Survey3, offers, searchhow_now, searchhow_3m, searchhow_6m, Survey4, Gambler_HH, expect, expect_2, thanks]