from otree.api import * import random doc = """ Your app description """ class C(BaseConstants): NAME_IN_URL = 'RCTIntrotoASCD' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass def creating_session(subsession): import random if subsession.round_number == 1: for player in subsession.get_players(): player.time_pressure = random.choice([2, 3, 4]) #Please change it based on which treatment you would like to include print('set time_pressure to', player.time_pressure) class Group(BaseGroup): pass class Player(BasePlayer): time_pressure = models.IntegerField() Usability = models.StringField( choices=[ ['1', 'Very difficult'], ['2', 'Difficult'], ['3', 'Neutral'], ['4', 'Easy'], ['5','Very easy'] ], label='Please select the statement that best aligns with your district.', widget=widgets.RadioSelect) # Perception = models.LongStringField( # label="Can you summarize in a few sentences what ASCD's Professional Learning Services main focus and activities are?" # ) # Web_attention = models.LongStringField( # label="Please paste the link to the “Meet your Partner” section of the site here: " # ) # PAGES # class RCT_web(Page): # form_model = "player" # form_fields =[ # "Usability", # "Perception", # "Web_attention"] # @staticmethod # def is_displayed(player): # return player.time_pressure == 1 class RCT_control(Page): form_model = "player" @staticmethod def is_displayed(player): return player.time_pressure == 2 class RCT_Benevolence(Page): form_model = "player" @staticmethod def is_displayed(player): return player.time_pressure == 3 class RCT_Integrity(Page): form_model = "player" @staticmethod def is_displayed(player): return player.time_pressure == 4 # class RCT_Competence(Page): # form_model = "player" # # @staticmethod # def is_displayed(player): # return player.time_pressure == 5 page_sequence = [RCT_control,RCT_Benevolence,RCT_Integrity]