Multiple correct string responses

271 views
Skip to first unread message

Blaire

unread,
Jun 29, 2009, 11:39:10 PM6/29/09
to E-Prime
This is the first time I've ever used E-prime so I'm very much a
beginner. My main question is: What is the easiest way to allow
multiple responses to be accepted as correct into a string input field
on a single trial?

In some trials, there are 113 correct responses - and if the
participant enters any of those 113, they must be counted as correct
and the program needs to let them move on, BUT if they enter anything
except those 113 they have to get feedback saying incorrect and must
be sent back to the trial until they enter a correct response.

I got excited earlier today because I thought that colon syntax would
be the way to do this, but I can't seem to make that work - even when
just trying with two correct responses.

Is colon syntax the way I should be trying to do this? (In which case
I'll go back and play with it because I guess I was doing it wrong.)
Or is there some easier way?

Thanks for any help you can offer,
Blaire

Peter Quain

unread,
Jun 29, 2009, 11:47:41 PM6/29/09
to e-p...@googlegroups.com
At 01:39 PM 30/06/2009, you wrote:

>This is the first time I've ever used E-prime so I'm very much a
>beginner. My main question is: What is the easiest way to allow
>multiple responses to be accepted as correct into a string input field
>on a single trial?
>
>In some trials, there are 113 correct responses - and if the
>participant enters any of those 113, they must be counted as correct
>and the program needs to let them move on, BUT if they enter anything
>except those 113 they have to get feedback saying incorrect and must
>be sent back to the trial until they enter a correct response.

just a mud map, but maybe store the 113 correct responses in an
array, then collect the string input as a variable and run a loop
through the array elements checking for a match. If it finds one,
jump out of the loop (maybe go to a label along the trial procedure),
if it doesn't, then progress to a text object to tell them incorrect,
followed by an inline which would start the trial again.

Rinus

unread,
Jun 30, 2009, 12:59:27 PM6/30/09
to E-Prime
I agree with Peter.. an easy way is to first put all the allowable
responses in an array.. you might even put a list with attributes into
a (dynamic) array using a loop .... and subsequently use that
(dynamically created or not) array to check whether the given input
was correct.. I've made a prelimary setup for you.. I'll send it to
you.. (as I can not add files evidently).

Groetjes, Rinus
> >Blaire- Hide quoted text -
>
> - Show quoted text -

David McFarlane

unread,
Oct 5, 2009, 3:49:49 PM10/5/09
to e-p...@googlegroups.com
At 6/29/2009 11:47 PM Monday, Peter Quain wrote:

>At 01:39 PM 30/06/2009, Blaire wrote:
> >This is the first time I've ever used E-prime so I'm very much a
> >beginner. My main question is: What is the easiest way to allow
> >multiple responses to be accepted as correct into a string input field
> >on a single trial?
> >
> >In some trials, there are 113 correct responses - and if the
> >participant enters any of those 113, they must be counted as correct
> >and the program needs to let them move on, BUT if they enter anything
> >except those 113 they have to get feedback saying incorrect and must
> >be sent back to the trial until they enter a correct response.
>
>just a mud map, but maybe store the 113 correct responses in an
>array, then collect the string input as a variable and run a loop
>through the array elements checking for a match. If it finds one,
>jump out of the loop (maybe go to a label along the trial procedure),
>if it doesn't, then progress to a text object to tell them incorrect,
>followed by an inline which would start the trial again.

Thanks Peter. I know this is too late for the original poster, but I
want to add this to the record in case anybody searches for this
later. Back in Sep 2007, Paul Groot presented another solution that
you may find at
http://listserv.linguistlist.org/cgi-bin/wa?A2=ind0709d&L=eprime&T=0&F=&S=&P=1497
. It uses the InStr() function, as documented in the online E-Basic
Help. So you put all the correct responses into a single string
(perhaps in a List attribute), and then use InStr() to test a given
response against all the correct ones without having to write an
actual loop, e.g.,

' case-insensitive search, see online E-Basic Help:
If InStr( 1, StimText.CRESP, StimText.RESP, 1 ) Then
StimText.ACC = 1 ' correct
end if
' else, incorrect by default

-- David McFarlane, Professional Faultfinder

Reply all
Reply to author
Forward
0 new messages