Actually you can end a loop prematurely from builder using the line
nameOfLoop.finished=True
Jon
On 13/11/2012 00:58, Michael MacAskill wrote:
> Hi Mitch,
>
> I'm not an expert in Builder, but although it does allow for the ending of a routine, it doesn't seem at first glance to allow for the conditional ending of a loop, which is what you want.
>
> You could add a code component at the top of the elements in your routine, and put something like this in the "Each Frame" box:
>
> if event.getKeys(["space"]):
> trials.addData('detectedOnRepetition', trials.thisRepN)
> while trials.nRemaining> 0:
> trials.next() # end the loop by instantly cycling though it
>
> This is kludgy, as it mucks up the data storage more than a bit.
>
> There is probably a better way from someone who knows Builder better� (This sort of thing would be very straightforward in the Coder view, as you could make the loop and individual stimuli conditional on keypresses exactly as required, and terminate when necessary).
>
> Regards,
>
> Mike
>
>
> On 13 Nov, 2012, at 09:43, Mitch LaPointe<
mitchla...@gmail.com> wrote:
>
>> Hi All,
>>
>> I've been trying to create a change detection experiment using psychopy. I've created a loop where stimuli 'A' is presented, followed by a blank screen, followed by stimuli 'B', followed by another blank screen. I've placed a loop around this sequence to alternate up to 20 times, however, I've also like to have participants hit the spacebar when they see the change, thus ending the trial. Unfortunately, what is occurring is the loop will go through one cycle and then wait for the spacebar press in order to advance to the next cycle of the loop. Does anyone recognize this problem? I've made sure to click the 'Force End Routine' button with no success. Any advice would be helpful.
>>
>> Thanks!
>
>
>
>
>
>
>
>
>
>
>
--
Jonathan Peirce
Nottingham Visual Neuroscience
http://www.peirce.org.uk
This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.
This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.