Hi there,
I have a manipulation check in my experiment. This check is based on five ratings m1, m2, m3, m4, m5
using the slider component. The correct responses are m1=4, m2=2, m3=3, m4=4, m5=1
.
After participants have made their ratings a code component checks the ratings. If correct the routine will end, if not correct a msg will be shown that the participants have to re-evaluate their ratings.
What I did so far:
Begin of experiment
msg=''
Each frame:
if 'escape' in keys:
core.quit()
if 'space' in keys:
completed_ratings = 0
for slider in [m1, m2, m3, m4, m5]:
if slider.getRating() is not None:
completed_ratings = completed_ratings + 1
if completed_ratings == 5 and m1.response == 4 and m2.response == 2 and m3.response == 3 and m4.response == 4 and m5.response == 1:
continueRoutine = False
else:
msg="Wrong! Please check your answers"
(credits to this thread as well: HERE)
The ratings in the csv-file are stored in columns called m1.response
and so on. But the sessions ends and returns the following error:
if completed_ratings == 5 and m1.response == 4 and m2.response == 2 and m3.response == 3 and m4.response == 4 and m5.response == 1:
AttributeError: 'Slider' object has no attribute 'response'