correct answer depending on "group" startup information

349 views
Skip to first unread message

Tobi

unread,
Sep 4, 2009, 1:40:20 PM9/4/09
to E-Prime
Hi everyone,

I have a question concerning the "group" variable than can be prompted
for in the beginning of each session. I want to change the correct
answer key according to this group variable (and change the key
assignment as a consequence of corse).

In a very easy example there might be a trials with a target or no
target (blank). One group should answer with "w" for TARGET and "q"
for BLANK, the other group the other way round:

LIST:

ID Procedure corrAns
-------------------------------
1 blank [no]
1 target [yes]


I used this InLineas the very first line:

dim yes, no
if group = 1 then yes = "q" and no = "w"
if group = 2 then yes = "w" and no = "q"

Unfortunately I get the error message "Unknown function "group"".
What does that mean? I am not so familiar with Basic, so any help
might be very cool.
Maybe you have other suggestions to change key assignment by the help
of startup information.

Thanks a lot,
Tobias

Tobi

unread,
Sep 4, 2009, 6:10:53 PM9/4/09
to E-Prime
To be more understandable, here are two screenshots, one of the list
and one of the InLine:

http://chilion.com/probl1.JPG
http://chilion.com/probl2.JPG

Shin-Yi Fang

unread,
Sep 5, 2009, 5:08:56 PM9/5/09
to e-p...@googlegroups.com
Hi,

I think group is not really a variable. It  is an attribute. You will need getattrib function. The following script probably is what you need.

if c.GetAttrib("group") = 1 then
   List1.SetAttrib 1, "corrAns", "w"
   List1.SetAttrib 2, "corrAns", "q"
else
   List1.SetAttrib 1, "corrAns", "q"
   List1.SetAttrib 2, "corrAns", "w"
end if

Best,

Shin-Yi


   List1.SetAttrib 1 "corrAns")yes = "q" and no = "w"

> if group = 2 then yes = "w" and no = "q"

--
Ph.D. Student
Department of Psychology
University of Connecticut
and
Haskins Laboratories

David McFarlane

unread,
Sep 7, 2009, 1:53:56 PM9/7/09
to e-p...@googlegroups.com
You may also need to do a List1.Reset after you make changes to the
list. See the FactorSpace.Reset topic in the onine E-Basic Help.

-- David McFarlane, Professional Faultfinder


At 9/5/2009 05:08 PM Saturday, you wrote:
>Hi,
>
>I think group is not really a variable. It is an attribute. You
>will need getattrib function. The following script probably is what you need.
>
>if c.GetAttrib("group") = 1 then
> List1.SetAttrib 1, "corrAns", "w"
> List1.SetAttrib 2, "corrAns", "q"
>else
> List1.SetAttrib 1, "corrAns", "q"
> List1.SetAttrib 2, "corrAns", "w"
>end if
>
>Best,
>
>Shin-Yi
>
>
> List1.SetAttrib 1 "corrAns")yes = "q" and no = "w"
> > if group = 2 then yes = "w" and no = "q"
>
>On Fri, Sep 4, 2009 at 6:10 PM, Tobi
><<mailto:tobi...@gmail.com>tobi...@gmail.com> wrote:
>
>To be more understandable, here are two screenshots, one of the list
>and one of the InLine:
>

><http://chilion.com/probl1.JPG>http://chilion.com/probl1.JPG


>http://chilion.com/probl2.JPG
>
>
>On 4 Sep., 19:40, Tobi

Tobi

unread,
Sep 16, 2009, 5:56:42 AM9/16/09
to E-Prime
Thank you,

that works fine. Unfortunately, in my real experiment (this example
was kept simple due to comprehensiveness) I don't have 2 lines in my
list but 640. I guess there is an easier way than using 640*2 lines in
this InLine. If I understand correctly, "List1.SetAttrib 1" changes
the first line in the list and "List1.SetAttrib 2" changes the second
line.

That means, that the CorrAns value is replaced (see http://chilion.com/probl1.JPG
) no matter if [yes] or [no] was specified. In fact in my real
experiment I also have only two variables. Easiest would be to change
[yes] to let's say "D" and [no] to "F" if c.GetAttrib("group") = 1 and
the other way round if it's 2.

Is that possible?

Thanks already in advance!

Cheers,
Tobias

