from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range, ) import random author = 'Shakil Ayan' doc = """ Lottery App for sorting participants """ class Constants(BaseConstants): name_in_url = 'game_lottery_std' players_per_group = 4 num_rounds = 1 #0 = control; 1 = public-public; 2 = public-private diagnostic_treatment = random.randint(0,2) class Subsession(BaseSubsession): def creating_session(subsession): print(subsession.get_group_matrix()) class Group(BaseGroup): #pass info from qualtrics super_game_ID = models.IntegerField( label="Group ID" ) type_temp = models.IntegerField( label = "", choices = [ [0,'EA'], [1, 'EPC'], [2, 'EPH'] ] ) treatment_temp = models.IntegerField( label = "", choices = [ [0, 'Control'], [1, 'public-public'], [2, 'public-private'] ] ) subtreatment_temp = models.IntegerField( label = "", choices = [ [0, 'non ego-relevant'], [1, 'ego-relevant'], ] ) total_diagnostic = models.IntegerField() eph_elicit_regret = models.IntegerField( label="", choices=[ [1, "Elicit Regret"], [0, "Do not elicit regret"] ] ) ea_fix_belief = models.IntegerField( label="", choices=[ [1,"Fix Belief in EA"], [0,"Ask belief in EA"] ] ) pub_update_sub = models.IntegerField( label="", choices=[ [1,"Public update subsample"], [0,"No Public update subsample"] ] ) d_update_sub = models.IntegerField( label="", choices=[ [1,"Disobedience posterior ER belief subsample"], [0,"No Disobedience posterior ER belief subsample"] ] ) d_likelihood_sub = models.IntegerField( label="", choices=[ [1, "Disobedience likelihood subsample"], [0, "No Disobedience likelihood subsample"] ] ) mood_sub = models.IntegerField( label="", choices=[ [1, "Disobedience likelihood subsample"], [0, "No Disobedience likelihood subsample"] ] ) elicit_c_type = models.IntegerField( label="", choices=[ [1, "Punisher guesses C type"], [0, "Punisher does not guess C type"] ] ) elicit_c_score = models.IntegerField( label="", choices=[ [1, "Punisher guesses C score"], [0, "Punisher does not guess C score"] ] ) class Player(BasePlayer): #pass info from qualtrics enum_name = models.IntegerField( label="Enumerator Name", choices=[ [11, "Tahmina"], [12, "Hasib"], [13, "Poli"], [14, "Momen"], [21, "Dilshad"], [22, "Abul Hossen"], [23, "Anne"], [24, "Quaium"], ] ) #pass info from qualtrics male = models.BooleanField( label="", choices=[ [False, 'female'], [True, 'male'] ] ) #pass info from qualtrics HHID = models.FloatField( label="Household ID" ) PID = models.FloatField( label="Person ID" ) lottery_num_pair = models.IntegerField( label = "Lottery number picked", max = 200, min = 1 ) lottery_num_role = models.IntegerField( label="Lottery number picked", max=200, min=1 ) spouse_lottery_num = models.IntegerField( label = "Spouse Lottery Number Picked", max = 200, min = 1 ) other_man_lottery_num = models.IntegerField( label = "Other HH man Lottery Number", max = 200, min = 1 ) other_woman_lottery_num = models.IntegerField( label = "Other HH woman Lottery Number", max = 200, min = 1 ) opponent_lottery_num_pair = models.IntegerField( label = "Opponent Lottery Number - pair ", max=200, min=1 ) opponent_groupID = models.IntegerField( label = "Opponent group ID" ) opponent_lottery_num_role = models.IntegerField( label="Opponent Lottery Number - role", max=200, min=1 ) group_pos_game = models.IntegerField( label = "Main game position", max=4, min=1 ) game_role = models.IntegerField( label = "Role in the game", choices= [ [1,'Punisher'], [0,'Chooser'] ] ) type = models.IntegerField( label = "", choices = [ [0,'EA'], [1, 'EPC'], [2, 'EPH'] ] ) treatment = models.IntegerField( label = "", choices = [ [0, 'Control'], [1, 'public-public'], [2, 'public-private'] ] ) subtreatment = models.IntegerField( label = "", choices = [ [0, 'non ego-relevant'], [1, 'ego-relevant'] ] ) diagnostic = models.IntegerField( label = "Is it a diagnostic game", choices = [ [0,'NO'], [1,'YES'] ] ) diagnostic_type = models.IntegerField( label="", choices=[ [0, "Not Diagnostic"], [1, "Diagnostic M v M"], [2, "Diagnostic M v W punisher"], [3, "Diagnostic W v W"] ] )