Hope you are well. I would appreciate it if anyone has any insight on this.
I’m trying to create an experiment in which participants are making a decision between two probabilities and two monetary values. They click the key ‘A’ to choose the option on the left and ‘K’ for the option on the right. This is what they see in the ‘Choice’ routine:
Based on their response, we’re trying to provide feedback by bolding the options on the left if ‘A’ is clicked and bolding the options on the right if ‘K’ is clicked. In order to do this we created another ‘Highlight’ routine that follows the ‘Choice’ routine which has the same components as the choice routine (i.e., probabilities and monetary values but no key press componenet) but changes font in a way to provide feedback using code that I pasted in the Begin Routine section of the code component:
keyPressed = event.getKeys()
if keyPressed == ‘a’:
Elif keyPressed == ’k’:
While this code works fine in bolding the right or left options when a key is pressed (i.e., either A or K), the program crashes when no key is pressed. My routine is set to a 6 second time deadline, so when no key is pressed after 6 seconds, I’d want to see nothing highlighted as a way to give them no feedback. How would I add that piece of code to what I currently have?
I appreciate the help.