Good morning to all. I have a problem that cannot be solved and I need it for a university project; we are doing a visual psychophysical test to detect changes in spatial frequency in patients with Parkinson's (a problem that is beside the point);
I have created a simple test of a stimulus which with right and left works, with successes(global variable)=0 and errors(global variable)=2; I mark that when I press the correct stimulus I add a hit and when I do the reverse I subtract 1 miss, but when I pass the first hit it always subtracts and adds both, and it sucks because it's not real and I don't know what happens. I attach screenshots:
If I erase or cancel the sequence of failures, it perfectly counts the successes; but if not the problem is the following:
Sometimes it works correctly, but other times it does very strange things and subtracts and adds at the same time.
any idea or solution?