from otree.api import * doc = """ Your app description """ class C(BaseConstants): NAME_IN_URL = 'OtherProbabilities' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): p1_G = models.IntegerField( label='What is the probability that the computer selects the Green box? Answer in percentage points.', min=0, max=100) p2_y_G = models.IntegerField( label='What is the probability Participant 2 beliefs one yellow marble is draw if the box is Green?', min=0, max=100) p2_G = models.IntegerField( label='What is the probability Participant 2 beliefs the computer selects the Green box?', min=0, max=100) # FUNCTIONS def p1_G_error_message(player, value): print('value is', value) if value < 10: return 'The probability is larger.' if value > 10: return 'The probability is smaller.' def p2_y_G_error_message(player, value): print('value is', value) if value < 25: return 'The probability is larger. The marble composition of the boxes are the same for you and Participant 2.' if value > 25: return 'The probability is smaller. The marble composition of the boxes are the same for you and Participant 2.' def p2_G_error_message(player, value): print('value is', value) if value < 80: return 'The probability is larger.' if value > 80: return 'The probability is smaller.' # PAGES class BetsSelfOther(Page): pass class TestSetting(Page): form_model = 'player' form_fields = ['p1_G', #'p2_y_G' ] class TestOther(Page): form_model = 'player' form_fields = ['p2_G'] class PaymentInfo(Page): pass class ResultsWaitPage(WaitPage): pass class Results(Page): pass page_sequence = [BetsSelfOther, TestSetting, TestOther, PaymentInfo # ResultsWaitPage, # Results ]