from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range, ) author = 'Your name here' doc = """ Your app description """ class Constants(BaseConstants): name_in_url = 'my_simple_survey' players_per_group = 1 num_rounds = 2 tasks = ['A', 'B', 'C'] num_rounds = len(tasks) choice_list = [[12,'C',c(10), 20,'C',c(0)],[11,'B',c(5), 12,'C',c(0)]] class Subsession(BaseSubsession): def creating_session(self): if self.round_number == 1: for p in self.get_players(): round_numbers = list(range(1, Constants.num_rounds+1)) random.shuffle(round_numbers) p.participant.vars['task_rounds'] = dict(zip(Constants.tasks, round_numbers)) class Group(BaseGroup): pass class Player(BasePlayer): feet = models.IntegerField() inches = models.IntegerField() age = models.IntegerField() rt_year = models.IntegerField()