Repository navigation
qualInterace object
Owen Selles edited this page Jun 3, 2015
·
20 revisions
import qual2db
qualInterface = qual2db.qualInterface()Gets XML survey schema from Qualtrics via a URL API call and processes it into a dictionary of attributes and lists that will eventually makeup the MySQL schema tables (Surveys, Blocks, Questions, Choices, Answers)
input:
qualInterface.getSchema(qid,sqlid=None,debug=False)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, # List of answers (Answers table)
'choices':clist, # List of choices (Choices table)
'questions':qlist, # List of questions (Questions table)
'ED': edlist, # List of embedded data fields
'schema':schema, # List of embedded data and questions (Questions table)
'blocks':blist # List of survey blocks (Blocks table)
}| Parameter | Description |
|---|---|
| qid | A Qualtrics survey id (required) |
| sqlid | The SQL id of the survey (if in MySQL). Will replace the qid throughout schema data. |
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 |