from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) from otreeutils.surveys import create_player_model_for_survey, generate_likert_field, generate_likert_table import random author = 'Huanren Zhang' doc = """ Guess participants' reason for defection after mutual cooperation, also elicit second order belief """ doc = """Big 5 personality test""" class Constants(BaseConstants): name_in_url = 'asghar' players_per_group = None num_rounds = 1 action_labels = ['C','D'] # labels for the player's actions instructions_template = 'belief_decision/instructions_template.html' # payoff matrix for each interaction payoff_matrix = { 'EQ-H': [[9,0,10,3],[9,0,10,3]], 'EQ-L': [[6,0,10,3],[6,0,10,3]], 'UNEQ': [[9,0,10,3],[6,0,10,3]], } class Subsession(BaseSubsession): pass class Group(BaseGroup): pass def make_q(label): return models.IntegerField(label=label, choices=[[1,''],[2,''],[3,''],[4,''],[5,''],[6,'']], widget=widgets.RadioSelect) class Player(BasePlayer): inequality_aversion1 = make_q('They disliked the unequal payoff between them and Player 1') other_defection1 = make_q("They believed that Player 1 would choose D") higher_payoff1 = make_q("They wanted to receive a higher payoff") inequality_aversion1g = make_q('They disliked the unequal payoff between them and Player 1') other_defection1g = make_q("They believed that Player 1 would choose D") higher_payoff1g = make_q("They wanted to receive a higher payoff") inequality_aversion = make_q('They disliked the unequal payoff between them and Player 1') other_defection = make_q("They believed that Player 1 would choose D") higher_payoff = make_q("They wanted to receive a higher payoff") inequality_aversiong = make_q('They disliked the unequal payoff between them and Player 1') other_defectiong = make_q("They believed that Player 1 would choose D") higher_payoffg = make_q("They wanted to receive a higher payoff")