from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) author = 'Vera Willems' doc = """ Master's thesis experiment. """ class Constants(BaseConstants): name_in_url = 'studyvera' players_per_group = None num_rounds = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): def assign_names(self): print('Assigning names to chat ...') for p in self.get_players(): p.nicknames = p.participant.vars['player_name'] class Player(BasePlayer): nicknames = models.StringField() # Social Desirability Scale # def dfe(x): return models.IntegerField( choices=[[1, 'Not at all concerned'], [2, 'Slightly concerned'], [3, 'Somewhat concerned'], [4, 'Moderately concerned'], [5, 'Extremely concerned']], label=x, widget=widgets.RadioSelect, blank=True) def abc(x): return models.IntegerField( choices=[[1, 'Less than once every three years'], [2, 'every two to three years'], [3, 'once a year'], [4, 'two times a year' ], [5, 'More than two times a year']], label=x, widget=widgets.RadioSelect, blank=True) filler1 = abc('On average, how often do you travel by airplane yourself?') filler2 = abc('On average, how often do you think the average person travels by airplane?') def xyz(x): return models.IntegerField( choices=[[1, 'Strongly disagree'], [2, 'Disagree'], [3, 'Somewhat disagree'], [4, 'Neither agree or disagree'], [5, 'Somewhat agree'], [6, 'Agree'], [7, 'Strongly agree']], label=x, widget=widgets.RadioSelect) plignorance1 = xyz('I am concerned about environmental issues') plignorance2 = xyz('I think the average person is concerned about environmental issues') filler3 = xyz('We worked as a team in this task') filler4 = xyz('We had enough time to come up with 10 solutions to the problem') filler5 = xyz('We ended up with appropriate solutions to the problem') filler6 = xyz('I feel that I contributed enough ideas to this group discussion') filler7 = xyz('I feel that I contributed appropriate ideas to this group discussion')