Win10
v2022.2.5
I need to give participants feedback during an experiment.
During the training trials routine, I would like to have it where if the participant selects the wrong key that it will go to a different image saying “oops”, then they press space to go to the next training trial.
For the main experiment, there will be timed feedback, which I think I can do in the same routine as the main stimuli (as in, timed image, and response availability, then new image comes up where you can only press spacebar to continue). However, if I can’t get that to work, then whatever I do here for feedback could be replicated for the target trials.
But for the “you got it wrong” feedback, I tried following the code advice given to someone else for something that was similar, but it’s not working (“correct/incorrect feedback using images” Correct/incorrect feedback using images - #2 by B.D.5).
No matter what key I press on the training, it always sends me to the “you got it wrong” image. I checked my key presses on my spreadsheet, and they are recording correctly. The correct images are pulling, everything else about it works fine.
Is there a way to get it so that the feedback only shows if it’s wrong, otherwise it just continues to the next trial?
I know I’m doing something wrong (obviously since it isn’t working), so any help would be appreciated.
I would prefer to do this in builder, as my python coding is super rusty.
Hello linguisticky
do you mind showing us how you try to achieve this, e.g. screenshots of the relevant routine and the code-component. Did you by any change forget to add a $-sign in the correct answer parameter?
Best wishes Jens
Hopefully the images show up.
I had it without the caps initially, and it still played the routine regardless of the answer.
So I looked at the link and opened the experiment downloads that were provided in the link I included, and their code had it with the caps.
So either way it’s not working
Hello
when there is a spelling error, it might be ignore by Psychopy. The proper syntax is the one provide by @wakecarter Ok, do you mind showing us how you specify KeyCorrect in your Excel-file or submit/upload a toy-version of your experiment (delete all routines irrelevant to the problem here, discard components that need images, upload a shortened version of the Excel-file) here.
Do you want feedback for the incorrect trials only?
Best wishes Jens
I’m going to try rebuilding from scratch with just a text component (so that I can get some sort of feedback that it worked). The drive that the original experiment was created on has become corrupted so I’m just going to start from scratch in the hopes that it works and maybe something else happened to the file and that’s why it’s being strange. (I had the original lower case code and everything initially and it wasn’t working).
So, I’ll make two routines and a loop with a basic excel that just has correct key presses. Then for the second routine I’ll use the following code as a ‘begin routine’ set up:
if (whatever key response it is.corr == 1):
continueRoutine = False
I’ll see what happens and then if that doesn’t work I’ll upload that here so that you all can look at it.
Apologies if I’ve been less than helpful, dealing with the corruption has thrown my timeline off so I haven’t been able to really trouble shoot this as actively as I wanted to, as I’ve had to remake all my stimuli.
I will update once I try just a basic set up.
Hello lingusticky
sorry to hear about your file corruption problem. Did you use a cloud drive? PsychoPy (Pavlovia) and cloud drives don’t go along well. In any case,
key_resp.corr
is a boolean variable, so it is True when the correct key has been pressed, False when the incorrect key has been pressed and None (undefined) when no key has been pressed. Therefore, there is no need to test for a specific value
if not key_resp.keys:
msg="You failed to respond"
elif key_resp.corr:
msg = "correct"
else:
msg="incorrect"
should do the trick. The first if checks whether the participant has responded or not. If this is true the expression evaluates as false and proceeds to the following elif. If a participant has responded with the correct key, this evaluates as True and the message is set, if not the message defined in the last else is set.
Success Jens.