# How to have Correct/Incorrect show on Neuroscan

OS: Windows
10
PsychoPy version:
3.1.2
What are you trying to achieve?
My experiment has 3 conditions where 1 of 3 prompts are presented before 1 of 3 large sets of images, followed by a final trial with a large image set that tests the subjects memory. A python code randomizes the order of images and the order of the 3 prompts and final test. In the final test the subject is asked to make 1 of 2 button presses (y for “Yes I have seen this image before in the experiment” or n for “No I have not seen this image before in the experiment”). I have this code I put into the builder mode that sends which group an image is shown from and when it pops up on Neuroscan:

Begin Experiment:

``````from psychopy import parallel
``````

Begin Routine:

``````a = marker
if a == 11:
b =11
elif  a== 12:
b=12
elif a==13:
b=13
if a == 21:
b =21
elif  a== 22:
b=22
elif a==23:
b=13if a == 31:
b =31
elif  a== 32:
b=32
elif a==33:
b=33
if a == 40:
b =40
elif  a== 50:
b=50
elif a==60:
b=60
elif a ==200
b=200
else:
b=999
parallel.setData(b)
``````

End Routine:

``````parallel.setData(0)
``````

// These numbers correlate to the images that are presented (for example, an image coded with 11 would be an image in the first group of images in the first condition, and so on (I would elaborate, but it is irrelevant to go any further for what I need help with). The problem is, in order to make data easier to aggregate I am trying to also display whether the subject correctly answered whether they have seen the image before or not in the final test. The scoring of correct in the excel sheet is 1 for correct and 0 for incorrect.

What did you try to make it work?:
Begin Routine:

``````a=corrAns
if a==1
b=Correct
elif a==0
b=Incorrect
else:
b=999

parallel.setData(b)
``````

What specifically went wrong when you tried that?:
Nothing beside the number correlated with the image was present.

Hi Carlos, you really need to re-write this post for clarity: It seems to contradict itself in terms of what code you used, and the purpose of the code is not at all clear. It might help to think about this from the perspective a naive reader (like me), who is trying to understand your situation but has nothing to go on other than what you’ve written here.

Dear Michael,

Thank you for getting back to me, I will try to make my post more clearly:

What are you trying to achieve:

In the Builder View there is an option for custom code to be placed into the experiment, I currently have a code that sends a message to Neuroscan stating what trial each image is coming from (this number shows at the bottom of the Neuroscan screen in real time), so that when I process the Neuroscan data I know the exact moment the image was shown and from which category the image belongs to (the code for that is the first set of code posted above). I am attempting to also have PsychoPy send 1 of 2 messages to Neuroscan through the Builder View’s code option. This is a memory experiment, so in the final trial of the experiment there is a recognition task that asks whether the subject has seen the image previously in the experiment with 2 button press options. The correct answer for the question is in the excel sheet attached to Psychopy with the heading “corrAns”. I am trying to have “Correct” or “Incorrect” shown at the bottom of the Neuroscan screen just as the number does that correlates to the image. The button presses are either “y” for “Yes, I have seen this image in the experiment previously” or “n” for “No, I have not seen this image in the experiment previously”. The output files from PsychoPy has a 1 in the corrAns column for correct button presses, and a 0 for incorrect button presses. The code I have tried is under the “What did you try to make it work?” heading in my previous post. Please let me know if this is still not clear, I appreciate your time on this matter.

Carlos