from otree.api import * c = Currency doc = """ Your app description """ class C(BaseConstants): NAME_IN_URL = 'instructions' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): Choice_1 = models.IntegerField( choices=[[1, "40 if the worker was Ann, 0 if the worker was Bob"], [2, "40 if the worker was Ann, 22 if the worker was Bob"], [3, "0 if the worker was Ann, 22 if the worker was Bob"], [4, "0 if the worker was Ann, 0 if the worker was Bob"]], widget=widgets.RadioSelect, label="The answer is:" ) Choice_2 = models.IntegerField( choices=[[1, "Case 1: 30, Case 2: 23"], [2, "Case 1: 17, Case 2: 25"], [3, "Case 1: 30, Case 2: 25"], [4, "Case 1: 17, Case 2: 23"]], widget=widgets.RadioSelect, label="The answer is:" ) wb_1 = models.FloatField( label="Your wage choice for Job 2 is:", max=90 ) Choice_31 = models.IntegerField( label="If the worker was Ann" ) Choice_32 = models.IntegerField( label="If the worker was Bob" ) Choice_33 = models.IntegerField( label="If both want a job and Ann was chosen" ) Choice_34 = models.IntegerField( label="If both want a job and Bob was chosen" ) # PAGES class Comp1(Page): form_model = "player" form_fields = ["Choice_1"] class Comp2(Page): def vars_for_template(player): return dict( correct=player.Choice_1 == 1 ) class Comp3(Page): form_model = "player" form_fields = ["Choice_2"] class Comp4(Page): def vars_for_template(player): return dict( correct=player.Choice_2 == 2 ) class Comp5(Page): form_model = "player" form_fields = ["Choice_31", "Choice_32", "Choice_33", "Choice_34"] class Comp6(Page): def vars_for_template(player): return dict( correct=(player.Choice_31 == 32) & (player.Choice_32 == 14) & (player.Choice_33 == 32) & ( player.Choice_34 == 14) ) class Inst1(Page): pass class Inst2(Page): pass class Inst3(Page): pass class Inst4(Page): pass class exmple1(Page): pass class exmple2(Page): pass class EndInst(Page): pass # page_sequence = [Inst1, Inst2, Inst3, Inst4] page_sequence = [Inst1, Inst2, Inst3, Inst4, Comp1, Comp2, Comp3, Comp4, Comp5, Comp6, EndInst]