from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) import random from otree.models import player author = 'Dominik' doc = """ This app functions as the after-experiment survey for the trial in MTurk for "OK Computer" """ def make_likert(): return models.IntegerField(widget=widgets.RadioSelectHorizontal, choices=[1, 2, 3, 4, 5, 6, 7], ) class Constants(BaseConstants): name_in_url = 'aftersurvey' players_per_group = None num_rounds = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): test1 = models.IntegerField( choices=[ [0, 'yes'], [1, 'no'] ] ) choice1 = models.IntegerField( ) explanation = models.StringField( ) choice2 = models.IntegerField( ) fair = models.IntegerField(widget=widgets.RadioSelectHorizontal, choices=[1, 2, 3, 4, 5, 6, 7], ) transparent = models.IntegerField(widget=widgets.RadioSelectHorizontal, choices=[1, 2, 3, 4, 5, 6, 7], ) simpler = models.IntegerField(widget=widgets.RadioSelectHorizontal, choices=[1, 2, 3, 4, 5, 6, 7], ) familiar = models.IntegerField(widget=widgets.RadioSelectHorizontal, choices=[1, 2, 3, 4, 5, 6, 7], ) characteristics = models.IntegerField(widget=widgets.RadioSelectHorizontal, choices=[1, 2, 3, 4, 5, 6, 7], ) previous_performance = models.IntegerField(widget=widgets.RadioSelectHorizontal, choices=[1, 2, 3, 4, 5, 6, 7], ) discriminate = models.IntegerField(widget=widgets.RadioSelectHorizontal, choices=[1, 2, 3, 4, 5, 6, 7], ) quickly = models.IntegerField(widget=widgets.RadioSelectHorizontal, choices=[1, 2, 3, 4, 5, 6, 7], ) error = models.IntegerField(widget=widgets.RadioSelectHorizontal, choices=[1, 2, 3, 4, 5, 6, 7], ) other = models.IntegerField(widget=widgets.RadioSelectHorizontal, choices=[1, 2, 3, 4, 5, 6, 7], ) # Define the random variables for the likert randomization x1 = models.IntegerField() x2 = models.IntegerField() x3 = models.IntegerField() x4 = models.IntegerField() x5 = models.IntegerField() def set_x1(self): self.x1 = random.randint(0, 1) def set_x2(self): self.x2 = random.randint(0, 1) def set_x3(self): self.x3 = random.randint(0, 1) def set_x4(self): self.x4 = random.randint(0, 1) def set_x5(self): self.x5 = random.randint(0, 1)