code/vexptoolbox/experiment.py
def requestParticipantData(self, questions={}, session=True, age=True, 
                               gender=True, expname=True):
        """ Show UI to input participant ID and further details. 
        Must be called as a Vizard task (using yield statement)!

        Some common fields are included for standardization, others can
        be added using the questions argument. Participant data is accessible
        through the experiment object's .participant property.

        Args:
            questions (dict or iterable): Further data fields to show
            session (bool): if True, include a session field
            age (bool): if True, include an age field
            gender (bool): if True, include a gender field
            expname (bool): if True, show a field for experiment name
        """
        if type(questions) in (list, tuple):
            questions = {q.replace(' ', ''):q for q in questions}

        ui = vizinfo.InfoPanel('Please enter the following data:', title='Participant Information', 
                               icon=False, align=viz.ALIGN_CENTER_CENTER)
        uid = {}
        if expname:
            uid['__expname__'] = ui.addLabelItem('Experiment', viz.addTextbox())
            uid['__expname__'].message(str(self.name))
        uid['id'] = ui.addLabelItem('Participant ID', viz.addTextbox())
        if session:
            uid['session'] = ui.addLabelItem('Session', viz.addTextbox())
        if age:
            uid['age'] = ui.addLabelItem('Age', viz.addTextbox())
        if gender:
            uid['gender'] = ui.addLabelItem('Gender',viz.addDropList())
            uid['gender'].addItems(['female', 'male', 'non-binary', 'prefer not to say'])

        if len(questions) > 0:
            ui.addSeparator()
            for q in questions.keys():
                uid[q] = ui.addLabelItem(questions[q], viz.addTextbox())

        ui_submit = ui.addItem(viz.addButtonLabel('Save'), align=viz.ALIGN_RIGHT_CENTER)
        yield viztask.waitButtonDown(ui_submit)

        metadata = {}
        for key in uid.keys():
            if key == '__expname__':
                self.name = uid['__expname__'].getMessage()
                continue
            metadata[key] = uid[key].getMessage()
        if gender: 
            metadata['gender'] = uid['gender'].getItems()[uid['gender'].getSelection()]
        
        ui.remove()
        self.participant = ParamSet(metadata)
        self._dlog('Participant Metadata: {:s}'.format(str(metadata)))
 Show UI to input participant ID and further details. 
        Must be called as a Vizard task (using yield statement)!

        Some common fields are included for standardization, others can
        be added using the questions argument. Participant data is accessible
        through the experiment object's .participant property.

        Args:
            questions (dict or iterable): Further data fields to show
            session (bool): if True, include a session field
            age (bool): if True, include an age field
            gender (bool): if True, include a gender field
            expname (bool): if True, show a field for experiment name
        
Show UI to input participant ID and further details.
Must be called as a Vizard task (using yield statement)!

Some common fields are included for standardization, others can
be added using the questions argument. Participant data is accessible
through the experiment object's .participant property.
Show UI to input participant ID and further details . Must be called as a Vizard task ( using yield statement ) ! Some common fields are included for standardization others can be added using the questions argument . Participant data is accessible through the experiment object ' s . participant property .
def requestParticipantData(self, questions={}, session=True, age=True, 
                               gender=True, expname=True):
        if type(questions) in (list, tuple):
            questions = {q.replace(' ', ''):q for q in questions}
        ui = vizinfo.InfoPanel('Please enter the following data:', title='Participant Information', 
                               icon=False, align=viz.ALIGN_CENTER_CENTER)
        uid = {}
        if expname:
            uid['__expname__'] = ui.addLabelItem('Experiment', viz.addTextbox())
            uid['__expname__'].message(str(self.name))
        uid['id'] = ui.addLabelItem('Participant ID', viz.addTextbox())
        if session:
            uid['session'] = ui.addLabelItem('Session', viz.addTextbox())
        if age:
            uid['age'] = ui.addLabelItem('Age', viz.addTextbox())
        if gender:
            uid['gender'] = ui.addLabelItem('Gender',viz.addDropList())
            uid['gender'].addItems(['female', 'male', 'non-binary', 'prefer not to say'])
        if len(questions) > 0:
            ui.addSeparator()
            for q in questions.keys():
                uid[q] = ui.addLabelItem(questions[q], viz.addTextbox())
        ui_submit = ui.addItem(viz.addButtonLabel('Save'), align=viz.ALIGN_RIGHT_CENTER)
        yield viztask.waitButtonDown(ui_submit)
        metadata = {}
        for key in uid.keys():
            if key == '__expname__':
                self.name = uid['__expname__'].getMessage()
                continue
            metadata[key] = uid[key].getMessage()
        if gender: 
            metadata['gender'] = uid['gender'].getItems()[uid['gender'].getSelection()]
        ui.remove()
        self.participant = ParamSet(metadata)
        self._dlog('Participant Metadata: {:s}'.format(str(metadata)))
