If this template helps then use it. If not then just delete and start from scratch.
OS: macOS Catalina
PsychoPy version: 2020.2.5
Standard Standalone? Yes
What are you trying to achieve?:
I would like to output different color text based on a conditional. I have a csv with the variable corrAns, populated with yes and no’s. I would like to output Yes in green if the corrAns == ‘yes’ and No in red if it equals ‘no’.
What have you tried?:
clr = ‘white’
If row[corrAns] == ‘yes’:
clr = “green”
feedback = ‘YES’
clr = “red”
feedback = ‘NO’
I then input $clr in the Color box of the text component
What specifically went wrong when you tried that?:
I’ve messed around with a few variations, it sometimes says Clr isn’t defined, and i’m not sure how else to define it. Sometimes it quits without an error.