Multiple correct string responses

David McFarlane mcfarla9 at msu.edu
Mon Oct 5 19:49:49 UTC 2009


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


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en
-~----------~----~----~----~------~----~------~--~---



More information about the Eprime mailing list