Millisecond Forums

list of lists

https://forums.millisecond.com/Topic17060.aspx

By AssemblerIstAuchEineInsel - 9/6/2015

As a prequel to my experiment I want Inquisit to qick a list (defining the course of the experiment) from a set of lists at random.

These are the lists:
(2,6,3,6,5,4,2,4,3,6,5,4,3,5,2)
(4,2,3,6,5,4,3,5,2,4,6,5,6,2,3)
(4,2,4,5,6,5,6,4,2,3,5,6,3,2,3)
(5,2,3,6,4,5,4,2,3,6,5,4,6,3,2)
(5,2,3,5,4,6,2,6,3,6,4,5,2,4,3)
(3,4,3,6,5,6,2,5,4,6,3,4,2,5,2)
(5,3,2,4,5,6,2,6,4,5,6,4,3,2,3)
(2,4,5,6,4,6,3,2,3,5,6,3,4,2,5)
(5,3,6,4,5,6,2,3,4,5,6,4,2,3,2)
(5,6,3,4,5,6,3,2,3,4,5,6,2,4,2)
(2,4,3,4,6,5,4,5,2,6,3,6,5,2,3)
(5,2,3,6,3,5,4,2,5,6,4,6,4,3,2)
(4,3,2,6,4,6,5,4,3,5,3,6,2,5,2)
(3,4,2,3,4,6,2,5,2,6,5,6,4,3,5)
(5,4,3,6,5,6,4,3,2,5,2,6,2,3,4)
(5,4,2,6,4,3,2,3,2,6,5,6,4,5,3)
(2,3,2,5,4,6,4,3,5,6,4,5,3,6,2)
(2,6,3,6,5,4,2,3,4,6,5,4,5,2,3)
(5,4,3,6,4,5,2,3,2,4,5,6,2,6,3)
(2,3,4,3,5,6,2,5,3,6,4,6,4,2,5)



For example in python I would write:

liststock=[[2,6,3,6,5,4,2,4,3,6,5,4,3,5,2],[4,2,3,6,5,4,3,5,2,4,6,5,6,2,3],[4,2,4,5,6,5,6,4,2,3,5,6,3,2,3],...]
actualListForExperiment=liststock[random.int(N)]

How would I do this in inquisit under the condition that the lists have to be hardcoded?

kind regard
Jens
By AssemblerIstAuchEineInsel - 9/6/2015

This ist not an answer but a work around I found my self.

When this code is used we have to insert a block at the beginning of the experiment definition:
1=initRandomListBlock;

And later on we can access the vales from the current list chosen at random at the beginning by:

list.TestWordsNumbersSentencesSetSizeRandomListPersubject.nextvalue

for example.


This is very inefficient code, can this be done smarter??


##################################################################################################################################################
##################################################################################################################################################
##################################################################################################################################################

