Millisecond Forums

removestimulustime() and removcestimulusframe() remove the stimuli but not the control

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

By Konstantina - 7/16/2015

Hello,

I am using the "removestimulusframe()" to remove a picture from a trial the second time the trial runs.
The function does indeed remove the picture but i still have to wait the specific timeframe that was specified by the control that was removed. (The same goes for removestimulustime()).

e.g.
In an expression within a block, before the trial runs for the first time : trial.x_x_trial.insertstimulusframe(picture.go,300);
The trial has /ontrialend=[trial.x_x_trial.removestimulusframe(300)] and /branch = [if(values.trialno<values.num_responses) trial.x_x_trial]
The second time the trial runs- i don't see the stimulus specified but i can't respond immediately.


Please let me know if my post is not clear enough and i could include some code.

Thank you in advance!
Konstantina

By Dave - 7/16/2015

Try using the resetstimulusframes() function instead, which restores the <trial>'s original state (i.e., before the picture was injected into the stimulus presentation sequence):

<block myblock>
/ onblockbegin = [trial.mytrial.insertstimulusframe(text.mytext,300); ]
/ trials = [1-2=mytrial]
</block>

<trial mytrial>
/ ontrialend = [trial.mytrial.resetstimulusframes(); ]
/ validresponse = (57)
</trial>

<text mytext>
/ items = ("GO")
</text>
By Konstantina - 7/16/2015

Hi Dave,

Thank you for the prompt reply. I only have to remove the last stimulus, i need the rest to remain as they are and so resetstimulusframes() won't work for me.
Is there anything else i can do to remove just this one stimulus?

Thank you,
Konstantina
.resetstimulusframes()#sthash.5X5jwNvt.dpuf
.resetstimulusframes()#sthash.5X5jwNvt.dpufresetstimulus
By Dave - 7/16/2015

Depends on how you've set up the trial and the other stimuli it displays. If you have

<trial mytrial>
/ stimulusframes = [1=a; 100=b; 200=c]
...
</trial>

with

/ onblockbegin = [trial.mytrial.insertstimulusframe(text.mytext,300); ]

then

/ ontrialend = [trial.mytrial.resetstimulusframes(); ]

will effectively only remove that single injected stimulus, while the rest remains intact.

Alternatively, you can force the beginsresponseframe or -time property to the desired value in addition to removing the frame:

<block myblock>
/ onblockbegin = [trial.mytrial.insertstimulusframe(text.mytext,300); ]
/ trials = [1-2=mytrial]
</block>

<trial mytrial>
/ ontrialend = [trial.mytrial.removestimulusframe(300); trial.mytrial.beginresponseframe=1; ]
/ validresponse = (57)
</trial>

<text mytext>
/ items = ("GO")
</text>
By Konstantina - 7/16/2015

Thanks a lot Dave! beginresponseframe did it!