On 5 Sep., 23:08, Shin-Yi Fang <shinyi.f...@gmail.com> wrote:
> Hi,
>
> I think group is not really a variable. It  is an attribute. You will need
> getattrib function. The following script probably is what you need.
>
> if c.GetAttrib("group") = 1 then
>    List1.SetAttrib 1, "corrAns", "w"
>    List1.SetAttrib 2, "corrAns", "q"
> else
>    List1.SetAttrib 1, "corrAns", "q"
>    List1.SetAttrib 2, "corrAns", "w"
> end if
>
> Best,
>
> Shin-Yi
>
>    List1.SetAttrib 1 "corrAns")yes = "q" and no = "w"
>
>
>
> > if group = 2 then yes = "w" and no = "q"

liwenna

unread,
Sep 16, 2009, 12:03:52 PM9/16/09
to E-Prime
I think I posted a reply to this thread (I wrote one for sure ^.^) but
it doesn't show up... my guess is that I hit 'reply to author' by
accident, but I can't find a record of that anywhere. Tobias, if you
didn't receive mail from me, let me know, then I'll repost (right now
I am a bit lazy to do so... it's time for me to go home...).

Have a good evening everyone!

On Sep 16, 11:56 am, Tobi <tobias...@gmail.com> wrote:
> Thank you,
>
> that works fine. Unfortunately, in my real experiment (this example
> was kept simple due to comprehensiveness) I don't have 2 lines in my
> list but 640. I guess there is an easier way than using 640*2 lines in
> this InLine. If I understand correctly, "List1.SetAttrib 1" changes
> the first line in the list and "List1.SetAttrib 2" changes the second
> line.
>
> That means, that the CorrAns value is replaced (seehttp://chilion.com/probl1.JPG

David McFarlane

unread,
Sep 16, 2009, 12:17:16 PM9/16/09
to e-p...@googlegroups.com
Tobias,

>I guess there is an easier way than using 640*2 lines in this InLine.

Yes, you could use a For...Next loop.

Tobi

unread,
Nov 9, 2009, 1:06:49 PM11/9/09
to E-Prime
Thank you very much for your e-mail. Only now I had the time to have a
close look at the problem again. It helped very much to solve the
problem. Just to maybe help others, I attach your e-mail here in the
forum so that it can be found by others. I guess that you're in favor
of that as you've already tried to post it aswell but then lost it.



"Hello Tobias,

Only last week did I have something similar at hand...
In my task a version (A B C or D) is assigned to each subject based on
subject number. Several features differ between the four different
versions, one of which is the
order of the response keys. I solved this as follows; in the slides
the correct response refers to an attribute called cresp, which is
declared on the user tab. In the triallist I have two collumns one
called abcresp, other one cdcresp (version A & B, and C & D are the
same response-key wise). An inline at the start of each trial tells
eprime to take the value from either abcresp or cdcresp and use this
value as cresp, depending on the variable 'version'.

Step 1:
declare the variable cresp on the user tab: dim cresp as string

step 2:
tell the responseslide that the correct response is [cresp]

step 3:
make two attribute collums in your triallist that contain the correct
response for both your 'groups', for instance group1cresp and
croup2cresp and fill them with D's and F's accordingly

step4:
add an inline at the start of your trialproc that contains something
like this:

If c.getattrib ("group") = 1 then
c.setattrib "cresp", c.getattrib ("group1cresp")

If c.getattrib ("group") = 2 then
c.setattrib "cresp", c.getattrib ("group2cresp")

end if


I hope this helps.

Best regards,

liw"

liwenna

unread,
Nov 9, 2009, 5:53:41 PM11/9/09
to E-Prime
Thanks for posting that Tobi!

Good to know that I am not crazy :p Just pushing some wrong buttons
every now and then ;)

Additionally, I use the above thing in combination with another few
lines of script that imports a randomisationkey (in the case of my a/b/
c/d-version task this could be for instance: D C B A B D A C) from
a .txt-file and uses that to assign a version based on subject number,
so subject 1 in above case gets version D, subject 2 version C,
subject 3 version B etc etc, subject 9 is again version D, subject 10
C etc etc). This way my students don't have to bother with randomising
nor keeping track of assigning 1 of 4 different e-run files to each
subject etc. etc. If only our ICT-guys would allow us to password-lock
folders on the testcomputers it would be the perfect double-blind
system.

I'll post the lines here (it's not that hard but I am not entirely
confident that I'll type it all right from heart) if you're
interested.

Greets,

liw
Reply all
Reply to author
Forward
0 new messages