[open] Working with arrays and opensesame loops
Hi Opensesame dudes,
Quick tips wanted :-) I'm in the process of creating a digit recall task - x number of individual digits presented, separated by masks, then participant asked to recall the digits in the correct order.
I'm using a variable within a loop to get the digits displayed in the correct order, then when a certain flag digit appears within the list, it triggers the form where the particpant enters the digits they recall. This has to be checked to see if the proceed to the "next level" or the task is done.
Consequently I need to record the variable as it is within the loop, for certain periods. As such I was wanting to pop the variable on to a list or array. I can access the opensesame variable within the loop, but dont seem to be able to append it to an array or list.
Any suggestion where and how I would declare the array? In an inline script I've tried to make it global but it didn't work.
in the run phase, I've tried:
digitSpan =  digitSpan.append(self.get('currentDigit'))
Where digitSpan is the array/list I want to create, and 'currentDigit' is the variable from the loop.
As you can tell, I'm not particularly familiar with python...And also its the end of the day so I am tired and probably making no sense!
Any suggestions gratefully received.