| 
		        
                
 
 
	Group: Forum Members 	        
    Posts: 10, 
    Visits: 53 
    
 
          
		     | 
				                       
                 
                
                    
			            Hi Dave!
  I have difficulties linking a button press to a specific block. If participants click on 'YES', they should be directed to block2 (the one that comes after the block Buttonpress); and if they click on 'NO' that they should be directed to block3 (the block that comes after block2). How do I achieve this? 
 
  <text Yes> /items = ("Yes") /position = (75%, 93%) / fontstyle = ("TimesNewRoman", 1.75%, false, false, false, false, 5, 1) / txcolor = (white) /txbgcolor = (black) /size = (15%, 10%) / vjustify = center </text>
  <text No> /items = ("No") /position = (25%, 93%) / fontstyle = ("TimesNewRoman", 1.75%, false, false, false, false, 5, 1) / txcolor = (white) /txbgcolor = (black) /size = (15%, 10%) /vjustify = center </text>
  <trial Buttonpress> /inputdevice = mouse /stimulusframes = [1 = Buttonpress, Yes, No] /validresponse = (Yes, No) ? </trial>
 
  <block Buttonpress> /trials = [1 = Buttonpress] </block>
  Thank you in advance,
  Nina                
			            				
			                                 
                     
                                            
                         
                    
                  
             | 
			
			
        
				| 
		        
                
 
 
	Group: Administrators 	        
    Posts: 13K, 
    Visits: 109K 
    
 
          
		     | 
				                       
                 
                
                    
			            +xHi Dave! I have difficulties linking a button press to a specific block. If participants click on 'YES', they should be directed to block2 (the one that comes after the block Buttonpress); and if they click on 'NO' that they should be directed to block3 (the block that comes after block2). How do I achieve this?  <text Yes> /items = ("Yes") /position = (75%, 93%) / fontstyle = ("TimesNewRoman", 1.75%, false, false, false, false, 5, 1) / txcolor = (white) /txbgcolor = (black) /size = (15%, 10%) / vjustify = center </text> <text No> /items = ("No") /position = (25%, 93%) / fontstyle = ("TimesNewRoman", 1.75%, false, false, false, false, 5, 1) / txcolor = (white) /txbgcolor = (black) /size = (15%, 10%) /vjustify = center </text> <trial Buttonpress> /inputdevice = mouse /stimulusframes = [1 = Buttonpress, Yes, No] /validresponse = (Yes, No) ?</trial> <block Buttonpress> /trials = [1 = Buttonpress] </block> Thank you in advance, Nina  You need to eiher /branch from <block Buttonpress> to the appropriate follow-on block based on the trial's response or alternatively define appropriate /skip commands in block2 and block3.                
			            				
			                                
                      
                                            
                         
                    
                  
             | 
			
			
        
				| 
		        
                
 
 
	Group: Administrators 	        
    Posts: 13K, 
    Visits: 109K 
    
 
          
		     | 
				                       
                 
                
                    
			            +x+xHi Dave! I have difficulties linking a button press to a specific block. If participants click on 'YES', they should be directed to block2 (the one that comes after the block Buttonpress); and if they click on 'NO' that they should be directed to block3 (the block that comes after block2). How do I achieve this?  <text Yes> /items = ("Yes") /position = (75%, 93%) / fontstyle = ("TimesNewRoman", 1.75%, false, false, false, false, 5, 1) / txcolor = (white) /txbgcolor = (black) /size = (15%, 10%) / vjustify = center </text> <text No> /items = ("No") /position = (25%, 93%) / fontstyle = ("TimesNewRoman", 1.75%, false, false, false, false, 5, 1) / txcolor = (white) /txbgcolor = (black) /size = (15%, 10%) /vjustify = center </text> <trial Buttonpress> /inputdevice = mouse /stimulusframes = [1 = Buttonpress, Yes, No] /validresponse = (Yes, No) ?</trial> <block Buttonpress> /trials = [1 = Buttonpress] </block> Thank you in advance, Nina  You need to eiher /branch from <block Buttonpress> to the appropriate follow-on block based on the trial's response or alternatively define appropriate /skip commands in block2 and block3.  The /branch variant: <text Yes> /items = ("Yes") /position = (75%, 93%) / fontstyle = ("TimesNewRoman", 1.75%, false, false, false, false, 5, 1) / txcolor = (white) /txbgcolor = (black) /size = (15%, 10%) / vjustify = center </text>
  <text No> /items = ("No") /position = (25%, 93%) / fontstyle = ("TimesNewRoman", 1.75%, false, false, false, false, 5, 1) / txcolor = (white) /txbgcolor = (black) /size = (15%, 10%) /vjustify = center </text>
  <trial Buttonpress> /inputdevice = mouse /stimulusframes = [1 = Yes, No] /validresponse = (Yes, No) / inputdevice = mouse </trial>
 
  <block Buttonpress> /trials = [1 = Buttonpress] / branch = [     if (trial.Buttonpress.response == "Yes"){         block.block2;     } else if (trial.Buttonpress.response == "No") {         block.block3;     } ] </block>
  <block block2> / trials = [1=mytrial] </block>
  <block block3> / trials = [1=mytrial] </block>
  <trial mytrial> / stimulusframes = [1=mytext] / validresponse = (0) / trialduration = 2000 </trial>
  <text mytext> / items = ("This is <%script.currentblock%>") </text>
  <expt> / blocks = [1=Buttonpress] </expt> The /skip variant: <text Yes> /items = ("Yes") /position = (75%, 93%) / fontstyle = ("TimesNewRoman", 1.75%, false, false, false, false, 5, 1) / txcolor = (white) /txbgcolor = (black) /size = (15%, 10%) / vjustify = center </text>
  <text No> /items = ("No") /position = (25%, 93%) / fontstyle = ("TimesNewRoman", 1.75%, false, false, false, false, 5, 1) / txcolor = (white) /txbgcolor = (black) /size = (15%, 10%) /vjustify = center </text>
  <trial Buttonpress> /inputdevice = mouse /stimulusframes = [1 = Yes, No] /validresponse = (Yes, No) / inputdevice = mouse </trial>
 
  <block Buttonpress> /trials = [1 = Buttonpress] </block>
  <block block2> / skip = [     trial.Buttonpress.response == "No" ] / trials = [1=mytrial] </block>
  <block block3> / trials = [1=mytrial] </block>
  <trial mytrial> / stimulusframes = [1=mytext] / validresponse = (0) / trialduration = 2000 </trial>
  <text mytext> / items = ("This is <%script.currentblock%>") </text>
  <expt> / blocks = [1=Buttonpress; 2 = block2; 3 = block3] </expt>
                  
			            				
			                                
                     
                                            
                         
                    
                  
             |