from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) from django import forms author = 'Your name here' doc = "" class Constants(BaseConstants): name_in_url = 'Introduction' players_per_group = None num_rounds = 1 instructions_template = 'Introduction/instructions.html' instructions_template2 = 'Introduction/instructions2.html' instructions_template3 = 'Introduction/instructions3.html' instructions_template4 = 'Introduction/instructions4.html' import random import itertools class Subsession(BaseSubsession): def creating_session(self): import itertools colors = itertools.cycle(['yellow', 'orange', 'black', 'white', 'red', 'green']) for p in self.get_players(): p.color = next(colors) p.participant.vars['color'] = p.color from django import forms class Group(BaseGroup): pass class Player(BasePlayer): color = models.StringField()