Cedrus Box response overriden

Hello, Psychopy-ers!

We have put together an experiment where participants read prime-target pairs (presented one word at a time on separate text components) and have to press a button whenever they find a color word (e.g., DOOR-BLUE). So, we have “go” and “no go” trials.

We’re using a Cedrus Box as a response box and we have updated to Psychopy3 release 2020.1, so that we could use multiple buttonbox components. This in itself has not been a problem. Psychopy finds the Cedrus box and responses to both the prime and the target are properly recorded.

The problem has to do with a feedback component we’ve created (see the code below). This component is set up in a different text component from the prime and target. It appears that–when selecting the feedback message–participants’ response to the target overrides their response to the prime. We have four possible types of feedback, depending on participants’ accuracy with the prime and the target. However, if participants are accurate with the prime but not with the target, they get the message they’ve messed up both. And if they are accurate with the target but not with the prime, they get the message they got both right.

The experiment does not crash (so there is no error message). As I said above, the Excel sheet with the data shows that the correct response is recorded for both the prime and the target. But by the time we get to the feedback component, it’s like the response to the prime has been overriden. Initially, we used the keyboard as a response box, and everything worked. It’s when we transitioned to the Cedrus Box that the issue arose, so that must be the culprit. However, we seem unable to get past this issue… So, any suggestions would be highly appreciated.

if Target.corr:
if Prime.corr:

if Prime.corr:
msg: both_incorrect


Hello José

it is best to enclose python-code in triple ` so that one can see the proper code-formatting which is important in python.

There is an error in your last msg: msg: both_incorrect. It has to read msg = both_incorrect. In addition, you need to enclose strings with " which is not in your code-example. I am not the best in simplyfing if-else construction but you might want to try this:

if Target.corr and Prime.corr:
    msg = "both correct"
elif Target.corr and not Prime.corr:
    msg = "target correct"
elif not Target.corr and Prime.corr:
    msg = "prime correct"
    msg = "both incorrect"

Best wishes Jens


Thanks A LOT for giving it a thought!

We just got it to work right before I read your message, so I came here to share it. :slight_smile:

The issue was that, although Prime and Target were different CedrusBox components, they both corresponded to “CedrusBox_0”. So, although accuracy information was correctly recorded for the Prime (and then also for the subsequent Target), by the time participants got to the feedback screen, only the response for the Target was taken into account for providing the feedback.

This is how we solved it: on the two separate screens that included the Prime and the Target components respectively, we created new variables (PrimeCorrect = Prime.corr; TargetCorrect = Target.corr) in a code component located AFTER the CedrusBox component (i.e., Prime and Target). Then we adjusted the code above so that it would run on those variables (because, as I said above, accuracy information was correctly recorded for both the Prime and the Target). And it worked! Probably not very elegant, but it did the trick.

Thanks again!