[open] Help needed using a sequence to 'pause' an experiment.
Hi. Sorry if this has been covered here before, but I went through the forum and couldn’t find anything. I’m totally new to OpenSesame so am probably missing something simple, but any help would be appreciated. I’m running 0.27 through Parallels.
Basically, I’m building two experiments.
In Experiment 1, participants are given a vigilance task. They’re presented with a set of patterned slides, and respond with a mouseclick when they see a slide containing vertical line patterns. At the same time, they hear 42 pieces of music interspersed with 42 periods of silence.
My overview looks like this:
However, participants should be able 'pause' the experiment at any time by pressing the space key. When they do, the MemoryQuestionnaire sequence should be shown, and, when that is completed, the visual/auditory stimuli sequence should resume from where it left off. Participants should be able to do this as many times as they want.
The problem I’m having is finding a way to implement this. Do you have any suggestions on where within the overview I should be placing the MemoryQuestionnaire sequence?
Additionally, is there any way to record whether the participants are correctly identifying the target slides? It seems that wherever I put a mouse_response item, the task sequence is interrupted. This isn’t essential, but would be useful.
For Experiment 2, participants are presented with a piece of music, and asked whether they associate it with a particular memory. If they respond positively, they are shown the MemoryQuestionnaire sequence. At present the overview looks like this:
I believe this will work correctly, I’m just wondering which ‘run if’ command I should use for the MemoryQuestionnaire sequence. I’d only like the questionnaire sequence to start if the participant selects the relevant button widget on the MemoryConfirmation form_base.
Thanks in advance!
Comments
ITA
Hi,
We will get back to you as soon as possible!
Best,
Lotje
Did you like my answer? Feel free to
Hi,
With regard to your first question, I have assumed that your experiment should look as follows:
I would advise you to use a bit of Python inline coding to achieve this. I think in the end this will be easier than using the parallel plugin. Basically, what we want to do is polling the keyboard and the mouse simultaneously after every slide presentation.
The following script should give you an example of how to do this (see comments for a more detailed explanation):
Note that the above code should be put in the "Run phase" tab of an inline_script item that is appended to your VisualStimuliSequence item. It is assumed that 'my_canvas' and 'my_sampler' are already defined in the "Prepare phase" tab of the same inline_script item. For more information on how to do this, see:
The overview of the example experiment looks like this:
and the full experiment can be downloaded here (simply save with the extension 'opensesame.tar.gz'). It is assumed that two .wav files called "sound1.wav" and "sound2.wav" are placed in the file pool, so the experiment will only run when you do so.
I hope this will get you started. If you still encounter any problems getting your first experiment to work, please let us know!
With regard to your second question, what you should put in the 'Run if' box(es) in your TaskSequence depends on the value you gave to the variable 'var' in your button widgets. If you defined a given widget button like so:
the variable 'button1' is declared and will have the value 'no' if the button was not pressed, and the value 'yes' if the button was pressed.
Therefore, if you want to run another item only if button1 was pressed, you could use the square-bracket method and set the "Run if" statement of this item to:
For more information about variables and condition statements, see also:
Hope this helps and don't hesitate to ask any further questions!
Best,
Lotje
Did you like my answer? Feel free to
Hi Lotje, thanks very much for your help! The second experiment is now running perfectly, and thanks to your template, the first is almost there.
The only problem I’m having is getting the sampler to play all of the sound_list files alongside the patch_list files. At the moment, in the template, the sound1.wav file is played at the beginning of the experiment, but the sampler doesn’t move on to sound2.wav. I was wondering if there’s anything I can put into the code to ensure that the sampler plays all of the musical stimuli?
Thanks again.
Apologies for the shameless bump, but is there anyone who might be able to point me in the right direction here, I'm at a total loss for what to do next. Any tips greatly appreciated
ITA
Did you like my answer? Feel free to
Hi,
Sorry for the delay.
I think the problem is that your currently running only one trial. And because only one sampler item is run per trial, this leads to only one sound file being played.
Perhaps the following changes could solve this:
To achieve the latter, remove the part of the first inline_script item (called 'constants', in the example) where we declared the patch_list. So this first inline_script item now looks something like this:
(By the way, I noticed that in the old script I accidentally shuffled 'patch_list' twice, and did not shuffle 'sound_list', so we should change this too, see line 12 of the above script).
Next, append a new inline_script item to the beginning of the sequence called 'vigilance_task'. Here, we will define the patch_list (because this list should be renewed for every trial):
A new example experiment is pasted here:
Does this answer your question?
Best,
Lotje
Did you like my answer? Feel free to
Hi Lotje,
Thanks very much for the info!
A new piece of 'sound_list' stimuli now plays at the start of each cycle, which does help, but I was wondering if there is anything I can do to get the sound stimuli to play without waiting until the end of the current cycle? (I.e. the sound_list and patch_list stimuli are displayed independently)
Thanks again for your help
Please disregard the previous comment, I tinkered around with the inline script and now both experiments are working perfectly.
Thanks!
Great to hear!
Did you like my answer? Feel free to