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 = 'TimePref' players_per_group = None num_rounds = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): time1 = models.IntegerField(widget=widgets.RadioSelectHorizontal, choices=[[1, ''], [2, '']]) time2 = models.IntegerField(widget=widgets.RadioSelectHorizontal, choices=[[1, ''], [2, '']]) time3 = models.IntegerField(widget=widgets.RadioSelectHorizontal, choices=[[1, ''], [2, '']]) time4 = models.IntegerField(widget=widgets.RadioSelectHorizontal, choices=[[1, ''], [2, '']]) time5 = models.IntegerField(widget=widgets.RadioSelectHorizontal, choices=[[1, ''], [2, '']]) time6 = models.IntegerField(widget=widgets.RadioSelectHorizontal, choices=[[1, ''], [2, '']]) time7 = models.IntegerField(widget=widgets.RadioSelectHorizontal, choices=[[1, ''], [2, '']]) time8 = models.IntegerField(widget=widgets.RadioSelectHorizontal, choices=[[1, ''], [2, '']]) time9 = models.IntegerField(widget=widgets.RadioSelectHorizontal, choices=[[1, ''], [2, '']]) time10 = models.IntegerField(widget=widgets.RadioSelectHorizontal, choices=[[1, ''], [2, '']]) def player_risk(self): self.participant.vars['time1'] = self.risk10 self.participant.vars['time2'] = self.risk20 self.participant.vars['time3'] = self.risk30 self.participant.vars['time4'] = self.risk40 self.participant.vars['time5'] = self.risk50 self.participant.vars['time6'] = self.risk60 self.participant.vars['time7'] = self.risk70 self.participant.vars['time8'] = self.risk80 self.participant.vars['time9'] = self.risk90 self.participant.vars['time10'] = self.risk100