Skip to content

Commit 06d63e6

Browse files
committed
docs: document uploads and editor response data
1 parent e67632a commit 06d63e6

File tree

2 files changed

+79
-6
lines changed

2 files changed

+79
-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: 71 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,62 @@ 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+
pattern: "^/(.+/)?$"
1002+
description: The folder path of this file. Must begin and end in `/`. Top-level files have a path of `/`.
1003+
filename:
1004+
type: string
1005+
file_ref:
1006+
$ref: "qppe-lms.yaml#/components/schemas/FileRef"
1007+
uploaded_at:
1008+
type: string
1009+
format: date-time
1010+
mime_type:
1011+
type: string
1012+
format: mime-type
1013+
size:
1014+
type: integer
1015+
required: [ path, filename, file_ref, uploaded_at, mime_type, size ]
1016+
1017+
RichTextEditorData:
1018+
description: The structure submitted by rich text editors.
1019+
type: object
1020+
properties:
1021+
text:
1022+
type: string
1023+
files:
1024+
type: array
1025+
items:
1026+
$ref: "#/components/schemas/UserUploadedFile"
1027+
default: []
1028+
patternProperties:
1029+
"^_":
1030+
description: The LMS may send and expect to receive again any additional fields beginning with `_`.
1031+
required: [ text ]
1032+
9791033
AttemptScoreArguments:
9801034
allOf:
9811035
- $ref: "#/components/schemas/AttemptViewArguments"
@@ -984,6 +1038,20 @@ components:
9841038
response:
9851039
type: object
9861040
additionalProperties: true
1041+
uploads:
1042+
type: object
1043+
default: {}
1044+
description: The files uploaded to any file upload elements, by their names.
1045+
additionalProperties:
1046+
type: array
1047+
items:
1048+
$ref: '#/components/schemas/UserUploadedFile'
1049+
editors:
1050+
type: object
1051+
default: {}
1052+
description: The text entered and files uploaded into rich text editor elements, by their names.
1053+
additionalProperties:
1054+
$ref: '#/components/schemas/RichTextEditorData'
9871055
timeout:
9881056
type: number
9891057
minimum: 0
@@ -999,7 +1067,7 @@ components:
9991067
generate_hint:
10001068
type: boolean
10011069
description: Try to give a hint on how to improve the response.
1002-
required: [ response, timeout, compute_adjusted_score, generate_hint ]
1070+
required: [ response, uploads, editors, timeout, compute_adjusted_score, generate_hint ]
10031071

10041072
AttemptScored:
10051073
allOf:
@@ -1066,7 +1134,7 @@ components:
10661134
nullable: true
10671135
default: null
10681136
scoring_code:
1069-
type: string
1137+
type: [string, "null"]
10701138
enum:
10711139
- AUTOMATICALLY_SCORED
10721140
- NEEDS_MANUAL_SCORING

0 commit comments

Comments
 (0)