Selecting a Block Based on Participant's Response


This experiment prompts the participant for an answer and uses conditional branching to select a path based on the response. It uses a code with two values that is set at the event level based on the participant’s response, then evaluated using macros at the block level in order to determine the next block to present.


  • A code is created with two values, "yes" and "no".
  • In the Participant Input's dialog, two keyboard responses are created: "Yes" and "No".
  • Event "Instructions": in the Event Editor's [B]Correct Response[/B] tab, the correct response is set to "Yes". The important point is that a correct response must be selected so that we can provide feedback based on correctness; we chose "Yes".
  • Event "Instructions": in the Event Editor's [B]Feedback[/B] tab, we set the value of the code to either "Yes" or "No" based on the participant's response. In the next step, we will use this information to branch to a specific block.
  • Block "Question": we create macro "Go to different blocks depending on answer". If the expression evaluates to True, we don't do anything so that the next block, "Numbers", is presented. If the expression evaluates to False, we instruct SuperLab to go to block "Letters".
  • Block "Numbers": we create a macro called "Exit experiment". Without this macro, both blocks "Numbers" and "Letters" will be presented. Note that this macro is set to run After all the trials in the block have been presented (see the Block Editor's Macros tab).


SuperLab 4.0.7 or later is needed.

Selecting a Block (Mac Version) (2.09 KB)

Selecting a Block (Windows Version) (2.11 KB)