Frame for an image untill keypress

Dear all

My task

Two (boarder less) images appear on the white screen- one at the top (’$loc_1’ in ‘condition.xlsx’ file) and one at the bottom (’$loc_2’ in ‘condition’ file). After 250 milliseconds, I want one of these images to have a border (a red frame) until a correct response key is pressed. The designated keys are ‘up’, ‘down’.That is, if the '$loc_1 is framed/highlighted the ‘up’ key should be pressed and $loc_2 is highlighted, ‘down’ key should be pressed. I have included a column in the condition file as ‘highlight’ which suggests which one of this image should have the highlight, and ‘CorrAns’ has the correct answer.

Problem 1:
How do I get the particular image location to be highlighted (with a red frame) as indicated in condition file under column ‘highlight’ ?
I have not tried anything on this yet.
Problem 2:

I want the trial to end only if the correct response key is pressed.

I tried adding something in ‘Begin routine’ of code
#############
keyResponses=event.getKeys(‘up’,‘down’)
isCollecting=True

and in ‘Each Frame’
if keyResponses==eval(CorrAns):
continueRoutine=False
########################
This gave me this error.

Problem 3:

I want a ‘+’ mark appearing for 500 ms after every three rows on the condition file is completed.

Thanks

Kuppu

Any help is appreciated

Thanks
kuppu