from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range, ) import random doc = """ """ class Constants(BaseConstants): name_in_url = 'stopping_rule_student_questions' players_per_group = None num_rounds = 1 class Subsession(BaseSubsession): def creating_session(self): eckel_grossman_random = random.randint(1, 2) for p in self.get_players(): p.eg_rand = eckel_grossman_random class Group(BaseGroup): pass class Player(BasePlayer): captcha = models.CharField(blank=True) job = models.StringField( label='What is your job/career?' ) gender = models.StringField( label='What is your gender?' ) race_ethnicity = models.StringField( label='What is your race? What is your ethnicity?' ) age = models.IntegerField( label='What is your age?', min =18, max =100 ) decision_description = models.StringField( label='Did you have a plan for how many balls you would draw in each round or did you decide as you went?' ) ### ECKEL GROSSMAN STUFF ### eg_choice = models.IntegerField( choices=[ [1, 'Gamble 1'], [2, 'Gamble 2'], [3, 'Gamble 3'], [4, 'Gamble 4'], [5, 'Gamble 5'] ], widget=widgets.RadioSelectHorizontal, label='Which gamble would you like to take?' ) eg_rand = models.IntegerField() eg_payoff = models.IntegerField(initial=0)