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 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 student travels by airplane?') def xyz(x): return models.IntegerField( choices=[[1, 'Strongly disagree'], [2, 'Disagree'], [3, 'Neither agree or disagree'], [4, 'Agree'], [5, 'Strongly agree']], label=x, widget=widgets.RadioSelect) filler4 = xyz('We had enough time to come up with good 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') def pli(x): return models.IntegerField( choices=[[1, 'Very concerned'], [2, 'Concerned'], [3, 'Cautious'], [4, 'Disengaged'], [5, 'Doubtful'], [6, 'Nonbeliever']], label=x, widget=widgets.RadioSelect) plignorance1 = pli('How concerned are you about environmental issues?') plignorance2 = pli('How concerned do you think the average student is about environmental issues?')