from otree.api import * doc = """ Question that lets you select multiple options (multi-select, multiple choice / multiple answer) The difference is that this one lets you customize the label of each checkbox, and requires at least 1 to be selected. """ class C(BaseConstants): NAME_IN_URL = 'multi_select_complex' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): q1Yes = models.BooleanField(blank=False) q1No = models.BooleanField(blank=True) q2Yes = models.BooleanField(blank=False) q2No = models.BooleanField(blank=True) answer1 = models.StringField(blank=True) q3Yes = models.BooleanField(blank=False) q3No = models.BooleanField(blank=True) answer2 = models.StringField(blank=True) offer_1 = models.IntegerField(widget=widgets.RadioSelectHorizontal, label=" anspruchsvoll (1)__________________ einfach (7) ", choices=[1,2,3,4,5,6,7]) offer_2 = models.IntegerField(widget=widgets.RadioSelectHorizontal, label=" langweilig (1)_________________ unterhaltsam (7) ", choices=[1,2,3,4,5,6,7]) offer_3 = models.IntegerField(widget=widgets.RadioSelectHorizontal, label=" anstrengend (1)_______________entspannend (7) ", choices=[1,2,3,4,5,6,7]) offer_4 = models.IntegerField(widget=widgets.RadioSelectHorizontal, label=" anspruchsvoll (1)__________________ einfach (7) ", choices=[1,2,3,4,5,6,7]) offer_5 = models.IntegerField(widget=widgets.RadioSelectHorizontal, label=" langweilig (1)_________________ unterhaltsam (7) ", choices=[1,2,3,4,5,6,7]) offer_6 = models.IntegerField(widget=widgets.RadioSelectHorizontal, label=" anstrengend (1)_______________entspannend (7) ", choices=[1,2,3,4,5,6,7]) offer_7 = models.IntegerField(widget=widgets.RadioSelectHorizontal, label="anspruchsvoll (1)__________________ einfach (7) ", choices=[1,2,3,4,5,6,7]) offer_8 = models.IntegerField(widget=widgets.RadioSelectHorizontal, label=" langweilig (1)_________________ unterhaltsam (7) ", choices=[1,2,3,4,5,6,7]) offer_9 = models.IntegerField(widget=widgets.RadioSelectHorizontal, label=" anstrengend (1)_______________entspannend (7) ", choices=[1,2,3,4,5,6,7]) #q7Yes = models.BooleanField(blank=False) #q7No = models.BooleanField(blank=True) #q8Yes = models.BooleanField(blank=False) #q8No = models.BooleanField(blank=True) analogietraining=models.IntegerField( label="7. Haben Sie bereits vorher schon Analogien gelöst?", choices=[ [0, "nein"], [1, "einmal"], [2, "mehrmals"], ], widget=widgets.RadioSelectHorizontal, ) zahlentraining = models.IntegerField( label="8. Haben Sie bereits vorher schon Zahlenreihen gelöst?", choices=[ [0, "nein"], [1, "einmal"], [2, "mehrmals"], ], widget=widgets.RadioSelectHorizontal, ) answer9 = models.FloatField() answer10 = models.IntegerField() answer11 = models.IntegerField() # PAGES class MyWaitPage(WaitPage): def after_all_players_arrive(group: Group): pass # title and body text for the wait page def title_text(self): return "Bitte warten" def body_text(self): return "Bitte warten Sie, bis das Experiment weitergeht." class MyPage1(Page): form_model = 'player' form_fields = ['offer_1', 'offer_2', 'offer_3'] class MyPage2(Page): form_model = 'player' form_fields = ['offer_4', 'offer_5', 'offer_6'] class MyPage3(Page): form_model = 'player' form_fields = ['offer_7', 'offer_8', 'offer_9'] class MyPage0(Page): form_model = 'player' form_fields = [ 'q1Yes', 'q1No', 'q2Yes', 'q2No', 'q3Yes', 'q3No', 'answer1', 'answer2' ] class MyPage4(Page): form_model = 'player' form_fields = [ 'analogietraining', 'zahlentraining', ] class MyPage5(Page): form_model = 'player' form_fields = ['answer9'] class MyPage6(Page): form_model = 'player' form_fields = ['answer10'] class MyPage7(Page): form_model = 'player' form_fields = ['answer11'] class Final(Page): pass page_sequence = [MyWaitPage,MyPage0 ,MyPage1, MyPage2, MyPage3,MyPage4,MyPage5,MyPage6,MyPage7,Final]