Group: Administrators
Posts: 13K,
Visits: 102K
|
Jens,
<picture dot.pic> /items = ("DotHor.png", "DotVer.png") </picture>
Defines a <picture> element with two items. Since no /select attribute is specified, the default is used -- which is 'noreplace'.
In your <trial> elements, you constantly change what the *first* item in that <picture> element is:
<trial target.neg.left> /ontrialbegin = [if (list.pos.tar.neg.left.nextvalue == 1) {picture.dot.pic.hposition = values.left; values.pos = values.left; picture.dot.pic.setitem("DotHor.png", 1); values.file.name = "DotHor.png";} ... else if (list.pos.tar.neg.left.nextvalue == 4) {picture.dot.pic.hposition = values.right; values.pos = values.right; picture.dot.pic.setitem("DotVer.png", 1); values.file.name = "DotVer.png";}] ... </trial>
That, however, *does not change the fact that there are two items in the element which are being sampled randomly without replacement*. There is no reason whatsoever why only the 1st item -- which is what you set -- should be sampled and thus displayed in any given trial.
Suppose that in the very first trial you run, you set the 1st item to "DotVer.png". Your <picture> element now effectively looks like this:
<picture dot.pic> /items = ("DotVer.png", "DotVer.png") </picture>
i.e., you now sample without replacement from *two identical items*. Further suppose that in that first trial the 1st item is randomly drawn. The trial will thus display "DotVer.png".
Since you are sampling *without replacement*, in the *next* trial the 2nd item will *inevitably* be sampled -- which is also "DotVer.png". And this is true *regardless* of whatever you set the 1st item to at the beginning of that 2nd trial. That's where you're apparent "mismatches" come from.
You either need to make sure that the <picture> constantly selects the 1st item as in
<picture dot.pic> /items = ("DotHor.png", "DotVer.png") / select = 1 </picture>
or abandon the setitem() approach, which is what I would *highly* recommend due to performance reasons alone. Instead use a simple variable to select the proper item as in
<values> ... / dot.pic.item = 1 ... </values>
<picture dot.pic> /items = ("DotHor.png", "DotVer.png") / select = values.dot.pic.item </picture>
with
<trial target.neg.left> /ontrialbegin = [if (list.pos.tar.neg.left.nextvalue == 1) {picture.dot.pic.hposition = values.left; values.pos = values.left; values.dot.pic.item = 1; values.file.name = "DotHor.png";} ... else if (list.pos.tar.neg.left.nextvalue == 4) {picture.dot.pic.hposition = values.right; values.pos = values.right; values.dot.pic.item = 2; values.file.name = "DotVer.png";}] ... </trial>
and so forth.
|