from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range, ) author = 'Your name here' doc = """ Your app description """ class Constants(BaseConstants): name_in_url = 'survey1_0709' ##This name will appear in the url once you run the app. # You can choose whatever you want but it needs to be unique among all your apps. players_per_group = None ##Here we set how many participants are interacting. None means no interaction (one person task) num_rounds = 1 ##Here we set how many rounds are being played. class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): first_name = models.StringField(label="What is your first name?") ##This is a field participants will fill in during the study. StringField means that it is a text field and that #participants can enter text. Label defines the text that will appear on top of the field for participants. age = models.IntegerField(label="How old are you?", min=16, max=100) ##This is also a field but a numerical. #Participants can only enter integers. The min and max options allow entries only between 16 and 100. economics = models.BooleanField( label="Do you study economics?", choices=[[True, "Yes"], [False, "No"]] ) ##This also a field but it only takes two entries True and False. It is very useful for more complex experiments. ##Choices is a very useful way to define possible answers for a field. It can also be used for String or Integer fields. #With choices, you make one entry for each choice that is available to participants. # You can also define what the options are called for participants. Like here, they don't answer True/False but Yes/No. #Here is what you could do for age for example: #age = models.IntegerField( #choices=[[1, "younger than 20"], [2, "20-40"], [3, "older than 40"]] #)