Millisecond Forums

Always making a certain block appear after another block

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

By Sercan - 3/1/2016

Hi,

I'm intending to show my participants a number of stimulus blocks in randomized order. After each of these stimulus blocks, I want to start another block containing survey questions specific to the stimuli presented in that block, and then select another randomized stimulus block to continue, and so forth. How would I implement this? It cannot be done inside <expt> since the order of the blocks must be randomized.
I currently have this, which doesn't work.

<block Jantje1>
/ onblockend = [values.stopblock=0; survey.Jantje1survey;]
/ stop = [values.stopblock==1]
/ trials = [1=getstim]
</block>

note: trial getstim sets values.stopblock to 1 when the stimuli have been presented and the block must end. the survey works when called from <expt> but not when called this way. this does not work either: /branch [if (values.stopblock==1) survey.Jantje1survey] 

regards,

Sercan
By Sercan - 3/1/2016

Update: I managed to get this to work simply by adding: /branch = [survey.Jantje1survey;] to the element. I'm glad it works, but I don't know why.
By Dave - 3/1/2016

Event attributes like /ontrialbegin, /ontrialend, /onblockbegin, /onblockend, etc. are supposed to execute some logic / expressions (e.g. update some global variables, etc.). They cannot be used to invoke other <trial> or <block> elements. That's what the /branch attribute is for, as you've already discovered.