Change the SlideObject Correct Response based on Attribute

Caleb J. Picker dbzgtfan4ever at gmail.com
Wed Jan 12 02:02:27 UTC 2011


Hello all,

I would just like to post a solution to this problem because I had 
difficulty finding it.

Just to clarify, the problem is this.  You have a slide object that collects 
input responses (e.g. TestSlide) with allowable response 'F' and 'J'.  Based 
on your List object (this presumably houses your stimuli and the correct 
responses), you have an attribute for correct responses (let's say 
"CorrectResp").  However, now let's say you have two similar experiments 
with two different Correct Responses.  In your List object, you might then 
have two attributes (CorrectResp1 and CorrectResp2).  Each attribute 
corresponds to a different experiment (say, Expt1 and Expt2).

In an inline (placed before the TestSlide runs), you need to change your 
'Correct:' property of your TestSlide based upon which experiment is 
selected at startup.  One solution I came up with is as follows:

Select Case c.getattrib("Group")
    Case "Expt1"
        TestSlide.InputMasks.Add Keyboard.CreateInputMask("fj", *
c.GetAttrib("CorrectResp1"*),_
        CLng(TestSlide.Duration), CLng("1"), ebEndResponseActionTerminate, 
CLogical("Yes"),_
        "", "", "ResponseMode:All ProcessBackspace:Yes")
    Case "Expt2"
        TestSlide.InputMasks.Add Keyboard.CreateInputMask("fj", *
c.GetAttrib("CorrectResp2"*),_
        CLng(TestSlide.Duration), CLng("1"), ebEndResponseActionTerminate, 
CLogical("Yes"),_
        "", "", "ResponseMode:All ProcessBackspace:Yes")
    Case Else
        MsgBox "Set correct response Error!"
End Select

The only way I found out how to do to this was by inputing an attribute 
within the 'Correct: ' field on the TestSlide object.  I then generated the 
script, and searched for the line where E-Prime 'sets up' the Slide Object. 
 From my understanding, what this line actually does is create allowable 
responses (in this case a keyboard with keys 'f' and 'j'), correct 
attribute, sets the duration, and then sets up the rest of the properties. 
 This list is pretty much all of the properties for any given slide object. 
 The only way to change these properties directly is by using this inline, 
figuring out which property is which, and then making the adjustments 
accordingly.

There is also another way.  Instead of creating two attributes, you can have 
one "CorrectResp" attribute (this way, you will not need to use the above 
inline).  Then you will need an inline that says the following:

dim y as integer

For y = 1 to List1.Size
Select Case c.getattrib ("Group")
    Case "Expt1"
        If List1.getattrib("Stimulus") = "Property1" then
            List1.setattrib(y, "CorrectResp"), "F"
        Elseif List1.getattrib("Stimulus")="Property2" then
            List1.setattrib(y, "CorrectResp")="J"
        Else
            MsgBox "Set Correct Response Error Expt 1"

Then just repeat this for Case "Expt2"

You just need to place this before you run your testing procedure and set 
the TestSlide 'Correct: ' Property field to [CorrectResp].

I hope this helps.  If anyone else has more elegant solutions than this 
(this is admittedly basic), please feel free to post.

Caleb J. Picker

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.linguistlist.org/pipermail/eprime/attachments/20110111/9ee47fdf/attachment.htm>


More information about the Eprime mailing list