Hi everyone!
I’m trying to create an experiment where participants see a fraction and need to locate it on a visual analogue scale from 0 to 1.
I defined my conditions (my fractions) in an excel-file. I also want to give participants feedback on their rating. So far i tried this code and stored the possible numbers in the excel-file. It works but not ideal !
My Code:
in Stim - each Frame
if rating.getRating() == CorrectAns or rating.getRating() == CorrectAns1 or rating.getRating() == CorrectAns2:
rating.corr = 1
else:
rating.corr = 0
In feedback select begin experiment:
nRespCorr = 0
nRespIncorr = 0
Begin Routine
if rating.corr == 1:
nRepsCorr = 1
nRepsIncorr = 0
else:
nRepsCorr = 0
nRepsIncorr = 1
Is it possible to give a range rather than a specific number? Since it’s hard to get the exact possible ratings from the VAS this would be a much more precise way to tell the participant how exact their rating was.
Ah, that’ll be because either CorrectAns or rating.getRating() is a numpy.float64 object and not a number. To get the value itself, just add .item() to the end, e.g. CorrectAns.item(), as this is the command for numpy objects which extracts their numeric value.