from otree.api import * doc = """ Your app description """ class C(BaseConstants): NAME_IN_URL = 'instructions1_principals_nounder' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 SEPARATE_POT = cu(1.75) BELIEFPAYOFF = cu(2.5) class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): q1_addition = models.IntegerField( label='', ) q2_addition = models.IntegerField( label='', ) q3_addition = models.IntegerField( label='', ) q4_addition = models.IntegerField( label='', ) q5_addition = models.IntegerField( label='', ) q6_addition = models.IntegerField( label='', ) q7_addition = models.IntegerField( label='', ) c_question1 = models.IntegerField( choices=[[1, 'additions'], [2, 'subtractions'], [3, 'multiplications'], [4, 'divisions']], label='The performer will perform seven __________ in each round.', widget=widgets.RadioSelect, ) c_question2 = models.IntegerField( choices=[[1, 'be more likely to get a high Task payment'], [2, 'be sure to get a high Task payment'], [3, "not be affected by the Performer's performance"]], label='If your Performer have more correct answers in a round, you will...', widget=widgets.RadioSelect, ) c_question3 = models.IntegerField( choices=[[1, '$2'], [2, '$1'], [3, '$1.5'], [4, '$1.75']], label='Suppose your Task payment is $2. What is the most you can pay to your Performer?', widget=widgets.RadioSelect, ) c_question4 = models.IntegerField( choices=[[1, 'You will get the $0.25'], [2, 'Another random Performer will get the $0.25'], [3, 'The researchers will get the $0.25']], label='Suppose you assign your paired Performer $1 and a random Performer from this study $0.5, where will the ' ' rest of the money ($0.25) go?', widget=widgets.RadioSelect, ) c_question5 = models.IntegerField( choices=[[1, 'the Task payment (either a high or low payment)'], [2, 'the Belief payment (either $2.5 or $0)'], [3, 'the Task payment (either a high or low payment) OR the Belief payment (either $2.5 or $0)']], label='How much bonus payment will you get in a round?', widget=widgets.RadioSelect, ) # PAGES class Instructions_task1(Page): @staticmethod def vars_for_template(player: Player): return dict( separate_pot=C.SEPARATE_POT, ) class Paymentrule(Page): @staticmethod def vars_for_template(player: Player): return dict( separate_pot=C.SEPARATE_POT, belief_payoff=C.BELIEFPAYOFF, ) class Instructions_beliefs(Page): @staticmethod def vars_for_template(player: Player): return dict( belief_payoff=C.BELIEFPAYOFF, ) class Instructions_task1_decider(Page): pass class SomeUnderstandingQuestions(Page): form_model = 'player' form_fields= ['c_question1', 'c_question2', 'c_question3', 'c_question4', 'c_question5'] @staticmethod def error_message(player, values): print('values is', values) if values["c_question1"] != 1 or values["c_question2"] != 1 or values["c_question3"] != 4 or values["c_question4"] != 3 or values["c_question5"] != 3: return 'There is at least one incorrect answer. Please, reconsider.' class Instructions_example_task(Page): form_model='player' form_fields=['q1_addition', 'q2_addition', 'q3_addition', 'q4_addition', 'q5_addition', 'q6_addition', 'q7_addition'] timeout_seconds = 3 #this time needs to be changed to 45 seconds page_sequence = [Instructions_task1, Instructions_task1_decider, Instructions_example_task, Instructions_beliefs, Paymentrule,]