from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range, ) from django.db import models as django_models from otree.models import Participant from django.db.models.signals import post_save from django.dispatch import receiver from random import randint import time class Constants(BaseConstants): name_in_url = 'survey' players_per_group = None num_rounds = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): clear_rules = models.IntegerField( choices=[[1, '1 - fully disagree'], [2, '2 - disagree'], [3, '3 - neutral'], [4, '4 - agree'], [5, '5 - fully agree']], label='The rules of the karma interaction were clear.', widget=widgets.RadioSelectHorizontal, ) clear_purpose = models.IntegerField( choices=[[1, '1 - fully disagree'], [2, '2 - disagree'], [3, '3 - neutral'], [4, '4 - agree'], [5, '5 - fully agree']], label='The purpose of the karma interaction was clear.', widget=widgets.RadioSelectHorizontal, ) difficulty = models.IntegerField( choices=[[1, '1 - fully disagree'], [2, '2 - disagree'], [3, '3 - neutral'], [4, '4 - agree'], [5, '5 - fully agree']], label='It was easy to find a good bidding strategy.', widget=widgets.RadioSelectHorizontal, ) fairness = models.IntegerField( choices=[[1, '1 - fully disagree'], [2, '2 - disagree'], [3, '3 - neutral'], [4, '4 - agree'], [5, '5 - fully agree']], label='Karma is fairer than money for allocating shared resources.', widget=widgets.RadioSelectHorizontal, ) use_roads = models.IntegerField( choices=[[1, '1 - fully disagree'], [2, '2 - disagree'], [3, '3 - neutral'], [4, '4 - agree'], [5, '5 - fully agree']], label='Granting access to regulated fast roads (instead of toll roads)', widget=widgets.RadioSelectHorizontal, ) use_ride_hailing = models.IntegerField( choices=[[1, '1 - fully disagree'], [2, '2 - disagree'], [3, '3 - neutral'], [4, '4 - agree'], [5, '5 - fully agree']], label='Allocating ride-sharing app trips during supply shortage (instead of surge-pricing)', widget=widgets.RadioSelectHorizontal, ) use_last_mile = models.IntegerField( choices=[[1, '1 - fully disagree'], [2, '2 - disagree'], [3, '3 - neutral'], [4, '4 - agree'], [5, '5 - fully agree']], label='Integrating limited number of free e-scooters/bikes in public transit', widget=widgets.RadioSelectHorizontal, ) use_first_class = models.IntegerField( choices=[[1, '1 - fully disagree'], [2, '2 - disagree'], [3, '3 - neutral'], [4, '4 - agree'], [5, '5 - fully agree']], label='Allocating first class airline seats', widget=widgets.RadioSelectHorizontal, ) use_internet = models.IntegerField( choices=[[1, '1 - fully disagree'], [2, '2 - disagree'], [3, '3 - neutral'], [4, '4 - agree'], [5, '5 - fully agree']], label='Getting faster internet service occasionally for free', widget=widgets.RadioSelectHorizontal, ) use_meetings = models.IntegerField( choices=[[1, '1 - fully disagree'], [2, '2 - disagree'], [3, '3 - neutral'], [4, '4 - agree'], [5, '5 - fully agree']], label='Reserving meeting rooms', widget=widgets.RadioSelectHorizontal, ) use_restaurants = models.IntegerField( choices=[[1, '1 - fully disagree'], [2, '2 - disagree'], [3, '3 - neutral'], [4, '4 - agree'], [5, '5 - fully agree']], label='Reserving restaurants', widget=widgets.RadioSelectHorizontal, ) info_urgency = models.IntegerField( choices=[[1, '1 - fully disagree'], [2, '2 - disagree'], [3, '3 - neutral'], [4, '4 - agree'], [5, '5 - fully agree']], label='Your current urgency', widget=widgets.RadioSelectHorizontal, ) info_karma = models.IntegerField( choices=[[1, '1 - fully disagree'], [2, '2 - disagree'], [3, '3 - neutral'], [4, '4 - agree'], [5, '5 - fully agree']], label='Your current karma', widget=widgets.RadioSelectHorizontal, ) info_urgency_prob = models.IntegerField( choices=[[1, '1 - fully disagree'], [2, '2 - disagree'], [3, '3 - neutral'], [4, '4 - agree'], [5, '5 - fully agree']], label='The urgency probabilities', widget=widgets.RadioSelectHorizontal, ) info_other_bid = models.IntegerField( choices=[[1, '1 - fully disagree'], [2, '2 - disagree'], [3, '3 - neutral'], [4, '4 - agree'], [5, '5 - fully agree']], label='The opponent\'s bid after every round', widget=widgets.RadioSelectHorizontal, ) info_karma_redistribution = models.IntegerField( choices=[[1, '1 - fully disagree'], [2, '2 - disagree'], [3, '3 - neutral'], [4, '4 - agree'], [5, '5 - fully agree']], label='The average karma redistribution after every round', widget=widgets.RadioSelectHorizontal, ) info_average_karma = models.IntegerField( choices=[[1, '1 - fully disagree'], [2, '2 - disagree'], [3, '3 - neutral'], [4, '4 - agree'], [5, '5 - fully agree']], label='The average amount of karma in the system (which equals the initial amount)', widget=widgets.RadioSelectHorizontal, ) info_others_urgency = models.IntegerField( choices=[[1, '1 - fully disagree'], [2, '2 - disagree'], [3, '3 - neutral'], [4, '4 - agree'], [5, '5 - fully agree']], label='That all participants have the same urgency probabilities as you', widget=widgets.RadioSelectHorizontal, ) info_num_others = models.IntegerField( choices=[[1, '1 - fully disagree'], [2, '2 - disagree'], [3, '3 - neutral'], [4, '4 - agree'], [5, '5 - fully agree']], label='The number of other participants', widget=widgets.RadioSelectHorizontal, ) text_bidding_strategy = models.LongStringField( label='Please briefly describe the bidding strategy that you followed during the experiment', ) text_comments = models.LongStringField( label='Please provide any other comments', blank=True, ) # 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, # ) # crt_bat = models.IntegerField( # label=''' # A bat and a ball cost 22 dollars in total. # The bat costs 20 dollars more than the ball. # How many dollars does the ball cost?''' # ) # crt_widget = models.IntegerField( # label=''' # "If it takes 5 machines 5 minutes to make 5 widgets, # how many minutes would it take 100 machines to make 100 widgets?" # ''' # ) # crt_lake = models.IntegerField( # label=''' # In a lake, there is a patch of lily pads. # Every day, the patch doubles in size. # If it takes 48 days for the patch to cover the entire lake, # how many days would it take for the patch to cover half of the lake? # ''' # )