Bug in Modifying Change Blindness Script


Author
Message
ldb24
ldb24
Partner Member (886 reputation)Partner Member (886 reputation)Partner Member (886 reputation)Partner Member (886 reputation)Partner Member (886 reputation)Partner Member (886 reputation)Partner Member (886 reputation)Partner Member (886 reputation)Partner Member (886 reputation)
Group: Forum Members
Posts: 13, Visits: 47

I am currently modifying the Change Blindness task posted in the task library and I've run into a bug. I am making the task simpler by having only 7 basic shapes (colored squares) for stimuli, presenting 1-4 shapes at a time, and participants make a same or different response to the test array (one item changes on a different trial; so no forced choice task as in the original script).


I'm running into 2 problems.


1) On some trials, an extra item is added to the test array or an item is deleted from the test array. So, if the number of objects is 3, sometimes the study array will have 3 items but then on the test array there is a 4th item (or there are only 2 items). I haven't been able to discern any rhyme or reason as to when the extra item shows up, but I've confirmed that it is occurring by looking at the screen captures.


2) I can only get a handful of trials in after the 10 practice trials before I get this error: "Unable to initialize <picture object2> item number 0. Verify the item exists and is correctly defined." The picture is not always object2. Based on what I can gather from the raw data, the values.numberofobjects variable (which determines how many objects to present) is correct, but for some reason on the study array trial it tries to present an additional item than it should. This doesn't happen on every trial which seems odd to me. I'm pretty sure the problem lies somewhere in this part of the script:


Note: trial.start resets variables at the beginning of each
new trial and selects the numberof array items for the current array


<trial start>


/ontrialbegin = [if (values.practice == 1)
values.numberofobjects = 4 else values.numberofobjects =
list.objectnumberinarray.nextvalue]


/ontrialbegin = [values.countobjects = 0]


/ontrialbegin = [list.arrayobjects.reset(); reset(list.possiblearrayobjects);
values.array_itemnumbers = ""]


/ontrialbegin = [values.object1 = 0; values.object2 = 0;
values.object3 = 0; values.object4 = 0]


/ontrialbegin = [if (values.practice == 1)
values.arraypresentationtime = values.practice_arraypresentationtime else
values.arraypresentationtime = values.test_arraypresentationtime]


/timeout = 0


/branch = [trial.createarray]


/recorddata = false


</trial>


Note: trial.createarray selects the itemnumbers of the
specified number of array items (3-16) from the entire pool of items and stores
them into list.arrayobjects.


<trial createarray>


/ontrialbegin = [values.countobjects += 1]


/ontrialbegin = [values.object =
list.possiblearrayobjects.nextvalue]


/ontrialbegin = [values.array_itemnumbers =
concat(values.array_itemnumbers, values.object)]


/ontrialbegin = [values.array_itemnumbers =
concat(values.array_itemnumbers, ",")]


/ontrialbegin = [list.arrayobjects.insertitem(values.object,
list.arrayobjects.itemcount+1)]


/timeout = 0


/branch = [if (values.countobjects <
values.numberofobjects) trial.createarray else trial.createarray2]


/recorddata = false


</trial>


Note: trial.createarray2 assigns itemnumbers and randomly
selected screen coordinates to the specified number of objects as well as
selects the prechanged object, postchanged objects, foils and unrelated objects
for the following forced choice tasks.


<trial createarray2>


/ontrialbegin = [if (values.numberofobjects >= 1)
{values.object1 = list.arrayobjects.nextvalue; values.object1_x =
list.screencoordinates_x.nextvalue; values.object1_y =
list.screencoordinates_y.nextvalue}]


/ontrialbegin = [if (values.numberofobjects >= 2)
{values.object2 = list.arrayobjects.nextvalue; values.object2_x =
list.screencoordinates_x.nextvalue; values.object2_y =
list.screencoordinates_y.nextvalue}]


/ontrialbegin = [if (values.numberofobjects >= 3)
{values.object3 = list.arrayobjects.nextvalue; values.object3_x =
list.screencoordinates_x.nextvalue; values.object3_y =
list.screencoordinates_y.nextvalue}]


/ontrialbegin = [if (values.numberofobjects >= 4)
{values.object4 = list.arrayobjects.nextvalue; values.object4_x =
list.screencoordinates_x.nextvalue; values.object4_y =
list.screencoordinates_y.nextvalue}]


/ontrialbegin = [values.testobject = values.object1]


/ontrialbegin = [values.newobject =
list.possiblearrayobjects.nextvalue]


/ontrialbegin = [values.sameordifferenttrial =
list.sameordifferentarray.nextvalue]


