-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexam-management.yaml
More file actions
310 lines (303 loc) · 12.4 KB
/
exam-management.yaml
File metadata and controls
310 lines (303 loc) · 12.4 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
openapi: "3.0.0"
info:
description: "This is the Exam API for UC4."
version: "0.17.1"
title: "UC4"
servers:
- url: https://uc4.cs.upb.de/api/experimental/exam-management
- url: https://uc4.cs.upb.de/api/develop/exam-management
- url: https://uc4.cs.upb.de/api/production/exam-management
tags:
- name: "Version Management"
description: "Everything about the Version"
externalDocs:
description: "Find out more"
url: "https://github.com/upb-uc4"
- name: "Exam Management"
description: "Everything about the exams"
externalDocs:
description: "Find out more"
url: "https://github.com/upb-uc4"
paths:
/version:
get:
tags:
- "Version Management"
summary: "Get version"
description: "Returns the version of the current service"
operationId: "getVersion"
responses:
"200":
description: "OK"
content:
application/json:
schema:
$ref: '#/components/schemas/JsonServiceVersion'
/version/hyperledger:
get:
tags:
- "Version Management"
summary: "Get Hyperledger version"
description: "Returns the version of the current hyperledger backend"
operationId: "getVersionHyperledger"
responses:
"200":
description: "OK"
content:
application/json:
schema:
$ref: '#/components/schemas/JsonHyperledgerVersion'
/exams:
get:
tags:
- "Exam Management"
summary: "Get All Exams"
description: "When invoked by an Admin and without query parameters, returns all exams. When invoked with query parameters, returns exams filtered by the parameters."
operationId: "getAllExams"
parameters:
- name: "examIds"
in: "query"
description: "Comma separated list of ExamIds to filter by"
required: false
schema:
type: "string"
- name: "courseIds"
in: "query"
description: "Comma separated list of CourseIds to filter by"
required: false
schema:
type: "string"
- name: "lecturerIds"
in: "query"
description: "Comma separated list of enrollmentIds of lecturers to filter by"
required: false
schema:
type: "string"
- name: "moduleIds"
in: "query"
description: "Comma separated list of ModuleIds to filter by"
required: false
schema:
type: "string"
- name: "types"
in: "query"
description: "Comma separated list of Types to filter by"
required: false
schema:
type: "string"
- name: "admittableAt"
in: "query"
description: "Only return exams for which admittableAt is before AdmittableUntil. Date in ISO 8601"
required: false
schema:
type: "string"
- name: "droppableAt"
in: "query"
description: "Only return exams for which droppableAt is before DroppableUntil. Date in ISO 8601"
required: false
schema:
type: "string"
responses:
"200":
description: "OK"
content:
application/json:
schema:
type: "array"
items:
$ref: '#/components/schemas/Exam'
examples:
GetExam:
$ref: '#/components/examples/ExampleExamGet'
"400":
description: |
Bad Request
types: MalformedLoginToken, MultipleAuthorizationError
content:
application/json:
schema:
$ref: '#/components/schemas/GenericError'
"401":
description: |
Unauthorized
types: JwtAuthorization, LoginTokenExpired
content:
application/json:
schema:
$ref: '#/components/schemas/GenericError'
"403":
description: |
Forbidden
types: NotEnoughPrivileges, OwnerMismatch
content:
application/json:
schema:
$ref: '#/components/schemas/GenericError'
"422":
description: |
Unprocessable Entity
types: LoginTokenSignatureInvalid
content:
application/json:
schema:
$ref: '#/components/schemas/GenericError'
/exams/unsigned_add_proposal:
post:
tags:
- "Exam Management"
summary: "Fetch a proposal for creating an exam"
description: "Fetch a proposal for creating the exam given in the body."
operationId: "getProposalAddExam"
security:
- uc4_token_login: []
- uc4_token_login_header: []
requestBody:
description: "Exam object based on which an operation is initiated"
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Exam'
examples:
AddCourseAdmission:
$ref: '#/components/examples/ExampleExam'
responses:
"200":
description: "OK"
content:
application/json:
schema:
$ref: '#/components/schemas/UnsignedProposal'
examples:
ExampleUnsignedProposal:
$ref: '#/components/examples/ExampleUnsignedProposal'
"400":
description: |
Bad Request
types: MalformedLoginToken, Deserialization, JsonValidation, MultipleAuthorizationError
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/GenericError'
- $ref: '#/components/schemas/DetailedError'
"401":
description: |
Unauthorized
types: JwtAuthorization, LoginTokenExpired
content:
application/json:
schema:
$ref: '#/components/schemas/GenericError'
"403":
description: |
Forbidden
types: NotEnoughPrivileges, OwnerMismatch
content:
application/json:
schema:
$ref: '#/components/schemas/GenericError'
"422":
description: |
Unprocessable Entity
types: Validation, ValidationTimeout, LoginTokenSignatureInvalid
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/GenericError'
- $ref: '#/components/schemas/DetailedError'
components:
securitySchemes:
uc4_token_login:
type: apiKey
in: cookie
name: login
uc4_token_login_header:
type: http
scheme: bearer
schemas:
Exam:
type: object
properties:
examId:
type: string
courseId:
type: string
moduleId:
type: string
lecturerEnrollmentId:
type: string
type:
type: string
enum: ["Written Exam"]
date:
type: string
format: date
description: "ISO 8601"
ects:
type: integer
admittableUntil:
type: string
format: date
description: "ISO 8601"
droppableUntil:
type: string
format: date
description: "ISO 8601"
UnsignedProposal:
allOf:
- $ref: 'https://raw.githubusercontent.com/upb-uc4/api/develop/hyperledger-proposals.yaml#/components/schemas/UnsignedProposal'
- type: object
JsonServiceVersion:
type: object
properties:
serviceVersion:
type: string
JsonHyperledgerVersion:
type: object
properties:
hlfApiVersion:
type: string
chaincodeVersion:
type: string
GenericError:
allOf:
- $ref: 'https://raw.githubusercontent.com/upb-uc4/api/develop/errors.yaml#/components/schemas/GenericError'
- type: object
DetailedError:
allOf:
- $ref: 'https://raw.githubusercontent.com/upb-uc4/api/develop/errors.yaml#/components/schemas/DetailedError'
- type: object
examples:
ExampleExam:
summary: "An example for an exam"
value:
examId: "eae27105-2fd5-11eb-ad58-572c5dfe1b7a:M.1275.01158:Written Exam:2021-04-01"
courseId: "eae27105-2fd5-11eb-ad58-572c5dfe1b7a"
moduleId: "M.1275.01158"
lecturerEnrollmentId: "e53143d725255d70945989901ebc137a7d35c2b61ffdfecb9a135c6136eea4a6"
type: "Written Exam"
date: "2021-04-01"
ects: 8
admittableUntil: "2021-03-01"
droppableUntil: "2021-03-25"
ExampleExamGet:
summary: "An example for an exam get operation"
value:
- examId: "eae27105-2fd5-11eb-ad58-572c5dfe1b7a:M.1275.01158:Written Exam:2021-04-01"
courseId: "eae27105-2fd5-11eb-ad58-572c5dfe1b7a"
moduleId: "M.1275.01158"
lecturerEnrollmentId: "e53143d725255d70945989901ebc137a7d35c2b61ffdfecb9a135c6136eea4a6"
type: "Written Exam"
date: "2021-04-01"
ects: 8
admittableUntil: "2021-03-01"
droppableUntil: "2021-03-25"
ExampleUnsignedProposal:
summary: "Example for UnsignedProposal"
value:
unsignedProposal: "CpUJCmoIAxABGgsIgL22/AUQ+NbCWSIJbXljaGFubmVsKkBhMzUwNzA1YWNiMGVmNDUyMzQxN2RjYTRkMTA0ZDUxNmYzMmMxNTgwNzhiYTA4Yzk0NmU1OGRkZWIzZWJhYTJmOgoSCBIGdWM0LWNjEqYICokICgdvcmcxTVNQEv0HLS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN4akNDQW0yZ0F3SUJBZ0lVYkFLNmdwb1BGaTQxeEloY1Z5YkdXZUV0cXpBd0NnWUlLb1pJemowRUF3SXcKWURFTE1Ba0dB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