from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup ) from otree.db.models import ForeignKey from slider_task.models import BaseSlider, SliderPlayer author = 'Eveline Vandewal' doc = """ Matching Partners - Reciprocity """ class Constants(BaseConstants): name_in_url = 'RECI2_MPRE' players_per_group = None num_rounds = 2 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(SliderPlayer): consent = models.IntegerField( choices=[ [1, 'Yes'], [2, 'No'] ], widget=widgets.RadioSelect ) reciprocity = models.StringField() colors_reversed = models.IntegerField() q1 = models.IntegerField( choices=[ [1, 'Yes'], [2, 'No'] ], widget=widgets.RadioSelect ) q2 = models.IntegerField() q3 = models.IntegerField() q1_error = models.BooleanField() q2_error = models.BooleanField() q3_error = models.BooleanField() cq_error = models.BooleanField() choice = models.IntegerField( choices=[ [1, 'Option A'], [2, 'Option B'] ], widget=widgets.RadioSelect ) sliders = models.IntegerField() question1a = models.IntegerField( choices=[1, 2, 3, 4, 5, 6, 7], widget=widgets.RadioSelect ) question1b = models.IntegerField( choices=[1, 2, 3, 4, 5, 6, 7], widget=widgets.RadioSelect ) question2a = models.IntegerField( choices=[1, 2, 3, 4, 5, 6, 7], widget=widgets.RadioSelect ) question2b = models.IntegerField( choices=[1, 2, 3, 4, 5, 6, 7], widget=widgets.RadioSelect ) question3a = models.IntegerField( choices=[1, 2, 3, 4, 5, 6, 7], widget=widgets.RadioSelect ) question3b = models.IntegerField( choices=[1, 2, 3, 4, 5, 6, 7], widget=widgets.RadioSelect ) class Slider(BaseSlider): player = ForeignKey( Player, on_delete=models.CASCADE )