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): name_in_url = 'stage1_new_agent1' players_per_group = None num_rounds = 1 lowpayoff = c(0) highpayoff = c(500) task1 = 'puzzles' task2 = 'grid' class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): Gender = models.IntegerField ( choices = [ [1, 'Male'], [2, 'Female'], [3, 'Other'], ] ) def set_gender(self): self.participant.vars['gender1'] = self.Gender Age = models.IntegerField(min=18, max=99) def set_age(self): self.participant.vars['age'] = self.Age 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 to say'], ] ) Caste = models.IntegerField( choices=[ [1, 'SC/ST'], [2, 'OBC'], [3, 'General'], [4, 'Other'], [5, 'Prefer not to say'], ] ) Employment = models.TextField ( widget=widgets.Textarea (attrs={'rows': 1, 'cols': 8}) ) Education = models.IntegerField ( choices=[ [1, 'Less than high school'], [2, 'Some high school'], [3, 'High school graduate'], [4, 'Some college'], [5, 'Trade/Technical/Vocational training'], [6, 'College graduate'], [7, 'Some post graduate study'], [8, 'Post graduate degree'], [9, 'Other'], [10, 'Prefer not say'], ] ) Task1CQ1 = models.IntegerField( choices=[ [1, 'one'], [2, 'two'], [3, 'three'], [4, 'four'], ] ) 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, '₹80'], [3, '₹130'], [4, 'anything'], ] ) PracticeRaven = models.IntegerField( choices=[1, 2, 3, 4, 5, 6, 7, 8] )