I am rather self-taught in programming these experiments and tend to do things a bit unconventionally, sometimes. But maybe you can help me again (as you have done before).
I built a very complicated trial, which I want to “recycle” (repeat). That works perfectly fine using lists, except for storing/saving values within those trials.
In my script I run through the same block multiple times. With the help of lists, I can change the stimuli dynamically. But I do not know, how to dynamically save values, for a repeated block.
What I want: Save the value.current_click (similar to a counter) dynamically.
My approach: I have a list with the values
<list list_responses>
/items = (values.DRAWStrial1, values.DRAWStrial2, values.DRAWStrial3)
/selectionmode = (values.current_list)
</list>
<values>
/DRAWStrial1 = -88
/DRAWStrial2 = -88
/DRAWStrial3 = -88
</values>
Then, at the end of the block, I want to simply change the current value in the list. My most intuitive approach was /onblockend = [list.list_responses.nextvalue=values.current_click] but it says “the expression attempts to set the value of read-only property”:
<block someblock>
/trials = [1-12 = trial_choose]
/onblockend = [list.list_responses.nextvalue=values.current_click]
</block>
<expt>
/ blocks = [1-3= someblock]
</expt>
<summarydata>
/ columns = [values.DRAWStrial1, values.DRAWStrial2, values.DRAWStrial3]
</summarydata>
I tried other functions like
/onblockend = [list.list_responses.setitem(values.current_click, values.current_list)]
and
/onblockend = [ list.list_responses.item(values.current_list)=values.current_click]
Not always I get an error message, but it never saves the value.current_click to the values “stored” in my list list_responses to be saved in summarydata. The value always stays at the value -88 (pre-defined at the beginning of script).
Another idea I had was to create values somehow on the fly using dynamically created strings. For this I would need to convert my “list-counter” to a string, concatenate this to “value. DRAWStrial” and save the values.current_click to it.
Any help appreciated! Thanks a lot! 😊