End a routine when mouse is not clicked but time is over

Hi Larissa,
Would this not again wait 10s before presenting the ‘Tempo Esgotado!’ feedback? It is hard to be sure how this sequence is structured (it would help to use the </> function when writing your code), but as far as I understand you have one Trial Routine where you check for clicks and end the routine if there is no response within 10s, and one Feedback Routine where you give feedback (correct, incorrect, too slow). I would suggest allocating corr within the Trial Routine (Each Frame), so:

if mouse.isPressedIn(clickable):
   clicked_things.append(clickable.name)
   if mouse.clicked_name == AnsCorr:
        corr=1 # correct
   else:
        corr=0 # incorrect

if t > 10: # here I typed 10(secs) but change accordingly
   corr=9 # too slow
   continueRoutine = False

Then in the Feedback Routine just allocate the message and colour based on the value of corr (in Begin Routine):

if corr == 1:
   feedback_text = ‘Correto!’
   msgcolor = ‘green’
elif corr == 0:
   feedback_text = ‘Errado!’
   msgcolor = ‘red’
elif corr ==9:
   feedback_text = ‘Tempo Esgotado!’
   msgcolor = ‘yellow’