But you *can* use a linear flow and simply change what occurs, using a
code component.
As an example see the attached experiment, it's the stroop again (my
favourite demo task ;-) ), but more complete, with practice trials and a
feedback routine. That feedback routine contains a message that's
conditional on the response of the previous routine using a code component:
"Oops, you goofed!"
or
"Well done! Your RT was xx.xx secs"
(could make it red or green too for impact, but I haven't done)
So I guess the question is, how different do the contents of your
conditional branches need to be?
Jon
--
Dr. Jonathan Peirce
Nottingham Visual Neuroscience
In short, that won't work right now. But I think it could do one day,
probably with very little effort on my part ;-)
Jon
Gary
The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.
Could you send me an idea of a study that would actually use this
feature? Then I'll ensure that it's possible and include a demo.
jon
A simple case is an experiment that has a training phase and a testing
phase. Perhaps you train to criterion, then test over multiple sessions.
In later sessions, you might want to skip the training (i.e., set weight
or nReps equal to 0). Limited branching could thus be achieved, as long as
you had control over the nReps variables. Conceptually, something like:
# ==== code fragment ===
# enable setting of nTrainingReps up here (Eprime does it via a dialog box
# that lets you set weights for all the experiment components on your
# timeline)
while nTrainingReps>0:
# do a training run
(CODE FOR ONE RUN OF THE TRAINING PHASE)
(GENERATES A performance VALUE, RANGE 0-1)
if performance>0.9: # if they did well enough, quit looping
nTrainingReps = 0
else: # otherwise keep looping until preset number of reps
nTrainingReps -= 1
# you could even compute nTestReps in here based on, oh, accuracy or RT or ...
while nTestReps>0:
# do a testing run
(CODE FOR ONE RUN OF THE TESTING PHASE)
nTestReps -= 1
# ==== end code fragment ===
That is, generate some wrapper loops around Builder elements, with
assocaited "Reps" variables (Eprime calls these "weights") that can then
be manipulated by in-line code for skipping sections, repeating sections,
etc. Others assuredly have better experimental examples for using this,
but I found it pretty useful for examples like the above in Eprime (once I
was introduced to the concept). It made for easy experiment testing too,
as you could "skip" large sections of the experiment (set weights to 0)
while testing some other phase of the experiment ...
G
--
You received this message because you are subscribed to the Google Groups "psychopy-users" group.
To post to this group, send email to psychop...@googlegroups.com.
To unsubscribe from this group, send email to psychopy-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/psychopy-users?hl=en.
Actually a colleague had asked that the loops could receive nReps=0 for
this purpose but in the dlg, not inline, and there is a fix in the git
repository to cope with that. The problem with changing it on the fly is
that nReps needed during init of the TrialHandler and shouldn't change
thereafter.
But your example below gave me the idea that things should be able to
quit during a loop as well (you could set nReps to 1000 and exit the
loop on a performance criterion instead). So, the fix is to have an
attribute of loops called .finished and if that ever gets set to True
(either before or during repeats) then the loop will exit at the
beginning of the next iteration.
If you want to play with it you need to fetch the new data.py from the
'raw' link in the repository here:
http://github.com/psychopy/psychopy/blob/master/psychopy/data.py
*NB: the source code has moved from google to github.com*
The attached file shows how to use the feature (the code component in
the `instr` Routine)
all the best,
Jon
Jon