def __init__(self, condition, value_text, desc_text, fname): '''All we need to present a single trial of our experiment So far, only integrated recording into 'EI' fname : the name of the avi where we'll store subject face images ''' # Chunks of stuff that get done in different trials def generic_E(desc_stop): return [ Event(instruction, 0.5, 'start_reading', text='ESTIMATE', log={'condition': condition}, response=ReadResponse('start_reading')) ] + \ self.display_description(desc_text, 'start_reading', desc_stop) + \ [ Event(answer, 'start_reading', desc_stop, text='<>', color=(0,0,0), response=EstimateResponse(timeout=5.0)) ] def surprise(surp_start): # return [ Event(answer, surp_start, 'surprise', text='<>', # color=(0,0,0), response=SurpriseResponse()), return [ Event(instruction, surp_start, 'surprise', text='SURPRISED?', response=SurpriseResponse() )] # Now define our actual conditions value_text = format_num(value_text) if condition == 'I': events = [ Event(instruction, 0.5, 'start_reading', text='READ', log={'condition': 'I'}, response=ReadResponse('start_reading')), Event(value, 'start_reading', 'surprise', text=value_text) ] + \ self.display_description(desc_text, ('start_reading', 2.0), 'surprise') + \ surprise(('start_reading', 2.0)) elif condition == 'E': events = generic_E('estimate') elif condition == 'EI': # Note that we set the first 'value' to offset after 'surprise' to # prevent this from deactivating the second value prompt ('<>') # right at 'read_num' events = [ Event(recording, 0.0, 'surprise', fname=fname) ] + \ generic_E('surprise') + \ [ Event(value, ('estimate', 0.5), 'surprise', text=value_text)] + \ surprise(('estimate', 2.5)) elif condition == 'EM': # [ Event(answer, 'estimate', 'memory', text='<>', # color=(0,0,0) ), events = generic_E('memory') + \ [ Event(instruction, 'estimate', 'memory', text='MEMORY?', response=MemoryResponse() ) ] Trial.__init__(self, events)
def __init__(self, FS): events=[Event(fixation, start=0, duration=2.0), Event(FS, start=2, duration=.5, log={'face':FS.parameters.text, 'subject':subject}), Event(blank, start=2, duration=2.5, response = Response(label='press',limit=('z','/')))] Trial.__init__(self,events)
def __init__(self, stim): voice_resp = VoiceResponse(label = 'speak', audio_controller = voice_controller) events=[Event(fixation, start=0, duration=2.0), Event(stim, start=2, duration=.5, log={'type': stim.type, 'subject': subject, 'VT_threshold': voice_controller.THRESHOLD}), Event(blank, start=2, duration=2.5, response = voice_resp)] Trial.__init__(self,events)