from otree.api import * #import pandas as pd import csv import random doc = """ Questionnaire """ ################################# ## ###################################################################### class Constants(BaseConstants): name_in_url = 'ExPost_IQ_B' players_per_group = None num_rounds = 1 base_payment=14 extra_payoff=6 Choices= [ [1, 'very unimportant'], [2, 'rather unimportant'], [3, 'neither important nor unimportant'], [4, 'rather important'], [5, 'very important'], ] class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): extrapayofftotal = models.IntegerField() difficulty_iq = models.IntegerField( label='How difficult did you find the test?', choices= [ [1, 'very easy'], [2, 'rather easy'], [3, 'neither difficult nor easy'], [4, 'rather difficult'], [5, 'very difficult'], ], widget=widgets.RadioSelect ) enjoyable_iq = models.IntegerField( label='How enjoyable did you find test?', choices= [[1, 'very unpleasant'], [2, 'somewhat unpleasant'], [3, 'neither enjoyable nor unpleasant'], [4, 'somewhat enjoyable'], [5, 'very enjoyable'], ], widget=widgets.RadioSelect ) concentration_iq = models.IntegerField( label='How much concentration do you think the test requires?', choices=[ [1, 'no concentration at all'], [2, 'little concentration'], [3, 'some concentration'], [4, 'a lot of concentration'], [5, 'very much concentration'], ], widget=widgets.RadioSelect ) tryhard_iq = models.IntegerField( label='How hard did you try to perform well in the test?', choices=[ [1, 'not hard at all'], [2, 'not very hard'], [3, 'rather hard'], [4, 'hard'], [5, 'very hard'], ], widget=widgets.RadioSelect ) egostudy_iq = models.IntegerField( label='How high do you rate the importance of your performance in the test for how well you succeed in your studies?', choices=Constants.Choices, widget=widgets.RadioSelect ) egowork_iq = models.IntegerField( label='How high do you rate the importance of your performance in the test for your success at work?', choices=Constants.Choices, widget=widgets.RadioSelect ) open_feedback = models.LongStringField(blank=True) ################################################################################################################### ################################## PAGES #################################################### ################################################################################################################### class Q1(Page): form_model = 'player' form_fields = ['difficulty_iq', 'enjoyable_iq', 'concentration_iq'] class Q2(Page): form_model = 'player' form_fields = ['tryhard_iq', 'egostudy_iq', 'egowork_iq'] class QOpen(Page): form_model = 'player' form_fields = ['open_feedback'] @staticmethod def before_next_page(player: Player, timeout_happened): player.extrapayofftotal = player.participant.extra_payoff class Part6(Page): pass class LastPage3(Page): pass page_sequence = [ Part6, Q1, Q2, QOpen, LastPage3, ]