How to change the stimuli list presented in a task depending on participant's response
Hello, everyone!
I am currently working on an experiment and it's the first time I use OpenSesame to program it. I intend to run this experiment online (so, I guess, I will also need to learn how OSWeb works, eventually). Right now, I am still in the programming phase and I would like to ask for your expertise.
The design of the experiment is the following: the participants will be asked to perform a 4-colour Stroop task but only after selecting on a slider the number of congruent trials (RED written in red) they want to perform in the upcoming block (e.g., none = 0, all = 24). I already have a stimuli list with 24 rows and 4 columns (colour, word, incongruency and correct response) with a counterbalanced number of congruent and incongruent trials (12 and 12), but I assume that in this case the stimuli list to be presented should be created on the go, since the participants' choice of congruent trials would be expressed through the said slider and it would vary in each block.
Right now, I have achieved creating and presenting onscreen the slider (I can attach the draft I've been working on as it may be helpful), but I am stuck with the create-a-new-stimuli-matrix-based-on-participants-choice phase.
Could someone help me?
Thanks so much in any case!
Comments
Hi Stone,
when things seem very complicated to implement it is often a good indication that the approach is not ideal. In your specific case, you shouldn't try to dynamically generate a loop table (I don't even think this is possible). Instead you can use Python (inside inline_scripts) to generate lists of task parameters that more or less correspond to the columns in the loop table. For example, your participant chose 20 in the form. Then you can do in an inline_script (run phase) following that form:
That you can then also shuffle to make it random
and finally match it with the other parameters
Now you have four lists that have 24 items. So you can put a loop/sequence after that inline_script, put another inline_script as first item in that sequence, and add there (in the prep phase):
And now you're set.
Does that make sense?
Eduard
ps. I have not tested the code, so there might be some errors. But I hope you get the general point.