Millisecond Forums

text color selection

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

By Georgia - 7/14/2015

Hello, 

I would like to have inquisit randomly select the text colour for a text element for a given trial, which will either be red or green. It needs to be random selection but for each trial type I should be able to have half of the trials in red letters and half in green letters. 

Is there something I can do with the /txcolor attribute or do I need to add some kind of dependency for /select? I am not sure how to do this.

I was thinking I may need to individually program the red and green trials and then do this using noreplace selection for the blocks, but that becomes very tedious because I have a lot of different trial types. 

Any help would be appreciated.
Thanks
By Dave - 7/14/2015

You can do that using a <list> and some /ontrialbegin logic:

<block myblock>
/ trials = [1-4=mytrial]
</block>

<trial mytrial>
/ ontrialbegin = [text.mytext.textcolor=list.mylist.nextvalue]
/ stimulusframes = [1=mytext]
/ validresponse = (57)
</trial>

<text mytext>
/ items = ("A", "B", "C", "D")
</text>

<list mylist>
/ items = (red, red, green, green)
</list>