from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range, ) import random class Constants(BaseConstants): name_in_url = 'wtp_c' 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_ca = WTP("What is your minimum acceptable payoff for information about: 'The way crocodiles are treated for producing meat' ?") WTP_ce = WTP("What is your minimum acceptable payoff for information about: 'The impact of crocodile farming on the environment' ? ") WTP_ch = WTP("What is your minimum acceptable payoff for information about: 'The effects of consuming crododile on health' ?") # variables for WTP draw and results see WTP_Beef and WTP_Croc in pages.py WTP_drawn_c = models.IntegerField() offer_c = models.FloatField() infodraw_c = models.IntegerField() info_draw_c_string = models.StringField() aor_c = models.StringField() # money = models.IntegerField() # online_points = models.IntegerField()