from otree.api import * c = cu doc = '' class C(BaseConstants): NAME_IN_URL = 'survey' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): age = models.IntegerField(label='What is your age', max=125, min=13) gender = models.StringField(choices=[['Male', '0'], ['Female', '1'], ['Other', '2']], label='What is your gender', widget=widgets.RadioSelect) Household_income = models.FloatField(choices=[[1, 'less than 20000'], [2, '20000-40000'], [3, '40000-60000'], [4, 'more than 60000']], label='What is your household income?') crt_bat = models.IntegerField(label='A bat and a ball cost $1.1 in total. The bat costs $1 dollars more than the ball. How many dollars does the ball cost?') crt_widget = models.IntegerField(label='If it takes 5 machines 5 minutes to make 5 widgets, how many minutes would it take 100 machines to make 100 widgets?') crt_lake = models.IntegerField(label='In a lake, there is a patch of lily pads every day the patch doubles in size If it takes 48 days for the patch to cover the entire lake how many days would it take for the patch to cover half of the lake?') od_1 = models.FloatField(choices=[[1, '100'], [2, '200'], [3, '300'], [4, '400']], label='You are a retailer who stocks and sells a single generic product for which demand is 100 units, although the timing of this demand is not known. You are facing a two-period selling season, but you can only order inventory to be available at the beginning of those periods.Demand for the full 100 units of product will occur in only one of the two periods. There is a 50% chance that the demand will take place in Period 1. You must decide how much inventory to order to be available at the beginning of each selling period. What is your decicion?') od_2 = models.FloatField(choices=[[0, 'Choice A'], [1, 'Choice B']], label='When you play a gamble, you have two choice: A. 80% chance of earning $4000; B. receive $3000 with certainty. Which one will you choose?') od_3 = models.FloatField(choices=[[0, 'choice A'], [1, 'choice B']], label='When you play a gamble, you have two choices: A. 80% chance of losing $4000; B. pay $3000 with certainty. Which one will you choose?') class Demographics(Page): form_model = 'player' form_fields = ['age', 'gender', 'Household_income'] class CognitiveReflectionTest(Page): form_model = 'player' form_fields = ['crt_bat', 'crt_widget', 'crt_lake'] class Ordering_decision(Page): form_model = 'player' form_fields = ['od_1', 'od_2'] page_sequence = [Demographics, CognitiveReflectionTest, Ordering_decision]