from statistics import mean from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range, ) from django import forms import random class Constants(BaseConstants): name_in_url = 'PNormElicitation' players_per_group = None num_rounds = 1 max_points = c(100) # Likert scale categories safe_choices = [ [-2, 'Very Unsafe'], [-1, 'Somewhat Unsafe'], [0, 'Not Sure'], [1, 'Somewhat Safe'], [2, 'Very Safe'] ] likely_choices = [ [-2, 'Very Unlikely'], [-1, 'Somewhat Unlikely'], [0, 'Not Sure'], [1, 'Somewhat Likely'], [2, 'Very Likely'] ] sure_choices = [ [-2, 'Very Unsure'], [-1, 'Somewhat Unsure'], [0, "Do not know"], [1, 'Somewhat sure'], [2, 'Very Safe'] ] effective_choices = [ [-2, 'Very Ineffective'], [-1, 'Somewhat Ineffective'], [0, "Not Sure"], [1, 'Somewhat Effective'], [2, 'Very Effective'] ] familiarity_choices = [ [-2, " Completely Unfamiliar"], [-1, "Somewhat Unfamiliar"], [0, "Unsure"], [1, "Somewhat Familiar"], [2, "Very Familiar"] ] class Subsession(BaseSubsession): pass # # Print the payoffs to verify their values # print("Payoff:", self.individual_payoff) class Group(BaseGroup): pass class Player(BasePlayer): Act1 = models.IntegerField( label="On a scale from 0 to 100, what is the probability that most people will choose to get vaccinated in " "this scenario?", min=0, max=100, blank=False, ) Act2 = models.IntegerField( label="On a scale from 0 to 100, what is the probability that most people perceive vaccines as safe in the " "given scenario?", min=0, max=100, blank=False, ) Act3 = models.IntegerField( label="On a scale from 0 to 100, what is the probability that you will decide to get vaccinated in the given " "scenario?", min=0, max=100, blank=False, ) Act4 = models.IntegerField( label="On a scale from 0 to 100, how confident are you in the safety of vaccines as a means of protection " "against the pandemic in the given scenario?", min=0, max=100, blank=False, ) Act5 = models.IntegerField( label="On a scale from 0 to 100, what is the probability that your work colleagues perceive vaccines as safe " "in the given scenario?", min=0, max=100, blank=False, ) Act6 = models.IntegerField( label="On a scale from 0 to 100, what is the probability that your family members perceive vaccines as safe " "in the given scenario?", min=0, max=100, blank=False, ) Act7 = models.IntegerField( label="On a scale from 0 to 100, what is the probability that your neighbors perceive vaccines as safe in the " "given scenario?", min=0, max=100, blank=False, ) Act8 = models.IntegerField( label="On a scale from 0 to 100, what is the probability that your friends perceive vaccines as safe in the " "given scenario?", min=0, max=100, blank=False, ) Act9 = models.IntegerField( label="On a scale from 0 to 100, how effective do you believe vaccines are in the given scenario?", min=0, max=100, blank=False, ) Act10 = models.IntegerField( label="On a scale from 0 to 100, what is the probability that most people perceive vaccines as effective in " "the given scenario?", min=0, max=100, blank=False, ) Plausibility = models.IntegerField( label="What is the likelihood that the above headline is true?", choices=Constants.likely_choices, widget=widgets.RadioSelectHorizontal, blank=False, ) Familiarity = models.IntegerField( label="Are you familiar with the above headline (have you seen or heard about it before)?", choices=Constants.familiarity_choices, widget=widgets.RadioSelectHorizontal, blank=False, ) # # Post Elicitation # # Act12 = models.IntegerField( # label="What is the likelihood that other people will choose to get vaccinated in this scenario?", # choices=Constants.likely_choices, # widget=widgets.RadioSelectHorizontal, # blank=False, # ) # # Act13 = models.IntegerField( # label="What do other people believe about the safety of vaccines in protection against the pandemic?", # choices=Constants.safe_choices, # widget=widgets.RadioSelectHorizontal, # blank=False, # ) # # Act14 = models.IntegerField( # label="What is the likelihood that you will choose to get vaccinated in the given scenario", # choices=[ # [-2, 'Very Unlikely'], # [-1, 'Somewhat Unlikely'], # [0, 'Not sure'], # [1, 'Somewhat Likely'], # [2, 'Very Likely'] # ], # widget=widgets.RadioSelectHorizontal, # blank=False, # ) # # Act15 = models.IntegerField( # label="How safe do you think vaccines are in protection against the virus?", # choices=Constants.safe_choices, # widget=widgets.RadioSelectHorizontal, # blank=False, # ) # # Act16 = models.IntegerField( # label="How sure are you about your response in the previous question?", # choices=Constants.sure_choices, # widget=widgets.RadioSelectHorizontal, # blank=False, # ) # # Act17 = models.IntegerField( # label="What do your family members think about the safety of vaccines in protection against the pandemic?", # choices=Constants.safe_choices, # widget=widgets.RadioSelectHorizontal, # blank=False, # ) # # Act18 = models.IntegerField( # label="What do your friends think about the safety of vaccines in protection against the pandemic?", # choices=Constants.safe_choices, # widget=widgets.RadioSelectHorizontal, # blank=False, # ) # # Act19 = models.IntegerField( # label="What do your neighbors think about the safety of vaccines in protection against the pandemic?", # choices=Constants.safe_choices, # widget=widgets.RadioSelectHorizontal, # blank=False, # ) # Act20 = models.IntegerField( # label="What do your work colleagues think about the safety of vaccines in protection against the pandemic?", # choices=Constants.safe_choices, # widget=widgets.RadioSelectHorizontal, # blank=False, # ) # Act21 = models.IntegerField( # label="How effective vaccines will be in protection against the virus infection in " # "this situation?", # choices=Constants.effective_choices, # widget=widgets.RadioSelect, # blank=False, # # ) # # Act22 = models.IntegerField( # label="What do most people think about the effectiveness of vaccines in protection against the virus " # "infection in this situation?", # choices=Constants.effective_choices, # widget=widgets.RadioSelect, # blank=False, # # )