Hi all,
the Inquisit help on the "currentvalue" and "nextvalue" properties suggests that they should produce the actual content of an <item> or <list> element's current or next-selected value, respectively. However, I just noticed that these properties work differently for <item> elements than for <list> elements. Specifically, for the latter, they work as expected, but for the former, they seem to be returning the index rather than the content. This is surprising behavior that leads to unintuitive results, although it can be worked around by using the item method to call the currentindex or nextindex property respectively. I was wondering whether this was intended behavior? If so, what am I missing in terms of rationale? If not, it's not an urgent issue given the workaround, but perhaps it could be addressed in future builds?
Here's some code to reproduce the issue and make it clearer:
<block test>
/ trials = [1-5 = test]
</block>
<list testlist>
/ items = ("hello","world","this","is","a","test")
/ selectionmode = sequence
</list>
<text testtext>
/ items = ("hello","world","this","is","a","test")
/ select = sequence
</text>
<text showtest>
/ items = ("currentitem: List - 'list.testlist.currentitem' produces error, Text - <%text.testtext.currentitem%>
currentvalue: List - <%list.testlist.currentvalue%>, Text - <%text.testtext.currentvalue%>,
nextvalue: List - <%list.testlist.nextvalue%>, Text - <%text.testtext.nextvalue%>
item(nextvalue): List - 'list.testlist.item(list.testlist.nextvalue)' produces error, Text - <%text.testtext.item(text.testtext.nextvalue)%>
item(nextindex): List - <%list.testlist.item(list.testlist.nextindex)%>, Text - <%text.testtext.item(text.testtext.nextindex)%>")
</text>
<trial test>
/ stimulustimes = [0 = showtest]
/ validresponse = (" ")
</trial>
An interesting side effect of this is that a list returns an empty value if its currentvalue is called before the nextvalue has been called for the first time, but an item (and therefore a stimulus) defaults to its first value. Might be useful for some esoteric programming applications (and to differentiate the two element types functionally), but also seems a tad inconsistent to me. Just something to consider, I suppose.