/timeout = 0


/branch = [trial.fixation]


/recorddata = false


</trial>


Note: trial.studyarray presents the first array


<trial studyarray>


/ontrialbegin = [if (values.numberofobjects
>= 1) trial.studyarray.insertstimulusframe(picture.object1, 1)]


/ontrialbegin = [if (values.numberofobjects
>= 2) trial.studyarray.insertstimulusframe(picture.object2, 1)]


/ontrialbegin = [if (values.numberofobjects
>= 3) trial.studyarray.insertstimulusframe(picture.object3, 1)]


/ontrialbegin = [if (values.numberofobjects
>= 4) trial.studyarray.insertstimulusframe(picture.object4, 1)]


/ontrialend =
[trial.studyarray.resetstimulusframes()]


/timeout = values.arraypresentationtime


/branch = [if (values.sameordifferenttrial ==
1) trial.sametrial else trial.differenttrial]


/posttrialpause = values.array_ISI


/recorddata = false


/screencapture = true

























</trial>


But I'm really not sure, so I attached the full script in text format (note that I'm not 100% finished with modifying the script in that I haven't customized the instructions). 


I've been staring at this for a few days and just can't see where the bug is. I tried to keep the script as similar as possible to the one posted in the task library, but I've obviously missed something here. Any ideas?


Thanks!


Attachments
ChangeDetectionScript.txt (210 views, 24.00 KB)
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

1) On some trials, an extra item is added to the test array or an item is deleted from the test array. So, if the number of objects is 3, sometimes the study array will have 3 items but then on the test array there is a 4th item (or there are only 2 items). I haven't been able to discern any rhyme or reason as to when the extra item shows up, but I've confirmed that it is occurring by looking at the screen captures.


Note that as opposed to


<trial sametrial>
/inputdevice = keyboard
/ontrialbegin = [if (values.numberofobjects >= 1) {trial.sametrial.insertstimulusframe(text.object1, 1)}]
/ontrialbegin = [if (values.numberofobjects >= 2) {trial.sametrial.insertstimulusframe(text.object2, 1)}]
/ontrialbegin = [if (values.numberofobjects >= 3) {trial.sametrial.insertstimulusframe(text.object3, 1)}]
/ontrialbegin = [if (values.numberofobjects >= 4) {trial.sametrial.insertstimulusframe(text.object4, 1)}]
/ontrialend = [trial.sametrial.resetstimulusframes()]
/timeout = 2000
/validresponse = ("z", "m")
/correctresponse = ("z")


[...]


in


<trial differenttrial>
/inputdevice = keyboard
/ontrialbegin = [if (values.numberofobjects >= 1) {trial.differenttrial.insertstimulusframe(text.changedobject, 1)}]
/ontrialbegin = [if (values.numberofobjects >= 2) {trial.differenttrial.insertstimulusframe(text.object2, 1)}]
/ontrialbegin = [if (values.numberofobjects >= 3) {trial.differenttrial.insertstimulusframe(text.object3, 1)}]
/ontrialbegin = [if (values.numberofobjects >= 4) {trial.differenttrial.insertstimulusframe(text.object4, 1)}]
/validresponse = ("z", "m")
/correctresponse = ("m")


[...]


you never reset the stimulus presentation sequence, i.e., the state from previous rounds will be preserved.


2) I can only get a handful of trials in after the 10 practice trials before I get this error: "Unable to initialize <picture object2> item number 0. Verify the item exists and is correctly defined." The picture is not always object2. Based on what I can gather from the raw data, the values.numberofobjects variable (which determines how many objects to present) is correct, but for some reason on the study array trial it tries to present an additional item than it should. This doesn't happen on every trial which seems odd to me


The item displayed by the <picture> elements is determined by a variable (I.e. a <values> entry) in /select:


<picture object1>
/items = objects
/select = values.object1
/hposition = values.object1_x
/vposition = values.object1_y
/size = (20,20)
</picture>


There can be no such thing as a 0th item, thus whenever said value is 0 *and* a trial tries to display the respective <picture> element, this will fail. Related to #1 above.


ldb24
ldb24
Partner Member (886 reputation)Partner Member (886 reputation)Partner Member (886 reputation)Partner Member (886 reputation)Partner Member (886 reputation)Partner Member (886 reputation)Partner Member (886 reputation)Partner Member (886 reputation)Partner Member (886 reputation)
Group: Forum Members
Posts: 13, Visits: 47

Ah, okay that makes sense. I think I misunderstood the resetstimulusframes function, I'm still new to Inquisit. Works perfectly now.


Thanks again!


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search