from os import environ from boto.mturk import qualification import otree.settings import pandas as pd SENTRY_DSN = environ.get('SENTRY_DSN') # BASE_DIR = os.path.dirname(os.path.abspath(__file__)) # the environment variable OTREE_PRODUCTION controls whether Django runs in # DEBUG mode. If OTREE_PRODUCTION==1, then DEBUG=False # if environ.get('OTREE_PRODUCTION') not in {None, '', '0'}: # DEBUG = False # else: # DEBUG = True ADMIN_USERNAME = 'admin' # for security, best to set admin password in an environment variable ADMIN_PASSWORD = environ.get('OTREE_ADMIN_PASSWORD') BROWSER_COMMAND = 'firefox' # don't share this with anybody. SECRET_KEY = '{{ secret_key }}' # To use a database other than sqlite, # set the DATABASE_URL environment variable. # Examples: # postgres://USER:PASSWORD@HOST:PORT/NAME # mysql://USER:PASSWORD@HOST:PORT/NAME # DATABASES = { # 'default': dj_database_url.config( # default='sqlite:///' + os.path.join(BASE_DIR, 'db.sqlite3') # ) # } # AUTH_LEVEL: # If you are launching a study and want visitors to only be able to # play your app if you provided them with a start link, set the # environment variable OTREE_AUTH_LEVEL to STUDY. # If you would like to put your site online in public demo mode where # anybody can play a demo version of your game, set OTREE_AUTH_LEVEL # to DEMO. This will allow people to play in demo mode, but not access # the full admin interface. # AUTH_LEVEL = environ.get('OTREE_AUTH_LEVEL') # e.g. EUR, CAD, GBP, CHF, CNY, JPY REAL_WORLD_CURRENCY_CODE = 'USD' USE_POINTS = False # ISO-639 code # for example: de, fr, ja, ko, zh-hans LANGUAGE_CODE = 'en' # if an app is included in SESSION_CONFIGS, you don't need to list it here INSTALLED_APPS = ['otree'] # SENTRY_DSN = '' DEMO_PAGE_INTRO_TEXT = """
Studien des Teilprojektes A2 der DFG-Forschergruppe 2104 »Maße der Bedarfsgerechtigkeit, Expertise und Kohärenz«.
Bei Rückfragen oder Problemen können Sie gerne eine Mail an bedarfsgerechtigkeit@uni-oldenburg.de schreiben.
""" ROOMS = [ dict( name='econ101', display_name='Econ 101 class', participant_label_file='_rooms/econ101.txt', ), dict( name='live_demo', display_name='Room for live demo (no participant labels)', ), dict( name='kohaerenz_oldenburg', display_name='Kohärenz-Pilotstudie in Oldenburg', participant_label_file='_rooms/kohaerenz_oldenburg.txt', ), dict( name='kohaerenzIII_hamburg', display_name='Dritte Kohärenzstudie in Hamburg (online)', participant_label_file='_rooms/kohaerenzIII_hamburg.txt', ), dict( name='responsibility_respondi', display_name='Responsibility-Studie (über Respondi)', participant_label_file='_rooms/responsibility_respondi.txt', ) ] SESSION_CONFIG_DEFAULTS = dict( real_world_currency_per_point=0.10, participation_fee=5, num_bots=6, doc="", mturk_hit_settings=dict( keywords='study, easy, choice', title='Survey on Justice', description='In this survey we ask for your opinions on matters of justice', frame_height=500, template='global/mturk_template.html', minutes_allotted_per_assignment=int(environ.get('TIMEOUT_MINUTES', 90)), expiration_hours=7 * 24, qualification_requirements=[ qualification.LocaleRequirement("EqualTo", "US"), # qualification.PercentAssignmentsApprovedRequirement("GreaterThanOrEqualTo", 50), # qualification.NumberHitsApprovedRequirement("GreaterThanOrEqualTo", 5), ], grant_qualification_id=str(environ.get('OWN_QUALIFICATION_ID')) # to prevent retakes ) ) SESSION_CONFIGS = [ dict( name='Bedarfsgerechtigkeit', display_name="Erste Studie zum Thema Bedarfsgerechtigkeit", num_demo_participants=4, app_sequence=['bedarfsgerechtigkeit'] ), dict( name='Bedarfsgerechtigkeit_Folgestudie', display_name="Folgestudie zum Thema Bedarfsgerechtigkeit", num_demo_participants=4, app_sequence=['bedarfsgerechtigkeit3'], ), dict( name='kohaerenz_studie', display_name="Kohärenzstudie", num_demo_participants=10, app_sequence=['kohaerenz'], treatment0=True, treatment1=True, treatment2=True, treatment3=True, treatment10=True, online=False, doc=""" . """ ), dict( name='kohaerenz_studie2', display_name="Kohärenzstudie II", num_demo_participants=28, app_sequence=['kohaerenz2'], treatment1=True, treatment2=True, treatment3=True, online=True, max_participants=5000, doc=""" Hier können die Treatments, die in der Studie einbezogen werden sollen angegeben werden, sowie ob es sich um eine Online-Studie handelt. Zudem kann für Treatment 1 eine zweite, "gebalancete" Version miteinbezogen werden. """, ), dict( name='kohaerenz_studie3', display_name="Kohärenzstudie III", num_demo_participants=12, app_sequence=['kohaerenz3'], treatment1=True, treatment2=True, treatment3=True, online=True, max_participants=5000, doc=""" Hier können die Treatments, die in der Studie einbezogen werden sollen angegeben werden, sowie ob es sich um eine Online-Studie handelt. Zudem kann für Treatment 1 eine zweite, "gebalancete" Version miteinbezogen werden. """, ), dict( name='responsibility', display_name="Responsibility Studie", num_demo_participants=12, app_sequence=['respondi_quotas', 'responsibility'], number_of_treatments=2, include_treatment_1=True, include_treatment_2=True, is_respondi_study=False, is_oldenburg_study=False, switch_after_first_block=False, switch_after_every_question=False, respondi_url=str(environ.get('RESPONDI_URL')), quota_male=50, # 0.5048, quota_female=50, # 0.4952, quota_diverse=0, # 0.0, quota_age_18_to_29=21, # 0.2065, quota_age_30_to_39=18, # 0.1858, quota_age_40_to_49=19, # 0.1908, quota_age_50_to_59=24, # 0.2377, quota_age_60_to_69=18, # 0.1793, quota_income_less_than_1100=20, # 0.2, quota_income_1100_to_1500=20, # 0.2, quota_income_1500_to_2000=20, # 0.2, quota_income_2000_to_2600=20, # 0.2, quota_income_more_than_2600=20, # 0.2, total_participants=100, full_BSJO=True, timeout_hours=2.0, # 'display_BSJO=True, # 'online=True, # 'max_participants=5000, doc=""" Responsibility-Studie. """, ), dict( name='typesofneed', display_name="Types of Need Studie", num_demo_participants=12, app_sequence=['respondi_quotas', 'typesofneed'], number_of_treatments=4, include_treatment_1=True, include_treatment_2=True, include_treatment_3=True, include_treatment_4=True, is_respondi_study=False, is_oldenburg_study=False, switch_after_first_block=False, switch_after_every_question=False, respondi_url=str(environ.get('RESPONDI_URL', "www.google.com")), quota_male=50, # 0.5048, quota_female=50, # 0.4952, quota_diverse=0, # 0.0, quota_age_18_to_29=21, # 0.2065, quota_age_30_to_39=18, # 0.1858, quota_age_40_to_49=19, # 0.1908, quota_age_50_to_59=24, # 0.2377, quota_age_60_to_69=18, # 0.1793, quota_income_less_than_1100=20, # 0.2, quota_income_1100_to_1500=20, # 0.2, quota_income_1500_to_2000=20, # 0.2, quota_income_2000_to_2600=20, # 0.2, quota_income_more_than_2600=20, # 0.2, timeout_hours=2.0, participants_per_treatment=100, full_BSJO=True, doc=""" Types of Need-Studie. """, ), dict( name='demos_test', display_name="Demos Test", num_demo_participants=12, app_sequence=['respondi_quotas', 'typesofneed'], number_of_treatments=4, include_treatment_1=True, include_treatment_2=True, include_treatment_3=True, include_treatment_4=True, is_respondi_study=True, is_oldenburg_study=False, switch_after_first_block=False, switch_after_every_question=False, respondi_url=str(environ.get('RESPONDI_URL')), quota_male=1, quota_female=0, quota_diverse=0, # 0.0, quota_age_18_to_29=1, quota_age_30_to_39=0, quota_age_40_to_49=0, quota_age_50_to_59=0, quota_age_60_to_69=0, quota_income_less_than_1100=1, quota_income_1100_to_1500=0, quota_income_1500_to_2000=0, quota_income_2000_to_2600=0, quota_income_more_than_2600=0, participants_per_treatment=1, full_BSJO=True, timeout_hours=0.0041666666666667, # 'display_BSJO=True, # 'online=True, # 'max_participants=5000, diverse_tolerance=1, doc=""" Responsibility-Studie. """, ), ] ma_jan = dict( name='ma_jan', display_name="Masterarbeit Jan", num_demo_participants=12, app_sequence=['ma_jan'], max_quality_fails=1, country_specific_names=False, country="USA", timeout_minutes=int(environ.get('TIMEOUT_MINUTES', 90)), doc=""" Studie Jan """, ) ma_jan_treatments = pd.read_csv('ma_jan/question_data/treatment.csv') for index, row in ma_jan_treatments.iterrows(): ma_jan[f"num_treatment_{row['treatment_number']}"] = row['default_size'] SESSION_CONFIGS.append(ma_jan)