changing CorrectAnswer

David McFarlane mcfarla9 at msu.edu
Thu Mar 18 20:48:45 UTC 2010


Oh, and if you find the nested bracket notation just too disturbing, 
then you can always revert to a more ordinary E-Prime way of doing 
things.  In this case, in your TrialList make *three* columns, named 
CorrectLeft, CorrectRight, and just Correct.  Fill in CorrectLeft and 
CorrectRight as before, and in Correct just put "Correct[Handedness]" 
(without the quotes).  Now in the Correct property of Stim1, just put 
"[Correct]".  Now everything will work pretty much as described 
earlier, but in a way that may not freak out folks quite as much as 
the nested brackets.  In fact, I came up with this way first on the 
way to figuring out the full nested bracket approach.  It's all up to you.

-- David McFarlane, Professional Faultfinder


>Eli,
>
>With all that said, how about if we think outside the frame of your 
>question as posed and see how to do this with no code at all?  Here's how:
>
>In your TrialList, add two columns called CorrectLeft and 
>CorrectRight.  Fill these in with the correct assignments for left & 
>right.  Now, in the Correct property of your Stim1 object, enter the 
>following exactly:
>[Correct[Handedness]]
>
>Note the use of nested brackets.  Now on each trial, using the inner 
>brackets Stim1 will construct an attribute reference from 
>Correct[Handedness], either Correctleft or Correctright (note that 
>E-Prime ignores case here).  Then it will use that value in the 
>outer brackets to get the correct value from the desired column.
>
>Isn't that slick?  I tested this and it really does work for 
>me.  Who would have thought that E-Prime allows nested attribute 
>references using the bracket notation?  Nice feature, now that we 
>know, so thanks for the question!
>
>-- David McFarlane, Professional Faultfinder
>
>
>>Eli,
>>
>>If you want to manipulate the correct response by changing .CRESP in
>>code, then you have to do that *before* your input mask runs, not
>>after.  Once an input mask gets a response it scores that response
>>using the latest value of .CRESP, so changing .CRESP after the fact
>>does no good.
>>
>>So, either change .CRESP before your input mask runs, or, as liw
>>suggested, use code after the response to score the response directly,
>>i.e., make your change directly to .ACC (based directly on, e.g.,
>>handedness and .RESP) instead of to .CRESP.
>>
>>-- David McFarlane, Professional Faultfinder
>>
>>
>>On Mar 18, 7:38 am, Eli Koren <ekor... at gmail.com> wrote:
>> > Hi There!
>> >
>> > I want to change the CorrectAnswer if handedness is left
>> > so i wrote this script:
>> >
>> > if c.GetAttrib("handedness") <>"left" then
>> > if stim1.Cresp ="{/}" then
>> > stim1.Cresp ="x"
>> > elseif stim1.Cresp ="{.}" then
>> > stim1.Cresp ="z"
>> > end if
>> > end if
>> >
>> > It doesn't change the CorrectAnswer so what's wrong with this
>> > script?
>> >
>> > Thanks
>> > ELi Koren

-- 
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