from otree.api import * c = cu doc = 'Survey for the break' class C(BaseConstants): NAME_IN_URL = 'survey' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 TASKS = ('ambiguity', 'choice') class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): risk = models.IntegerField(choices=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], widget=widgets.RadioSelect) intertemporal = models.IntegerField(choices=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], widget=widgets.RadioSelect) trust = models.IntegerField(choices=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], widget=widgets.RadioSelect) financialrisk = models.IntegerField(choices=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], widget=widgets.RadioSelect) financial_literacy = models.IntegerField(choices=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], widget=widgets.RadioSelect) trust_ai = models.IntegerField(choices=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], widget=widgets.RadioSelect) trust_human = models.IntegerField(choices=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], widget=widgets.RadioSelect) familiar_ai = models.IntegerField(choices=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], widget=widgets.RadioSelect) familiar_human = models.IntegerField(choices=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], widget=widgets.RadioSelect) class Start(Page): form_model = 'player' class Questionnaire(Page): form_model = 'player' form_fields = ['risk', 'intertemporal', "trust", "financialrisk", "financial_literacy"] class Questionnaire_2(Page): form_model = 'player' form_fields = ['trust_ai', 'trust_human', "familiar_ai", "familiar_human"] class NextTask(Page): form_model = 'player' timeout_seconds = 1 # 90 @staticmethod def app_after_this_page(player: Player, upcoming_apps): participant = player.participant if participant.second_task == C.TASKS[0]: return f'{C.TASKS[0]}_task_2' else: return f'{C.TASKS[1]}_task_2' page_sequence = [Start, Questionnaire, Questionnaire_2, NextTask]