Yes, you need to use your actual stimulus and variable names, so try this:
if mouse_resp.clicked_name[0] == req_response:
-
$
is not needed anywhere in this code, as anything in a code component is Python code. i.e. the$
symbol is not a valid Python expression itself, rather it is just a prefix used as a hint to Builder to treat what follows as Python rather than a literal value. That is only necessary in some Builder fields (e.g. in a text field, it isn’t clear other one wants to display some literal text or use a Python expression, so the$
makes clear what is wanted). -
clicked_name
is a property of a Builder mouse object, which stores a list of what it was used to click (and we just want the first entry (i.e.[0]
) in that list. You need to use this exact name to access this property. (i.e. notclicked_mouse_resp
as you suggested above).