Problem with list element


Author
Message
TME_
TME_
Respected Member (304 reputation)Respected Member (304 reputation)Respected Member (304 reputation)Respected Member (304 reputation)Respected Member (304 reputation)Respected Member (304 reputation)Respected Member (304 reputation)Respected Member (304 reputation)Respected Member (304 reputation)
Group: Forum Members
Posts: 3, Visits: 33
Dear Inquisit support staff,

a colleague of mine has encountered an issue in Inquisit 5 when using a <list> element. Here is a basic script that throws the error encountered (Error: 'could not locate item 'namelist'):

*******************************SCRIPT***************************************
<values>
/ othername = 0
</values>

<block test>
/ trials = [1=test1; 2=test2]
</block>

<trial test1>
/ stimulusframes = [1=text1]
/ validresponse = (" ")
/ ontrialend = [
values.othername = text.text1.currentitem;
list.namelist.appenditem(values.othername);
]
</trial>

<trial test2>
/ stimulusframes = [1=text2]
/ validresponse = (" ")
/ ontrialend = [
values.othername = text.text2.currentitem;
]
</trial>

<text text1>
/ items = names
/ select = noreplace
</text>

<text text2>
/ items = namelist
/ select = noreplace
</text>

<item names>
/ 1 = "batrek"
/ 2 = "galmug"
/ 3 = "sordot"
/ 4 = "lapnuk"
/ 5 = "napges"
/ 6 = "nerdet"
/ 7 = "scaztu"
/ 8 = "zetdos"
/ 9 = "ekisepo"
/ 10 = "wagratu"
/ 11 = "lapusaw"
/ 12 = "lavukef"
/ 13 = "knupfim"
/ 14 = "rerubel"
/ 15 = "pezarig"
/ 16 = "jaliper"
/ 17 = "tahnluc"
/ 18 = "hiknilch"
/ 19 = "padasnut"
/ 20 = "notlinfu"
/ 21 = "gekikite"
/ 22 = "snacthec"
/ 23 = "nekaripo"
/ 24 = "secanamu"
/ 25 = "cildenug"
</item>

<list namelist>
/ selectionmode = random
/ replace = false
</list>

*******************************SCRIPT***************************************

We both could not figure out why it does not work, but since he has found out that apparently the script works when the <list> element is replaced with an <item> element. So he has a workaround but we were curious whether this is a general problem with list elements (i.e., they cannot be used as intended in the script) or whether the script needs to be/could be adjusted somehow?

Thanks in advance and have a nice weekend!

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
TME_ - Friday, January 25, 2019
Dear Inquisit support staff,

a colleague of mine has encountered an issue in Inquisit 5 when using a <list> element. Here is a basic script that throws the error encountered (Error: 'could not locate item 'namelist'):

*******************************SCRIPT***************************************
<values>
/ othername = 0
</values>

<block test>
/ trials = [1=test1; 2=test2]
</block>

<trial test1>
/ stimulusframes = [1=text1]
/ validresponse = (" ")
/ ontrialend = [
values.othername = text.text1.currentitem;
list.namelist.appenditem(values.othername);
]
</trial>

<trial test2>
/ stimulusframes = [1=text2]
/ validresponse = (" ")
/ ontrialend = [
values.othername = text.text2.currentitem;
]
</trial>

<text text1>
/ items = names
/ select = noreplace
</text>

<text text2>
/ items = namelist
/ select = noreplace
</text>

<item names>
/ 1 = "batrek"
/ 2 = "galmug"
/ 3 = "sordot"
/ 4 = "lapnuk"
/ 5 = "napges"
/ 6 = "nerdet"
/ 7 = "scaztu"
/ 8 = "zetdos"
/ 9 = "ekisepo"
/ 10 = "wagratu"
/ 11 = "lapusaw"
/ 12 = "lavukef"
/ 13 = "knupfim"
/ 14 = "rerubel"
/ 15 = "pezarig"
/ 16 = "jaliper"
/ 17 = "tahnluc"
/ 18 = "hiknilch"
/ 19 = "padasnut"
/ 20 = "notlinfu"
/ 21 = "gekikite"
/ 22 = "snacthec"
/ 23 = "nekaripo"
/ 24 = "secanamu"
/ 25 = "cildenug"
</item>

<list namelist>
/ selectionmode = random
/ replace = false
</list>

*******************************SCRIPT***************************************

We both could not figure out why it does not work, but since he has found out that apparently the script works when the <list> element is replaced with an <item> element. So he has a workaround but we were curious whether this is a general problem with list elements (i.e., they cannot be used as intended in the script) or whether the script needs to be/could be adjusted somehow?

Thanks in advance and have a nice weekend!

<text text2>
/ items = namelist
/ select = noreplace
</text>

A <list> is not an <item> element. The <text> element expects an <item> element called "namelist" to be referenced in its /items attribute.

TME_
TME_
Respected Member (304 reputation)Respected Member (304 reputation)Respected Member (304 reputation)Respected Member (304 reputation)Respected Member (304 reputation)Respected Member (304 reputation)Respected Member (304 reputation)Respected Member (304 reputation)Respected Member (304 reputation)
Group: Forum Members
Posts: 3, Visits: 33
Hi Dave, that is what we thought. Thanks for your always quick and helpful responses!

Best wishes for the week!

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search