from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) import itertools author = 'Your name here' doc = """ Your app description """ class Constants(BaseConstants): name_in_url = 'scenario' players_per_group = None num_rounds = 1 class Subsession(BaseSubsession): def creating_session(self): roles = itertools.cycle([1, 2, 3]) for p in self.get_players(): p.role = next(roles) class Group(BaseGroup): pass class Player(BasePlayer): #Player name name = models.StringField() # Player role role = models.IntegerField() # Preference View preference = models.FloatField() # Risk Preference risk = models.FloatField() # Knowledge knowledge = models.FloatField() # Participant Age age = models.IntegerField() # Participant Gender gender = models.StringField( choices=['Male', 'Female', 'Transgender Male', 'Transgender Female', 'Other Gender Variant'], ) # Participant Education education = models.StringField( choices=['High School Degree', 'Bachelors Degree', 'Masters Degree', 'Doctoral Degree', 'Rather not say'], ) # Participant Political Science Education political = models.BooleanField( choices=[ [True, 'Yes'], [False, 'No'] ], widget=widgets.RadioSelectHorizontal) # Participant Computer Science Education computer = models.BooleanField( choices=[ [True, 'Yes'], [False, 'No'] ], widget=widgets.RadioSelectHorizontal) # Hospital Experience Experience hospital = models.BooleanField( choices=[ [True, 'Yes'], [False, 'No']], widget=widgets.RadioSelectHorizontal )