Skip to content

Commit e39e545

Browse files
committed
docs: document uploads and editor response data
1 parent fb980e2 commit e39e545

File tree

2 files changed

+77
-6
lines changed

2 files changed

+77
-6
lines changed

docs/qppe-lms.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
openapi: 3.0.3
1+
openapi: 3.1.1
22
info:
33
title: Question Provider and Package Execution (QPPE) LMS Callback API
44
version: 0.1.0
@@ -267,8 +267,7 @@ components:
267267
description: A unique file identifier that is determined by the LMS. It might be a file hash or some other
268268
identifier that changes when the content is modified.
269269
schema:
270-
type: string
271-
pattern: '^[a-zA-Z0-9\-_=]{1,64}$'
270+
$ref: '#/components/schemas/FileRef'
272271

273272
FileName:
274273
name: file_name
@@ -292,6 +291,12 @@ components:
292291
description: A question attempt reference that is determined by the LMS. It uniquely identifies an attempt
293292
of a question.
294293

294+
FileRef:
295+
type: string
296+
pattern: '^[a-zA-Z0-9\-_=]{1,64}$'
297+
description: A unique file identifier that is determined by the LMS. It might be a file hash or some other
298+
identifier that changes when the content is modified.
299+
295300
AttemptAsyncScoringStatusFinished:
296301
type: object
297302
allOf:

docs/qppe-server.yaml

Lines changed: 69 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
openapi: 3.0.3
1+
openapi: 3.1.1
22
info:
33
title: Question Provider and Package Execution (QPPE) Server API
44
version: 0.1.0
@@ -974,8 +974,60 @@ components:
974974
nullable: true
975975
default: null
976976
description: Data from the question's input fields.
977+
uploads:
978+
type: object
979+
nullable: true
980+
default: null
981+
description: The files uploaded to any file upload elements, by their names.
982+
additionalProperties:
983+
type: array
984+
items:
985+
$ref: '#/components/schemas/UserUploadedFile'
986+
editors:
987+
type: object
988+
nullable: true
989+
default: null
990+
description: The text entered and files uploaded into rich text editor elements, by their names.
991+
additionalProperties:
992+
$ref: '#/components/schemas/RichTextEditorData'
977993
required: [ attempt_ref, attempt_state, response_ref ]
978994

995+
UserUploadedFile:
996+
description: A file that is stored by the LMS. Contains metadata and a reference to retrieve the file.
997+
type: object
998+
properties:
999+
path:
1000+
type: string
1001+
filename:
1002+
type: string
1003+
file_ref:
1004+
$ref: "qppe-lms.yaml#/components/schemas/FileRef"
1005+
uploaded_at:
1006+
type: string
1007+
format: date-time
1008+
mime_type:
1009+
type: string
1010+
format: mime-type
1011+
size:
1012+
type: integer
1013+
required: [ path, filename, file_ref, uploaded_at, mime_type, size ]
1014+
1015+
RichTextEditorData:
1016+
description: The structure submitted by rich text editors.
1017+
type: object
1018+
properties:
1019+
text:
1020+
type: string
1021+
files:
1022+
type: array
1023+
items:
1024+
$ref: "#/components/schemas/UserUploadedFile"
1025+
default: []
1026+
patternProperties:
1027+
"^_":
1028+
description: The LMS may send and expect to receive again any additional fields beginning with `_`.
1029+
required: [ text ]
1030+
9791031
AttemptScoreArguments:
9801032
allOf:
9811033
- $ref: "#/components/schemas/AttemptViewArguments"
@@ -984,6 +1036,20 @@ components:
9841036
response:
9851037
type: object
9861038
additionalProperties: true
1039+
uploads:
1040+
type: object
1041+
default: {}
1042+
description: The files uploaded to any file upload elements, by their names.
1043+
additionalProperties:
1044+
type: array
1045+
items:
1046+
$ref: '#/components/schemas/UserUploadedFile'
1047+
editors:
1048+
type: object
1049+
default: {}
1050+
description: The text entered and files uploaded into rich text editor elements, by their names.
1051+
additionalProperties:
1052+
$ref: '#/components/schemas/RichTextEditorData'
9871053
timeout:
9881054
type: number
9891055
minimum: 0
@@ -999,7 +1065,7 @@ components:
9991065
generate_hint:
10001066
type: boolean
10011067
description: Try to give a hint on how to improve the response.
1002-
required: [ response, timeout, compute_adjusted_score, generate_hint ]
1068+
required: [ response, uploads, editors, timeout, compute_adjusted_score, generate_hint ]
10031069

10041070
AttemptScored:
10051071
allOf:
@@ -1066,7 +1132,7 @@ components:
10661132
nullable: true
10671133
default: null
10681134
scoring_code:
1069-
type: string
1135+
type: [string, "null"]
10701136
enum:
10711137
- AUTOMATICALLY_SCORED
10721138
- NEEDS_MANUAL_SCORING

0 commit comments

Comments
 (0)