Unable to initialize item number 1. Verify the item exists and is correctly defined.


Author
Message
james.schmidt
james.schmidt
Associate Member (217 reputation)Associate Member (217 reputation)Associate Member (217 reputation)Associate Member (217 reputation)Associate Member (217 reputation)Associate Member (217 reputation)Associate Member (217 reputation)Associate Member (217 reputation)Associate Member (217 reputation)
Group: Forum Members
Posts: 2, Visits: 11
I am new to Inquisit and receiving the above error message that I am not sure I understand after a bunch of sanity checks. The offending line of code seems to be here:

<picture primeS>
/ items = ("<%values.currShape%>")
/ size = (15%,15%)
</picture>


The values.currShape item will change on each trial on the basis of ontrialbegin code like the following:

/ ontrialbegin = [values.randNum = rand(0,3); values.currWord=""; values.distType=2;
if(values.randNum < 1){values.currShape=values.shape1; values.contingency=0;}
else if(values.rndNumber < 2){values.currShape=values.shape2; values.contingency=1;}
else{values.currShape=values.shape3; values.contingency=1;}]

The values.shape1, values.shape2, and values.shape3 file names are themselves set earlier with an onexptbegin randomization:

/ onexptbegin=[if (values.rndShape==0){values.shape1=values.shapeA; values.shape2=values.shapeB; values.shape3=values.shapeC;}
else if (values.rndShape==1){values.shape1=values.shapeA; values.shape2=values.shapeC; values.shape3=values.shapeB;}
else if (values.rndShape==2){values.shape1=values.shapeB; values.shape2=values.shapeA; values.shape3=values.shapeC;}
else if (values.rndShape==3){values.shape1=values.shapeB; values.shape2=values.shapeC; values.shape3=values.shapeA;}
else if (values.rndShape==4){values.shape1=values.shapeC; values.shape2=values.shapeA; values.shape3=values.shapeB;}
else{values.shape1=values.shapeC; values.shape2=values.shapeB; values.shape3=values.shapeA;}]

I have confirmed that: valuesA, valuesB, and valuesC are being correctly assigned to values1, values2, and values3 (onexptbegin code above), and that currShape is correctly taking on a trial-by-trial basis one of these values based on a random calculation (ontrialbegin code above). I have also confirmed that picture objects can take code like:

items = ("<%values.[_something_]%>")

as long as the value does not change (???).
I have also confirmed that literally identical code for text objects works exactly as intended, as in:

<text primeW>
/ items = ("<%values.currWord%>")
/ color = black
</text>

The fact that it works for text but not pictures is particularly confusing. Am I trying to do something that is impossible in Inquisit? Note that trying to make multiple versions of the stimulus assignments with subjects = (1 of x) type code is definitely not feasible for this particular experiment where there are way too many combinations of stimulus assignments. It needs to be randomized somehow. Thanks for any suggestion.

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: 98K
james.schmidt - Wednesday, December 13, 2017
I am new to Inquisit and receiving the above error message that I am not sure I understand after a bunch of sanity checks. The offending line of code seems to be here:

<picture primeS>
/ items = ("<%values.currShape%>")
/ size = (15%,15%)
</picture>


The values.currShape item will change on each trial on the basis of ontrialbegin code like the following:

/ ontrialbegin = [values.randNum = rand(0,3); values.currWord=""; values.distType=2;
if(values.randNum < 1){values.currShape=values.shape1; values.contingency=0;}
else if(values.rndNumber < 2){values.currShape=values.shape2; values.contingency=1;}
else{values.currShape=values.shape3; values.contingency=1;}]

The values.shape1, values.shape2, and values.shape3 file names are themselves set earlier with an onexptbegin randomization:

/ onexptbegin=[if (values.rndShape==0){values.shape1=values.shapeA; values.shape2=values.shapeB; values.shape3=values.shapeC;}
else if (values.rndShape==1){values.shape1=values.shapeA; values.shape2=values.shapeC; values.shape3=values.shapeB;}
else if (values.rndShape==2){values.shape1=values.shapeB; values.shape2=values.shapeA; values.shape3=values.shapeC;}
else if (values.rndShape==3){values.shape1=values.shapeB; values.shape2=values.shapeC; values.shape3=values.shapeA;}
else if (values.rndShape==4){values.shape1=values.shapeC; values.shape2=values.shapeA; values.shape3=values.shapeB;}
else{values.shape1=values.shapeC; values.shape2=values.shapeB; values.shape3=values.shapeA;}]

I have confirmed that: valuesA, valuesB, and valuesC are being correctly assigned to values1, values2, and values3 (onexptbegin code above), and that currShape is correctly taking on a trial-by-trial basis one of these values based on a random calculation (ontrialbegin code above). I have also confirmed that picture objects can take code like:

items = ("<%values.[_something_]%>")

as long as the value does not change (???).
I have also confirmed that literally identical code for text objects works exactly as intended, as in:

<text primeW>
/ items = ("<%values.currWord%>")
/ color = black
</text>

The fact that it works for text but not pictures is particularly confusing. Am I trying to do something that is impossible in Inquisit? Note that trying to make multiple versions of the stimulus assignments with subjects = (1 of x) type code is definitely not feasible for this particular experiment where there are way too many combinations of stimulus assignments. It needs to be randomized somehow. Thanks for any suggestion.

The problem and difference is that with a <picture> element, an external file is involved, whereas with a <text> element everything is internal. The consequence: Inquisit does not "know" that the external file you set values.currShape to actually exists / cannot ensure its existence at the time the script is initially parsed. There are several ways to deal with this. My preferred way is to work with item numbers instead, i.e.

<picture primeS>
/ items = primeSitems
/ size = (15%, 15%)
/ select = values.currshape
</picture>

<item PrimeSitems>
/ 1 = "a.jpg"
/ 2 = "b.jpg"
/ 3 = "c.jpg"
</items>

with the values initialized as:

<values>
/ shapeA = 1
/ shapeB = 2
/ shapeC = 3

/ shape1 = 1
/ shape2 = 1
/ shape3 = 1

/ currshape = 1
</values>

The rest of the code, then, should work as is.
.

james.schmidt
james.schmidt
Associate Member (217 reputation)Associate Member (217 reputation)Associate Member (217 reputation)Associate Member (217 reputation)Associate Member (217 reputation)Associate Member (217 reputation)Associate Member (217 reputation)Associate Member (217 reputation)Associate Member (217 reputation)
Group: Forum Members
Posts: 2, Visits: 11
Thanks for the response. I managed to work out a similar solution. Also caught a few typos in the above randomization code (oops). Everything is working fine now, I think. 
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search