Response to a slide

248 views
Skip to first unread message

Greg Osenbach

unread,
Feb 25, 2009, 8:33:04 PM2/25/09
to e-p...@googlegroups.com
Hi guys,

I have a simple sounding question here and I am sure I am having a problem here simply due to a lack of experience with e-prime.

I have a slide that I am looping through (time out at 100ms).  Each time I change one of the values on the slide (random number).  The subject is supposed to press a key to stop it and then I do some calculations with what ever the random number was at the time.  I would like the subject to do this with the space bar.  When I set the allowable response to {SPACE} and my inline do a check: If Slide1.RESP = " " and I have also tries If Slide1.RESP = chr(32), it does not work.  If I set the allowable response to 1 and do the check If Slide1.RESP = "1", It works perfectly.  I would think that I need something in my if statement other than " " or chr(32).

Anyone have any ideas?  Thanks.

Greg

Peter Quain

unread,
Feb 25, 2009, 8:54:42 PM2/25/09
to e-p...@googlegroups.com

if there is only the single response to Slide1, using SPACE (and that
response terminates the Object) maybe log Slide1.RT, then something like:

If Slide1.RT <> 0 Then
... whatever
End If
>No virus found in this incoming message.
>Checked by AVG.
>Version: 7.5.557 / Virus Database: 270.11.3/1971 - Release Date:
>25/02/2009 6:40 AM


--
No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.557 / Virus Database: 270.11.3/1971 - Release Date: 25/02/2009 6:40 AM


janpsy

unread,
Feb 26, 2009, 2:07:39 AM2/26/09
to E-Prime
Hello Greg,

Slide1.RESP="{SPACE}" should work. You find the whole key nomenclature
in the E-Basic Help.

Janina

David McFarlane

unread,
Feb 26, 2009, 8:48:29 AM2/26/09
to e-p...@googlegroups.com
Just to summarize, in the case where you have only one allowable
response (e.g., 'SPACE') and you want to test for the occurrence of only
that response, then the following should work:

If Slide1.RESP = "{SPACE}" ' using the {key} nomenclature from online
E-Basic Help
If Slide1.RESP <> ""
If Slide1.RT > 0 ' or "<>" if you prefer
If Slide1.RT ' you don't even need the explicit test in this case
If Slide1.RTTime > 0 ' etc. as in .RT test

If you had also set the Correct response to {SPACE}, then you could also use

If Slide1.ACC = 1
If Slide1.ACC <> 0
If Slice1.ACC ' once again, do not need explicit test in this case

Also note that E-Basic/Visual Basic itself is case insensitive, so you
may use whatever case you like, except that you must observe case for
the E-Basic {key} nomenclature.

I leave it as an exercise to the reader to figure out the corresponding
tests for the case of more than one allowable response, or how to test
for the occurrence of a non-response (or non-occurrence of a response?).
You may post your solutions here for extra credit.

-- David McFarlane, Professional Faultfinder and Insufferable Pedant

David McFarlane

unread,
Feb 26, 2009, 9:12:18 AM2/26/09
to e-p...@googlegroups.com
Greg,

> I have a slide that I am looping through (time out at 100ms). Each time
> I change one of the values on the slide (random number). The subject is
> supposed to press a key to stop it and then I do some calculations with
> what ever the random number was at the time. I would like the subject
> to do this with the space bar. When I set the allowable response to
> {SPACE} and my inline do a check: If Slide1.RESP = " " and I have also
> tries If Slide1.RESP = chr(32), it does not work. If I set the
> allowable response to 1 and do the check If Slide1.RESP = "1", It works
> perfectly. I would think that I need something in my if statement other
> than " " or chr(32).
>
> Anyone have any ideas? Thanks.

BTW, if I were looping through a slide and just wanted to stop when the
subject responds to any presentation, I might try another EP trick.
Instead of even getting a response to each slide presentation, I might
put a Wait object (let's call it ResponseWait) before my slide loop. I
would make its Duration 0, set it collect my desired response, and
(here's the key) set Time Limit to "(infinite)" or the max duration of
my slide loop. The PST User's Guide calls this Extended Input, see the
much overlooked Appendix C. I would probably also set its End Action to
Terminate so that it will terminate the current slide when the subject
responds, unless I wanted to allow the final slide to time-out on its
own. Anyway, then in my script or whatever I would just test for a
response to ResponseWait instead of my slides.

I really don't know if this makes things any better in your case, but I
had an experiment where this technique solved a lot of problems.

David McFarlane

unread,
Feb 26, 2009, 9:29:18 AM2/26/09
to e-p...@googlegroups.com
I wrote,

> I had an experiment where this technique solved a lot of problems.

Sorry to keep posting in piece-meal fashion, but just to explain a bit...

We had a task where we rapidly looped through a set of slides (i.e., new
slide on each screen refresh) and wanted to stop when the subject
responded. I first did it as you described, testing for a response to
the slides themselves. But much of time the program would not detect
the subject response. When I thought it through and looked at the
timing, I realized that in this case the program spent a good proportion
of its time between each slide, whereas it could collect responses only
during each slide's run; e.g., if a slide appeared every 17 ms, with 7
ms for in-between-slide setup and 10 ms of actual slide running (even
though it does remain on the screen for the full 17 ms), my program got
responses only during the 10 ms interval so 7/17 = 40% of the time my
program could not get a response!

I solved the problem using one pre-loop object with extended input as
described in my previous post, and I have described this just in case it
can ever do anyone else any good.

Greg Osenbach

unread,
Feb 26, 2009, 4:21:48 PM2/26/09
to e-p...@googlegroups.com
David.  I just now am reading through this email chain and what you described in this last one is exactly what I am attempting to do and that is exactly one of problems I am seeing.  I only had the few minutes to get it set up so have not had any time to try another method yet.  They requested they have it look through faster than what I had it set at, but could not run it any faster without having to kit the stop key several times to get it to stop  :)

Thank you for the suggestion, I'll try it out this evening and let you know how it goes.

Greg

(ps.  Thanks for all the very detailed help you give on this list!!)

David McFarlane

unread,
Feb 26, 2009, 5:16:28 PM2/26/09
to e-p...@googlegroups.com
Greg,

>I only had the few minutes to get it set up

<unsolicited-editorial-rant>
That illustrates the bigger problem here. Behavioral research labs
today seem to think that they can do research in a rush, and so do
not allow time to do things properly. Back in my graduate training
in the early 1980s, my advisor at the University of Chicago actually
reminded me that science is a deliberative process, and I needed to
slow down and take more time to ponder things. Seems our culture has
abandoned those values, taking an abundance of whiz-bang technology
as a substitute for timely deliberation. As for me, I do not find
that an improvement. But then I am a cranky old geezer.
</unsolicited-editorial-rant>

Greg Osenbach

unread,
Mar 1, 2009, 9:33:03 AM3/1/09
to e-p...@googlegroups.com
David,
That method worked great.  Thanks for the suggestion!

Best Regards,
Greg
Reply all
Reply to author
Forward
0 new messages