Hi Jeremy,
I am currently working on an experiment and I found that I needed to use a variable element to keep track of how many
trials the user had completed. I tried debugging and trying out the general behavior of the variable element. To do that,
I created the following experiment:
PennController.ResetPrefix(null);
Sequence('test')
newVar('counter',10).global();
newTrial('test',
getVar('counter')._element.value == 10 ? [
newButton('button','True!')
.print()
.wait()
]:
[
newButton('Button', 'False :(')
.print()
.wait()
]
,
getVar('counter').set(v=>v+1)
)
newTrial('test',
getVar('counter')._element.value == 11 ? [
newButton('button','True!')
.print()
.wait()
]:
[
newButton('Button', 'False :(')
.print()
.wait()
]
)
When running this file, the statement getVar(‘counter’)._element.value == 11 evaluates to false. I don’t understand
why this is happening. I would appreciate it if you could help me out.
Thanks