Skip to content

qualInterace object

Owen Selles edited this page Jun 3, 2015 · 20 revisions

Creation

import qual2db
qualInterface = qual2db.qualInterface()

Functions

getSchema()

Gets XML survey schema from Qualtrics via a URL API call and processes it into a dictionary of lists.

input:

qualInterface.getSchema()

output:

 survey_schema = {'name':name,            # The given name of the survey
                  'owner':owner,          # The Qualtrics id of the survey owner
                  'status':status,        # The survey status (1 = active, 0 = inactive)
                  'creation':creation,    # The survey creation date
                  'answers':alist,        # A list of answers of every question (this becomes the Answers table)
                  'choices':clist,        # A list of choices of every question (this becomes the Choices table)
                  'questions':qlist,      # A list of questions (this becomes the Questions table)
                  'ED': edlist,           # A list of embedded data fields (this is appended to the Questions table)
                  'schema':schema,        # A list of embedded data (ED) and the Questions list (questions) (this becomes the Questions table) 
                  'blocks':blist          # A list of survey blocks (this becomes the Blocks table)
                         }
Parameter Description
qid A Qualtrics survey id (required)
sqlid The SQL id of the survey (if it is already in MySQL). Using this will replace the qid throughout
the schema data.
enddate The latest response date to include. (optional)
respondent A qualtrics respondent id. If specified, only data for this respondent are returned. (optional)

getData()

Gets XML survey data from Qualtrics via a URL API call. Date format:YYYY-MM-DD hh:mm:ss.

qualInterface.getData()
Parameter Description
survey_object A pre-created survey object. (required)
startdate The earliest response date to include. (optional)
enddate The latest response date to include. (optional)
respondent A qualtrics respondent id. If specified, only data for this respondent are returned. (optional)
limit Limits the number respondents' data returned (optional)
debug Exposes the API URL call sent to Qualtrics to access the raw XML data

Clone this wiki locally