I am interested in how I can pull a value from my conditions file, and use it in my code to determine what kind of feedback to give.
I am running multiple trials (my loop is called ‘trials’), each trial corresponds to a row in my ‘Conditions’ file. In my conditions file, I have a column called, “Feedback”. Values in this column can be either ‘correct’ or ‘incorrect’.
If I am in a trial where the feedback type is ‘correct’ I want one type of message presented, if it is ‘incorrect’ I want another. This is an example of the code I have tried in my code builder:
if trials["Feedback"] == 'Correct': msg = "You got some behaviors correct" elif trials["Feedback"] == "Incorrect": msg = "You got some behaviors incorrect" else: msg = "you made a mistake in coding"
The error message I get is: TypeError: ‘TrialHandler’ object is not subscriptable
What am I doing wrong? How can I use the text in my conditions file to determine what message to display? Thank you so much for any help or guidance!