def requestParticipantData ( self , questions = { } , session = True , age = True , gender = True , expname = True ) : if type ( questions ) in ( list , tuple ) : questions = { q . replace ( ' ' , '' ) : q for q in questions } ui = vizinfo . InfoPanel ( 'Please enter the following data:' , title = 'Participant Information' , icon = False , align = viz . ALIGN_CENTER_CENTER ) uid = { } if expname : uid [ '__expname__' ] = ui . addLabelItem ( 'Experiment' , viz . addTextbox ( ) ) uid [ '__expname__' ] . message ( str ( self . name ) ) uid [ 'id' ] = ui . addLabelItem ( 'Participant ID' , viz . addTextbox ( ) ) if session : uid [ 'session' ] = ui . addLabelItem ( 'Session' , viz . addTextbox ( ) ) if age : uid [ 'age' ] = ui . addLabelItem ( 'Age' , viz . addTextbox ( ) ) if gender : uid [ 'gender' ] = ui . addLabelItem ( 'Gender' , viz . addDropList ( ) ) uid [ 'gender' ] . addItems ( [ 'female' , 'male' , 'non-binary' , 'prefer not to say' ] ) if len ( questions ) > 0 : ui . addSeparator ( ) for q in questions . keys ( ) : uid [ q ] = ui . addLabelItem ( questions [ q ] , viz . addTextbox ( ) ) ui_submit = ui . addItem ( viz . addButtonLabel ( 'Save' ) , align = viz . ALIGN_RIGHT_CENTER ) yield viztask . waitButtonDown ( ui_submit ) metadata = { } for key in uid . keys ( ) : if key == '__expname__' : self . name = uid [ '__expname__' ] . getMessage ( ) continue metadata [ key ] = uid [ key ] . getMessage ( ) if gender : metadata [ 'gender' ] = uid [ 'gender' ] . getItems ( ) [ uid [ 'gender' ] . getSelection ( ) ] ui . remove ( ) self . participant = ParamSet ( metadata ) self . _dlog ( 'Participant Metadata: {:s}' . format ( str ( metadata ) ) )
Show UI to input participant ID and further details.
Show UI to input participant ID and further details .
""" Show UI to input participant ID and further details. 
        Must be called as a Vizard task (using yield statement)!

        Some common fields are included for standardization, others can
        be added using the questions argument. Participant data is accessible
        through the experiment object's .participant property.

        Args:
            questions (dict or iterable): Further data fields to show
            session (bool): if True, include a session field
            age (bool): if True, include an age field
            gender (bool): if True, include a gender field
            expname (bool): if True, show a field for experiment name
        """
self
questions
Further data fields to show
Further data fields to show
session
if True, include a session field
if True include a session field
age
if True, include an age field
if True include an age field
gender
if True, include a gender field
if True include a gender field
expname
if True, show a field for experiment name
if True show a field for experiment name