ianchadd / va

Code for gender + virtual assistants project
Other
1 stars 0 forks source link

in VA slider app, include check for how many VA turns ended up being "correct" #13

Closed ianchadd closed 1 year ago

ianchadd commented 1 year ago

For context, this is to incentivize the subject to pay attention to how frequently the VA is "helpful". I'll add an instructions page at the beginning of this app to tell them to keep track of how many correct moves they made.

maddy0314 commented 1 year ago

Done. See variable pt1qbonus in settings.py, guess_correct and va_correct in models.py, and new page Debrief.html.

ianchadd commented 1 year ago

Debrief page initially works, I submitted a guess, but then got this KeyError. Please address this before I close this issue.

KeyError at /p/346cjwun/pt1_VA2/Debrief/4/ 'participate' Request Method: POST Request URL: http://localhost:8000/p/346cjwun/pt1_VA2/Debrief/4/ Django Version: 2.2.4 Exception Type: KeyError Exception Value: 'participate' Exception Location: /Users/chaddi/va/pt99/pages.py in is_displayed, line 8 Python Executable: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 Python Version: 3.7.6 Python Path: ['/Users/chaddi/va', '/Library/Frameworks/Python.framework/Versions/3.7/lib/python37.zip', '/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7', '/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload', '/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages'] Server time: Wed, 29 Mar 2023 17:07:49 +0200

ianchadd commented 1 year ago

Traceback: `Environment:

Request Method: POST Request URL: http://localhost:8000/p/346cjwun/pt1_VA2/Debrief/4/

Django Version: 2.2.4 Python Version: 3.7.6 Installed Applications: ['otree', 'django.contrib.auth', 'django.forms', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'channels', 'huey.contrib.djhuey', 'idmap', 'custom_templates', 'django.contrib.humanize', 'otreeutils', 'radiogrid', 'slider_puzzle', 'Introduction', 'pt4', 'slider_training', 'pt1_VA2', 'pt3', 'pt99', 'pt2grp', 'survey_va_pilot', 'pt2', 'pt1grp', 'pt0', 'slider_individual'] Installed Middleware: ['otree.middleware.CheckDBMiddleware', 'otree.middleware.perf_middleware', 'whitenoise.middleware.WhiteNoiseMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware']

Traceback:

File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/otree/views/abstract.py" in _is_displayed

  1. is_displayed = self.is_displayed()

File "/Users/chaddi/va/pt99/pages.py" in is_displayed

  1. return self.participant.vars['participate'] == 0

Exception Type: KeyError at /p/346cjwun/pt1_VA2/Debrief/4/ Exception Value: 'participate' `

maddy0314 commented 1 year ago

This was an issue in pt99 which I haven't written over yet. I just pushed a commit that stops it from fatal erroring like that.

maddy0314 commented 1 year ago

This has been done for a long time, and pt99 isn't even running in the pilot. It's just legacy code from whatever experiment we borrowed the initial program from, so I'm closing this issue.