first commit

This commit is contained in:
duartegoncalvesds 2026-03-12 21:05:38 +00:00
commit 73fc2121bf
30 changed files with 13308 additions and 0 deletions

50
Start/__init__.py Normal file
View file

@ -0,0 +1,50 @@
from otree import session
from otree.api import *
doc = """
Landing page with consent.
"""
class C(BaseConstants):
NAME_IN_URL = 'Start'
PLAYERS_PER_GROUP = None
NUM_ROUNDS = 1
class Subsession(BaseSubsession):
pass
class Group(BaseGroup):
pass
class Player(BasePlayer):
consent = models.BooleanField(blank=True)
exp = models.IntegerField()
# FUNCTIONS
# PAGES
class Welcome(Page):
form_model = 'player'
form_fields = ['consent']
@staticmethod
def vars_for_template(player):
return dict(
participation_fee=float(player.session.config['participation_fee']),
max_payment=float(player.session.config['max_payment']),
use_captchas=player.session.config['use_captchas'],
estimated_completion_time=player.session.config['estimated_completion_time'],
# usinstructions = player.session.config['usinstructions'],
)
@staticmethod
def before_next_page(player: Player, timeout_happened):
player.exp = 1
player.participant.vars['exp'] = 1
page_sequence = [Welcome]