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
/items = (values.DRAWStrial1, values.DRAWStrial2, values.DRAWStrial3)
/selectionmode = (values.current_list)
/DRAWStrial1 = -88
/DRAWStrial2 = -88
/DRAWStrial3 = -88
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”:
/trials = [1-12 = trial_choose]
/onblockend = [list.list_responses.nextvalue=values.current_click]
/ blocks = [1-3= someblock]
/ columns = [values.DRAWStrial1, values.DRAWStrial2, values.DRAWStrial3]
I tried other functions like
/onblockend = [list.list_responses.setitem(values.current_click, values.current_list)]
/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! 😊