from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range, ) import random class Constants(BaseConstants): name_in_url = 'wtp' players_per_group = None num_rounds = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass # ATTITUDE QUESTIONS class Player(BasePlayer): #WTP QUESTIONS def WTP(label): return models.IntegerField( choices=[[-75, "-75"], [-50, "-50"], [-25, "-25"], [0, "0"], [25, "+25"], [50, "+50"], [75, "+75"]], label=label, widget=widgets.RadioSelectHorizontal, ) WTP_ba = WTP("What is your minimum acceptable payoff for information about: 'The way cows are treated for beef production' ?") WTP_be = WTP("What is your minimum acceptable payoff for information about: 'The impact of beef production on the environment' ?") WTP_bh = WTP("What is your minimum acceptable payoff for information about: 'The effect of consuming beef on health' ? ") # variables for WTP draw and results see WTP_Beef and WTP_Croc in pages.py WTP_drawn_b = models.IntegerField() offer_b = models.FloatField() infodraw_b = models.IntegerField() info_draw_b_string = models.StringField() aor_b = models.StringField() # money = models.IntegerField() # online_points = models.IntegerField()