from otree.api import * author = 'Marte Abts' doc = """ Introduction """ class Constants(BaseConstants): name_in_url = 'introduction' players_per_group = None num_rounds = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): #rightanswerAcc= models.BooleanField(label='',choices=[True, False]) #rightanswerPay = models.BooleanField(label='',choices=[True, False]) informedconsent = models.BooleanField( label='', choices=[ [True, 'I agree to participate in this study. The study will start shortly.'], [False, 'I do not agree to participate in this study. The study will end here.'], ], widget=widgets.RadioSelect, ) experimentID = models.StringField(label="Please enter your experimental ID here: ") question2=models.IntegerField(label='Q1: What is the effect of current week investments in each area on net income in the current week?', choices=[[1, 'There is no effect in the current week as there is one week delay in realization'],[2,'There is a direct effect in the current week']],widget=widgets.RadioSelect,) question3=models.IntegerField(label='Q2: Which investment region is presently the most attractive?', choices=[[1, 'Region 1'],[2,'Region 2'], [3, 'Region 3'], [4, 'All are as attractive']],widget=widgets.RadioSelect,) question3A = models.IntegerField(label='Q3: You need to invest in multiples of 5 thousand euros.', choices=[[1, 'Correct'], [2, 'Incorrect']],widget=widgets.RadioSelect,) question4 = models.IntegerField(label='Q4: You have ... goal(s).', choices=[[1, 'annual'], [2, 'monthly'], [3, 'quarterly']], widget=widgets.RadioSelect, ) question6 = models.IntegerField(label='Q5: You will receive additional compensation only if you attain the goal.', choices=[[1, 'Correct'], [2, 'Incorrect']],widget=widgets.RadioSelect,) question7 = models.IntegerField(label='Q6: You will receive additional compensation irrespective of whether you attain the goal.', choices=[[1, 'Correct'], [2, 'Incorrect']],widget=widgets.RadioSelect,) question8 = models.IntegerField(label='Q7: Your additional compensation equals 6 euros.',choices=[[1, 'Correct'], [2, 'Incorrect']], widget=widgets.RadioSelect, ) question9 = models.IntegerField(label='Q7: Your potential additional compensation equals 12 euros.',choices=[[1, 'Correct'], [2, 'Incorrect']], widget=widgets.RadioSelect, ) question10 = models.IntegerField(label='Q7: Your potential additional compensation equals 1 euro per monthly goal and you have 12 goals in total.',choices=[[1, 'Correct'], [2, 'Incorrect']], widget=widgets.RadioSelect, ) def get_categories(self): if self.participant.vars['treatment'] == 'evalpast': self.participant.vars['purpose'] = 'eval' self.participant.vars['orientation'] = 'past' if self.participant.vars['treatment'] == 'evalfuture': self.participant.vars['purpose'] = 'eval' self.participant.vars['orientation'] = 'future' if self.participant.vars['treatment'] == 'develpast': self.participant.vars['purpose'] = 'devel' self.participant.vars['orientation'] = 'past' if self.participant.vars['treatment'] == 'develfuture': self.participant.vars['purpose'] = 'devel' self.participant.vars['orientation'] = 'future' if self.participant.vars['treatment'] == 'none': self.participant.vars['purpose'] = 'no' self.participant.vars['orientation'] = 'no' #PAGES class Welcome(Page): form_model = 'player' form_fields = ['experimentID'] class InformedConsent(Page): form_model = 'player' form_fields = ['informedconsent'] class BlockDropouts(Page): def is_displayed(player: Player): return player.informedconsent == False class WelcomeScreen(Page): timeout_seconds = 0.0000000001 def before_next_page(player: Player, timeout_happened): player.get_categories() print('def_get_categories') def is_displayed(player): return player.round_number == 1 class Instructions(Page): def is_displayed(player): return player.round_number == 1 page_sequence = [Welcome, # InformedConsent, #BlockDropouts, #WelcomeScreen, Instructions ]