openstax_exchange 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/openstax/exchange/client_instance.rb +4 -0
- data/lib/openstax/exchange/exchange.rb +8 -0
- data/lib/openstax/exchange/fake_client/fake_client.rb +19 -0
- data/lib/openstax/exchange/real_client/real_client.rb +18 -0
- data/lib/openstax/exchange/version.rb +1 -1
- data/spec/cassettes/OpenStax_Exchange_RealClient/behaves_like_exchange_client_api_v1/_record_grade/duplicate_identifer_resource_trial_triplet/records_the_new_grade.yml +198 -0
- data/spec/cassettes/OpenStax_Exchange_RealClient/behaves_like_exchange_client_api_v1/_record_grade/invalid_resource_string/raises_an_exception.yml +148 -0
- data/spec/cassettes/OpenStax_Exchange_RealClient/behaves_like_exchange_client_api_v1/_record_grade/success/allows_grades_for_distinct_identifiers_to_be_saved.yml +249 -0
- data/spec/cassettes/OpenStax_Exchange_RealClient/behaves_like_exchange_client_api_v1/_record_grade/success/allows_grades_for_distinct_resources_to_be_saved.yml +198 -0
- data/spec/cassettes/OpenStax_Exchange_RealClient/behaves_like_exchange_client_api_v1/_record_grade/success/allows_grades_for_distinct_trials_to_be_saved.yml +198 -0
- data/spec/cassettes/OpenStax_Exchange_RealClient/behaves_like_exchange_client_api_v1/_record_grade/success/records_the_exercise_grade_for_the_given_identifier.yml +149 -0
- data/spec/lib/openstax/exchange/shared_examples_for_exchange_client_v1.rb +178 -8
- metadata +16 -4
@@ -33,6 +33,7 @@ module OpenStax
|
|
33
33
|
|
34
34
|
@token = SecureRandom.hex(64)
|
35
35
|
@multiple_choice_responses = {}
|
36
|
+
@grades = {}
|
36
37
|
end
|
37
38
|
|
38
39
|
def is_real_client?
|
@@ -66,6 +67,24 @@ module OpenStax
|
|
66
67
|
'answer' => answer
|
67
68
|
}
|
68
69
|
end
|
70
|
+
|
71
|
+
def record_grade(identifier, resource, trial, grade, grader)
|
72
|
+
host = URI(resource).host
|
73
|
+
raise "invalid resource" unless host =~ /openstax\.org\z|localhost\z/
|
74
|
+
|
75
|
+
@grades[identifier] ||= {}
|
76
|
+
@grades[identifier][resource] ||= {}
|
77
|
+
@grades[identifier][resource][trial] ||= []
|
78
|
+
@grades[identifier][resource][trial] << {grade: grade, grader: grader}
|
79
|
+
|
80
|
+
return {
|
81
|
+
'identifier' => identifier,
|
82
|
+
'resource' => resource,
|
83
|
+
'trial' => trial,
|
84
|
+
'grade' => grade,
|
85
|
+
'grader' => grader
|
86
|
+
}
|
87
|
+
end
|
69
88
|
end
|
70
89
|
|
71
90
|
end
|
@@ -60,6 +60,24 @@ module OpenStax
|
|
60
60
|
return JSON.parse(response.body)
|
61
61
|
end
|
62
62
|
|
63
|
+
def record_grade(identifier, resource, trial, grade, grader)
|
64
|
+
options = {}
|
65
|
+
add_accept_header! options
|
66
|
+
add_authorization_header! options
|
67
|
+
add_content_type_header! options
|
68
|
+
|
69
|
+
options[:body] = { identifier: identifier, resource: resource,
|
70
|
+
trial: trial, grade: grade, grader: grader }.to_json
|
71
|
+
|
72
|
+
response = @oauth_token.request(
|
73
|
+
:post,
|
74
|
+
"#{@server_url}/api/events/platforms/gradings",
|
75
|
+
options
|
76
|
+
)
|
77
|
+
|
78
|
+
return JSON.parse(response.body)
|
79
|
+
end
|
80
|
+
|
63
81
|
private
|
64
82
|
|
65
83
|
def add_header_hash!(options)
|
@@ -0,0 +1,198 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://123:abc@localhost:3003/oauth/token
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: grant_type=client_credentials
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.1
|
12
|
+
Content-Type:
|
13
|
+
- application/x-www-form-urlencoded
|
14
|
+
Accept:
|
15
|
+
- ! '*/*'
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
X-Frame-Options:
|
22
|
+
- SAMEORIGIN
|
23
|
+
X-Xss-Protection:
|
24
|
+
- 1; mode=block
|
25
|
+
X-Content-Type-Options:
|
26
|
+
- nosniff
|
27
|
+
Cache-Control:
|
28
|
+
- no-store
|
29
|
+
Pragma:
|
30
|
+
- no-cache
|
31
|
+
Content-Type:
|
32
|
+
- application/json; charset=utf-8
|
33
|
+
Etag:
|
34
|
+
- W/"f2964886eb9c7cd1f64e2739e98321e4"
|
35
|
+
X-Request-Id:
|
36
|
+
- 457cd5be-08c5-460f-9f75-a6ae65f8cf33
|
37
|
+
X-Runtime:
|
38
|
+
- '0.017691'
|
39
|
+
Connection:
|
40
|
+
- close
|
41
|
+
Server:
|
42
|
+
- thin
|
43
|
+
body:
|
44
|
+
encoding: US-ASCII
|
45
|
+
string: ! '{"access_token":"24a5e62794ef61812b4ade1da0a3741a446a87c448cf8ffa267b6a95c97b6cea","token_type":"bearer","scope":"read
|
46
|
+
write","created_at":1431390441}'
|
47
|
+
http_version:
|
48
|
+
recorded_at: Tue, 12 May 2015 00:27:21 GMT
|
49
|
+
- request:
|
50
|
+
method: post
|
51
|
+
uri: http://localhost:3003/api/identifiers
|
52
|
+
body:
|
53
|
+
encoding: US-ASCII
|
54
|
+
string: ''
|
55
|
+
headers:
|
56
|
+
User-Agent:
|
57
|
+
- Faraday v0.9.1
|
58
|
+
Accept:
|
59
|
+
- application/vnd.exchange.openstax.v1
|
60
|
+
Content-Type:
|
61
|
+
- application/json
|
62
|
+
Authorization:
|
63
|
+
- Bearer 24a5e62794ef61812b4ade1da0a3741a446a87c448cf8ffa267b6a95c97b6cea
|
64
|
+
Content-Length:
|
65
|
+
- '0'
|
66
|
+
response:
|
67
|
+
status:
|
68
|
+
code: 201
|
69
|
+
message: Created
|
70
|
+
headers:
|
71
|
+
X-Frame-Options:
|
72
|
+
- SAMEORIGIN
|
73
|
+
X-Xss-Protection:
|
74
|
+
- 1; mode=block
|
75
|
+
X-Content-Type-Options:
|
76
|
+
- nosniff
|
77
|
+
Date:
|
78
|
+
- Tue, 12 May 2015 00:27:21 GMT
|
79
|
+
Content-Type:
|
80
|
+
- application/json; charset=utf-8
|
81
|
+
Etag:
|
82
|
+
- W/"2430efaf9cc9bc89900d4eaa04400807"
|
83
|
+
Cache-Control:
|
84
|
+
- max-age=0, private, must-revalidate
|
85
|
+
Set-Cookie:
|
86
|
+
- request_method=POST; path=/
|
87
|
+
X-Request-Id:
|
88
|
+
- 44d442fe-ef13-4e08-bd07-d0d9947abd78
|
89
|
+
X-Runtime:
|
90
|
+
- '0.062409'
|
91
|
+
Connection:
|
92
|
+
- close
|
93
|
+
Server:
|
94
|
+
- thin
|
95
|
+
body:
|
96
|
+
encoding: US-ASCII
|
97
|
+
string: ! '{"read":"8b23c3d2299a1fc6478e28b1f7024a4f14a7945c818b57864616f02149883065","write":"8fc97bc59e6bf2df9fb6612c74c63bf38292b5011f2266b5b78276aed7bd1b86"}'
|
98
|
+
http_version:
|
99
|
+
recorded_at: Tue, 12 May 2015 00:27:21 GMT
|
100
|
+
- request:
|
101
|
+
method: post
|
102
|
+
uri: http://localhost:3003/api/events/platforms/gradings
|
103
|
+
body:
|
104
|
+
encoding: UTF-8
|
105
|
+
string: ! '{"identifier":"8fc97bc59e6bf2df9fb6612c74c63bf38292b5011f2266b5b78276aed7bd1b86","resource":"https://exercises-dev1.openstax.org/api/exercises/123@1","trial":"1","grade":"0.0","grader":"openstax"}'
|
106
|
+
headers:
|
107
|
+
User-Agent:
|
108
|
+
- Faraday v0.9.1
|
109
|
+
Accept:
|
110
|
+
- application/vnd.exchange.openstax.v1
|
111
|
+
Authorization:
|
112
|
+
- Bearer 24a5e62794ef61812b4ade1da0a3741a446a87c448cf8ffa267b6a95c97b6cea
|
113
|
+
Content-Type:
|
114
|
+
- application/json
|
115
|
+
response:
|
116
|
+
status:
|
117
|
+
code: 201
|
118
|
+
message: Created
|
119
|
+
headers:
|
120
|
+
X-Frame-Options:
|
121
|
+
- SAMEORIGIN
|
122
|
+
X-Xss-Protection:
|
123
|
+
- 1; mode=block
|
124
|
+
X-Content-Type-Options:
|
125
|
+
- nosniff
|
126
|
+
Date:
|
127
|
+
- Tue, 12 May 2015 00:27:21 GMT
|
128
|
+
Content-Type:
|
129
|
+
- application/json; charset=utf-8
|
130
|
+
Etag:
|
131
|
+
- W/"bfe8018341200e22df35c585e2a0ec5d"
|
132
|
+
Cache-Control:
|
133
|
+
- max-age=0, private, must-revalidate
|
134
|
+
Set-Cookie:
|
135
|
+
- request_method=POST; path=/
|
136
|
+
X-Request-Id:
|
137
|
+
- db32c35a-413c-4482-92f0-d4c2baa49173
|
138
|
+
X-Runtime:
|
139
|
+
- '0.094311'
|
140
|
+
Connection:
|
141
|
+
- close
|
142
|
+
Server:
|
143
|
+
- thin
|
144
|
+
body:
|
145
|
+
encoding: US-ASCII
|
146
|
+
string: ! '{"identifier":"8fc97bc59e6bf2df9fb6612c74c63bf38292b5011f2266b5b78276aed7bd1b86","resource":"https://exercises-dev1.openstax.org/api/exercises/123@1","trial":"1","created_at":"2015-05-12T00:27:21.280Z","grader":"openstax","grade":"0.0"}'
|
147
|
+
http_version:
|
148
|
+
recorded_at: Tue, 12 May 2015 00:27:21 GMT
|
149
|
+
- request:
|
150
|
+
method: post
|
151
|
+
uri: http://localhost:3003/api/events/platforms/gradings
|
152
|
+
body:
|
153
|
+
encoding: UTF-8
|
154
|
+
string: ! '{"identifier":"8fc97bc59e6bf2df9fb6612c74c63bf38292b5011f2266b5b78276aed7bd1b86","resource":"https://exercises-dev1.openstax.org/api/exercises/123@1","trial":"1","grade":"1.0","grader":"tutor"}'
|
155
|
+
headers:
|
156
|
+
User-Agent:
|
157
|
+
- Faraday v0.9.1
|
158
|
+
Accept:
|
159
|
+
- application/vnd.exchange.openstax.v1
|
160
|
+
Authorization:
|
161
|
+
- Bearer 24a5e62794ef61812b4ade1da0a3741a446a87c448cf8ffa267b6a95c97b6cea
|
162
|
+
Content-Type:
|
163
|
+
- application/json
|
164
|
+
response:
|
165
|
+
status:
|
166
|
+
code: 201
|
167
|
+
message: Created
|
168
|
+
headers:
|
169
|
+
X-Frame-Options:
|
170
|
+
- SAMEORIGIN
|
171
|
+
X-Xss-Protection:
|
172
|
+
- 1; mode=block
|
173
|
+
X-Content-Type-Options:
|
174
|
+
- nosniff
|
175
|
+
Date:
|
176
|
+
- Tue, 12 May 2015 00:27:21 GMT
|
177
|
+
Content-Type:
|
178
|
+
- application/json; charset=utf-8
|
179
|
+
Etag:
|
180
|
+
- W/"8a5afe915582c7458850da40c2f35e79"
|
181
|
+
Cache-Control:
|
182
|
+
- max-age=0, private, must-revalidate
|
183
|
+
Set-Cookie:
|
184
|
+
- request_method=POST; path=/
|
185
|
+
X-Request-Id:
|
186
|
+
- 7f825b12-c4a7-4b6a-aea3-97db28fcee8a
|
187
|
+
X-Runtime:
|
188
|
+
- '0.086670'
|
189
|
+
Connection:
|
190
|
+
- close
|
191
|
+
Server:
|
192
|
+
- thin
|
193
|
+
body:
|
194
|
+
encoding: US-ASCII
|
195
|
+
string: ! '{"identifier":"8fc97bc59e6bf2df9fb6612c74c63bf38292b5011f2266b5b78276aed7bd1b86","resource":"https://exercises-dev1.openstax.org/api/exercises/123@1","trial":"1","created_at":"2015-05-12T00:27:21.372Z","grader":"tutor","grade":"1.0"}'
|
196
|
+
http_version:
|
197
|
+
recorded_at: Tue, 12 May 2015 00:27:21 GMT
|
198
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,148 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://123:abc@localhost:3003/oauth/token
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: grant_type=client_credentials
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.1
|
12
|
+
Content-Type:
|
13
|
+
- application/x-www-form-urlencoded
|
14
|
+
Accept:
|
15
|
+
- ! '*/*'
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
X-Frame-Options:
|
22
|
+
- SAMEORIGIN
|
23
|
+
X-Xss-Protection:
|
24
|
+
- 1; mode=block
|
25
|
+
X-Content-Type-Options:
|
26
|
+
- nosniff
|
27
|
+
Cache-Control:
|
28
|
+
- no-store
|
29
|
+
Pragma:
|
30
|
+
- no-cache
|
31
|
+
Content-Type:
|
32
|
+
- application/json; charset=utf-8
|
33
|
+
Etag:
|
34
|
+
- W/"671e0a562337a825aa19d4a1e8b75206"
|
35
|
+
X-Request-Id:
|
36
|
+
- 0c7e053f-e805-4c4a-9bf3-a1478d4f00ce
|
37
|
+
X-Runtime:
|
38
|
+
- '0.016269'
|
39
|
+
Connection:
|
40
|
+
- close
|
41
|
+
Server:
|
42
|
+
- thin
|
43
|
+
body:
|
44
|
+
encoding: US-ASCII
|
45
|
+
string: ! '{"access_token":"c0ca319e2588f9f74b8b14c960fd5f4e157a6edf060c36d764a390e082f7f131","token_type":"bearer","scope":"read
|
46
|
+
write","created_at":1431390182}'
|
47
|
+
http_version:
|
48
|
+
recorded_at: Tue, 12 May 2015 00:23:02 GMT
|
49
|
+
- request:
|
50
|
+
method: post
|
51
|
+
uri: http://localhost:3003/api/identifiers
|
52
|
+
body:
|
53
|
+
encoding: US-ASCII
|
54
|
+
string: ''
|
55
|
+
headers:
|
56
|
+
User-Agent:
|
57
|
+
- Faraday v0.9.1
|
58
|
+
Accept:
|
59
|
+
- application/vnd.exchange.openstax.v1
|
60
|
+
Content-Type:
|
61
|
+
- application/json
|
62
|
+
Authorization:
|
63
|
+
- Bearer c0ca319e2588f9f74b8b14c960fd5f4e157a6edf060c36d764a390e082f7f131
|
64
|
+
Content-Length:
|
65
|
+
- '0'
|
66
|
+
response:
|
67
|
+
status:
|
68
|
+
code: 201
|
69
|
+
message: Created
|
70
|
+
headers:
|
71
|
+
X-Frame-Options:
|
72
|
+
- SAMEORIGIN
|
73
|
+
X-Xss-Protection:
|
74
|
+
- 1; mode=block
|
75
|
+
X-Content-Type-Options:
|
76
|
+
- nosniff
|
77
|
+
Date:
|
78
|
+
- Tue, 12 May 2015 00:23:02 GMT
|
79
|
+
Content-Type:
|
80
|
+
- application/json; charset=utf-8
|
81
|
+
Etag:
|
82
|
+
- W/"8e5c3fe6bde08de633da0d6153d8d0cc"
|
83
|
+
Cache-Control:
|
84
|
+
- max-age=0, private, must-revalidate
|
85
|
+
Set-Cookie:
|
86
|
+
- request_method=POST; path=/
|
87
|
+
X-Request-Id:
|
88
|
+
- 64d5effc-e4a5-4180-a31f-38e3ddff9f8b
|
89
|
+
X-Runtime:
|
90
|
+
- '0.063133'
|
91
|
+
Connection:
|
92
|
+
- close
|
93
|
+
Server:
|
94
|
+
- thin
|
95
|
+
body:
|
96
|
+
encoding: US-ASCII
|
97
|
+
string: ! '{"read":"383cc2fee618697bf70d7cec3298b05733bb007ce9f18032de065b90709c26d4","write":"e26218f6aa93129c2b4fc84b2548264e3256308d53164212b3d0285b40575843"}'
|
98
|
+
http_version:
|
99
|
+
recorded_at: Tue, 12 May 2015 00:23:02 GMT
|
100
|
+
- request:
|
101
|
+
method: post
|
102
|
+
uri: http://localhost:3003/api/events/platforms/gradings
|
103
|
+
body:
|
104
|
+
encoding: UTF-8
|
105
|
+
string: ! '{"identifier":"e26218f6aa93129c2b4fc84b2548264e3256308d53164212b3d0285b40575843","resource":"https://example.com/api/exercises/123@1","trial":"1","grade":"1.0","grader":"openstax"}'
|
106
|
+
headers:
|
107
|
+
User-Agent:
|
108
|
+
- Faraday v0.9.1
|
109
|
+
Accept:
|
110
|
+
- application/vnd.exchange.openstax.v1
|
111
|
+
Authorization:
|
112
|
+
- Bearer c0ca319e2588f9f74b8b14c960fd5f4e157a6edf060c36d764a390e082f7f131
|
113
|
+
Content-Type:
|
114
|
+
- application/json
|
115
|
+
response:
|
116
|
+
status:
|
117
|
+
code: 422
|
118
|
+
message: Unprocessable Entity
|
119
|
+
headers:
|
120
|
+
X-Frame-Options:
|
121
|
+
- SAMEORIGIN
|
122
|
+
X-Xss-Protection:
|
123
|
+
- 1; mode=block
|
124
|
+
X-Content-Type-Options:
|
125
|
+
- nosniff
|
126
|
+
Date:
|
127
|
+
- Tue, 12 May 2015 00:23:02 GMT
|
128
|
+
Content-Type:
|
129
|
+
- application/json; charset=utf-8
|
130
|
+
Cache-Control:
|
131
|
+
- no-cache
|
132
|
+
Set-Cookie:
|
133
|
+
- request_method=POST; path=/
|
134
|
+
X-Request-Id:
|
135
|
+
- 09a3a36a-5172-46fe-aca0-115a7077df12
|
136
|
+
X-Runtime:
|
137
|
+
- '0.039371'
|
138
|
+
Connection:
|
139
|
+
- close
|
140
|
+
Server:
|
141
|
+
- thin
|
142
|
+
body:
|
143
|
+
encoding: US-ASCII
|
144
|
+
string: ! '[{"code":"blank","data":{"model":{"id":null,"identifier_id":15,"resource_id":null,"trial":"1","due_at":null,"created_at":null,"updated_at":null},"attribute":"resource"},"kind":"activerecord","message":"can''t
|
145
|
+
be blank","offending_inputs":"resource"}]'
|
146
|
+
http_version:
|
147
|
+
recorded_at: Tue, 12 May 2015 00:23:02 GMT
|
148
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,249 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://123:abc@localhost:3003/oauth/token
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: grant_type=client_credentials
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.1
|
12
|
+
Content-Type:
|
13
|
+
- application/x-www-form-urlencoded
|
14
|
+
Accept:
|
15
|
+
- ! '*/*'
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
X-Frame-Options:
|
22
|
+
- SAMEORIGIN
|
23
|
+
X-Xss-Protection:
|
24
|
+
- 1; mode=block
|
25
|
+
X-Content-Type-Options:
|
26
|
+
- nosniff
|
27
|
+
Cache-Control:
|
28
|
+
- no-store
|
29
|
+
Pragma:
|
30
|
+
- no-cache
|
31
|
+
Content-Type:
|
32
|
+
- application/json; charset=utf-8
|
33
|
+
Etag:
|
34
|
+
- W/"ab670f60e3a9b5c0efbe4129f1d37624"
|
35
|
+
X-Request-Id:
|
36
|
+
- 7cc8251c-b438-44c1-ac7c-7d97aacbf814
|
37
|
+
X-Runtime:
|
38
|
+
- '0.017613'
|
39
|
+
Connection:
|
40
|
+
- close
|
41
|
+
Server:
|
42
|
+
- thin
|
43
|
+
body:
|
44
|
+
encoding: US-ASCII
|
45
|
+
string: ! '{"access_token":"958660c63a1f4909480a222d1da43bdf57f9e4aae3c63fb735645fe81d4f19d7","token_type":"bearer","scope":"read
|
46
|
+
write","created_at":1431390181}'
|
47
|
+
http_version:
|
48
|
+
recorded_at: Tue, 12 May 2015 00:23:01 GMT
|
49
|
+
- request:
|
50
|
+
method: post
|
51
|
+
uri: http://localhost:3003/api/identifiers
|
52
|
+
body:
|
53
|
+
encoding: US-ASCII
|
54
|
+
string: ''
|
55
|
+
headers:
|
56
|
+
User-Agent:
|
57
|
+
- Faraday v0.9.1
|
58
|
+
Accept:
|
59
|
+
- application/vnd.exchange.openstax.v1
|
60
|
+
Content-Type:
|
61
|
+
- application/json
|
62
|
+
Authorization:
|
63
|
+
- Bearer 958660c63a1f4909480a222d1da43bdf57f9e4aae3c63fb735645fe81d4f19d7
|
64
|
+
Content-Length:
|
65
|
+
- '0'
|
66
|
+
response:
|
67
|
+
status:
|
68
|
+
code: 201
|
69
|
+
message: Created
|
70
|
+
headers:
|
71
|
+
X-Frame-Options:
|
72
|
+
- SAMEORIGIN
|
73
|
+
X-Xss-Protection:
|
74
|
+
- 1; mode=block
|
75
|
+
X-Content-Type-Options:
|
76
|
+
- nosniff
|
77
|
+
Date:
|
78
|
+
- Tue, 12 May 2015 00:23:01 GMT
|
79
|
+
Content-Type:
|
80
|
+
- application/json; charset=utf-8
|
81
|
+
Etag:
|
82
|
+
- W/"789d410da7b2991db05829ab261f60e3"
|
83
|
+
Cache-Control:
|
84
|
+
- max-age=0, private, must-revalidate
|
85
|
+
Set-Cookie:
|
86
|
+
- request_method=POST; path=/
|
87
|
+
X-Request-Id:
|
88
|
+
- f6fcebdb-65dc-4930-baa6-41d70df78f92
|
89
|
+
X-Runtime:
|
90
|
+
- '0.061422'
|
91
|
+
Connection:
|
92
|
+
- close
|
93
|
+
Server:
|
94
|
+
- thin
|
95
|
+
body:
|
96
|
+
encoding: US-ASCII
|
97
|
+
string: ! '{"read":"062be8afc3cfd2dc5ddc418c735d5c00783495b4947815b69289df6865e81ccd","write":"43afc96d250fa4bf6cc62c63c4b5ba22668345e2ac618edc6fdcf4813d44b5d0"}'
|
98
|
+
http_version:
|
99
|
+
recorded_at: Tue, 12 May 2015 00:23:01 GMT
|
100
|
+
- request:
|
101
|
+
method: post
|
102
|
+
uri: http://localhost:3003/api/identifiers
|
103
|
+
body:
|
104
|
+
encoding: US-ASCII
|
105
|
+
string: ''
|
106
|
+
headers:
|
107
|
+
User-Agent:
|
108
|
+
- Faraday v0.9.1
|
109
|
+
Accept:
|
110
|
+
- application/vnd.exchange.openstax.v1
|
111
|
+
Content-Type:
|
112
|
+
- application/json
|
113
|
+
Authorization:
|
114
|
+
- Bearer 958660c63a1f4909480a222d1da43bdf57f9e4aae3c63fb735645fe81d4f19d7
|
115
|
+
Content-Length:
|
116
|
+
- '0'
|
117
|
+
response:
|
118
|
+
status:
|
119
|
+
code: 201
|
120
|
+
message: Created
|
121
|
+
headers:
|
122
|
+
X-Frame-Options:
|
123
|
+
- SAMEORIGIN
|
124
|
+
X-Xss-Protection:
|
125
|
+
- 1; mode=block
|
126
|
+
X-Content-Type-Options:
|
127
|
+
- nosniff
|
128
|
+
Date:
|
129
|
+
- Tue, 12 May 2015 00:23:01 GMT
|
130
|
+
Content-Type:
|
131
|
+
- application/json; charset=utf-8
|
132
|
+
Etag:
|
133
|
+
- W/"90bb024d74098622bdbed99fea1d62f0"
|
134
|
+
Cache-Control:
|
135
|
+
- max-age=0, private, must-revalidate
|
136
|
+
Set-Cookie:
|
137
|
+
- request_method=POST; path=/
|
138
|
+
X-Request-Id:
|
139
|
+
- b4afb357-2b92-45c1-91dd-f407ee2e37c2
|
140
|
+
X-Runtime:
|
141
|
+
- '0.054959'
|
142
|
+
Connection:
|
143
|
+
- close
|
144
|
+
Server:
|
145
|
+
- thin
|
146
|
+
body:
|
147
|
+
encoding: US-ASCII
|
148
|
+
string: ! '{"read":"0d659139fa13163cfd60e6e365646505dad2ac6cff0afece9f01daa7db2b72d7","write":"8ffc8b438bca8f79e4b1ac7b1dfdb55c447e96099e19faf74e57718681e041d0"}'
|
149
|
+
http_version:
|
150
|
+
recorded_at: Tue, 12 May 2015 00:23:01 GMT
|
151
|
+
- request:
|
152
|
+
method: post
|
153
|
+
uri: http://localhost:3003/api/events/platforms/gradings
|
154
|
+
body:
|
155
|
+
encoding: UTF-8
|
156
|
+
string: ! '{"identifier":"43afc96d250fa4bf6cc62c63c4b5ba22668345e2ac618edc6fdcf4813d44b5d0","resource":"https://exercises-dev1.openstax.org/api/exercises/123@1","trial":"1","grade":"1.0","grader":"openstax"}'
|
157
|
+
headers:
|
158
|
+
User-Agent:
|
159
|
+
- Faraday v0.9.1
|
160
|
+
Accept:
|
161
|
+
- application/vnd.exchange.openstax.v1
|
162
|
+
Authorization:
|
163
|
+
- Bearer 958660c63a1f4909480a222d1da43bdf57f9e4aae3c63fb735645fe81d4f19d7
|
164
|
+
Content-Type:
|
165
|
+
- application/json
|
166
|
+
response:
|
167
|
+
status:
|
168
|
+
code: 201
|
169
|
+
message: Created
|
170
|
+
headers:
|
171
|
+
X-Frame-Options:
|
172
|
+
- SAMEORIGIN
|
173
|
+
X-Xss-Protection:
|
174
|
+
- 1; mode=block
|
175
|
+
X-Content-Type-Options:
|
176
|
+
- nosniff
|
177
|
+
Date:
|
178
|
+
- Tue, 12 May 2015 00:23:01 GMT
|
179
|
+
Content-Type:
|
180
|
+
- application/json; charset=utf-8
|
181
|
+
Etag:
|
182
|
+
- W/"b8477e35034c555e8d5851ab64cc2670"
|
183
|
+
Cache-Control:
|
184
|
+
- max-age=0, private, must-revalidate
|
185
|
+
Set-Cookie:
|
186
|
+
- request_method=POST; path=/
|
187
|
+
X-Request-Id:
|
188
|
+
- 8e004a6a-a92b-466b-bab2-8a90d7467884
|
189
|
+
X-Runtime:
|
190
|
+
- '0.096030'
|
191
|
+
Connection:
|
192
|
+
- close
|
193
|
+
Server:
|
194
|
+
- thin
|
195
|
+
body:
|
196
|
+
encoding: US-ASCII
|
197
|
+
string: ! '{"identifier":"43afc96d250fa4bf6cc62c63c4b5ba22668345e2ac618edc6fdcf4813d44b5d0","resource":"https://exercises-dev1.openstax.org/api/exercises/123@1","trial":"1","created_at":"2015-05-12T00:23:01.414Z","grader":"openstax","grade":"1.0"}'
|
198
|
+
http_version:
|
199
|
+
recorded_at: Tue, 12 May 2015 00:23:01 GMT
|
200
|
+
- request:
|
201
|
+
method: post
|
202
|
+
uri: http://localhost:3003/api/events/platforms/gradings
|
203
|
+
body:
|
204
|
+
encoding: UTF-8
|
205
|
+
string: ! '{"identifier":"8ffc8b438bca8f79e4b1ac7b1dfdb55c447e96099e19faf74e57718681e041d0","resource":"https://exercises-dev1.openstax.org/api/exercises/123@1","trial":"1","grade":"1.0","grader":"openstax"}'
|
206
|
+
headers:
|
207
|
+
User-Agent:
|
208
|
+
- Faraday v0.9.1
|
209
|
+
Accept:
|
210
|
+
- application/vnd.exchange.openstax.v1
|
211
|
+
Authorization:
|
212
|
+
- Bearer 958660c63a1f4909480a222d1da43bdf57f9e4aae3c63fb735645fe81d4f19d7
|
213
|
+
Content-Type:
|
214
|
+
- application/json
|
215
|
+
response:
|
216
|
+
status:
|
217
|
+
code: 201
|
218
|
+
message: Created
|
219
|
+
headers:
|
220
|
+
X-Frame-Options:
|
221
|
+
- SAMEORIGIN
|
222
|
+
X-Xss-Protection:
|
223
|
+
- 1; mode=block
|
224
|
+
X-Content-Type-Options:
|
225
|
+
- nosniff
|
226
|
+
Date:
|
227
|
+
- Tue, 12 May 2015 00:23:01 GMT
|
228
|
+
Content-Type:
|
229
|
+
- application/json; charset=utf-8
|
230
|
+
Etag:
|
231
|
+
- W/"2e96a53698c31e33a3cbaaa39d125557"
|
232
|
+
Cache-Control:
|
233
|
+
- max-age=0, private, must-revalidate
|
234
|
+
Set-Cookie:
|
235
|
+
- request_method=POST; path=/
|
236
|
+
X-Request-Id:
|
237
|
+
- 20a4191f-34c0-4035-9e9e-6a271a5737a6
|
238
|
+
X-Runtime:
|
239
|
+
- '0.102653'
|
240
|
+
Connection:
|
241
|
+
- close
|
242
|
+
Server:
|
243
|
+
- thin
|
244
|
+
body:
|
245
|
+
encoding: US-ASCII
|
246
|
+
string: ! '{"identifier":"8ffc8b438bca8f79e4b1ac7b1dfdb55c447e96099e19faf74e57718681e041d0","resource":"https://exercises-dev1.openstax.org/api/exercises/123@1","trial":"1","created_at":"2015-05-12T00:23:01.519Z","grader":"openstax","grade":"1.0"}'
|
247
|
+
http_version:
|
248
|
+
recorded_at: Tue, 12 May 2015 00:23:01 GMT
|
249
|
+
recorded_with: VCR 2.9.3
|