Picking trial layout based on random variable


Author
Message
nashby
nashby
Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)
Group: Forum Members
Posts: 78, Visits: 159

Hello so I am trying to get the stimulus frames in a trial to change dependent on the value of a randomly drawn number. Below should convey what I am trying to do although its clear the code is wrong ( I have tried multiple versions of below with no luck).



Thanks in advance of any help.



++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++




/ stimulusframes = [1= option1, option2, option1t, option2t, option1b, option2b, option1o, option1bo, option2o, option2bo, totals, outcomes, selectinstructions], if values.side <= 50

else

{1= option1, option2, option1k, option2k, option1bk, option2bk, option1ok, option1bok, option2ok, option2bok, totals, outcomes, selectinstructions;}]


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

You can't do this in the /stimulusframes attribute directly. Instead you need to work with the setstimulusframe and/or insertstimulusframe function(s). Details are available in the documentation.


However, it might be way easier to simply use different <trial> elements.


Edit: Here's a quick, basic example:


<values>
/ myvalue = 1
</values>

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

<trial mytrial>
/ ontrialbegin = [if(values.myvalue==1){
    trial.mytrial.insertstimulusframe(text.b1,1);
    } else {
    trial.mytrial.insertstimulusframe(text.b2,1);
    }]
/ stimulustimes = [0=a,c]
/ ontrialend = [trial.mytrial.resetstimulusframes()]
/ validresponse = (57)
</trial>

<text a>
/ items = ("A")
/ position = (25%, 50%)
</text>

<text b1>
/ items = ("B1")
/ position = (50%, 50%)
</text>

<text b2>
/ items = ("B2")
/ position = (50%, 50%)
</text>

<text c>
/ items = ("C")
/ position = (75%, 50%)
</text>


nashby
nashby
Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)Guru (8.8K reputation)
Group: Forum Members
Posts: 78, Visits: 159

Thanks, used set stimulus frames and that works. 


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search