I’m attempting to use a variable in a Penncontroller.Template function in order to keep track of how many selectors from a set are chosen in each trial. I made the variable global because, as I understand it, a local variable cannot be accessed and edited by multiple selectors. Since global variables don’t reset with each new trial, I manually included a getVar command at the top of the Template function to reset the value to 0 for each new trial. However, this manual reset to 0 doesn’t seem to be working (the last value of the variable carries over to the next trial), and I can’t figure out why. Do you have any insight as to why this may be the case?
This topic was modified 3 years, 9 months ago by crtorma.
There is a known bug with global Var elements which will be fixed with the release of PennController 1.7—I am not quite ready to make that release yet, but if you’re in a hurry I just published a version 1.7 alpha, you can sync it to your project following the steps described here and typing 1.7alpha in the branch field
Also, did you make sure to also call .settings.global() on the getVar just before you use set?