from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) import random author = 'Your name here' doc = """ Your app description """ class Constants(BaseConstants): <<<<<<< HEAD name_in_url = 'stage1_new_agent1' players_per_group = None num_rounds = 1 class Subsession(BaseSubsession): pass ======= name_in_url = 'stage1_new' players_per_group = None num_rounds = 1 class Subsession (BaseSubsession): def before_session_starts(self): if self.round_number == 1: for p in self.get_players(): p.participant.vars['Condition'] = random.choice((0, 1)) >>>>>>> 0982dc5566ffb7cb2176b6338e4f4497a3d00fc3 class Group(BaseGroup): pass class Player(BasePlayer): <<<<<<< HEAD ======= def set_condition(self): self.Condition = self.participant.vars['Condition'] Condition = models.IntegerField() >>>>>>> 0982dc5566ffb7cb2176b6338e4f4497a3d00fc3 Gender = models.IntegerField ( choices = [ [1, 'Male'], [2, 'Female'], <<<<<<< HEAD [3, 'Other'], ======= >>>>>>> 0982dc5566ffb7cb2176b6338e4f4497a3d00fc3 ] ) Age = models.IntegerField(min=18, max=99) Country = models.TextField ( widget=widgets.Textarea (attrs={'rows': 1, 'cols': 8}) ) Religion = models.IntegerField( choices=[ [1, 'Muslim'], [2, 'Hindu'], [3, 'Sikh'], [4, 'Christian'], [5, 'Buddhist'], [6, 'Zoroastrian'], [7, 'Jain'], [8, 'Other'], [9, 'Prefer not say'], ] ) Employment = models.TextField ( widget=widgets.Textarea (attrs={'rows': 1, 'cols': 8}) ) Education = models.IntegerField ( choices=[ [1, 'Some high school'], [2, 'High school graduate'], [3, 'Some college'], [4, 'Trade/Technical/Vocational training'], [5, 'College graduate'], [6, 'Some post graduate degree'], [7, 'Post graduate degree'], [8, 'Prefer not say'], ] <<<<<<< HEAD ) Task1CQ1 = models.IntegerField( choices=[ [1, 'added'], [2, 'subtracted'], [3, 'multiplied'], [4, 'divided'], ] ) Task1CQ2 = models.IntegerField( choices=[ [1, 'Yes'], [2, 'No'], [3, 'It depends'], ] ) Task1CQ3 = models.IntegerField( choices=[ [1, 'Yes'], [2, 'No'], ] ) Task1CQ4 = models.IntegerField( choices=[ [1, '$0'], [2, '$1'], [3, '$2'], [4, 'anything'], ] ) ======= ) >>>>>>> 0982dc5566ffb7cb2176b6338e4f4497a3d00fc3