How to delete items from pictures, and to be able to use remaining ones in another trial?


Author
Message
mingwu
mingwu
Partner Member (693 reputation)Partner Member (693 reputation)Partner Member (693 reputation)Partner Member (693 reputation)Partner Member (693 reputation)Partner Member (693 reputation)Partner Member (693 reputation)Partner Member (693 reputation)Partner Member (693 reputation)
Group: Forum Members
Posts: 6, Visits: 16
My task is to run the trials where I show some pictures(not all) from summerpicture, and once I have finished to show them, I would like to have 2 collections of: 1.pictures that were displayed and 2. pictures that were not displayed!!. I need to show non-displayed pictures separately for my second trial. 

Here is my thinking:
I think my problem occurs in ontrialend. 
Actually, my first trial(summerdelete) does not show any errors


<trial summerdelete> 
/ontrialbegin = [
values.congruency = 1;
]
/ stimulustimes = [1=summerpicture]
/ correctresponse = ("d")
/ validresponse = ("d", "f", "j", "k")
/ontrialend = [
item.summerremained.removeitem(picture.summerpicture.currentindex);
item.summerdisplayed.appenditem(picture.summerpicture.currentitem);
]
</trial>

However, when I run the second one, 

<trial summershow> 
/ontrialbegin = [
values.congruency = 1;
]
/ stimulustimes = [1=summerpicturerest]
/ correctresponse = ("d")
/ validresponse = ("d", "f", "j", "k")
/ontrialend = [
list.latencies.insertitem(trial.purpleincongruent.latency, 1);

I get an error, for example
Unable to initialize <picture summerpicturerest> item number 8. Verify the item exists and is correctly defined.

Please, help. I think the way I am deleting items is wrong. 
Here is, how I am declaring items and pictures.

<item summeroriginal>
/1="Summer/1.jpg"
/2="Summer/2.jpg"
/3="Summer/3.jpg"
/4="Summer/4.jpg"
/5="Summer/5.jpg"
/6="Summer/6.jpg"
/7="Summer/7.jpg"
/8="Summer/8.jpg"
</item>

<item summerremained>
/1="Summer/1.jpg"
/2="Summer/2.jpg"
/3="Summer/3.jpg"
/4="Summer/4.jpg"
/5="Summer/5.jpg"
/6="Summer/6.jpg"
/7="Summer/7.jpg"
/8="Summer/8.jpg"
</item>

<item summerdisplayed>
</item>


<picture summerpicture>
/ items = summeroriginal
/ valign =center
/ height = 35
/halign=center
/ width = 80
/ size = (60%,60%)
</picture>

<picture summerpicturerest>
/ items = summerremained
/ valign =center
/ height = 35
/halign=center
/ width = 80
/ size = (60%,60%)
</picture>

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: 105K
mingwu - Sunday, November 06, 2016
My task is to run the trials where I show some pictures(not all) from summerpicture, and once I have finished to show them, I would like to have 2 collections of: 1.pictures that were displayed and 2. pictures that were not displayed!!. I need to show non-displayed pictures separately for my second trial. 

Here is my thinking:
I think my problem occurs in ontrialend. 
Actually, my first trial(summerdelete) does not show any errors


<trial summerdelete> 
/ontrialbegin = [
values.congruency = 1;
]
/ stimulustimes = [1=summerpicture]
/ correctresponse = ("d")
/ validresponse = ("d", "f", "j", "k")
/ontrialend = [
item.summerremained.removeitem(picture.summerpicture.currentindex);
item.summerdisplayed.appenditem(picture.summerpicture.currentitem);
]
</trial>

However, when I run the second one, 

<trial summershow> 
/ontrialbegin = [
values.congruency = 1;
]
/ stimulustimes = [1=summerpicturerest]
/ correctresponse = ("d")
/ validresponse = ("d", "f", "j", "k")
/ontrialend = [
list.latencies.insertitem(trial.purpleincongruent.latency, 1);

I get an error, for example
Unable to initialize <picture summerpicturerest> item number 8. Verify the item exists and is correctly defined.

Please, help. I think the way I am deleting items is wrong. 
Here is, how I am declaring items and pictures.

<item summeroriginal>
/1="Summer/1.jpg"
/2="Summer/2.jpg"
/3="Summer/3.jpg"
/4="Summer/4.jpg"
/5="Summer/5.jpg"
/6="Summer/6.jpg"
/7="Summer/7.jpg"
/8="Summer/8.jpg"
</item>

<item summerremained>
/1="Summer/1.jpg"
/2="Summer/2.jpg"
/3="Summer/3.jpg"
/4="Summer/4.jpg"
/5="Summer/5.jpg"
/6="Summer/6.jpg"
/7="Summer/7.jpg"
/8="Summer/8.jpg"
</item>

<item summerdisplayed>
</item>


<picture summerpicture>
/ items = summeroriginal
/ valign =center
/ height = 35
/halign=center
/ width = 80
/ size = (60%,60%)
</picture>

<picture summerpicturerest>
/ items = summerremained
/ valign =center
/ height = 35
/halign=center
/ width = 80
/ size = (60%,60%)
</picture>

Instead of removing images from and appending them to <item> elements, the better way is to simply work with *item numbers* and distribute them to various <list>s for selection. See e.g. https://www.millisecond.com/forums/FindPost17070.aspx

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search