########  ####  ######  ##    ##             ########     ###    ##    ## ########   #######  ##     ##          ##       ####  ######  ########
##     ##  ##  ##    ## ##   ##              ##     ##   ## ##   ###   ## ##     ## ##     ## ###   ###          ##        ##  ##    ##    ##   
##     ##  ##  ##       ##  ##               ##     ##  ##   ##  ####  ## ##     ## ##     ## #### ####          ##        ##  ##          ##   
########   ##  ##       #####                ########  ##     ## ## ## ## ##     ## ##     ## ## ### ##          ##        ##   ######     ##   
##         ##  ##       ##  ##               ##   ##   ######### ##  #### ##     ## ##     ## ##     ##          ##        ##        ##    ##   
##         ##  ##    ## ##   ##              ##    ##  ##     ## ##   ### ##     ## ##     ## ##     ##          ##        ##  ##    ##    ##   
##        ####  ######  ##    ##             ##     ## ##     ## ##    ## ########   #######  ##     ##          ######## ####  ######     ## 
<values ARSPAN>
/ testnumberwordssentencescurrentlist=0
</values>
<block initRandomListBlock>
/ trials = [1=initRandomListTrial]
/ recorddata = false
</block>
<trial initRandomListTrial>
/ ontrialbegin = [values.testnumberwordssentencescurrentlist=list.TestWordsNumbersSentencesSetSizeSelectListList.nextvalue]
/ trialduration = 0
/ recorddata = false
</trial>
<expressions ARSPAN>
/ numberwordssentencescurrentlistcurrentsetsize = (
if(values.testnumberwordssentencescurrentlist==1) TestWordsNumbersSentencesSetSize1 else {
    if(values.testnumberwordssentencescurrentlist==2) TestWordsNumbersSentencesSetSize2 else {
        if(values.testnumberwordssentencescurrentlist==3) TestWordsNumbersSentencesSetSize3 else {
            if(values.testnumberwordssentencescurrentlist==4) TestWordsNumbersSentencesSetSize4 else {
                if(values.testnumberwordssentencescurrentlist==5) TestWordsNumbersSentencesSetSize5 else {
                    if(values.testnumberwordssentencescurrentlist==6) TestWordsNumbersSentencesSetSize6 else {
                        if(values.testnumberwordssentencescurrentlist==7) TestWordsNumbersSentencesSetSize7 else {
                            if(values.testnumberwordssentencescurrentlist==8) TestWordsNumbersSentencesSetSize8 else {
                                if(values.testnumberwordssentencescurrentlist==9) TestWordsNumbersSentencesSetSize9 else {
                                    if(values.testnumberwordssentencescurrentlist==10) TestWordsNumbersSentencesSetSize10 else {
                                        if(values.testnumberwordssentencescurrentlist==11) TestWordsNumbersSentencesSetSize11 else {
                                            if(values.testnumberwordssentencescurrentlist==12) TestWordsNumbersSentencesSetSize12 else {
                                                if(values.testnumberwordssentencescurrentlist==13) TestWordsNumbersSentencesSetSize13 else {
                                                    if(values.testnumberwordssentencescurrentlist==14) TestWordsNumbersSentencesSetSize14 else {
                                                        if(values.testnumberwordssentencescurrentlist==15) TestWordsNumbersSentencesSetSize15 else {
                                                            if(values.testnumberwordssentencescurrentlist==16) TestWordsNumbersSentencesSetSize16 else {
                                                                if(values.testnumberwordssentencescurrentlist==17) TestWordsNumbersSentencesSetSize17 else {
                                                                    if(values.testnumberwordssentencescurrentlist==18) TestWordsNumbersSentencesSetSize18 else {
                                                                        if(values.testnumberwordssentencescurrentlist==19) TestWordsNumbersSentencesSetSize19 else {
                                                                            TestWordsNumbersSentencesSetSize20
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
)
</expressions>
<list TestWordsNumbersSentencesSetSizeSelectListList>
/ items = (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20)
</list>
<list TestWordsNumbersSentencesSetSizeRandomListPersubject>
/ items = (expressions.numberwordssentencescurrentlistcurrentsetsize)
</list>
<list TestWordsNumbersSentencesSetSize1>
/ items = (4,2,3,6,5,4,3,5,2,4,6,5,6,2,3)
/ selectionmode = sequence
</list>
<list TestWordsNumbersSentencesSetSize2>
/ items = (2,6,3,6,5,4,2,4,3,6,5,4,3,5,2)
/ selectionmode = sequence
</list>
<list TestWordsNumbersSentencesSetSize3>
/ items = (4,2,4,5,6,5,6,4,2,3,5,6,3,2,3)
/ selectionmode = sequence
</list>
<list TestWordsNumbersSentencesSetSize4>
/ items = (5,2,3,6,4,5,4,2,3,6,5,4,6,3,2)
/ selectionmode = sequence
</list>
<list TestWordsNumbersSentencesSetSize5>
/ items = (5,2,3,5,4,6,2,6,3,6,4,5,2,4,3)
/ selectionmode = sequence
</list>
<list TestWordsNumbersSentencesSetSize6>
/ items = (3,4,3,6,5,6,2,5,4,6,3,4,2,5,2)
/ selectionmode = sequence
</list>
<list TestWordsNumbersSentencesSetSize7>
/ items = (5,3,2,4,5,6,2,6,4,5,6,4,3,2,3)
/ selectionmode = sequence
</list>
<list TestWordsNumbersSentencesSetSize8>
/ items = (2,4,5,6,4,6,3,2,3,5,6,3,4,2,5)
/ selectionmode = sequence
</list>
<list TestWordsNumbersSentencesSetSize9>
/ items = (5,3,6,4,5,6,2,3,4,5,6,4,2,3,2)
/ selectionmode = sequence
</list>
<list TestWordsNumbersSentencesSetSize10>
/ items = (5,6,3,4,5,6,3,2,3,4,5,6,2,4,2)
/ selectionmode = sequence
</list>
<list TestWordsNumbersSentencesSetSize11>
/ items = (2,4,3,4,6,5,4,5,2,6,3,6,5,2,3)
/ selectionmode = sequence
</list>
<list TestWordsNumbersSentencesSetSize12>
/ items = (5,2,3,6,3,5,4,2,5,6,4,6,4,3,2)
/ selectionmode = sequence
</list>
<list TestWordsNumbersSentencesSetSize13>
/ items = (4,3,2,6,4,6,5,4,3,5,3,6,2,5,2)
/ selectionmode = sequence
</list>
<list TestWordsNumbersSentencesSetSize14>
/ items = (3,4,2,3,4,6,2,5,2,6,5,6,4,3,5)
/ selectionmode = sequence
</list>
<list TestWordsNumbersSentencesSetSize15>
/ items = (5,4,3,6,5,6,4,3,2,5,2,6,2,3,4)
/ selectionmode = sequence
</list>
<list TestWordsNumbersSentencesSetSize16>
/ items = (5,4,2,6,4,3,2,3,2,6,5,6,4,5,3)
/ selectionmode = sequence
</list>
<list TestWordsNumbersSentencesSetSize17>
/ items = (2,3,2,5,4,6,4,3,5,6,4,5,3,6,2)
/ selectionmode = sequence
</list>
<list TestWordsNumbersSentencesSetSize18>
/ items = (2,6,3,6,5,4,2,3,4,6,5,4,5,2,3)
/ selectionmode = sequence
</list>
<list TestWordsNumbersSentencesSetSize19>
/ items = (5,4,3,6,4,5,2,3,2,4,5,6,2,6,3)
/ selectionmode = sequence
</list>
<list TestWordsNumbersSentencesSetSize20>
/ items = (2,3,4,3,5,6,2,5,3,6,4,6,4,2,5)
/ selectionmode = sequence
</list>
########  ####  ######  ##    ##             ########     ###    ##    ## ########   #######  ##     ##          ##       ####  ######  ########
##     ##  ##  ##    ## ##   ##              ##     ##   ## ##   ###   ## ##     ## ##     ## ###   ###          ##        ##  ##    ##    ##   
##     ##  ##  ##       ##  ##               ##     ##  ##   ##  ####  ## ##     ## ##     ## #### ####          ##        ##  ##          ##   
########   ##  ##       #####                ########  ##     ## ## ## ## ##     ## ##     ## ## ### ##          ##        ##   ######     ##   
##         ##  ##       ##  ##               ##   ##   ######### ##  #### ##     ## ##     ## ##     ##          ##        ##        ##    ##   
##         ##  ##    ## ##   ##              ##    ##  ##     ## ##   ### ##     ## ##     ## ##     ##          ##        ##  ##    ##    ##   
##        ####  ######  ##    ##             ##     ## ##     ## ##    ## ########   #######  ##     ##          ######## ####  ######     ## 

##################################################################################################################################################
##################################################################################################################################################
##################################################################################################################################################

By Dave - 9/7/2015

That's a valid solution. You can also do something like this:

<values>
/ selectedlist = 1
</values>

<block myblock>
/ onblockbegin = [values.selectedlist=noreplace(1,2,3); ]
/ trials = [1-3=mytrial]
</block>

<trial mytrial>
/ stimulusframes = [1=mytext]
/ validresponse = (57)
</trial>

<list a>
/ items = (1,2,3)
/ selectionmode = sequence
</list>

<list b>
/ items = (3,2,1)
/ selectionmode = sequence
</list>

<list c>
/ items = (2,3,1)
/ selectionmode = sequence
</list>


<list mylist>
/ items = [if(values.selectedlist==1) {list.a.nextvalue; }
    else if(values.selectedlist==2) {list.b.nextvalue; }
    else if(values.selectedlist==3) {list.c.nextvalue; }; ]
</list>

<text mytext>
/ items = ("A", "B", "C")
/ select = list.mylist.nextvalue
</text>