code: def do_download_datafiles(self, _):
          ''' Download datafiles. '''
          contents = {"trialdata": lambda p: p.get_trial_data(), "eventdata": \
                      lambda p: p.get_event_data(), "questiondata": lambda p: \
                      p.get_question_data()}
          query = Participant.query.all()
          for k in contents:
              ret = "".join([contents[k](p) for p in query])
              temp_file = open(k + '.csv', 'w')
              temp_file.write(ret)
              temp_file.close(f do_download_datafiles(self, _):
          ''' Download datafiles. '''
          contents = {"trialdata": lambda p: p.get_trial_data(), "eventdata": \
                      lambda p: p.get_event_data(), "questiondata": lambda p: \
                      p.get_question_data()}
          query = Participant.query.all()
          for k in contents:
              ret = "".join([contents[k](p) for p in query])
              temp_file = open(k + '.csv', 'w')
              temp_file.write(ret)
              temp_file.close()
docs: Download datafiles.