Hi Tenri,
Sorry for the delay in responding.
I want to have an equal number of valid trials, 30 trials, for every condition (31 x 2 = 62 conditions), presented in random order. How do I make this work?
I’ve attached a short example that demonstrates how to do this, while also letting you stop and restart the protocol. (It’s written in MWEL, but everything in it can be done in an XML-based experiment, too.)
The example contains two protocols. “Main Protocol” performs the 30x62 trials you described, while “Other Protocol” just logs a message to the console. The main protocol stops itself at random intervals, which gives you a chance to run the other protocol. When you restart the main protocol, it picks up where it left off, without repeating previously-completed trials.
One aspect of your task that complicates things slightly is that you’re making random selections over combinations of two variables (SOA
and hemifield
). To handle this, the example uses two additional variables: SOA_hemifield
, whose value is a list of lists containing all possible combinations of SOA and hemifield; and SOA_hemifield_index
, a selection variable used to draw random SOA+hemifield combinations from SOA_hemifield.
Hopefully this will make sense. If you have any questions, please let me know.
Time of target presentation is the time stamp of Display Update event of “target”. Is this good enough? Or should I get a time with now() right after I present the target (Update Stimulus Display) and use this as an approximation of “target” presentation time?
You should stick with your current method. The time stamp of the relevant #stimDisplayUpdate
(or #announceStimulus
) event is the best estimate MWorks has for when the stimulus will start to appear on the display. The only way to do better is to measure the stimulus onset with a photodiode.
If you want to use the predicted output time inside your experiment, set the predicted_output_time parameter of the update_stimulus_display action to the name of the variable in which to store the value.
Chris