Branch syntax


Author
Message
nakayama
nakayama
Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)
Group: Forum Members
Posts: 72, Visits: 408
Hi, Mr Dave,
May I ask a question about Branch syntax? I grouped three trials into a block, and I made several of these blocks. I wonder if I can let inquisit to start
blocks depending on how participants performed on the previous block? it seems branch can only do this on trials level.
Like:
<trial 1>
</trial>
<trial 2>
</trial>
<trial 3>
</trial>
<block 1>
trials=[1;2;3]
</block>
<trial 4>
</trial>
<trial 5>
</trial>
<trial 6>
</trial>
<block 1>
trials=[4;5;6]
</block>
...
Best Wishes,
Nakayama


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: 104K
Of course you can /branch at the <block> level. The respective /branch ought to reside at the <block> level, i.e.

<block a>
...
/ branch = [if (condition) block.b]
</block>

nakayama
nakayama
Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)
Group: Forum Members
Posts: 72, Visits: 408
Thank you for your reply.
That is the past I can't get.
Participants make responses at "instruction1" trial, "practice1" and "practice2" just for stimulus presentation.
How can I choose the block I want to perform depending on whether participants make a correct response in "instruction1" trial?
<block 1>
/ trials = [1= practice1;2=practice2;3=instruction1]
/ postinstructions = (practiceend)
/ branch=[if (block.1.?) block.2]
</block>
Best Wishes,
Nakayama
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: 104K
<block 1>
/ trials = [1= practice1;2=practice2;3=instruction1]
/ postinstructions = (practiceend)
/ branch=[if (trial.instruction1.correct) block.2]
</block>
nakayama
nakayama
Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)
Group: Forum Members
Posts: 72, Visits: 408
It works! Thank you!
nakayama
nakayama
Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)
Group: Forum Members
Posts: 72, Visits: 408
Hi, Dave,
I almost got the concept of branch syntax, but still not very skillful. Would you help me with this?
I am doing an adaptive method on temporal stimulus, since the variable is "timeout', I guess I can't do it on trial level. 
The rule is like this:
Once subject makes a wrong response in "question", the timeout of "target" goes up by 100ms, else goes down by 100ms.
The block keeps running until the "timeout" of target is equals to the "timeout" of standard.
I tried to write syntax like this, but it just stopped by one run.


<trial standard>
/ stimulustimes = [1=fixation;2000=target;]
/ recorddata = true
/ timeout = 2200
</trial>

<trial target>
/ stimulustimes = [1=fixation;2000=target;]
/ recorddata = true
/ timeout = values.timeout
</trial>

<values>
/timeout=3000
/block=10
</values>

<block 1>
/ onblockbegin = [if (values.block>10)values.timeout+=100 else values.timeout-=100 ]
/ trials = [1= standard;2=target;3=question]
/ branch = [if(trial.question.correct) values.block-=1 && block.1 else values.block+=1 && block.1]
/ onblockend = [values.block=1]
/postinstructions = (practiceend)
</block>

<expt>
/preinstructions = (instruction)
/postinstructions = (result)
/blocks = [1 = 1;]
</expt>   

Best Wishes,
nakayama
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: 104K
Of course you can do it on the <trial>-level:

<trial question>
...
/ ontrialend = [if (trial.question.error) values.timeout += 100 else values.timeout -= 100]
...
</trial>

<block 1>
/ stop = [values.timeout == 2200]
...
</block>

nakayama
nakayama
Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)
Group: Forum Members
Posts: 72, Visits: 408
[Post mistakenly edited, resulting in loss of contents. Apologies. -Dave]

Edited 9 Years Ago by Dave
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: 104K
Apologies, I mistakenly edited your last post. Intended response is below:

You run <block 1> a single time via your <expt>:

<expt>
/preinstructions = (instruction)
/postinstructions = (result)
/blocks = [1 = 1;]
</expt>

Since there is no /branch or the like in the <block> or anywhere else

<block 1>
/ trials = [1= practice1;2=practice2;3=question]
/ stop = [values.timeout==2200]
/ postinstructions = (practiceend)
</block>

the script then terminates as expected. If you want to run <block 1> again, use /branch as discussed previously.
nakayama
nakayama
Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)Guru (5.2K reputation)
Group: Forum Members
Posts: 72, Visits: 408
Thank you for your help ! Dave.
I am sorry I am little bit confused. So would you show me how to run block 1 again using branch? 
Best,
Nakayama


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search