from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) author = 'Marco Gutierrez' doc = """ General Final Quiz - MTurk """ class Constants(BaseConstants): name_in_url = 'final_quiz' players_per_group = None num_rounds = 1 timer = 300 survey_payoff = 10 class Subsession(BaseSubsession): pass class Group(BaseGroup): def set_payoffs(self): for p in self.get_players(): p.participant.vars['final_payoff'] += Constants.survey_payoff p.payoff = Constants.survey_payoff class Player(BasePlayer): age = models.IntegerField(label='What is your age?', min=13, max=125) gender = models.StringField( choices=[['Male', 'Male'], ['Female', 'Female']], label='What is your gender?', widget=widgets.RadioSelect, ) survey_timeout = models.IntegerField(initial=0) total_earnings_dollar = models.CharField() strategy = models.LongStringField(label='Please describe the strategy that you used in making your decisions:') problems = models.CharField(label='Did you encounter any problems while completing the task?' ,choices=[['Yes', 'Yes'],['No', 'No']], widget=widgets.RadioSelect) problems_text = models.LongStringField(label='If so, please describe the problems you encountered:', blank=True) satisfaction_with_strat = models.CharField(label='You were satisfied with your strategy:',choices= [['Strongly Agree', 'Strongly Agree'], ['Agree', 'Agree'], ['Neutral', 'Neutral'], ['Disagree', 'Disagree'], ['Strongly Disagree', 'Strongly Disagree']],widget=widgets.RadioSelect) understanding = models.CharField(label='You understood the whole study:',choices= [['Strongly Agree', 'Strongly Agree'], ['Agree', 'Agree'], ['Neutral', 'Neutral'], ['Disagree', 'Disagree'], ['Strongly Disagree', 'Strongly Disagree']],widget=widgets.RadioSelect) understanding_text = models.LongStringField(label='If not, please explain:', blank=True) quiz_earnings = models.CurrencyField() instruction_earnings = models.CurrencyField() game_earnings = models.CurrencyField() survey_earnings = models.CurrencyField() total_earnings = models.CurrencyField() # Hidden field for quiz eval_underst = models.LongStringField(blank=True)