from otree.api import (
    models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer,
)
import random


author = 'Vytautas Silinskas'

doc = """
Routing app
"""


class Constants(BaseConstants):
    name_in_url = 'intro'
    players_per_group = None
    num_rounds = 1
    apps = [1, 2]
    instructions_template = 'urns_intro/Instructions.html'


class Subsession(BaseSubsession):
    def creating_session(self):
        for p in self.get_players():
            chosen_app = random.choice(Constants.apps)
            p.participant.vars['chosen_app_urns'] = chosen_app


class Group(BaseGroup):
    pass


class Player(BasePlayer):
    pass

