Use rotation attribute to determine correct response


Author
Message
kev_dent
kev_dent
Partner Member (726 reputation)Partner Member (726 reputation)Partner Member (726 reputation)Partner Member (726 reputation)Partner Member (726 reputation)Partner Member (726 reputation)Partner Member (726 reputation)Partner Member (726 reputation)Partner Member (726 reputation)
Group: Forum Members
Posts: 47, Visits: 153
I have a script I am working on in which observers decide if a face is rotated clockwise or counterclockwise.
When I use the code (iscorrectresponse) below to determine the correct response on each trial it does not seem to work.
Can you tell me what I am doing wrong here.

<list rotate>
/items=(15,-15)
/poolsize =30
/ selectionrate = always
</list>

<item neutralmale>
/1="WM01/WM01_NO.jpg"
/2="WM02/WM02_NO.jpg"
/3="WM03/WM03_NO.jpg"
/4="WM04/WM04_NO.jpg"
/5="WM05/WM05_NO.jpg"
</item>

<picture maletarget>
/ items = neutralmale
/ selectionrate = always
/size = (150,150)
/rotation = list.rotate.nextvalue
/ position = ((list.poslistx.nextvalue), (list.poslisty.currentvalue))
/ transparentcolor = (white)
</picture>

<trial search>
/ beginresponseframe = 30

/ontrialbegin =[picture.maletarget.resetselection();list.poslistx.reset();list.poslisty.reset()]
/ posttrialpause = 200
/stimulusframes =[
1 =blank,fix;30=blank,maletarget]
/ inputdevice = keyboard
/ validresponse = ("z" "n")
/ iscorrectresponse = [(picture.maletarget.rotation == 15 && trial.search.response == 49)||(picture.maletarget.rotation == -15 && trial.search.response == 44)]
</trial>

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 100K
kev_dent - 10/31/2023
I have a script I am working on in which observers decide if a face is rotated clockwise or counterclockwise.
When I use the code (iscorrectresponse) below to determine the correct response on each trial it does not seem to work.
Can you tell me what I am doing wrong here.

<list rotate>
/items=(15,-15)
/poolsize =30
/ selectionrate = always
</list>

<item neutralmale>
/1="WM01/WM01_NO.jpg"
/2="WM02/WM02_NO.jpg"
/3="WM03/WM03_NO.jpg"
/4="WM04/WM04_NO.jpg"
/5="WM05/WM05_NO.jpg"
</item>

<picture maletarget>
/ items = neutralmale
/ selectionrate = always
/size = (150,150)
/rotation = list.rotate.nextvalue
/ position = ((list.poslistx.nextvalue), (list.poslisty.currentvalue))
/ transparentcolor = (white)
</picture>

<trial search>
/ beginresponseframe = 30

/ontrialbegin =[picture.maletarget.resetselection();list.poslistx.reset();list.poslisty.reset()]
/ posttrialpause = 200
/stimulusframes =[
1 =blank,fix;30=blank,maletarget]
/ inputdevice = keyboard
/ validresponse = ("z" "n")
/ iscorrectresponse = [(picture.maletarget.rotation == 15 && trial.search.response == 49)||(picture.maletarget.rotation == -15 && trial.search.response == 44)]
</trial>

Because your list is set to selectionrate always, every time you query the rotation property, a new value will be selected. This is obviously counterproductive and will lead to wrong results. The list ought to be set to selectionrate trial for this to make sense and work.
kev_dent
kev_dent
Partner Member (726 reputation)Partner Member (726 reputation)Partner Member (726 reputation)Partner Member (726 reputation)Partner Member (726 reputation)Partner Member (726 reputation)Partner Member (726 reputation)Partner Member (726 reputation)Partner Member (726 reputation)
Group: Forum Members
Posts: 47, Visits: 153
Hi actually the example I sent was simplified. In the full code multiple faces are presented on each trial with each face rotated according to a query of the rotation list. If selection rate were to be set to trial all faces would have the same rotation which is not what I'm aiming for.

/ stimulusframes =[1 =blank,fix;30=blank,nef1,nef2,maletarget]
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 100K
kev_dent - 10/31/2023
Hi actually the example I sent was simplified. In the full code multiple faces are presented on each trial with each face rotated according to a query of the rotation list. If selection rate were to be set to trial all faces would have the same rotation which is not what I'm aiming for.

/ stimulusframes =[1 =blank,fix;30=blank,nef1,nef2,maletarget]

Then you ought to use variables, or at least one variable for the target, instead of referencing the list directly (which, as I explained, will lead to a new rotation value being sampled whenever the target's rotation is queried).

<values>
/ targetrotation = 0
</values>

<picture maletarget>
..
/rotation = values.targetrotation
...
</picture>

<trial search>
/ ontrialbegin = [
    values.targetrotation = list.rotate.nextvalue;
]
...
</trial>
kev_dent
kev_dent
Partner Member (726 reputation)Partner Member (726 reputation)Partner Member (726 reputation)Partner Member (726 reputation)Partner Member (726 reputation)Partner Member (726 reputation)Partner Member (726 reputation)Partner Member (726 reputation)Partner Member (726 reputation)
Group: Forum Members
Posts: 47, Visits: 153
Thanks, I can implement it like that.
If I wished to have two rotation lists, and flip between these two lists over trials but select from one list within each trial what would be the best way to do that?
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 100K
kev_dent - 10/31/2023
Thanks, I can implement it like that.
If I wished to have two rotation lists, and flip between these two lists over trials but select from one list within each trial what would be the best way to do that?

Make a list of lists, use a variable to switch between them.

https://forums.millisecond.com/Topic26477.aspx
kev_dent
kev_dent
Partner Member (726 reputation)Partner Member (726 reputation)Partner Member (726 reputation)Partner Member (726 reputation)Partner Member (726 reputation)Partner Member (726 reputation)Partner Member (726 reputation)Partner Member (726 reputation)Partner Member (726 reputation)
Group: Forum Members
Posts: 47, Visits: 153
Thanks, list of lists worked.
I guess resetting the items within a single list on each trial would also work, but more is more cumbersome.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search