from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range, ) import random author = 'Your name here' doc = """ Your app description """ class Constants(BaseConstants): name_in_url = 'part1' players_per_group = None num_rounds = 1 question_sets = ['set1','set2','set3','set4','set5','set6','set7','set8','set9'] num_rounds = len(question_sets) + 1 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.question_sets, round_numbers)) class Group(BaseGroup): pass def make_field(label): return models.StringField( choices = ['Option A', 'Option B'], label = label, widget = widgets.RadioSelect) class Player(BasePlayer): q1 = make_field('According to the payoff table above, which of Option A or B do you prefer?') q2 = make_field('According to the payoff table above, which of Option A or B do you prefer?') q3 = make_field('According to the payoff table above, which of Option A or B do you prefer?') q4 = make_field('According to the payoff table above, which of Option A or B do you prefer?') q5 = make_field('According to the payoff table above, which of Option A or B do you prefer?') q6 = make_field('According to the payoff table above, which of Option A or B do you prefer?') q7 = make_field('According to the payoff table above, which of Option A or B do you prefer?') q8 = make_field('According to the payoff table above, which of Option A or B do you prefer?') q9 = make_field('According to the payoff table above, which of Option A or B do you prefer?') q10 = make_field('According to the payoff table above, which of Option A or B do you prefer?') q11 = make_field('According to the payoff table above, which of Option A or B do you prefer?') q12 = make_field('According to the payoff table above, which of Option A or B do you prefer?') q13 = make_field('According to the payoff table above, which of Option A or B do you prefer?') q14 = make_field('According to the payoff table above, which of Option A or B do you prefer?') q15 = make_field('According to the payoff table above, which of Option A or B do you prefer?') q16 = make_field('According to the payoff table above, which of Option A or B do you prefer?') q17 = make_field('According to the payoff table above, which of Option A or B do you prefer?') q18 = make_field('According to the payoff table above, which of Option A or B do you prefer?') q19 = make_field('According to the payoff table above, which of Option A or B do you prefer?') q20 = make_field('According to the payoff table above, which of Option A or B do you prefer?') q21 = make_field('According to the payoff table above, which of Option A or B do you prefer?') q22 = make_field('According to the payoff table above, which of Option A or B do you prefer?') q23 = make_field('According to the payoff table above, which of Option A or B do you prefer?') q24 = make_field('According to the payoff table above, which of Option A or B do you prefer?') q25 = make_field('According to the payoff table above, which of Option A or B do you prefer?') q26 = make_field('According to the payoff table above, which of Option A or B do you prefer?') q27 = make_field('According to the payoff table above, which of Option A or B do you prefer?') q28 = make_field('According to the payoff table above, which of Option A or B do you prefer?') q29 = make_field('According to the payoff table above, which of Option A or B do you prefer?') q30 = make_field('According to the payoff table above, which of Option A or B do you prefer?')