psychopy.org | Reference | Downloads | Github

None as a correct response and Feedback Issues in AX-CPT

Hey Guys,

ISSUE 1:
I’ve been trying to create the AX-CPT task with the builder and the coder. To make life simpler, I decided to try it only on the coder. I’ve gotten to a point where it all works great except when I try to elicit a Go/No-Go type response with the corrAns set to ‘None’.

In the attached trial types excel sheet you’ll see how I wrote ‘None’ as a correct answer for the non AX trials. Whenever I reach a trial that is not AX the experiment shuts down with this error:

TypeError: float argument required, not list

If I replace ‘None’ with an actual keypress the program works fine. But, I don’t want to elicit a response when it’s a non AX task.

I’ve got the probabilities already set in the excel and the randomizer method in the trial ensures that I pick out from a ‘deck of cards’. So… I’m so close to getting this right.

ISSUE2:
I can’t get the feedback routine to work either. I want it to provide positive feedback when they got the answer correct and negative feedback when incorrect. I thought this would be easy, but with the None not working, I’ve tried other methods. But, still no luck.
axcpt_trialTypes.xlsx (27.7 KB)
axcpt_2.psyexp (10.1 KB)

Any help would be greatly appreciated!! Thanks so much!

Hello Rob, there are a number of issues here, but they are all minor.

(1) I had thought that PsychoPy converted the string of characters 'None' to the Python object None in conditions files, but that actually doesn’t appear to happen here. What you need to do is clear all the cells containing 'None' so they are blank. That way, PsychoPy does seem to correctly interpret that those responses should be None (i.e. a non-response) rather than the literal string of characters 'None'.

(2) Remove 'None' from the list of valid responses in your keyboard component. It’s not doing any harm, except that there is no valid key literally called 'None', so listing it isn’t doing anything more than specifying some other non-valid string, like octopus. We don’t actually need to somehow specify a non-response as an option, as the trial will simply automatically time out after two seconds, with no response recorded.

(3) On your feedback routine, shift the code component so that it appears above the text component (by right clicking on the icon and selecting move up). This is because the code needs to be executed before the text component. Otherwise, the $msg variable gets updated after the text component is displayed, which means that the feedback will always be lagging behind by one trial (i.e. there would be no feedback on the first trial, trial 2 would give the feedback for trial 1, and so on).

(4) The error you were receiving was because on a trial where no response is given, key_resp_2.rt returns an empty list (indicating no response was obtained), rather than a floating point number for a valid reaction time. So you need to change your feedback code to distinguish between correct keypresses and correct non-responses, as follows:

if key_resp_2.corr: #stored on last run routine
    if corrAns is not None:
        msg = "Correct! RT=%.3f seconds" %(key_resp_2.rt) # display the reaction time
    else:
        msg = "Correct!"  # there is no reaction time
else:
    msg="Oops! That was wrong"