Skip to content

Commit

Permalink
new endpoint coverage for Get Distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
dsavransky committed Jul 14, 2024
1 parent c1e370b commit b0db405
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions cornellGrading/cornellQualtrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,34 @@ def listDistributions(self, surveyId):

return response.json()["result"]["elements"]

def getDistribution(self, surveyId, distributionId):
"""Get a distribution
Args:
surveyId (str):
Unique id string of survey. Get either from web interface or via
getSurveyId
distributionId (str):
Unique id string of distribution.
Returns:
dict:
Dictionary encoding distribution definition and stats
Notes:
https://api.qualtrics.com/f5b1d8775d803-get-distribution
"""

baseUrl = "https://{0}{1}distributions/{2}?surveyId={3}".format(
self.dataCenter, self.qualtricsapi, distributionId, surveyId
)

response = requests.get(baseUrl, headers=self.headers_tokenOnly)
assert response.status_code == 200

return response.json()["result"]

def exportSurvey(self, surveyId, fileFormat="csv", useLabels="true", saveDir=None):
"""Download and extract survey results
Expand Down

0 comments on commit b0db405

Please sign in to comment.