Conditional expression within items attribute of list element. How?!


Author
Message
socialpsych
socialpsych
Esteemed Member (1.5K reputation)Esteemed Member (1.5K reputation)Esteemed Member (1.5K reputation)Esteemed Member (1.5K reputation)Esteemed Member (1.5K reputation)Esteemed Member (1.5K reputation)Esteemed Member (1.5K reputation)Esteemed Member (1.5K reputation)Esteemed Member (1.5K reputation)
Group: Forum Members
Posts: 11, Visits: 11

Hoping someone can help me with a syntax error!



I plan to have a number of different conditions in my experiment, which will have a different number of blocks (maximum = 24), so I've set  "/ blocks=[1-24" and am trying to come up with a way of skipping over the extra blocks for conditions which only have 12. There may be a simpler way of doing this (if so - I would love to be corrected!), but in this attempt I have run across a syntax error that I just can't figure out.



Here is a simplified version of what I've currently attempted:





<variables>


/group=(1 of
2) (blocklist=list.blockorder1)


/group=(2 of
2) (blocklist=list.blockorder2)


</variables>


 


<expt>


/ blocks=[1-4=blocklist]


</expt>


 


<list blockorder1>


/ items =
[if(list.blocklist1.selectedcount!=list.blocklist1.poolsize)list.blocklist1.nextvalue
else skipblock]


/
selectionmode = sequence


</list>


 


<list
blockorder2>


/ items =
[if(list.blocklist2.selectedcount!=list.blocklist2.poolsize)list.blocklist1.nextvalue
else skipblock]


/
selectionmode = sequence


</list>


 


 


<block
skipblock>


/trials =
[1=skip]


</block>


 


<trial
skip>


/
stimulustimes = [0=skip]


/
trialduration = 10


</trial>


 


<text
skip>


/ items =
(" ")


</text>


 


<list
blocklist1>


/ items =
(block.block1, block.block2)


/
selectionmode = sequence


</list>


 


<list
blocklist2>


/ items =
(block.block1, block.block2, block.block1, block.block2)


/
selectionmode = sequence


</list>


 


 


<block
block1>


/ trials =
[1=mytrial1]


</block>


 


<block
block2>


/ trials =
[1=mytrial2]


</block>


 


<trial
mytrial1>


/
stimulusframes = [1=text1]


/
validresponse = (57)


</trial>


 


<trial
mytrial2>


/
stimulusframes = [1=text2]


/
validresponse = (57)


</trial>


 


<text
text1>


/ items =
("Block 1")


</text>


 


<text
text2>


/ items =
("Block 2")


</text>


 


When I try to run this, it returns the error "The /blocks command selected an element that was not a type of block". However, it runs without errors if I change the items attribute of blockorder1 to something simple like / items = (list.blocklist1.nextvalue). So, I am guessing there is something wrong with my syntax in that expression.


 


However, after hours of reading through the documentation I have failed to get a single expression to work within the items attribute! I based my attempt on the template in the list element --> items attribute help file (pasted below), but I can't get the syntax from the help file to work even when I approximate it as closely as possible...


 


<list evenodd>
/ selectionmode = sequence
/ items =
[if ( floor(mod(block.test.currenttrialnumber, 2)) == 0 ) 1 else
2]
</list>




If anyone can help me you will receive immense amounts of my appreciation!!





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

There may be a simpler way of doing this


I certainly think there is. I suggest using the <block> elements' /skip attributes. In essence


/ skip = [variables.currentgroupnumber==1 && expt.1.blockcount >= 12]


Or you could simply do


<expt>
/ blocks = [1-6=sequence(block1, block2)]
/ subjects = (1 of 2)
[...]
</expt>

<expt>
/ blocks = [1-12=sequence(block1, block2)]
/ subjects = (2 of 2)
[...]
</expt>


I do not see why any complex nesting of <list> elements should be necessary here.


Regards,


~Dave


socialpsych
socialpsych
Esteemed Member (1.5K reputation)Esteemed Member (1.5K reputation)Esteemed Member (1.5K reputation)Esteemed Member (1.5K reputation)Esteemed Member (1.5K reputation)Esteemed Member (1.5K reputation)Esteemed Member (1.5K reputation)Esteemed Member (1.5K reputation)Esteemed Member (1.5K reputation)
Group: Forum Members
Posts: 11, Visits: 11

Many thanks for your reply Dave!


You are right that what I want to do would be possible using either of those methods - unfortunately my finished experiment will involve dozens of different block orders, so I was hoping to find a method that involved less repetition, but I seem to be overcomplicating things. I will have 5 sets of around 12 blocks each in the final experiment, and participants will need to complete various combinations of those sets in different orders (but always as whole sets), so I was hoping to find a way of defining each set of blocks as a list, so that I only had to type it out once (and then to compose complete block orders from those lists somehow). 


My problem would be over much faster if I just typed out the lists as separate expts though, so maybe I will just do that!


If you have any idea what was wrong with the original items expression, I'd love to hear what I did wrong for future reference?


Thanks again for your help. It's very much appreciated and I've found your other posts on this forum invaluable too (I don't know if you get paid for this but I hope so!)


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search