from otree.api import * from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer ) doc = """ Your app description """ class C(BaseConstants): NAME_IN_URL = 'testing' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): fruit = models.StringField() def fruit_choices(player): import random choices = ['apple', 'kiwi', 'mango'] random.shuffle(choices) return choices # PAGES class Page1(Page): form_model = "player" form_fields = ["fruit"] class MyPage(Page): pass class ResultsWaitPage(WaitPage): pass class Results(Page): pass page_sequence = [Page1]