specify image stimulus based on participant input

37 views
Skip to first unread message

arm...@uchicago.edu

unread,
Mar 31, 2018, 6:39:30 PM3/31/18
to E-Prime
Hi All,

I'm trying to present an image on Slide B that participants chose on Slide A. 

On Slide A, they see several cartoon avatars and are asked to choose one to represent them in the coming task. They do this by typing the number associated with each avatar (1-9).

On Slide B, I would like to show this avatar.

Currently, I have created an attribute called "avatar" and typed [avatar] into 'Filename' in the Properties window of the image on Slide B.

Before this but after Slide A there is an inline script that reads:


If GirlAvChoice.RESP = "1" Then
c.SetAttrib("avatar") = "Avatars/FPD_Avatars/Chicago/Chicago_Female/Female5_MBrBl_Chicago.jpg"
Else c.SetAttrib("avatar") = "Avatars/FPD_Avatars/X_big.jpg"
End If


However, when I try to generate the script, a warning that 'SetAttrib is not a method of the object'appears.
I know this must be very simple, and that there are probably oodles of tutorials on it but am having trouble finding them (maybe not using the right search terms...)

Any advice would be much appreciated!


Thanks

Mika

David McFarlane

unread,
Apr 2, 2018, 2:31:05 PM4/2/18
to e-p...@googlegroups.com
Looks like yet another case of "PreRelease prior to an InLine". Please
see groups.google.com/d/topic/e-prime/Liej8Ik83sU , and make sure to
follow all the links posted in that thread to get the full picture.
Although, note that the pstnet articles have moved, the new links are

support.pstnet.com/hc/en-us/articles/229355567-NEW-FEATURE-GeneratePreRun-and-GeneratePostRun-properties-18177-

and

support.pstnet.com/hc/en-us/articles/229355227-NEW-FEATURE-PreRelease-defaults-changed-to-promote-better-timing-accuracy-17936-

---------------
David McFarlane
E-Prime® 2.0 training online:
psychology.msu.edu/workshop-and-additional-course/e-prime-introduction-to-programming-computerized-behavioral-tasks
Twitter: @EPrimeMaster (twitter.com/EPrimeMaster)

arm...@uchicago.edu

unread,
Apr 2, 2018, 3:54:30 PM4/2/18
to E-Prime
Hey, David,

Thanks very much for your response. I'm not sure if that 's the issue, though. I read through the links and tried out some other suggested changes, but I don't know that the error is because of a PreRelease issue. The inline that assigns the image to the avatar occurs in a the 'mother' procedure ahead of the one that contains the slide that refers to it for image location.

Experiment Proc
  AvatarAssign (inline posted above)
  PlayerList
    PlayerProc
      Slide B (slide that has avatar image on it)

The error in the Full Script occurs on this line of code:

Slide B_SlideImage.Filename = c.GetAttrib(ebLCase_a & ebLCase_v & ebLCase_a & ebLCase_t & ebLCase_a & ebLCase_r)

David McFarlane

unread,
Apr 2, 2018, 4:49:30 PM4/2/18
to e-p...@googlegroups.com
Mika,

Oops, I overlooked the error message that you specified at the end of
your post. Here is your error message:

'SetAttrib is not a method of the object'

Yes, that is a different matter. I also failed to look carefully at
your inline code, which may have triggered that error. In particular, a
line like

c.SetAttrib("avatar") = "Chicago.jpg"

would trigger that error (I actually just tried that to make sure). The
proper form would be

c.SetAttrib "avatar", "Chicago.jpg"

Please look at the Context Object topic in the E-Basic Help facility for
more information on SetAttrib and GetAttrib. I cannot quite figure out
why your mistake would trigger that particular error though.

That said, in your latest message you say that you get the error message
on a line that instead uses c.GetAttrib, with proper syntax, so I may
not have yet gotten to your issue.

-- David McFarlane

arm...@uchicago.edu

unread,
Apr 2, 2018, 4:59:38 PM4/2/18
to E-Prime
Hey, Dave,

Thanks again for your help. I figured it out - I'd had a jump in between the slide on which folk select their avatar and the inline that assigned the avatar's stimulus path (the jump is in there because there are different avatar selection slides for boys and girls, so only girls see the girl avatar slide, and only boys see the boy one.). so the inline was being completely skipped.  Was a stupid error on my part, but thank you very much for your help. Your posts have helped me oodles in the past; you a blessing to the ePrime community.

Thanks,

Mika
Reply all
Reply to author
Forward
0 new messages