e4c_expe2/settings.py
Johanne Trotin 981d06d34c Expé E4C v6
2025-03-30 12:32:15 +02:00

198 lines
6.4 KiB
Python

from os import environ
# if you set a property in SESSION_CONFIG_DEFAULTS, it will be inherited by all configs
# in SESSION_CONFIGS, except those that explicitly override it.
# the session config can be accessed from methods in your apps as self.session.config,
# e.g. self.session.config['participation_fee']
#### WB MTURK / session config MTurk #########################
mturk_hit_settings = {
'keywords': ['Survey', 'Game', 'Demographics'], # Questionnaire démographique #'Questionnaire', 'Français'
'title': 'Survey (gain $3.0, duration 7 min)',# Questionnaire démographique
'description': 'You can earn up to $3.0 in approximately 7 minutes.', # Questionnaire démographique: Gain de $0.60 pour une durée de 1 minute.
'frame_height': 500,
'template': 'global/mturk_template.html',
'minutes_allotted_per_assignment': 60,
'expiration_hours': 7*24, # 7 days
# 'grant_qualification_id': '3O3C52ZQEUFOKIZH0662Y397HAFSHV',# Mturk reel Exp G-J ###to prevent retakes
# 'grant_qualification_id': '3ZSPHI510NGVHARBJTEPE3ECGE6IJ2', # Sandbox Exp G-J
'grant_qualification_id': '3IMKSS0I9C91UAW9OSPZY1N2EAQW6A' , # Mturk exp Covid
# 'grant_qualification_id': '3LKGAM13UYJQHAONM1Z1QYBBX0W7ES', # Sandbox exp Covid
# 'grant_qualification_id': '3C2W12C2LIJHOP5OLGDWR8T1PGZURB',# Mturk reel Exp Ines
# 'grant_qualification_id': '3MTUBPNNZX0I8DMRLCRIX5T88L6XMM', # Sandbox Exp Ines
'qualification_requirements': [
{
'QualificationTypeId': "00000000000000000071", # que pour expé Ines ##### workers from the US, 00000000000000000071 is the code for a location-based qualification
'Comparator': "EqualTo",
# 'LocaleValues': [{'Country': "FR"}]
'LocaleValues': [{'Country': "US"}]
},
{
# 'QualificationTypeId': "3O3C52ZQEUFOKIZH0662Y397HAFSHV", # Mturk reel Exp G-J ###To prevent a worker from participating in your study twice
# 'QualificationTypeId': "3ZSPHI510NGVHARBJTEPE3ECGE6IJ2", # Sandbox Exp G-J
# 'QualificationTypeId': '3C2W12C2LIJHOP5OLGDWR8T1PGZURB',# Mturk reel Exp Ines
# 'QualificationTypeId': '3MTUBPNNZX0I8DMRLCRIX5T88L6XMM', # Sandbox Exp Ines
'QualificationTypeId': '3IMKSS0I9C91UAW9OSPZY1N2EAQW6A', # Mturk exp Covid
# 'QualificationTypeId':'3LKGAM13UYJQHAONM1Z1QYBBX0W7ES', # Sandbox exp Covid
'Comparator': "DoesNotExist",
}
]
}
#############################################################################
SESSION_CONFIG_DEFAULTS = {
'real_world_currency_per_point': 0.001,# 0.001 pour exp realeffort et exp covid sinon = 1
'participation_fee': 0,# 0.5 # 0 Expé police
'doc': "",
'mturk_hit_settings': mturk_hit_settings,
}
#############################################################################
# # Liste des jeux
# games = [
# 'a3_gp',
# 'b3_bw',
# 'dictator_modif_asso',
# 'dictator_modif_class',
# ]
#
# # Mélanger l'ordre des jeux
# random.shuffle(games)
def custom_app_sequence(num_participants):
# Define the tasks
tasks = ['A', 'B', 'C', 'D']
# Create a list to store randomized sequences for each participant
participant_sequences = []
# Generate a random sequence for each participant
for _ in range(num_participants):
participant_sequence = tasks[:] # Copy the tasks list
shuffle(participant_sequence) # Shuffle the sequence for each participant
participant_sequences.append(participant_sequence)
return participant_sequences
SESSION_CONFIGS = [
dict(
name='exp2_e4c_random',
display_name='exp2_e4c_random',
num_demo_participants=1,
app_sequence=['a3_welcome0',
'a3_welcome',
'a4_questappli',
'a1_en_p1_quest',
'b3_bw_v2', # game 2 (v2)
'a3_gp', # game 1
'b3_bw', # game 2
'dictator_modif_class_v2', # game 4 (v2)
'dictator_modif_asso', # game 3
'dictator_modif_class', # game 4
'a5_survey',
'a1_en_p1_quest_v2', # questionnaire (after)
'a5_questfin',
],
# completionlink=
# 'https://app.prolific.co/submissions/complete?cc=11111111', # prolific
), #
dict(
name='exp2_e4c_random_BOT',
display_name='exp2_e4c_random_BOT',
num_demo_participants=1,
app_sequence=['a3_welcome',
'a1_en_p1_quest',
'b3_bw_v2', # game 2 (v2)
'a3_gp', # game 1
'b3_bw', # game 2
'dictator_modif_class_v2', # game 4 (v2)
'dictator_modif_asso', # game 3
'dictator_modif_class', # game 4
'a5_survey',
'a1_en_p1_quest_v2', # questionnaire (after)
'a5_questfin',
],
# completionlink=
# 'https://app.prolific.co/submissions/complete?cc=11111111', # prolific
use_browser_bots=True,
), #
]
# ISO-639 code
# for example: de, fr, ja, ko, zh-hans
LANGUAGE_CODE = 'en' #en # 'fr' pour Exp Mindfullness et exp police
# e.g. EUR, GBP, CNY, JPY
REAL_WORLD_CURRENCY_CODE = 'USD' # EUR pour Exp Mindfullness
USE_POINTS = True # False
ROOMS = [
dict(
name="labeds",
display_name="labeds",
participant_label_file="_rooms/labeds.txt"
),
# prolific
dict(
name='exp2_e4c_random',
display_name='exp2_e4c_random',
),
]
#ADMIN_USERNAME = 'admin'
ADMIN_USERNAME = 'wael bousselmi'
# for security, best to set admin password in an environment variable
ADMIN_PASSWORD = environ.get('OTREE_ADMIN_PASSWORD')
DEMO_PAGE_INTRO_HTML = """
Here are some oTree games.
"""
# don't share this with anybody.
SECRET_KEY = 'nm5eaornndp(_0bt_64k+03(-f-n%4bir_+==$8i7&-o$th2@)'
# List of additional apps besides otree default apps
INSTALLED_APPS = ['otree', 'a3_welcome', 'a3_gp', 'b3_bw', 'dictator_modif_asso', 'dictator_modif_class']
AWS_ACCESS_KEY_ID = environ.get('AWS_ACCESS_KEY_ID')
AWS_SECRET_ACCESS_KEY = environ.get('AWS_SECRET_ACCESS_KEY')
DEBUG = False