Mouse click record selections and end routine on final “okay

It should be set to “every repeat” so that the colour re-sets at the beginning of each trial to its default value that you specify. If it is set to “every frame”, it would keep updating with the default value 'white' you provide, which would immediately counteract the change applied in the code, so no change would be apparent. “constant” would mean that it should change in response to the code, but not get re-set at the start of each trial.

If it is still not changing, it would be worth temporarily inserting some debugging code, as it is possible that our comparison of the current stimulus colour is failing, as colours can be stored in multiple ways. e.g.:

for letter_stim in [letter01, letter02, ..., letter26]:
        # only respond if a letter has not already been clicked:
        if mouse.isPressedIn(letter_stim):
            print(letter_stim.colour)
            if letter_stim.colour == 'white':
                print('Changing to green')
                letter_stim.colour = 'green'

NB this code should not be kept in your production-ready experiment. Those print statements are expensive in terms of timing and performance.

EDIT: wait a moment, I just saw a typo in the original code (since amended), where I had letter_stim.colour == 'green' rather than letter_stim.colour = 'green'. That wouldn’t have actually changed anything (i.e. = assigns one thing to another, while == just compares them). I suspect the original code would work fine if you just change the == to = in that line, and ensure that the update fields are set to “every repeat”.