Multiple correct answers script
Ellie van Setten
ellievansetten at gmail.com
Thu Apr 24 08:29:25 UTC 2014
Dear David,
I have followed your advise, in another script on another computer it
worked just fine... so I still don't know why I got the error
I have modified the script I found slightly in two ways that may be of use
for people using an older version of E-prime because the script I found
only works for experiments where an answer is given every time and without
an answer it does not continue.
Working with multiple correct answers in case not always an answer is
required:
*Dim sCorrectResponses as StringsCorrectResponses =
c.GetAttrib("CorrectResponses")'determine if there is an responseDim resp
as integerif Stimulus.RESP = "" then resp = 0else resp = 1end if
' perform a case-insensitive search operation if (resp = 1 AND (Instr(1,
sCorrectResponses, Stimulus.RESP, 1)=0)) OR (resp = 0 AND sCorrectresponses
<>"") then Stimulus.ACC = 0else Stimulus.ACC = 1end if' save the
accuracy as attributec.SetAttrib "Stimulus.ACC", Stimulus.ACC*
and to make it work for situations were a response is always required, so a
failure or responses that are too late are also seen as incorrect:
*Dim sCorrectResponses as StringsCorrectResponses =
c.GetAttrib("CorrectResponses")' perform a case-insensitive search
operation if Instr(1, sCorrectResponses, W2.RESP, 1)=0 OR (W2.RESP =
"")then W2.ACC = 0else W2.ACC = 1end if' and also save the accuracy
as attributec.SetAttrib "W2.ACC", W2.ACC*
For these scipts to work you need to have an attribiute in your stimulus
list that contains all correct responses called "CorrectResponses" (without
comma's and spaces). In the first scirpt the accuracy to a text display
called Stimulus is logged and in the second script to W2. Hope this may
help others with a similar problem.
Best,
Ellie
Op donderdag 17 april 2014 21:22:16 UTC+2 schreef McFarlane, David:
>
> Ellie,
>
> Oh, and if you do *not* get the error in the minimal example, but
> still get it in your original program, then my money says that the
> error occurs somewhere else than in the bit of code that you posted,
> and has something to do with the reasons in my first reply.
>
> Regards,
> -- David
>
>
> At 4/17/2014 03:17 PM Thursday, David McFarlane wrote:
> >Ellie,
> >
> >Hmm. First, I do not see anything wrong with that code. And to be
> >sure, I went ahead and directly copied your code into a little test
> >program, using EP2.0.8.90 (same version as you), and it both
> >compiled and ran without error.
> >
> >If you have not already, then you should make a minimal example that
> >shows this error. Mine looks like this:
> >
> >SessionProc
> > List1
> > Proc1
> > TextDisplay1
> > InLine1
> >
> >List1 has an attribute named "CorrectResponses", and InLine1 has
> >your code, verbatim. No need to even enter anything else for the
> >various objects, as this is already enough to check any syntax errors.
> >
> >If you still get the error in this minimal test, then something must
> >be peculiar on your system. Try it out on another machine.
> >
> >Good luck,
> >-- David McFarlane
> >
> >
> >At 4/17/2014 01:11 PM Thursday, Ellie van Setten wrote:
> >>Dear David,
> >>
> >>Thank you for your fast reply. The line the error was referring to was:
> >>
> >>if Instr(1, sCorrectResponses, TextDisplay1.RESP,1)=0 then
> >> TextDisplay1.ACC = 0
> >>
> >>It seems correct to me, but I keep getting the error.
> >>
> >>The version I use was 2.08.90 the 9 was a typo.
> >>
> >>Best,
> >>
> >>Ellie
>
>
--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe at googlegroups.com.
To post to this group, send email to e-prime at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/e-prime/fb495303-e698-48f9-abf5-b3a69ea1a070%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.linguistlist.org/pipermail/eprime/attachments/20140424/834c528b/attachment.htm>
More information about the Eprime
mailing list