Millisecond Forums

How to get original stimuli to appear again after response stimuli duration is over, when they are overlapped?

https://forums.millisecond.com/Topic30703.aspx

By nidhi_desai - 2/3/2021

In this example from another post, I changed the response message text position to overlap with the stimulus times text in this trial. When the duration of text response is over, it covers the area of the text with a white rectangle. Instead, I am interested in having the original text mentioned in the stimulus times to be displayed again after the response duration is over. I need the stimulus times text and response tex to overlap in my experiment for some reason. Is there a way to achieve this without having to write multiple trials connected through branching?


<block myblock>
/ trials = [1=mytrial]
</block>

<trial mytrial>
/ stop = [
trial.mytrial.elapsedtime >= 10000;
]
/ stimulustimes = [0=clearscreen,mytext]
/ validresponse = ("E", "I")
/ responsemessage = ("E", Epress, 100)
/ responsemessage = ("I", Ipress, 100)
</trial>

<text mytext>
/ items = ("Press the E and I keys. You have 10 seconds.")
/ position = (50%, 50%)
/ erase = false
</text>

<text Epress>
/ items = ("Pressed E")
/ position = (50%, 50%)
</text>

<text Ipress>
/ items = ("Pressed I")
/ position = (50%, 50%)
</text>

By Dave - 2/3/2021

nidhi_desai - 2/3/2021
In this example from another post, I changed the response message text position to overlap with the stimulus times text in this trial. When the duration of text response is over, it covers the area of the text with a white rectangle. Instead, I am interested in having the original text mentioned in the stimulus times to be displayed again after the response duration is over. I need the stimulus times text and response tex to overlap in my experiment for some reason. Is there a way to achieve this without having to write multiple trials connected through branching?


<block myblock>
/ trials = [1=mytrial]
</block>

<trial mytrial>
/ stop = [
trial.mytrial.elapsedtime >= 10000;
]
/ stimulustimes = [0=clearscreen,mytext]
/ validresponse = ("E", "I")
/ responsemessage = ("E", Epress, 100)
/ responsemessage = ("I", Ipress, 100)
</trial>

<text mytext>
/ items = ("Press the E and I keys. You have 10 seconds.")
/ position = (50%, 50%)
/ erase = false
</text>

<text Epress>
/ items = ("Pressed E")
/ position = (50%, 50%)
</text>

<text Ipress>
/ items = ("Pressed I")
/ position = (50%, 50%)
</text>


> Is there a way to achieve this without having to write multiple trials connected through branching?

The only way I can think of is to set up the trial to periodically re-draw the original stimuli to the screen:

<block myblock>
/ trials = [1=mytrial]
</block>

<values>
/ time = 0
</values>

<trial mytrial>
/ stop = [
  trial.mytrial.elapsedtime >= 10000;
]
/ ontrialbegin = [
    trial.mytrial.resetstimulusframes();
   values.time = 0;
    while (values.time < 10000) {
         values.time += 500;
        trial.mytrial.insertstimulustime(clearscreen, values.time);
        trial.mytrial.insertstimulustime(text.mytext, values.time);
    };
]
/ stimulustimes = [0=clearscreen,mytext;]
/ beginresponsetime = 0
/ validresponse = ("E", "I")
/ responsemessage = ("E", Epress, 0)
/ responsemessage = ("I", Ipress, 0)
</trial>

<text mytext>
/ items = ("Press the E and I keys. You have 10 seconds.")
/ position = (50%, 50%)
/ erase = false
</text>

<text Epress>
/ items = ("Pressed E")
/ position = (50%, 50%)
/ erase = false
</text>

<text Ipress>
/ items = ("Pressed I")
/ position = (50%, 50%)
/ erase = false
</text>