from otree.api import * import random import string # import csv doc = """ Your app description """ ########################################################################################################### ################################## MODELS ################################ ########################################################################################################### class Constants(BaseConstants): name_in_url = 'session_1_start_munich' players_per_group = None num_rounds = 1 days_single = 14 days_double = 28 base_payment = 14 extra_payoff = 6 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): Melessa_ID = models.StringField() #num_tasks = models.IntegerField() consent = models.BooleanField(initial=True) ########################################################################################################### ################################## PAGES ################################ ########################################################################################################### class GeneralInstructions(Page): form_model = 'player' form_fields = ['Melessa_ID'] @staticmethod def before_next_page(player: Player, timeout_happened): player.participant.melessa_id = player.Melessa_ID class Consent(Page): def is_displayed(player): return player.round_number == 1 form_model = 'player' form_fields = [ 'consent' ] @staticmethod def error_message(player:Player, values): if values['consent'] == False: return 'You need to give consent to participate in this study.' class Part1(Page): pass page_sequence = [#Consent, GeneralInstructions, Part1, ]