psychopy/psychopy — pull request #338 by m-macaskill (2013-07-02 00:13:54+00:00)
Title: 	ENH: Extending TrialHandler's n-back information options

In response to user query at
.
Sometimes access is needed to information from previous trials (as in
an n-back task). As a kludge, the trialHandler's getFutureTrial()
function could be used for this by passing a negative index value, but
as it wasn't designed for this, it didn't include a bounds check to
handle trying to access a trial before the first one. This has now been
added.
To be explicit, have also added a getEarlierTrial() function, which
simply calls the getFutureTrial function but ensures the index is
negative.