When is block.ontrialbegin executed?


Author
Message
Blackadder
Blackadder
Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)
Group: Forum Members
Posts: 280, Visits: 147

That's great. You can put logic into the branch statement as long as it contains a "trial" result somewhere. The possibilities have become even more endless!


Thanks again,
  Malte 


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

Allow me a follow-up question. Is there an "on..." statement or something similar that fires ONLY when the block branches into the trial?


No, but you can incorporate it directly into the /branch itself:


<values>
/ countmybranches = 0
</values>

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

<trial a>
/ stimulusframes = [1=mytext]
/ trialduration = 1000
/ branch = [if (true) {values.countmybranches+=1; trial.a}]
</trial>

<text mytext>
/ items = ("<%values.countmybranches%>")
</text>


Blackadder
Blackadder
Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)
Group: Forum Members
Posts: 280, Visits: 147

Hi Dave, gold-standard answer! Thanks a lot.


Allow me a follow-up question. Is there an "on..." statement or something similar that fires ONLY when the block branches into the trial?


I know I could achieve about the same thing with some logic but I'd rather not since timing might screw things up.



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

will it also be executed when the trial branches into itself?


This. block.ontrialbegin is defining global statements to be executed in *all trials* in the block. I.e.


<values>
/ count = 0
</values>

<block myblock>
/ ontrialbegin = [values.count+=1]
/ trials = [1=a]
</block>

<trial a>
/ stimulusframes = [1=mytext]
/ trialduration = 1000
/ branch = [trial.b]
</trial>

<trial b>
/ stimulusframes = [1=mytext]
/ trialduration = 1000
/ branch = [trial.a]
</trial>

<text mytext>
/ items = ("<%values.count%>")
</text>


is equivalent to


<values>
/ count = 0
</values>

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

<trial a>
/ ontrialbegin = [values.count+=1]
/ stimulusframes = [1=mytext]
/ trialduration = 1000
/ branch = [trial.b]
</trial>

<trial b>
/ ontrialbegin = [values.count+=1]
/ stimulusframes = [1=mytext]
/ trialduration = 1000
/ branch = [trial.a]
</trial>

<text mytext>
/ items = ("<%values.count%>")
</text>



Will block.ontrialbegin be executed only for the 10 times the block will call the trial OR will it also be executed when the trial branches into itself?


In any case, do I assume correctly that block.ontrialbegin always fires before trial.ontrialbegin?



No, actually it fires after, which you can see by doing something like this:


<values>
/ count = 0
</values>

<block myblock>
/ ontrialbegin = [values.count+=1]
/ trials = [1=a]
</block>

<trial a>
/ ontrialbegin = [values.count=666]
/ stimulusframes = [1=mytext]
/ trialduration = 1000
/ branch = [trial.a]
</trial>

<text mytext>
/ items = ("<%values.count%>")
</text>


Hope this helps,


~Dave


Blackadder
Blackadder
Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)
Group: Forum Members
Posts: 280, Visits: 147

Hi All,


one question: when is


<block BLOCKname>
/ ontrialbegin = [...]
</block>


executed?  I'm asking specifically with regard to the following scenario.


Suppose you have


<trial TRIALname>
/ ontrialbegin = [counter = counter + 1]
/ branch = [if (something) trial.TRIALname]
</trial>


<block BLOCKname>
/ ontrialbegin = [counter = counter + 1]
/ trials = [1-10 = TRIALname]
</block>


Will block.ontrialbegin be executed only for the 10 times the block will call the trial OR will it also be executed when the trial branches into itself?


In any case, do I assume correctly that block.ontrialbegin always fires before trial.ontrialbegin?


Bye, Malte



GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search