from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range, ) doc = """ author: wb """ class Constants(BaseConstants): name_in_url = 'exp_u1ss_fp_mt_part6' players_per_group = None num_rounds = 1 percent1 ="40%" percent2 = "60%" multiple = 3 multiple2= 0 endowT5 = 1000 # task 5 taux = 0.003 # 1000 coins = $3 bonus = 500 # ancien bonus1 = 150 # pour screener 1 bonus2 = 150 # pour screener 2 bonus1_2 = 300 # somme bonus 1 & 2 # var CRT crt_correct_a = 2 crt_correct_b = 0.25 crt_correct_c = 5 crt_correct_d = 4 crt_correct_e = 29 crt_correct_f = 20 gaincrtcorrect = 200 # gain par bonne réponse (CRT) showupfee = 0.4 # +0.1 dans le settings class Subsession(BaseSubsession): def vars_for_admin_report(self): report = list() for p in self.get_players(): report.append(dict(id=p.participant.id_in_session, label=p.participant.label, gain_task1_f = p.gain_task1_f, gain_task2_f = p.gain_task2_f, gain_task3_f=p.gain_task3_f, gain_task4_f=p.gain_task4_f, gain_task5_f=p.gain_task5_f, gain_task6_f=p.gain_task5_f, eliminated=p.eliminated, treatment = p.treatment, tirageausort=p.tirageausort, gain_final=p.gain_final, gain_final_et_bonus=p.gain_final_et_bonus, gain_final_eur = p.gain_final_eur, gain_final_eur_plus_showup = p.gain_final_eur_plus_showup, )) return dict(report=report) class Group(BaseGroup): pass class Player(BasePlayer): treatment = models.IntegerField( label="", blank=True ) qc_a = models.IntegerField( max=10000, min=0, label="", blank=False ) qc_b = models.IntegerField( max=10000, min=0, label="", blank=False ) qc_c = models.IntegerField( max=10000, min=0, label="", blank=False ) invest_risk = models.IntegerField( max=1000, min=0, label="", blank=False ) invest_riskfree = models.IntegerField( max=1000, min=0, label="", blank=False ) tirage1 = models.FloatField( ) gain_task5 = models.FloatField() tirageausort = models.IntegerField() gain_task1_f = models.FloatField() gain_task2_f = models.FloatField() gain_task3_f = models.FloatField() gain_task4_f = models.FloatField() gain_task5_f = models.FloatField() gain_task6_f = models.FloatField() # gain_task7_f = models.FloatField() ### var CRT task_start_18 = models.FloatField() task_time_18 = models.FloatField() crt_a = models.FloatField( blank=True ) crt_b = models.FloatField( blank=True ) crt_c = models.FloatField( blank=True ) crt_d = models.FloatField( blank=True ) crt_e = models.FloatField( blank=True ) crt_f = models.FloatField( blank=True ) gain_crt = models.FloatField(initial=0) gain_final = models.FloatField() gain_final_et_bonus = models.FloatField() gain_final_eur = models.FloatField() gain_final_eur_plus_showup = models.FloatField() num_post = models.FloatField() #gain_expe1 = models.FloatField() eliminated = models.IntegerField() gaineliminated = models.FloatField()