from otree.api import * c = cu doc = '' class C(BaseConstants): NAME_IN_URL = 'PEQ' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Group(BaseGroup): pass class Player(BasePlayer): peq1 = models.IntegerField( choices=[[1, 'Strongly Disagree'], [2, 'Disagree'], [3, 'Somewhat Disagree'], [4, 'Neutral'], [5, 'Somewhat Agree'], [6, 'Agree'], [7, 'Strongly Agree']], label='1. I think the other worker in my group will choose higher work level than me ', widget=widgets.RadioSelectHorizontal) peq2 = models.IntegerField( choices=[[1, 'Strongly Disagree'], [2, 'Disagree'], [3, 'Somewhat Disagree'], [4, 'Neutral'], [5, 'Somewhat Agree'], [6, 'Agree'], [7, 'Strongly Agree']], label='2. When choosing my work level, I consider what I think the other worker in my group would do', widget=widgets.RadioSelectHorizontal) peq3 = models.IntegerField( choices=[[1, 'Strongly Disagree'], [2, 'Disagree'], [3, 'Somewhat Disagree'], [4, 'Neutral'], [5, 'Somewhat Agree'], [6, 'Agree'], [7, 'Strongly Agree']], label='3. I think participants who give more to charity in part 1 will choose higher work level', widget=widgets.RadioSelectHorizontal) peq4 = models.IntegerField( choices=[[1, 'Strongly Disagree'], [2, 'Disagree'], [3, 'Somewhat Disagree'], [4, 'Neutral'], [5, 'Somewhat Agree'], [6, 'Agree'], [7, 'Agree']], label='4. I considered my own earnings when deciding my work level ', widget=widgets.RadioSelectHorizontal) otherworklevel_est = models.IntegerField(min=1, max=10, label='') allworklevel_est = models.IntegerField(min=1, max=10, label='') #Demographics gender = models.IntegerField( label="1. Please select your gender.", choices=[ [1, 'Male'], [2, 'Female'], [3, 'Other'], [4, 'I prefer not to say.'], ] ) age = models.IntegerField(label="2. Please enter your age.", min=14, max=90, blank=True) studies = models.IntegerField( label="3. Please estimate how many studies you have participated in (excluding this study).", choices=[ [1, 'Less than 5 studies'], [2, 'Between 5 and less than 10 studies.'], [3, 'between 10 and less than 15 studies.'], [4, '15 or more studies.'], [5, 'I prefer not to say.'] ] ) workexperience = models.IntegerField( label="4. Please indicate your work experience. All jobs count, including part-time and volunteer work.", choices=[ [1, 'I do not have work experience.'], [2, 'Less than 1 year work experience.'], [3, 'Between 1 and less than 2 years of work experience'], [4, 'Between 2 and less than 3 years work experience.'], [5, 'Between 3 and less than 4 years work experience.'], [6, 'Between 4 and less than 5 years work experience.'], [7, '5 years or more work experience.'], [8, 'I prefer not to say.'], ] ) english = models.IntegerField( label="5. Please rate your English on a percentage scale between 0 and 100.", min=0, max=100, blank=True, initial=None ) class PEQnew(Page): form_model = 'player' form_fields = ['peq1', 'peq2', 'peq3', 'peq4','otherworklevel_est','allworklevel_est'] class PEQIntro(Page): pass class Subsession(BaseSubsession): pass class Demographics(Page): form_model = 'player' form_fields = ['gender', 'age', 'studies', 'workexperience', 'english'] class PEQEnd(Page): form_model = 'player' def is_displayed(player): participant = player.participant return participant.consent == True @staticmethod def js_vars(player): return dict( completionlink= player.subsession.session.config['completionlink'] ) pass page_sequence = [PEQIntro, PEQnew, Demographics, PEQEnd ]