Hello, I am new to PsychoPy (and also to Python which I don’t know a thing about sadly.)
I am doing a kind of n-back task experiment where the stimuli are random numbers and a ‘x’ mark. When the ‘x’ mark is presented the participant would need to key in between ‘left’ or ‘right’ keys depending whether the number two steps before is odd or even respectively.
I have attached how the excel and builder look like. Currently, the experiment runs in sequence, target = 1 is where the sequence ends.
I still would like to keep this sequence format but also wondering if there is any way for me to randomise which sequence comes first and after. So that the participants get presented the stimuli randomly (but still in sequence) and not according to how the sequence is in the excel.
I am very clueless currently, any help will be very very deeply appreciated. Thank you and have a good day! (or evening, or night!)
Hello
just set the Loop-type to random.
However, this may result in a sequence where the first trial is an x, or two or more x come in a row.
Best wishes Jens
Thank you Jens!
Is it possible for me to randomise the sequence of ‘number’, 'number, ‘x’ instead to have it always be presented sequentially?
Hello
Do you always want the order number - number - x?
You can find some n-back programs on Pavlovia that you can use as a starting point. Searching the forum will also give you some ideas for an n-back task. At PsychoPy Online Demos you can find an implementation of an n-back task.
Best wishes Jens
There are several different ways to approach this.
The random number could be generated randomly instead of being read from a spreadsheet.
The spreadsheet could contain a list of “number of trials until the next x” and then have an inner loop which presents that number of random numbers before the next x (presented in a separate routine).
You could just randomise the order of a spreadsheet containing numbers and xs and count how many trials since the last x to determine the correct answer.
You could have a list of random numbers and then have a variable called nextX and insert an x instead of a number when trials.thisN == nextX (I use this method for prospective memory tasks).
1 Like
Thanks ao much Jen!
I will look at the programs on Pavlovia for my references, and build my experiment from them.
Also the order doesn’t necessarily have to be number - number - x, as some sequences in my spreadsheet list (shown previously) are also number - number - number.
I was just thinking that randomising which sequence comes first would be easier when it comes to storing the correct answer (when the number two steps before x is odd, left key is the correct answer, and right key when it is even) than having everything randomised.
Thanks again, Syahirin
Thank you so much!
I will try again with the spreadsheet of number of trials until the next x and have it as a loop.
1 Like