Description of the problem: Offline, the experiment worked well but after trying to run it on Pavlovia the Wisconsin card sort task part I only get the “incorrect” message no matter if the answer is correct or not. I’ve tried some troubleshooting but as I’m new to coding I think I may just have a huge mess!
If anyone can take a look I’d really appreciate it
Please could you show your code related to the feedback?
Code for the feedback is (in python, it’s been automatically changed in the program for auto>JS):
msg = ‘’
if (corrAns == 1):
if (trials.thisTrialN) == 10:
trials.finished = True
Is this in Begin Routine of the routine with the response?
How are you setting corrAns?
thisTrialN doesn’t work online.
I have a routine for “trial” and for “feedback” in the same loop.
The code for the trial part is:
if currentLoop.thisN == 0: # reset on the first trial
n_consecutive = 0
for stimulus in [one_red_dot, two_yellow_triangles, three_green_crosses, four_blue_stars]:
print(stimulus.image, corrAns, stimulus.image==corrAns, type(stimulus.image), type(corrAns))
if stimulus.image == corrAns:
corrAns = 1
continueRoutine = False
n_consecutive = n_consecutive + 1
if n_consecutive == 5:
currentLoop.finished = True
n_consecutive = 0
Save this in the data to check things are working OK:
(I’m sorry if I’m not giving you the right answers to your questions but I’m not 100% sure on coding!)
You seem to be using corrAns for three different things.
- Is it a column in your Excel file
- You are trying to set it to 1 if the correct stimulus is clicked. Use a different variable for this and set it to 0 in Begin Routine.
- You seem to also have a keyboard response and I think you mean if key_resp.corr (which should be 1 if the keyboard response is correct).