class Group(BaseGroup): # variables that change for each group treatment_endowment = models.IntegerField() treatment_treatment = models.TextField() a_takes = models.DecimalField(min=0, max=100, max_digits=5, decimal_places=2) total_taken = models.CurrencyField() b_predicts = models.PositiveIntegerField(min=0, max=100) b_willing = models.DecimalField(min=0, max_digits=6, decimal_places=3) b_message = models.TextField() b_message_price = models.DecimalField(max_digits=5, decimal_places=2) price_method = models.TextField() price_display = models.TextField() b_eligible = models.BooleanField() target_income = models.DecimalField(max_digits=5, decimal_places=2) reader_index = models.IntegerField() def final_pay(self): p1 = self.get_player_by_id(1) p2 = self.get_player_by_id(2) p1.final_reward = self.treatment_endowment+ p1.task_reward + self.total_taken if self.price_method != 'WTA': if self.b_eligible: p2.final_reward = self.treatment_endowment+ p2.task_reward - self.total_taken - self.b_message_price else: p2.final_reward = self.treatment_endowment + p2.task_reward - self.total_taken else: # WTA if self.b_eligible: p2.final_reward = self.treatment_endowment + p2.task_reward - self.total_taken else: # gave up right to send message p2.final_reward = self.treatment_endowment + p2.task_reward - self.total_taken + self.b_message_price def reader_pay(self): for p in self.get_players(): p.final_reward = self.treatment_endowment + p.task_reward
class Player(BasePlayer): q1_first_game_judge_surprised = models.PositiveIntegerField( min=1, max=5, widget=widgets.SliderInput(show_value=False)) q1_first_game_judge_satisfied = models.PositiveIntegerField( min=1, max=5, widget=widgets.SliderInput(show_value=False)) q1_first_game_judge_upset = models.PositiveIntegerField( min=1, max=5, widget=widgets.SliderInput(show_value=False)) q1_players_helping_each_other = models.PositiveIntegerField( min=1, max=5, widget=widgets.SliderInput(show_value=False)) q1_team_spirit_or_cohesion = models.PositiveIntegerField( min=1, max=5, widget=widgets.SliderInput(show_value=False)) q1_important_presented_image_of_and_to_yourself = models.PositiveIntegerField( min=1, max=5, widget=widgets.SliderInput(show_value=False)) q1_important_maximum_and_fair_resources_to_everyone = models.PositiveIntegerField( min=1, max=5, widget=widgets.SliderInput(show_value=False)) q1_important_other_members_trust_in_you = models.PositiveIntegerField( min=1, max=5, widget=widgets.SliderInput(show_value=False)) q1_important_not_you_maximum_and_fair_resources_to_everyone = models.PositiveIntegerField( min=1, max=5, widget=widgets.SliderInput(show_value=False)) q1_trust_do_you_have_into_other_members = models.PositiveIntegerField( min=1, max=5, widget=widgets.SliderInput(show_value=False)) q1_how_much_do_you_like_the_other_team_members = models.PositiveIntegerField( min=1, max=5, widget=widgets.SliderInput(show_value=False)) q1_how_good_do_you_understand_solving = models.PositiveIntegerField( min=1, max=5, widget=widgets.SliderInput(show_value=False)) q1_how_good_do_the_other_group_members_understand_solving = models.PositiveIntegerField( min=1, max=5, widget=widgets.SliderInput(show_value=False)) q1_how_to_improve_the_groups_behavior_to_maximize_resources = models.TextField( ) q1_which_strategy_would_you_follow_and_why = models.TextField() q1_if_communicate_what_would_you_say_and_why = models.TextField()
class Player(otree.models.BasePlayer): # <built-in> subsession = models.ForeignKey(Subsession) group = models.ForeignKey(Group, null=True) # </built-in> def set_payoff(self): self.payoff = 0 # example field q_race = models.CharField( initial=None, choices=RACE_CHOICES, verbose_name="Ethnicity origin (or Race): Please specify your ethnicity" ) q_age = models.PositiveIntegerField(verbose_name="What is your age?", choices=range(13, 125), initial=None) q_gender = models.CharField(initial=None, choices=['Female', 'Male'], verbose_name="What is your gender?", widget=widgets.RadioSelect()) q_education = models.CharField( initial=None, choices=EDUCATION_CHOICES, verbose_name= "Education: What is the highest degree or level of school you have completed?", ) q_household = models.CharField( initial=None, choices=HOUSEHOLD_CHOICES, verbose_name="Marital Status: What is your marital status", ) q_gpa = models.CharField( blank=True, verbose_name="If you are a student, what is your gpa?") q_professional = models.CharField( initial=None, choices=PROFESSIONAL_CHOICES, verbose_name="Employment Status: Are you currenly...?", ) q_decision = models.TextField( initial=None, verbose_name= "Can you explain in few words what guided your decision to invest or not invest in the Group Account?" ) q_comments = models.TextField( blank=True, initial=None, verbose_name= "Do you have any comment, questions, or complains about today's experiment?" )
class Subsession(BaseSubsession): reader_message = models.TextField() debug_mode = models.BooleanField() vid_url = models.TextField() def before_session_starts(self): group_matrix = [] empty_messages = [] readers = max(self.session.config['readerSelection']) for reader in range(0, readers): empty_messages.append([]) # print(empty_messages) # print(reader) self.reader_message = json.dumps(empty_messages) for grouping in self.session.config["group"]: print(grouping) # assigns groups based on array values in cofig group_matrix.append(grouping) self.set_group_matrix(group_matrix) self.debug_mode = self.session.config['debug'] unparsed_video = self.session.config['video'] vid_url = unparsed_video.split('v=')[1] i = 0 for groupx in self.get_groups(): groupx.treatment_endowment = self.session.config['endowment'][i] groupx.treatment_treatment = self.session.config['treatment'][i] groupx.target_income = self.session.config['targetIncome'][i] groupx.reader_index = self.session.config['readerSelection'][i] groupx.price_method = self.session.config['method'][i] for user in groupx.get_players(): user.p_role = self.session.config['role'][i][user.id_in_group-1] # user.task_reward = user.participant.vars['task_income'] # user.intermediate_reward = user.participant.vars['task_income'] + groupx.treatment_endowment if groupx.treatment_treatment == 'FM': groupx.b_eligible = True groupx.b_message_price = 0 else: if self.session.config['price'][i] == -1: # -1 is encoding for random price groupx.b_message_price = random.randrange(0, 300) / 100 # list vs cont only applies with WTP or WTA, not SOP groupx.price_display = self.session.config['priceDisplay'][i] else: groupx.b_message_price = self.session.config['price'][i] i += 1 # message price is different (random) for every group print("finished set up before session starts")
class Player(BasePlayer): q3_second_game_surprised = models.PositiveIntegerField( min=1, max=5, widget=widgets.SliderInput(show_value=False)) q3_second_game_satisfied = models.PositiveIntegerField( min=1, max=5, widget=widgets.SliderInput(show_value=False)) q3_second_game_upset = models.PositiveIntegerField( min=1, max=5, widget=widgets.SliderInput(show_value=False)) q3_help_each_other_in_the_second_game = models.PositiveIntegerField( min=1, max=5, widget=widgets.SliderInput(show_value=False)) q3_team_spirit = models.PositiveIntegerField( min=1, max=5, widget=widgets.SliderInput(show_value=False)) q3_recommendations_of_actions_to_maximize_everyones_resources = models.PositiveIntegerField( min=1, max=5, widget=widgets.SliderInput(show_value=False)) q3_i_follow_recommendations_of_action_followed = models.PositiveIntegerField( min=1, max=5, widget=widgets.SliderInput(show_value=False)) q3_i_follow_recommendations_of_action_my_advantage = models.PositiveIntegerField( min=1, max=5, widget=widgets.SliderInput(show_value=False)) q3_others_follow_recommendations_of_action_followed = models.PositiveIntegerField( min=1, max=5, widget=widgets.SliderInput(show_value=False)) q3_others_follow_recommendations_of_action_their_advantage = models.PositiveIntegerField( min=1, max=5, widget=widgets.SliderInput(show_value=False)) q3_yopinion_if_they_followed_would_everyone_max_his_resources = models.PositiveIntegerField( min=1, max=5, widget=widgets.SliderInput(show_value=False)) q3_second_game_different_and_is_it_because_of_the_communication = models.TextField( ) q3_the_best_strategy_to_optimize_everyones_resources = models.TextField() q3_gender = models.CharField(choices=["Male", "Female"], widget=widgets.RadioSelectHorizontal()) q3_birthday = models.DateField(widget=widgets.Input()) q3_main_subject_in_university = models.TextField() q3_already_take_part_in_a_problem_solving = models.BooleanField( widget=widgets.RadioSelectHorizontal()) q3_experiment_itself_was_interessting = models.PositiveIntegerField( min=1, max=5, widget=widgets.SliderInput(show_value=False)) q3_were_you_personally_engaged_achieving_good_results = models.PositiveIntegerField( min=1, max=5, widget=widgets.SliderInput(show_value=False)) q3_dificult_understanding_and_solving_the_problem = models.PositiveIntegerField( min=1, max=5, widget=widgets.SliderInput(show_value=False)) q3_was_it_obvious_what_to_do = models.PositiveIntegerField( min=1, max=5, widget=widgets.SliderInput(show_value=False)) q3_short_feedback = models.TextField()
class Player(BasePlayer): q2_communication_surprised = models.PositiveIntegerField(min=1, max=5, widget=widgets.SliderInput(show_value=False)) q2_communication_satisfied = models.PositiveIntegerField(min=1, max=5, widget=widgets.SliderInput(show_value=False)) q2_communication_upset = models.PositiveIntegerField(min=1, max=5, widget=widgets.SliderInput(show_value=False)) q2_how_did_you_talk_about_the_cleaning = models.CharField( max_length=255, widget=widgets.RadioSelect(), choices=["The group created strict rules when to clean.", "More or less rules when to clean.", "Several cleaning possibilities were mentioned without staying with one.", "Without cleaning possibilites given by the group members, I found myself easier doing it next time better.", "Cleaning behaviors were mentioned without helping me judge how to improve next time.", "The issure 'Toilet cleaning' or behavior in game wasn't mentioned at all."]) q2_recomendation_for_actions = models.TextField() q2_communication_helped_positive_and_negative = models.TextField() q2_opinion_recomendation_everyone = models.PositiveIntegerField(min=1, max=5, widget=widgets.SliderInput(show_value=False)) q2_opinion_recomendation_fair = models.PositiveIntegerField(min=1, max=5, widget=widgets.SliderInput(show_value=False)) q2_opinion_recomendation_max_resources = models.PositiveIntegerField(min=1, max=5, widget=widgets.SliderInput(show_value=False)) q2_opinion_recomendation_understandable = models.PositiveIntegerField(min=1, max=5, widget=widgets.SliderInput(show_value=False)) q2_pressure_behaving_like_settled_rules = models.PositiveIntegerField(min=1, max=5, widget=widgets.SliderInput(show_value=False)) q2_would_it_disturb_you_behaving_differently = models.PositiveIntegerField(min=1, max=5, widget=widgets.SliderInput(show_value=False)) q2_is_there_any_kind_of_social_pressure = models.PositiveIntegerField(min=1, max=5, widget=widgets.SliderInput(show_value=False)) q2_i_will_follwow_the_recommendation_entirely = models.PositiveIntegerField(min=1, max=5, widget=widgets.SliderInput(show_value=False)) q2_i_will_follwow_the_recommendation_maximizing_my_advantage = models.PositiveIntegerField(min=1, max=5, widget=widgets.SliderInput(show_value=False)) q2_others_follow_the_recommendations_entirely = models.PositiveIntegerField(min=1, max=5, widget=widgets.SliderInput(show_value=False)) q2_others_follow_the_recommendations_try_to_max_their_advantage = models.PositiveIntegerField(min=1, max=5, widget=widgets.SliderInput(show_value=False)) q2_how_much_cooperate_because_communication = models.PositiveIntegerField(min=1, max=5, widget=widgets.SliderInput(show_value=False)) q2_team_spirit = models.PositiveIntegerField(min=1, max=5, widget=widgets.SliderInput(show_value=False)) q2_afterc_importance_of_your_image = models.PositiveIntegerField(min=1, max=5, widget=widgets.SliderInput(show_value=False)) q2_afterc_importance_maximum_resources_to_everyone = models.PositiveIntegerField(min=1, max=5, widget=widgets.SliderInput(show_value=False)) q2_afterc_importance_other_members_trust_in_you = models.PositiveIntegerField(min=1, max=5, widget=widgets.SliderInput(show_value=False)) q2_afterc_importance_maximum_resources_to_everyone_not_you = models.PositiveIntegerField(min=1, max=5, widget=widgets.SliderInput(show_value=False)) q2_afterc_how_much_trust_do_you_have_into_other_members = models.PositiveIntegerField(min=1, max=5, widget=widgets.SliderInput(show_value=False)) q2_afterc_how_much_do_you_like_the_other_team_members = models.PositiveIntegerField(min=1, max=5, widget=widgets.SliderInput(show_value=False)) q2_afterc_how_good_you_understand_solving_problem_max_resources = models.PositiveIntegerField(min=1, max=5, widget=widgets.SliderInput(show_value=False)) q2_afterc_others_understand_solving_problem_great_max_resources = models.PositiveIntegerField(min=1, max=5, widget=widgets.SliderInput(show_value=False)) q2_which_strategy_would_you_follow_and_why = models.TextField()
class Player(BasePlayer): my_entity = models.CharField( choices=Constants.c_entity, verbose_name="De quelle entité avez-vous la responsabilité?", widget=widgets.RadioSelect()) # Phase 1 nb_mcf1 = models.IntegerField(min=0, max=10) nb_mcf2 = models.IntegerField(min=0, max=10) nb_mcf3 = models.IntegerField(min=0, max=10) nb_mcffinal = models.IntegerField(min=0, max=10) # Phase 2 salaire_moyen = models.IntegerField(min=0) nb_mcf_avec_salaire_moyen = models.IntegerField(min=0) # Phase 3 hff = models.IntegerField(min=0, max=240) cout_vacation_avec_hff = models.IntegerField(min=0, max=180000) # GlobalResults cout_total = models.IntegerField(min=0) recettes = models.TextField( verbose_name="Quelle(s) source(s) de financement imaginez-vous?") commentaires = models.TextField(blank=True, verbose_name="Commentaires libres:")
class Player(BasePlayer): debriefing_guess_which_group = models.CharField( max_length=255, widget=widgets.RadioSelect(), choices=[ 'Gruppe mit Anweisungen für alle zu positiver Kommunikation', 'Gruppe mit Konfident mit positiver Kommunikation', 'Gruppe mit Konfident mit negativer Kommunikation', 'Kontrollgruppe ohne eigentliche Anweisungen', 'Weiss nicht' ]) debriefing_sure_about_confidant_in_group = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) debriefing_who_was_confidant = models.CharField( max_length=255, widget=widgets.RadioSelect(), choices=[]) what_made_you_assume_confidant = models.TextField(default='n/a') debriefing_feedback = models.TextField() # confidant confidant_debriefing_feedback = models.TextField()
class Message(models.Model): group = models.ForeignKey(Group) player = models.ForeignKey(Player) message = models.TextField() timestamp = models.DateTimeField(auto_now_add=True) COLORS = {1: "#F249F2", 2: "#60AB4F", 3: "#FCC767", 4: "#FF7979", 5: "#F249F2"} @property def color(self): return Message.COLORS[self.player.id_in_group]
class Player(BasePlayer): # variables that change for each player task_reward = models.DecimalField(max_digits=5, decimal_places=2) intermediate_reward = models.DecimalField(max_digits=5, decimal_places=2) final_reward = models.DecimalField(max_digits=5, decimal_places=2) total_pay = models.DecimalField(max_digits=5, decimal_places=2) p_role = models.TextField() survey_response0 = models.IntegerField() survey_response1 = models.IntegerField() survey_response2 = models.IntegerField() survey_response3 = models.IntegerField() survey_response4 = models.IntegerField() survey_response5 = models.IntegerField() survey_responseA = models.IntegerField() survey_responseB = models.IntegerField() survey_responseC = models.IntegerField() survey_responseD = models.IntegerField() survey_responseE = models.IntegerField() survey_responseF = models.IntegerField() def get_partner(self): return self.get_others_in_group()[0]
class Group(BaseGroup): # Data pour phase 1 nb_mcf_fmm = models.IntegerField(min=0, max=10) nb_mcf_ft = models.IntegerField(min=0, max=10) nb_mcf_fges = models.IntegerField(min=0, max=10) nb_mcf_flsh = models.IntegerField(min=0, max=10) nb_mcf_fd = models.IntegerField(min=0, max=10) nb_mcf_espol = models.IntegerField(min=0, max=10) nb_mcf_santesocial = models.IntegerField(min=0, max=10) nb_mcf_commonhome = models.IntegerField(min=0, max=10) nb_mcf_anthropolab = models.IntegerField(min=0, max=10) # Data agrégées nb_mcf_total = models.IntegerField(min=0) # Data pour phase 2 salaire_moyen_fmm = models.IntegerField(min=0) salaire_moyen_ft = models.IntegerField(min=0) salaire_moyen_fges = models.IntegerField(min=0) salaire_moyen_flsh = models.IntegerField(min=0) salaire_moyen_fd = models.IntegerField(min=0) salaire_moyen_espol = models.IntegerField(min=0) salaire_moyen_santesocial = models.IntegerField(min=0) salaire_moyen_commonhome = models.IntegerField(min=0) salaire_moyen_anthropolab = models.IntegerField(min=0) nb_mcf_avec_salaire_moyen_fmm = models.IntegerField(min=0) nb_mcf_avec_salaire_moyen_ft = models.IntegerField(min=0) nb_mcf_avec_salaire_moyen_fges = models.IntegerField(min=0) nb_mcf_avec_salaire_moyen_flsh = models.IntegerField(min=0) nb_mcf_avec_salaire_moyen_fd = models.IntegerField(min=0) nb_mcf_avec_salaire_moyen_espol = models.IntegerField(min=0) nb_mcf_avec_salaire_moyen_santesocial = models.IntegerField(min=0) nb_mcf_avec_salaire_moyen_commonhome = models.IntegerField(min=0) nb_mcf_avec_salaire_moyen_anthropolab = models.IntegerField(min=0) # Data agrégées salaire_moyen_icl = models.IntegerField(min=0) nb_mcf_avec_salaire_moyen_icl = models.IntegerField(min=0) # Data pour phase 3 hff_fmm = models.IntegerField(min=0, max=240) hff_ft = models.IntegerField(min=0, max=240) hff_fges = models.IntegerField(min=0, max=240) hff_flsh = models.IntegerField(min=0, max=240) hff_fd = models.IntegerField(min=0, max=240) hff_espol = models.IntegerField(min=0, max=240) hff_santesocial = models.IntegerField(min=0, max=240) hff_commonhome = models.IntegerField(min=0, max=240) hff_anthropolab = models.IntegerField(min=0, max=240) cout_vacation_avec_hff_fmm = models.IntegerField(min=0, max=180000) cout_vacation_avec_hff_ft = models.IntegerField(min=0, max=180000) cout_vacation_avec_hff_fges = models.IntegerField(min=0, max=180000) cout_vacation_avec_hff_flsh = models.IntegerField(min=0, max=180000) cout_vacation_avec_hff_fd = models.IntegerField(min=0, max=180000) cout_vacation_avec_hff_espol = models.IntegerField(min=0, max=180000) cout_vacation_avec_hff_santesocial = models.IntegerField(min=0, max=180000) cout_vacation_avec_hff_commonhome = models.IntegerField(min=0, max=180000) cout_vacation_avec_hff_anthropolab = models.IntegerField(min=0, max=180000) # Data agrégées hff_moyen_icl = models.IntegerField(min=0, max=240) cout_vacation_avec_hff_moyen_icl = models.IntegerField(min=0, max=180000) # Data recettes recettes_icl = models.TextField() commentaires_icl = models.TextField() def compute_group_grandes_masses_results1(self): self.nb_mcf_total = 0 for p in self.get_players(): p.nb_mcffinal = p.nb_mcf1 self.nb_mcf_total += p.nb_mcf1 if p.my_entity == 'FMM-SanteSocial': self.nb_mcf_fmm = p.nb_mcf1 elif p.my_entity == 'FT': self.nb_mcf_ft = p.nb_mcf1 elif p.my_entity == 'FGES': self.nb_mcf_fges = p.nb_mcf1 elif p.my_entity == 'FLSH': self.nb_mcf_flsh = p.nb_mcf1 elif p.my_entity == 'FD': self.nb_mcf_fd = p.nb_mcf1 elif p.my_entity == 'Espol': self.nb_mcf_espol = p.nb_mcf1 elif p.my_entity == 'Sante-Social': self.nb_mcf_santesocial = p.nb_mcf1 elif p.my_entity == 'Common-Home': self.nb_mcf_commonhome = p.nb_mcf1 elif p.my_entity == 'Anthropo-Lab': self.nb_mcf_anthropolab = p.nb_mcf1 def compute_group_grandes_masses_results2(self): self.nb_mcf_total = 0 for p in self.get_players(): p.nb_mcffinal = p.nb_mcf2 self.nb_mcf_total += p.nb_mcf2 if p.my_entity == 'FMM-SanteSocial': self.nb_mcf_fmm = p.nb_mcf2 elif p.my_entity == 'FT': self.nb_mcf_ft = p.nb_mcf2 elif p.my_entity == 'FGES': self.nb_mcf_fges = p.nb_mcf2 elif p.my_entity == 'FLSH': self.nb_mcf_flsh = p.nb_mcf2 elif p.my_entity == 'FD': self.nb_mcf_fd = p.nb_mcf2 elif p.my_entity == 'Espol': self.nb_mcf_espol = p.nb_mcf2 elif p.my_entity == 'Sante-Social': self.nb_mcf_santesocial = p.nb_mcf2 elif p.my_entity == 'Common-Home': self.nb_mcf_commonhome = p.nb_mcf2 elif p.my_entity == 'Anthropo-Lab': self.nb_mcf_anthropolab = p.nb_mcf2 def compute_group_grandes_masses_results3(self): self.nb_mcf_total = 0 for p in self.get_players(): p.nb_mcffinal = p.nb_mcf3 self.nb_mcf_total += p.nb_mcf3 if p.my_entity == 'FMM-SanteSocial': self.nb_mcf_fmm = p.nb_mcf3 elif p.my_entity == 'FT': self.nb_mcf_ft = p.nb_mcf3 elif p.my_entity == 'FGES': self.nb_mcf_fges = p.nb_mcf3 elif p.my_entity == 'FLSH': self.nb_mcf_flsh = p.nb_mcf3 elif p.my_entity == 'FD': self.nb_mcf_fd = p.nb_mcf3 elif p.my_entity == 'Espol': self.nb_mcf_espol = p.nb_mcf3 elif p.my_entity == 'Sante-Social': self.nb_mcf_santesocial = p.nb_mcf3 elif p.my_entity == 'Common-Home': self.nb_mcf_commonhome = p.nb_mcf3 elif p.my_entity == 'Anthropo-Lab': self.nb_mcf_anthropolab = p.nb_mcf3 def compute_group_masse_salariale_results(self): # Compute le salaire moyen self.salaire_moyen_icl = 0 self.nb_mcf_avec_salaire_moyen_icl = 0 for p in self.get_players(): self.salaire_moyen_icl += p.salaire_moyen self.nb_mcf_avec_salaire_moyen_icl += p.nb_mcf_avec_salaire_moyen if p.my_entity == 'FMM-SanteSocial': self.salaire_moyen_fmm = p.salaire_moyen self.nb_mcf_avec_salaire_moyen_fmm = p.nb_mcf_avec_salaire_moyen elif p.my_entity == 'FT': self.salaire_moyen_ft = p.salaire_moyen self.nb_mcf_avec_salaire_moyen_ft = p.nb_mcf_avec_salaire_moyen elif p.my_entity == 'FGES': self.salaire_moyen_fges = p.salaire_moyen self.nb_mcf_avec_salaire_moyen_fges = p.nb_mcf_avec_salaire_moyen elif p.my_entity == 'FLSH': self.salaire_moyen_flsh = p.salaire_moyen self.nb_mcf_avec_salaire_moyen_flsh = p.nb_mcf_avec_salaire_moyen elif p.my_entity == 'FD': self.salaire_moyen_fd = p.salaire_moyen self.nb_mcf_avec_salaire_moyen_fd = p.nb_mcf_avec_salaire_moyen elif p.my_entity == 'Espol': self.salaire_moyen_espol = p.salaire_moyen self.nb_mcf_avec_salaire_moyen_espol = p.nb_mcf_avec_salaire_moyen elif p.my_entity == 'Sante-Social': self.salaire_moyen_santesocial = p.salaire_moyen self.nb_mcf_avec_salaire_moyen_santesocial = p.nb_mcf_avec_salaire_moyen elif p.my_entity == 'Common-Home': self.salaire_moyen_commonhome = p.salaire_moyen self.nb_mcf_avec_salaire_moyen_commonhome = p.nb_mcf_avec_salaire_moyen elif p.my_entity == 'Anthropo-Lab': self.salaire_moyen_anthropolab = p.salaire_moyen self.nb_mcf_avec_salaire_moyen_anthropolab = p.nb_mcf_avec_salaire_moyen # Terminer les moyennes self.salaire_moyen_icl /= len(self.get_players()) self.nb_mcf_avec_salaire_moyen_icl /= len(self.get_players()) def compute_group_croissance_intext_results(self): # Compute la décharge moyenne self.hff_moyen_icl = 0 self.cout_vacation_avec_hff_moyen_icl = 0 for p in self.get_players(): self.hff_moyen_icl += p.hff self.cout_vacation_avec_hff_moyen_icl += p.cout_vacation_avec_hff if p.my_entity == 'FMM-SanteSocial': self.hff_fmm = p.hff self.cout_vacation_avec_hff_fmm = p.cout_vacation_avec_hff elif p.my_entity == 'FT': self.hff_ft = p.hff self.cout_vacation_avec_hff_ft = p.cout_vacation_avec_hff elif p.my_entity == 'FGES': self.hff_fges = p.hff self.cout_vacation_avec_hff_fges = p.cout_vacation_avec_hff elif p.my_entity == 'FLSH': self.hff_flsh = p.hff self.cout_vacation_avec_hff_flsh = p.cout_vacation_avec_hff elif p.my_entity == 'FD': self.hff_fd = p.hff self.cout_vacation_avec_hff_fd = p.cout_vacation_avec_hff elif p.my_entity == 'Espol': self.hff_espol = p.hff self.cout_vacation_avec_hff_espol = p.cout_vacation_avec_hff elif p.my_entity == 'Sante-Social': self.hff_santesocial = p.hff self.cout_vacation_avec_hff_santesocial = p.cout_vacation_avec_hff elif p.my_entity == 'Common-Home': self.hff_commonhome = p.hff self.cout_vacation_avec_hff_commonhome = p.cout_vacation_avec_hff elif p.my_entity == 'Anthropo-Lab': self.hff_anthropolab = p.hff self.cout_vacation_avec_hff_anthropolab = p.cout_vacation_avec_hff # Terminer les moyennes self.hff_moyen_icl /= len(self.get_players()) self.cout_vacation_avec_hff_moyen_icl /= len(self.get_players()) def compute_group_recettes_results(self): self.recettes_icl = '' self.commentaires_icl = '' for p in self.get_players(): self.recettes_icl += "\n**********************\n" + p.my_entity + "\n**********************\n" + p.recettes + "\n" self.commentaires_icl += "\n**********************\n" + p.my_entity + "\n**********************\n" + p.commentaires + "\n"
class Player(BasePlayer): # <built-in> subsession = models.ForeignKey(Subsession) group = models.ForeignKey(Group, null=True) # </built-in> # whether bomb is collected or not bomb = models.IntegerField() # location of bomb with row/col info bomb_location = models.TextField() # number of collected boxes boxes_collected = models.IntegerField() # set/scheme of collected boxes boxes_scheme = models.TextField() # --- set round results and player's payoff # ------------------------------------------------------------------------------------------------------------------ round_to_pay = models.IntegerField() round_result = models.CurrencyField() def set_payoff(self): # randomly determine round to pay on player level if self.subsession.round_number == 1: self.session.vars['round_to_pay'] = random.randint( 1, Constants.num_rounds) # determine round_result as (potential) payoff per round if self.bomb == 0: self.round_result = c(self.boxes_collected * Constants.box_value) else: self.round_result = c(0) # set payoffs if <random_payoff = True> to round_result of randomly chosen round if Constants.random_payoff == True: if self.subsession.round_number == self.session.vars[ 'round_to_pay']: self.payoff = self.round_result else: self.payoff = c(0) # set payoffs to round_result if <random_payoff = False> else: self.payoff = self.round_result # --- store values as global variables for session-wide use # ------------------------------------------------------------------------------------------------------------------ def set_globals(self): self.session.vars['bomb'] = [p.bomb for p in self.in_all_rounds()] self.session.vars['bomb_location'] = [ p.bomb_location for p in self.in_all_rounds() ] self.session.vars['boxes_collected'] = [ p.boxes_collected for p in self.in_all_rounds() ] self.session.vars['boxes_scheme'] = [ p.boxes_scheme for p in self.in_all_rounds() ] self.session.vars['round_result'] = [ p.round_result for p in self.in_all_rounds() ] self.session.vars['bret_payoff'] = [ p.payoff for p in self.in_all_rounds() ]
class Player(BasePlayer): q3_second_game_results_surprised = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q3_second_game_results_satisfied = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q3_second_game_results_upset = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q3_second_game_teamwork = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q3_second_game_teamspirit = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q3_communication_inputs_maxresources_how_useful = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q3_followed_communication_inputs = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q3_took_advantage_communication_inputs = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q3_majority_followed_communication_inputs = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q3_majority_took_advantage_communication_inputs = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q3_minority_followed_communication_inputs = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q3_minority_took_advantage_communication_inputs = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q3_how_max_resources_communication_inputs_if_followed = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q3_after_second_round_like_others = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q3_second_round_impressions = models.TextField() q3_best_strategy_to_max_resources = models.TextField() q3_gender = models.CharField(choices=["M", "F"], widget=widgets.RadioSelectHorizontal()) q3_birthday = models.DateField(widget=widgets.Input()) q3_main_subject_in_university = models.TextField() q3_already_take_part_in_a_problem_solving = models.CharField( max_length=255, widget=widgets.RadioSelect(), choices=['Ja', 'Nein']) q3_already_took_part_x_times_for_x_months = models.TextField( default='X Male und das letzte Mal vor X Monaten.') q3_experiment_itself_was_interessting = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q3_were_you_personally_engaged_achieving_good_results = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q3_dificult_understanding_and_solving_the_problem = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q3_was_it_obvious_what_to_do = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q3_count_unclear_questions = models.TextField() q3_unclear_questions_description = models.TextField() q3_technical_issues = models.CharField(max_length=255, widget=widgets.RadioSelect(), choices=['Ja', 'Nein']) q3_technical_issues_details = models.TextField() q3_opinion_about_questions_and_hypotheses = models.TextField() # confidant q3_confidant_second_game_teamwork = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q3_confidant_second_game_teamspirit = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q3_confidant_majority_followed_communication_inputs = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q3_confidant_majority_took_advantage_communication_inputs = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q3_confidant_minority_followed_communication_inputs = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q3_confidant_minority_took_advantage_communication_inputs = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q3_confidant_best_strategy_to_max_resources = models.TextField() q3_confidant_gender = models.CharField( choices=["M", "F"], widget=widgets.RadioSelectHorizontal()) q3_confidant_birthday = models.DateField(widget=widgets.Input()) q3_confidant_main_subject_in_university = models.TextField() q3_confidant_already_take_part_in_a_problem_solving = models.CharField( max_length=255, widget=widgets.RadioSelect(), choices=['Ja', 'Nein']) q3_confidant_already_took_part_x_times_for_x_months = models.TextField( default='X Male und das letzte Mal vor X Monaten.') q3_confidant_experiment_itself_was_interessting = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q3_confidant_were_you_personally_engaged_achieving_good_results = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q3_confidant_dificult_understanding_and_solving_the_problem = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q3_confidant_was_it_obvious_what_to_do = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q3_confidant_count_unclear_questions = models.TextField() q3_confidant_unclear_questions_description = models.TextField() q3_confidant_technical_issues = models.CharField( max_length=255, widget=widgets.RadioSelect(), choices=['Ja', 'Nein']) q3_confidant_technical_issues_details = models.TextField()
class Player(BasePlayer): q2_communication_surprised = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q2_communication_satisfied = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q2_communication_upset = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q2_fair_discussion = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q2_fear_criticism = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q2_communication_to_be_right = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q2_give_opinion = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q2_others_opinions = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q2_communication_whine = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q2_inputs_considered = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q2_best_player = models.CharField(max_length=255, widget=widgets.RadioSelect(), choices=[]) q2_communication_focused = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q2_communication_efficient = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q2_communication_interested_in_solution = models.PositiveIntegerField( min=1, max=5, widget=widgets.SliderInput(show_value=False)) q2_discussion_tense = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q2_discussion_tense_why = models.TextField() q2_chat_instructions_helpful = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q2_chat_instructions_followed = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q2_was_there_negative_participant = models.CharField( max_length=255, widget=widgets.RadioSelect(), choices=['Ja', 'Nein']) q2_negative_participant = models.TextField( default='Fügen Sie hier die Spielernamen hinzu.') q2_was_there_positive_participant = models.CharField( max_length=255, widget=widgets.RadioSelect(), choices=['Ja', 'Nein']) q2_positive_participant = models.TextField( default='Fügen Sie hier die Spielernamen hinzu.') # confidant q2_confidant_followed_chat_intstructions = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q2_confidant_difficulty_chat_instructions = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q2_confidant_problems_chat_instructions = models.TextField() q2_confidant_others_found_out_confidant = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q2_confidant_others_found_out_confidant_why = models.TextField() q2_confidant_pleased_about_being_chosen = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q2_confidant_would_have_participated_if_knew = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q2_confidant_comments_in_general = models.TextField() q2_confidant_influence_inputs = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q2_confidant_inputs_being_ignored_others = models.PositiveIntegerField( min=1, max=10, widget=widgets.SliderInput(show_value=False)) q2_confidant_cleaning_how_to_proceed = models.CharField( max_length=255, widget=widgets.RadioSelect(), choices=[ 'Die Gruppe einigte sich auf klare Regeln, wie sich jeder im Spiel verhalten soll.', 'Es wurde vage vereinbart, wie sich jeder im Spiel verhalten soll.', 'Verschiedene Möglichkeiten, wie sich jeder im Spiel verhalten soll, wurden angesprochen, aber es kam nie zu einer Einigung auf eine der Möglichkeiten.', 'Obschon keine konkreten Möglichkeiten genannt wurden, wie sich jeder im Spiel verhalten soll wurde mir klarer, wie ich meine Entscheidungen verbessern könnte.', 'Es wurde zwar über das Reinigen bzw. Verhalten im Spiel geredet, dies hatte aber keinen Bezug darauf, wie man in weiteren Spielen handeln soll.', 'Das Thema \'Toilettenreinigung\' bzw. Verhalten im Spiel wurde gar nicht angesprochen' ]) q2_confidant_how_to_realize_recommendations = models.TextField()