Set position of shape in a list?


Author
Message
nashby
nashby
Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)
Group: Forum Members
Posts: 78, Visits: 159
I am trying to design a simple change detection task where a flash say what quadrant participants need to remember items from and then random colored boxes (with no repetition) are flashed in that quadrant of the screen and then return (sometimes the same colored boxes, sometimes different).  I am having a hard time trying to define where the positions of the boxes are. So far I have this which creates a list with the random colored boxes and then adds them into the memory and test trials, but I cannot seem to define the locations of the list items which is important as I need to say for instance that the first two items in the list show up in locations X1 and X2, while the next items show up in a different quadrant. 

I have tried things like this:
shape.list.cb1.item.1.hposition =
list.cb1.item.1.hposition =

but these do not work. Getting quite frustrated as I cannot find any documentation or examples to help with this (been stuck on it about a week now).

Any help would be greatly appreciated. 

<trial Set1>
/ trialduration = 500
/ ontrialbegin = [trial.set1.clearstimulusframes()]
/ ontrialbegin = [trial.set1.insertstimulusframe(shape.FlashUR, 1)]
/ ontrialbegin = [trial.memory.clearstimulusframes()]
/ ontrialbegin = [list.cb1.clearitems()]
/ ontrialbegin = [list.cb1.insertitem(counter.colorboxes.selectedvalue, 1); list.cb1.insertitem(counter.colorboxes.selectedvalue, 2); list.cb1.insertitem(counter.colorboxes.selectedvalue, 3);]


/ ontrialbegin = [{trial.memory.insertstimulusframe(list.cb1.items.1, 1); trial.Memory.insertstimulusframe(list.cb1.items.2, 2);}]
/ ontrialbegin = [{trial.test.insertstimulusframe(list.cb1.items.1, 1); trial.test.insertstimulusframe(list.cb1.items.2, 2);}]

</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: 13K, Visits: 108K
> I have tried things like this:
> shape.list.cb1.item.1.hposition =
> list.cb1.item.1.hposition =

list elements don't have any position properties, the underlying shape elements do. You thus need to manipulate those element's position.

shape.someshape.hposition = ...

nashby
nashby
Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)
Group: Forum Members
Posts: 78, Visits: 159
Hey Dave thanks for the response. I know how to define a shape position but that will not work for this purpose as it would require me to know the name of the shape which I dont as it needs to be random. Basically I am adding boxes to a list randomly using a counter. I then need to define that the first item in a list go to location X Y, while the second go to location X2 Y2. Is there no way to do this? 
nashby
nashby
Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)
Group: Forum Members
Posts: 78, Visits: 159
I have also tried this which doesnt break the code but doesnt set the locations either.
/ ontrialbegin = [shape.{list.cb1.items.1}.hposition = (counter.locationsx.selectedvalue );shape.{list.cb1.items.1}.vposition = (counter.locationsy.selectedvalue );]


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: 13K, Visits: 108K
I'm pretty sure there is a way to do this, however, the few code snippets you posted don't convey sufficient detail re. your setup. Can you provide a simplified, concise, self-contained (i.e. runnable) example?

As to this:

"I have also tried this which doesnt break the code but doesnt set the locations either.
/ ontrialbegin = [shape.{list.cb1.items.1}.hposition = (counter.locationsx.selectedvalue );shape.{list.cb1.items.1}.vposition = (counter.locationsy.selectedvalue );]"

It's invalid syntax and should not be expected to work.

nashby
nashby
Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)
Group: Forum Members
Posts: 78, Visits: 159
Here is the experiment I am trying to program (http://www.geocities.ws/maro_g_machizawa/documents/Nature2005.pdf) its experiment 2.

This is the design in a nutshell:
I have 7 different colored boxes. On each trial a quadrant ( if two items) or side of the screen (if 4 items) is indicated as being the area where participants need to remember what is flashed. Then, either 2 (in the same quadrant) or 4 (2 in upper quadrant, 2 in lower quadrant) non repeating randomly selected colored boxes from the list of 7 are flashed within that quadrant or side, but at random locations which do not overlap. Following the flash there is a brief blank screen and then the colored boxes come back in the same locations as before but on 50% of trials one of the colored boxes changes color. Participants task is to say whether they are the same or different. 



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: 13K, Visits: 108K
As a starting point, consider the below minimal example. Suppose you have two shapes A and B, both to be presented in a given trial at different times in random order. You want the 1st shape presented to always be on the left side, the 2nd always on the right side -- regardless of whether the 1st shape displayed is A or B:

<block myblock>
/ trials = [1-4=mytrial]
</block>

<trial mytrial>
/ posttrialpause = 500
/ stimulustimes = [0=list.shapelist; 1000=list.shapelist]
/ validresponse = (57)
</trial>

<list shapelist>
/ items = (shape.a, shape.b)
/ selectionmode = random
/ selectionrate = always
</list>

<shape a>
/ shape = rectangle
/ size = (5%, 5%)
/ color = (red)
/ vposition = 50%
/ hposition = list.hposlist.nextvalue
</shape>

<shape b>
/ shape = rectangle
/ size = (5%, 5%)
/ color = (blue)
/ vposition = 50%
/ hposition = list.hposlist.nextvalue
</shape>

<list hposlist>
/ items = (25%, 75%)
/ selectionrate = always
/ selectionmode = sequence
</list>

Note that you need not know a shape's name to achieve the positioning.

nashby
nashby
Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)
Group: Forum Members
Posts: 78, Visits: 159
But how do I then get the same items to show in the same locations in the next trial which is the test array? Also, wouldnt I then have to define each shape multiple times just to get it to be able to show up in each specific quadrant? And then how do I get the same shape to not show up in different quadrants? 

I guess I am just not getting how to get this to work.

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: 13K, Visits: 108K
> But how do I then get the same items to show in the same locations in the next trial which is the test array?

Store the positions in a list and replay in sequence.

> Also, wouldnt I then have to define each shape multiple times just to get it to be able to show up in each specific quadrant?

 No, why? Referring back to the example in my previous reply, you'll notice that neither shape A nor shape A is defined multiple times and yet they show up in different screen halves (can be easily extended to quadrants or whatever).

> And then how do I get the same shape to not show up in different quadrants? 

You sample from the set of shapes without replacement?

nashby
nashby
Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)
Group: Forum Members
Posts: 78, Visits: 159
Ok I get the storing but what a lot of work for what should be really simple.


Also I need exactly 2 items to go to quadrant 1 which can have a total of say 30 locations, and need 2 items to go to quadrant 2 which can have 30 locations. The way the above code looks I could not control what quadrant for each shape drawn?


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search