-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathquestion_sets.py
More file actions
56 lines (44 loc) · 1.21 KB
/
question_sets.py
File metadata and controls
56 lines (44 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
QUESTION_SET_PATH = '/question_sets'
class QuestionSets():
def __init__(self, client):
self.client = client
#
# '/question_sets' POST
#
# verification_id -
def create(self, person_id, time_limit = 0, options = {}):
body = options['body'] if 'body' in options else {}
body['person_id'] = person_id
body['time_limit'] = time_limit
response = self.client.post(QUESTION_SET_PATH, body)
return response
#
# '/question_sets/:id/:score' POST
#
# answers -
def score(self, id, answers):
body = {}
body['answers'] = answers
options = {}
options['request_type'] = 'json'
response = self.client.post('%s/%s/score' % (QUESTION_SET_PATH, str(id)), body, options)
return response
#
# '/question_sets/:id' GET
#
# id -
def retrieve(self, id):
body = {}
response = self.client.get('%s/%s' % (QUESTION_SET_PATH, str(id)), body)
return response
#
# '/question_sets' GET
#
def all(self, count=None, offset=None, options = {}):
body = options['body'] if 'body' in options else {}
if count:
body['count'] = count
if offset:
body['offset'] = offset
response = self.client.get(QUESTION_SET_PATH, body)
return response