EEG triggers in Flanker Task

OS Win10 Pro
PsychoPy version v2022.2.5
Standard Standalone? (y/n) Yes
What are you trying to achieve?:
I’m trying to create EEG markers for correct and incorrect answers in Flanker Task.

What did you try to make it work?:
I’ve created in excel corrAns, like: 1=left and 2=right, but then it shows me whether participant answered 1 or 2, and not whether his answer was correct or not. I want to create EEG marker that will simply indicate 1/correct if the participant’s answer is correct or not (doesn’t matter whether it’s right or left).

What specifically went wrong when you tried that?:
I don’t know specifically how to do that. I suppose that creating another variable in excel with conditions would work, but I don’t know how to do that.

Hey,
Do you still collect data or want to do so on already collected data?
If I understand correctly, you have 1 column with the participant’s answer and one column with the correct answer, right?

Hi,
I haven’t begun collecting the data, I’m preparing the experiment.
I have 1 column with the correct answer, and I want to create an EEG marker that will show later in the EEG data file the time and correctness of the answer (so, when the participant clicked an answer and whether it was correct or not).
I hope that’s understandable, if not please let me know then I will specify.

I don’t know which variable defines your correct answer, but you can compare the correct answer to and participant answer. Then, at the end of the trial add this variable to your data sheet.

For example:

# End Routine
answerCorrectness = None

if corrAnswer == chosenAnswer:
    answerCorrectness = True
else:
    answerCorrectness = False

thisExp.addData(" answerCorrectness",  answerCorrectness)

Or, with the Ternary Operator:

answerCorrectness = True if corrAnswer == chosenAnswer else False

thisExp.addData(" answerCorrectness",  answerCorrectness)