cont=captureResponse(port,keys = [response_info['pause_resp'],None]) if cont == response_info['pause_resp']: while captureResponse(port,keys=resp_keys+ [None]) in resp_keys: win.flip() win.callOnFlip(et.sendTriggers,port,trigger_info['start_block'],reset=0.5) win.logOnFlip(level=logging.INFO, msg='start_block\t{}'.format(trial_info['block_no'])) win.flip() break #################### ### trial loop ### #################### for trial_no in range(param['n_trials']): # force quite experiment if 'q' in event.getKeys(): et.finishExperiment(win,data_logger) ####################### ### SET VARIABLES ### ####################### # reset variables trial_info['reward']=0 trial_info['resp_key']=None trial_info['timeout']=0 trial_info['choice_side'] = None leftbar.fillColor=win_info['fg_color'] rightbar.fillColor=win_info['fg_color'] # set trial variables trial_info['trial_no'] = trial_no+1 trial_info['mag_left'] = sequence.loc[trial_count,'mag1']
trial_info['context'] = 'reward' elif miniblock_no+1 in param['post_blocks']: trial_info['context'] = 'reward' ########################## ### START TRIAL LOOP ### ########################## for trial_no in range(n_trials): trial_info['start_feed_time']=np.nan trial_info['end_feed_time']=np.nan trial_info['feedbackDur']= np.nan trial_info['end_stim_time']= np.nan # force quite experiment escape = event.getKeys() if 'q' in escape: et.finishExperiment(win,data_logger) # draw duration of fix cross from predefined distribution trial_info['fix_sleep'] = fix_seq[miniblock_no,trial_no] # set trial-specific variables trial_info['trial_no'] = trial_no+1 trial_info['trial_count']+=1 # go or nogo trial_info['condition'] = gonogo_seq[trial_no] # which greeble trial_info['stim'] = stim_seq[trial_no] # what is the correct response trial_info['corr_resp'] = corr_resp_seq[trial_no] # set current greeble image greeble.setImage(trial_info['stim'])