• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5  margin: 0;
6  padding: 0;
7  border: 0;
8  font-weight: inherit;
9  font-style: inherit;
10  font-size: 100%;
11  font-family: inherit;
12  vertical-align: baseline;
13}
14
15body {
16  font-size: 13px;
17  padding: 1em;
18}
19
20h1 {
21  font-size: 26px;
22  margin-bottom: 1em;
23}
24
25h2 {
26  font-size: 24px;
27  margin-bottom: 1em;
28}
29
30h3 {
31  font-size: 20px;
32  margin-bottom: 1em;
33  margin-top: 1em;
34}
35
36pre, code {
37  line-height: 1.5;
38  font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42  margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46  font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50  border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54  margin-top: 0.5em;
55}
56
57.firstline {
58  margin-left: 2 em;
59}
60
61.method  {
62  margin-top: 1em;
63  border: solid 1px #CCC;
64  padding: 1em;
65  background: #EEE;
66}
67
68.details {
69  font-weight: bold;
70  font-size: 14px;
71}
72
73</style>
74
75<h1><a href="classroom_v1.html">Google Classroom API</a> . <a href="classroom_v1.courses.html">courses</a> . <a href="classroom_v1.courses.courseWork.html">courseWork</a> . <a href="classroom_v1.courses.courseWork.studentSubmissions.html">studentSubmissions</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78  <code><a href="#get">get(courseId, courseWorkId, id, x__xgafv=None)</a></code></p>
79<p class="firstline">Returns a student submission.</p>
80<p class="toc_element">
81  <code><a href="#list">list(courseId, courseWorkId, pageSize=None, userId=None, states=None, x__xgafv=None, late=None, pageToken=None)</a></code></p>
82<p class="firstline">Returns a list of student submissions that the requester is permitted to</p>
83<p class="toc_element">
84  <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
85<p class="firstline">Retrieves the next page of results.</p>
86<p class="toc_element">
87  <code><a href="#modifyAttachments">modifyAttachments(courseId, courseWorkId, id, body, x__xgafv=None)</a></code></p>
88<p class="firstline">Modifies attachments of student submission.</p>
89<p class="toc_element">
90  <code><a href="#patch">patch(courseId, courseWorkId, id, body, updateMask=None, x__xgafv=None)</a></code></p>
91<p class="firstline">Updates one or more fields of a student submission.</p>
92<p class="toc_element">
93  <code><a href="#reclaim">reclaim(courseId, courseWorkId, id, body=None, x__xgafv=None)</a></code></p>
94<p class="firstline">Reclaims a student submission on behalf of the student that owns it.</p>
95<p class="toc_element">
96  <code><a href="#return_">return_(courseId, courseWorkId, id, body=None, x__xgafv=None)</a></code></p>
97<p class="firstline">Returns a student submission.</p>
98<p class="toc_element">
99  <code><a href="#turnIn">turnIn(courseId, courseWorkId, id, body=None, x__xgafv=None)</a></code></p>
100<p class="firstline">Turns in a student submission.</p>
101<h3>Method Details</h3>
102<div class="method">
103    <code class="details" id="get">get(courseId, courseWorkId, id, x__xgafv=None)</code>
104  <pre>Returns a student submission.
105
106* `PERMISSION_DENIED` if the requesting user is not permitted to access the
107requested course, course work, or student submission or for
108access errors.
109* `INVALID_ARGUMENT` if the request is malformed.
110* `NOT_FOUND` if the requested course, course work, or student submission
111does not exist.
112
113Args:
114  courseId: string, Identifier of the course.
115This identifier can be either the Classroom-assigned identifier or an
116alias. (required)
117  courseWorkId: string, Identifier of the course work. (required)
118  id: string, Identifier of the student submission. (required)
119  x__xgafv: string, V1 error format.
120    Allowed values
121      1 - v1 error format
122      2 - v2 error format
123
124Returns:
125  An object of the form:
126
127    { # Student submission for course work.
128      #
129      # StudentSubmission items are generated when a CourseWork item is created.
130      #
131      # StudentSubmissions that have never been accessed (i.e. with `state` = NEW)
132      # may not have a creation time or update time.
133    "draftGrade": 3.14, # Optional pending grade. If unset, no grade was set.
134        # This value must be non-negative. Decimal (i.e. non-integer) values are
135        # allowed, but will be rounded to two decimal places.
136        #
137        # This is only visible to and modifiable by course teachers.
138    "updateTime": "A String", # Last update time of this submission.
139        # This may be unset if the student has not accessed this item.
140        #
141        # Read-only.
142    "userId": "A String", # Identifier for the student that owns this submission.
143        #
144        # Read-only.
145    "alternateLink": "A String", # Absolute link to the submission in the Classroom web UI.
146        #
147        # Read-only.
148    "courseId": "A String", # Identifier of the course.
149        #
150        # Read-only.
151    "multipleChoiceSubmission": { # Student work for a multiple-choice question. # Submission content when course_work_type is MULTIPLE_CHOICE_QUESTION.
152      "answer": "A String", # Student's select choice.
153    },
154    "creationTime": "A String", # Creation time of this submission.
155        # This may be unset if the student has not accessed this item.
156        #
157        # Read-only.
158    "submissionHistory": [ # The history of the submission (includes state and grade histories).
159        #
160        # Read-only.
161      { # The history of the submission. This currently includes state and grade
162          # histories.
163        "stateHistory": { # The history of each state this submission has been in. # The state history information of the submission, if present.
164          "state": "A String", # The workflow pipeline stage.
165          "actorUserId": "A String", # The teacher or student who made the change
166          "stateTimestamp": "A String", # When the submission entered this state.
167        },
168        "gradeHistory": { # The history of each grade on this submission. # The grade history information of the submission, if present.
169          "gradeTimestamp": "A String", # When the grade of the submission was changed.
170          "maxPoints": 3.14, # The denominator of the grade at this time in the submission grade
171              # history.
172          "pointsEarned": 3.14, # The numerator of the grade at this time in the submission grade history.
173          "actorUserId": "A String", # The teacher who made the grade change.
174          "gradeChangeType": "A String", # The type of grade change at this time in the submission grade history.
175        },
176      },
177    ],
178    "shortAnswerSubmission": { # Student work for a short answer question. # Submission content when course_work_type is SHORT_ANSWER_QUESTION.
179      "answer": "A String", # Student response to a short-answer question.
180    },
181    "late": True or False, # Whether this submission is late.
182        #
183        # Read-only.
184    "state": "A String", # State of this submission.
185        #
186        # Read-only.
187    "courseWorkId": "A String", # Identifier for the course work this corresponds to.
188        #
189        # Read-only.
190    "courseWorkType": "A String", # Type of course work this submission is for.
191        #
192        # Read-only.
193    "assignedGrade": 3.14, # Optional grade. If unset, no grade was set.
194        # This value must be non-negative. Decimal (i.e. non-integer) values are
195        # allowed, but will be rounded to two decimal places.
196        #
197        # This may be modified only by course teachers.
198    "assignmentSubmission": { # Student work for an assignment. # Submission content when course_work_type is ASSIGNMENT.
199        #
200        # Students can modify this content using
201        # google.classroom.Work.ModifyAttachments.
202      "attachments": [ # Attachments added by the student.
203          # Drive files that correspond to materials with a share mode of
204          # STUDENT_COPY may not exist yet if the student has not accessed the
205          # assignment in Classroom.
206          #
207          # Some attachment metadata is only populated if the requesting user has
208          # permission to access it. Identifier and alternate_link fields are always
209          # available, but others (e.g. title) may not be.
210        { # Attachment added to student assignment work.
211            #
212            # When creating attachments, setting the `form` field is not supported.
213          "link": { # URL item. # Link attachment.
214            "url": "A String", # URL to link to.
215                # This must be a valid UTF-8 string containing between 1 and 2024 characters.
216            "thumbnailUrl": "A String", # URL of a thumbnail image of the target URL.
217                #
218                # Read-only.
219            "title": "A String", # Title of the target of the URL.
220                #
221                # Read-only.
222          },
223          "driveFile": { # Representation of a Google Drive file. # Google Drive file attachment.
224            "thumbnailUrl": "A String", # URL of a thumbnail image of the Drive item.
225                #
226                # Read-only.
227            "alternateLink": "A String", # URL that can be used to access the Drive item.
228                #
229                # Read-only.
230            "id": "A String", # Drive API resource ID.
231            "title": "A String", # Title of the Drive item.
232                #
233                # Read-only.
234          },
235          "youTubeVideo": { # YouTube video item. # Youtube video attachment.
236            "alternateLink": "A String", # URL that can be used to view the YouTube video.
237                #
238                # Read-only.
239            "thumbnailUrl": "A String", # URL of a thumbnail image of the YouTube video.
240                #
241                # Read-only.
242            "id": "A String", # YouTube API resource ID.
243            "title": "A String", # Title of the YouTube video.
244                #
245                # Read-only.
246          },
247          "form": { # Google Forms item. # Google Forms attachment.
248            "formUrl": "A String", # URL of the form.
249            "thumbnailUrl": "A String", # URL of a thumbnail image of the Form.
250                #
251                # Read-only.
252            "responseUrl": "A String", # URL of the form responses document.
253                # Only set if respsonses have been recorded and only when the
254                # requesting user is an editor of the form.
255                #
256                # Read-only.
257            "title": "A String", # Title of the Form.
258                #
259                # Read-only.
260          },
261        },
262      ],
263    },
264    "id": "A String", # Classroom-assigned Identifier for the student submission.
265        # This is unique among submissions for the relevant course work.
266        #
267        # Read-only.
268    "associatedWithDeveloper": True or False, # Whether this student submission is associated with the Developer Console
269        # project making the request.
270        #
271        # See google.classroom.Work.CreateCourseWork for more
272        # details.
273        #
274        # Read-only.
275  }</pre>
276</div>
277
278<div class="method">
279    <code class="details" id="list">list(courseId, courseWorkId, pageSize=None, userId=None, states=None, x__xgafv=None, late=None, pageToken=None)</code>
280  <pre>Returns a list of student submissions that the requester is permitted to
281view, factoring in the OAuth scopes of the request.
282`-` may be specified as the `course_work_id` to include student
283submissions for multiple course work items.
284
285Course students may only view their own work. Course teachers
286and domain administrators may view all student submissions.
287
288This method returns the following error codes:
289
290* `PERMISSION_DENIED` if the requesting user is not permitted to access the
291requested course or course work, or for access errors.
292* `INVALID_ARGUMENT` if the request is malformed.
293* `NOT_FOUND` if the requested course does not exist.
294
295Args:
296  courseId: string, Identifier of the course.
297This identifier can be either the Classroom-assigned identifier or an
298alias. (required)
299  courseWorkId: string, Identifier of the student work to request.
300This may be set to the string literal `"-"` to request student work for
301all course work in the specified course. (required)
302  pageSize: integer, Maximum number of items to return. Zero or unspecified indicates that the
303server may assign a maximum.
304
305The server may return fewer than the specified number of results.
306  userId: string, Optional argument to restrict returned student work to those owned by the
307student with the specified identifier. The identifier can be one of the
308following:
309
310* the numeric identifier for the user
311* the email address of the user
312* the string literal `"me"`, indicating the requesting user
313  states: string, Requested submission states. If specified, returned student submissions
314match one of the specified submission states. (repeated)
315  x__xgafv: string, V1 error format.
316    Allowed values
317      1 - v1 error format
318      2 - v2 error format
319  late: string, Requested lateness value. If specified, returned student submissions are
320restricted by the requested value.
321If unspecified, submissions are returned regardless of `late` value.
322  pageToken: string, nextPageToken
323value returned from a previous
324list call,
325indicating that the subsequent page of results should be returned.
326
327The list request
328must be otherwise identical to the one that resulted in this token.
329
330Returns:
331  An object of the form:
332
333    { # Response when listing student submissions.
334    "nextPageToken": "A String", # Token identifying the next page of results to return. If empty, no further
335        # results are available.
336    "studentSubmissions": [ # Student work that matches the request.
337      { # Student submission for course work.
338          #
339          # StudentSubmission items are generated when a CourseWork item is created.
340          #
341          # StudentSubmissions that have never been accessed (i.e. with `state` = NEW)
342          # may not have a creation time or update time.
343        "draftGrade": 3.14, # Optional pending grade. If unset, no grade was set.
344            # This value must be non-negative. Decimal (i.e. non-integer) values are
345            # allowed, but will be rounded to two decimal places.
346            #
347            # This is only visible to and modifiable by course teachers.
348        "updateTime": "A String", # Last update time of this submission.
349            # This may be unset if the student has not accessed this item.
350            #
351            # Read-only.
352        "userId": "A String", # Identifier for the student that owns this submission.
353            #
354            # Read-only.
355        "alternateLink": "A String", # Absolute link to the submission in the Classroom web UI.
356            #
357            # Read-only.
358        "courseId": "A String", # Identifier of the course.
359            #
360            # Read-only.
361        "multipleChoiceSubmission": { # Student work for a multiple-choice question. # Submission content when course_work_type is MULTIPLE_CHOICE_QUESTION.
362          "answer": "A String", # Student's select choice.
363        },
364        "creationTime": "A String", # Creation time of this submission.
365            # This may be unset if the student has not accessed this item.
366            #
367            # Read-only.
368        "submissionHistory": [ # The history of the submission (includes state and grade histories).
369            #
370            # Read-only.
371          { # The history of the submission. This currently includes state and grade
372              # histories.
373            "stateHistory": { # The history of each state this submission has been in. # The state history information of the submission, if present.
374              "state": "A String", # The workflow pipeline stage.
375              "actorUserId": "A String", # The teacher or student who made the change
376              "stateTimestamp": "A String", # When the submission entered this state.
377            },
378            "gradeHistory": { # The history of each grade on this submission. # The grade history information of the submission, if present.
379              "gradeTimestamp": "A String", # When the grade of the submission was changed.
380              "maxPoints": 3.14, # The denominator of the grade at this time in the submission grade
381                  # history.
382              "pointsEarned": 3.14, # The numerator of the grade at this time in the submission grade history.
383              "actorUserId": "A String", # The teacher who made the grade change.
384              "gradeChangeType": "A String", # The type of grade change at this time in the submission grade history.
385            },
386          },
387        ],
388        "shortAnswerSubmission": { # Student work for a short answer question. # Submission content when course_work_type is SHORT_ANSWER_QUESTION.
389          "answer": "A String", # Student response to a short-answer question.
390        },
391        "late": True or False, # Whether this submission is late.
392            #
393            # Read-only.
394        "state": "A String", # State of this submission.
395            #
396            # Read-only.
397        "courseWorkId": "A String", # Identifier for the course work this corresponds to.
398            #
399            # Read-only.
400        "courseWorkType": "A String", # Type of course work this submission is for.
401            #
402            # Read-only.
403        "assignedGrade": 3.14, # Optional grade. If unset, no grade was set.
404            # This value must be non-negative. Decimal (i.e. non-integer) values are
405            # allowed, but will be rounded to two decimal places.
406            #
407            # This may be modified only by course teachers.
408        "assignmentSubmission": { # Student work for an assignment. # Submission content when course_work_type is ASSIGNMENT.
409            #
410            # Students can modify this content using
411            # google.classroom.Work.ModifyAttachments.
412          "attachments": [ # Attachments added by the student.
413              # Drive files that correspond to materials with a share mode of
414              # STUDENT_COPY may not exist yet if the student has not accessed the
415              # assignment in Classroom.
416              #
417              # Some attachment metadata is only populated if the requesting user has
418              # permission to access it. Identifier and alternate_link fields are always
419              # available, but others (e.g. title) may not be.
420            { # Attachment added to student assignment work.
421                #
422                # When creating attachments, setting the `form` field is not supported.
423              "link": { # URL item. # Link attachment.
424                "url": "A String", # URL to link to.
425                    # This must be a valid UTF-8 string containing between 1 and 2024 characters.
426                "thumbnailUrl": "A String", # URL of a thumbnail image of the target URL.
427                    #
428                    # Read-only.
429                "title": "A String", # Title of the target of the URL.
430                    #
431                    # Read-only.
432              },
433              "driveFile": { # Representation of a Google Drive file. # Google Drive file attachment.
434                "thumbnailUrl": "A String", # URL of a thumbnail image of the Drive item.
435                    #
436                    # Read-only.
437                "alternateLink": "A String", # URL that can be used to access the Drive item.
438                    #
439                    # Read-only.
440                "id": "A String", # Drive API resource ID.
441                "title": "A String", # Title of the Drive item.
442                    #
443                    # Read-only.
444              },
445              "youTubeVideo": { # YouTube video item. # Youtube video attachment.
446                "alternateLink": "A String", # URL that can be used to view the YouTube video.
447                    #
448                    # Read-only.
449                "thumbnailUrl": "A String", # URL of a thumbnail image of the YouTube video.
450                    #
451                    # Read-only.
452                "id": "A String", # YouTube API resource ID.
453                "title": "A String", # Title of the YouTube video.
454                    #
455                    # Read-only.
456              },
457              "form": { # Google Forms item. # Google Forms attachment.
458                "formUrl": "A String", # URL of the form.
459                "thumbnailUrl": "A String", # URL of a thumbnail image of the Form.
460                    #
461                    # Read-only.
462                "responseUrl": "A String", # URL of the form responses document.
463                    # Only set if respsonses have been recorded and only when the
464                    # requesting user is an editor of the form.
465                    #
466                    # Read-only.
467                "title": "A String", # Title of the Form.
468                    #
469                    # Read-only.
470              },
471            },
472          ],
473        },
474        "id": "A String", # Classroom-assigned Identifier for the student submission.
475            # This is unique among submissions for the relevant course work.
476            #
477            # Read-only.
478        "associatedWithDeveloper": True or False, # Whether this student submission is associated with the Developer Console
479            # project making the request.
480            #
481            # See google.classroom.Work.CreateCourseWork for more
482            # details.
483            #
484            # Read-only.
485      },
486    ],
487  }</pre>
488</div>
489
490<div class="method">
491    <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
492  <pre>Retrieves the next page of results.
493
494Args:
495  previous_request: The request for the previous page. (required)
496  previous_response: The response from the request for the previous page. (required)
497
498Returns:
499  A request object that you can call 'execute()' on to request the next
500  page. Returns None if there are no more items in the collection.
501    </pre>
502</div>
503
504<div class="method">
505    <code class="details" id="modifyAttachments">modifyAttachments(courseId, courseWorkId, id, body, x__xgafv=None)</code>
506  <pre>Modifies attachments of student submission.
507
508Attachments may only be added to student submissions belonging to course
509work objects with a `workType` of `ASSIGNMENT`.
510
511This request must be made by the Developer Console project of the
512[OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
513create the corresponding course work item.
514
515This method returns the following error codes:
516
517* `PERMISSION_DENIED` if the requesting user is not permitted to access the
518requested course or course work, if the user is not permitted to modify
519attachments on the requested student submission, or for
520access errors.
521* `INVALID_ARGUMENT` if the request is malformed.
522* `NOT_FOUND` if the requested course, course work, or student submission
523does not exist.
524
525Args:
526  courseId: string, Identifier of the course.
527This identifier can be either the Classroom-assigned identifier or an
528alias. (required)
529  courseWorkId: string, Identifier of the course work. (required)
530  id: string, Identifier of the student submission. (required)
531  body: object, The request body. (required)
532    The object takes the form of:
533
534{ # Request to modify the attachments of a student submission.
535    "addAttachments": [ # Attachments to add.
536        # A student submission may not have more than 20 attachments.
537        #
538        # Form attachments are not supported.
539      { # Attachment added to student assignment work.
540          #
541          # When creating attachments, setting the `form` field is not supported.
542        "link": { # URL item. # Link attachment.
543          "url": "A String", # URL to link to.
544              # This must be a valid UTF-8 string containing between 1 and 2024 characters.
545          "thumbnailUrl": "A String", # URL of a thumbnail image of the target URL.
546              #
547              # Read-only.
548          "title": "A String", # Title of the target of the URL.
549              #
550              # Read-only.
551        },
552        "driveFile": { # Representation of a Google Drive file. # Google Drive file attachment.
553          "thumbnailUrl": "A String", # URL of a thumbnail image of the Drive item.
554              #
555              # Read-only.
556          "alternateLink": "A String", # URL that can be used to access the Drive item.
557              #
558              # Read-only.
559          "id": "A String", # Drive API resource ID.
560          "title": "A String", # Title of the Drive item.
561              #
562              # Read-only.
563        },
564        "youTubeVideo": { # YouTube video item. # Youtube video attachment.
565          "alternateLink": "A String", # URL that can be used to view the YouTube video.
566              #
567              # Read-only.
568          "thumbnailUrl": "A String", # URL of a thumbnail image of the YouTube video.
569              #
570              # Read-only.
571          "id": "A String", # YouTube API resource ID.
572          "title": "A String", # Title of the YouTube video.
573              #
574              # Read-only.
575        },
576        "form": { # Google Forms item. # Google Forms attachment.
577          "formUrl": "A String", # URL of the form.
578          "thumbnailUrl": "A String", # URL of a thumbnail image of the Form.
579              #
580              # Read-only.
581          "responseUrl": "A String", # URL of the form responses document.
582              # Only set if respsonses have been recorded and only when the
583              # requesting user is an editor of the form.
584              #
585              # Read-only.
586          "title": "A String", # Title of the Form.
587              #
588              # Read-only.
589        },
590      },
591    ],
592  }
593
594  x__xgafv: string, V1 error format.
595    Allowed values
596      1 - v1 error format
597      2 - v2 error format
598
599Returns:
600  An object of the form:
601
602    { # Student submission for course work.
603      #
604      # StudentSubmission items are generated when a CourseWork item is created.
605      #
606      # StudentSubmissions that have never been accessed (i.e. with `state` = NEW)
607      # may not have a creation time or update time.
608    "draftGrade": 3.14, # Optional pending grade. If unset, no grade was set.
609        # This value must be non-negative. Decimal (i.e. non-integer) values are
610        # allowed, but will be rounded to two decimal places.
611        #
612        # This is only visible to and modifiable by course teachers.
613    "updateTime": "A String", # Last update time of this submission.
614        # This may be unset if the student has not accessed this item.
615        #
616        # Read-only.
617    "userId": "A String", # Identifier for the student that owns this submission.
618        #
619        # Read-only.
620    "alternateLink": "A String", # Absolute link to the submission in the Classroom web UI.
621        #
622        # Read-only.
623    "courseId": "A String", # Identifier of the course.
624        #
625        # Read-only.
626    "multipleChoiceSubmission": { # Student work for a multiple-choice question. # Submission content when course_work_type is MULTIPLE_CHOICE_QUESTION.
627      "answer": "A String", # Student's select choice.
628    },
629    "creationTime": "A String", # Creation time of this submission.
630        # This may be unset if the student has not accessed this item.
631        #
632        # Read-only.
633    "submissionHistory": [ # The history of the submission (includes state and grade histories).
634        #
635        # Read-only.
636      { # The history of the submission. This currently includes state and grade
637          # histories.
638        "stateHistory": { # The history of each state this submission has been in. # The state history information of the submission, if present.
639          "state": "A String", # The workflow pipeline stage.
640          "actorUserId": "A String", # The teacher or student who made the change
641          "stateTimestamp": "A String", # When the submission entered this state.
642        },
643        "gradeHistory": { # The history of each grade on this submission. # The grade history information of the submission, if present.
644          "gradeTimestamp": "A String", # When the grade of the submission was changed.
645          "maxPoints": 3.14, # The denominator of the grade at this time in the submission grade
646              # history.
647          "pointsEarned": 3.14, # The numerator of the grade at this time in the submission grade history.
648          "actorUserId": "A String", # The teacher who made the grade change.
649          "gradeChangeType": "A String", # The type of grade change at this time in the submission grade history.
650        },
651      },
652    ],
653    "shortAnswerSubmission": { # Student work for a short answer question. # Submission content when course_work_type is SHORT_ANSWER_QUESTION.
654      "answer": "A String", # Student response to a short-answer question.
655    },
656    "late": True or False, # Whether this submission is late.
657        #
658        # Read-only.
659    "state": "A String", # State of this submission.
660        #
661        # Read-only.
662    "courseWorkId": "A String", # Identifier for the course work this corresponds to.
663        #
664        # Read-only.
665    "courseWorkType": "A String", # Type of course work this submission is for.
666        #
667        # Read-only.
668    "assignedGrade": 3.14, # Optional grade. If unset, no grade was set.
669        # This value must be non-negative. Decimal (i.e. non-integer) values are
670        # allowed, but will be rounded to two decimal places.
671        #
672        # This may be modified only by course teachers.
673    "assignmentSubmission": { # Student work for an assignment. # Submission content when course_work_type is ASSIGNMENT.
674        #
675        # Students can modify this content using
676        # google.classroom.Work.ModifyAttachments.
677      "attachments": [ # Attachments added by the student.
678          # Drive files that correspond to materials with a share mode of
679          # STUDENT_COPY may not exist yet if the student has not accessed the
680          # assignment in Classroom.
681          #
682          # Some attachment metadata is only populated if the requesting user has
683          # permission to access it. Identifier and alternate_link fields are always
684          # available, but others (e.g. title) may not be.
685        { # Attachment added to student assignment work.
686            #
687            # When creating attachments, setting the `form` field is not supported.
688          "link": { # URL item. # Link attachment.
689            "url": "A String", # URL to link to.
690                # This must be a valid UTF-8 string containing between 1 and 2024 characters.
691            "thumbnailUrl": "A String", # URL of a thumbnail image of the target URL.
692                #
693                # Read-only.
694            "title": "A String", # Title of the target of the URL.
695                #
696                # Read-only.
697          },
698          "driveFile": { # Representation of a Google Drive file. # Google Drive file attachment.
699            "thumbnailUrl": "A String", # URL of a thumbnail image of the Drive item.
700                #
701                # Read-only.
702            "alternateLink": "A String", # URL that can be used to access the Drive item.
703                #
704                # Read-only.
705            "id": "A String", # Drive API resource ID.
706            "title": "A String", # Title of the Drive item.
707                #
708                # Read-only.
709          },
710          "youTubeVideo": { # YouTube video item. # Youtube video attachment.
711            "alternateLink": "A String", # URL that can be used to view the YouTube video.
712                #
713                # Read-only.
714            "thumbnailUrl": "A String", # URL of a thumbnail image of the YouTube video.
715                #
716                # Read-only.
717            "id": "A String", # YouTube API resource ID.
718            "title": "A String", # Title of the YouTube video.
719                #
720                # Read-only.
721          },
722          "form": { # Google Forms item. # Google Forms attachment.
723            "formUrl": "A String", # URL of the form.
724            "thumbnailUrl": "A String", # URL of a thumbnail image of the Form.
725                #
726                # Read-only.
727            "responseUrl": "A String", # URL of the form responses document.
728                # Only set if respsonses have been recorded and only when the
729                # requesting user is an editor of the form.
730                #
731                # Read-only.
732            "title": "A String", # Title of the Form.
733                #
734                # Read-only.
735          },
736        },
737      ],
738    },
739    "id": "A String", # Classroom-assigned Identifier for the student submission.
740        # This is unique among submissions for the relevant course work.
741        #
742        # Read-only.
743    "associatedWithDeveloper": True or False, # Whether this student submission is associated with the Developer Console
744        # project making the request.
745        #
746        # See google.classroom.Work.CreateCourseWork for more
747        # details.
748        #
749        # Read-only.
750  }</pre>
751</div>
752
753<div class="method">
754    <code class="details" id="patch">patch(courseId, courseWorkId, id, body, updateMask=None, x__xgafv=None)</code>
755  <pre>Updates one or more fields of a student submission.
756
757See google.classroom.v1.StudentSubmission for details
758of which fields may be updated and who may change them.
759
760This request must be made by the Developer Console project of the
761[OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
762create the corresponding course work item.
763
764This method returns the following error codes:
765
766* `PERMISSION_DENIED` if the requesting developer project did not create
767the corresponding course work, if the user is not permitted to make the
768requested modification to the student submission, or for
769access errors.
770* `INVALID_ARGUMENT` if the request is malformed.
771* `NOT_FOUND` if the requested course, course work, or student submission
772does not exist.
773
774Args:
775  courseId: string, Identifier of the course.
776This identifier can be either the Classroom-assigned identifier or an
777alias. (required)
778  courseWorkId: string, Identifier of the course work. (required)
779  id: string, Identifier of the student submission. (required)
780  body: object, The request body. (required)
781    The object takes the form of:
782
783{ # Student submission for course work.
784    #
785    # StudentSubmission items are generated when a CourseWork item is created.
786    #
787    # StudentSubmissions that have never been accessed (i.e. with `state` = NEW)
788    # may not have a creation time or update time.
789  "draftGrade": 3.14, # Optional pending grade. If unset, no grade was set.
790      # This value must be non-negative. Decimal (i.e. non-integer) values are
791      # allowed, but will be rounded to two decimal places.
792      #
793      # This is only visible to and modifiable by course teachers.
794  "updateTime": "A String", # Last update time of this submission.
795      # This may be unset if the student has not accessed this item.
796      #
797      # Read-only.
798  "userId": "A String", # Identifier for the student that owns this submission.
799      #
800      # Read-only.
801  "alternateLink": "A String", # Absolute link to the submission in the Classroom web UI.
802      #
803      # Read-only.
804  "courseId": "A String", # Identifier of the course.
805      #
806      # Read-only.
807  "multipleChoiceSubmission": { # Student work for a multiple-choice question. # Submission content when course_work_type is MULTIPLE_CHOICE_QUESTION.
808    "answer": "A String", # Student's select choice.
809  },
810  "creationTime": "A String", # Creation time of this submission.
811      # This may be unset if the student has not accessed this item.
812      #
813      # Read-only.
814  "submissionHistory": [ # The history of the submission (includes state and grade histories).
815      #
816      # Read-only.
817    { # The history of the submission. This currently includes state and grade
818        # histories.
819      "stateHistory": { # The history of each state this submission has been in. # The state history information of the submission, if present.
820        "state": "A String", # The workflow pipeline stage.
821        "actorUserId": "A String", # The teacher or student who made the change
822        "stateTimestamp": "A String", # When the submission entered this state.
823      },
824      "gradeHistory": { # The history of each grade on this submission. # The grade history information of the submission, if present.
825        "gradeTimestamp": "A String", # When the grade of the submission was changed.
826        "maxPoints": 3.14, # The denominator of the grade at this time in the submission grade
827            # history.
828        "pointsEarned": 3.14, # The numerator of the grade at this time in the submission grade history.
829        "actorUserId": "A String", # The teacher who made the grade change.
830        "gradeChangeType": "A String", # The type of grade change at this time in the submission grade history.
831      },
832    },
833  ],
834  "shortAnswerSubmission": { # Student work for a short answer question. # Submission content when course_work_type is SHORT_ANSWER_QUESTION.
835    "answer": "A String", # Student response to a short-answer question.
836  },
837  "late": True or False, # Whether this submission is late.
838      #
839      # Read-only.
840  "state": "A String", # State of this submission.
841      #
842      # Read-only.
843  "courseWorkId": "A String", # Identifier for the course work this corresponds to.
844      #
845      # Read-only.
846  "courseWorkType": "A String", # Type of course work this submission is for.
847      #
848      # Read-only.
849  "assignedGrade": 3.14, # Optional grade. If unset, no grade was set.
850      # This value must be non-negative. Decimal (i.e. non-integer) values are
851      # allowed, but will be rounded to two decimal places.
852      #
853      # This may be modified only by course teachers.
854  "assignmentSubmission": { # Student work for an assignment. # Submission content when course_work_type is ASSIGNMENT.
855      #
856      # Students can modify this content using
857      # google.classroom.Work.ModifyAttachments.
858    "attachments": [ # Attachments added by the student.
859        # Drive files that correspond to materials with a share mode of
860        # STUDENT_COPY may not exist yet if the student has not accessed the
861        # assignment in Classroom.
862        #
863        # Some attachment metadata is only populated if the requesting user has
864        # permission to access it. Identifier and alternate_link fields are always
865        # available, but others (e.g. title) may not be.
866      { # Attachment added to student assignment work.
867          #
868          # When creating attachments, setting the `form` field is not supported.
869        "link": { # URL item. # Link attachment.
870          "url": "A String", # URL to link to.
871              # This must be a valid UTF-8 string containing between 1 and 2024 characters.
872          "thumbnailUrl": "A String", # URL of a thumbnail image of the target URL.
873              #
874              # Read-only.
875          "title": "A String", # Title of the target of the URL.
876              #
877              # Read-only.
878        },
879        "driveFile": { # Representation of a Google Drive file. # Google Drive file attachment.
880          "thumbnailUrl": "A String", # URL of a thumbnail image of the Drive item.
881              #
882              # Read-only.
883          "alternateLink": "A String", # URL that can be used to access the Drive item.
884              #
885              # Read-only.
886          "id": "A String", # Drive API resource ID.
887          "title": "A String", # Title of the Drive item.
888              #
889              # Read-only.
890        },
891        "youTubeVideo": { # YouTube video item. # Youtube video attachment.
892          "alternateLink": "A String", # URL that can be used to view the YouTube video.
893              #
894              # Read-only.
895          "thumbnailUrl": "A String", # URL of a thumbnail image of the YouTube video.
896              #
897              # Read-only.
898          "id": "A String", # YouTube API resource ID.
899          "title": "A String", # Title of the YouTube video.
900              #
901              # Read-only.
902        },
903        "form": { # Google Forms item. # Google Forms attachment.
904          "formUrl": "A String", # URL of the form.
905          "thumbnailUrl": "A String", # URL of a thumbnail image of the Form.
906              #
907              # Read-only.
908          "responseUrl": "A String", # URL of the form responses document.
909              # Only set if respsonses have been recorded and only when the
910              # requesting user is an editor of the form.
911              #
912              # Read-only.
913          "title": "A String", # Title of the Form.
914              #
915              # Read-only.
916        },
917      },
918    ],
919  },
920  "id": "A String", # Classroom-assigned Identifier for the student submission.
921      # This is unique among submissions for the relevant course work.
922      #
923      # Read-only.
924  "associatedWithDeveloper": True or False, # Whether this student submission is associated with the Developer Console
925      # project making the request.
926      #
927      # See google.classroom.Work.CreateCourseWork for more
928      # details.
929      #
930      # Read-only.
931}
932
933  updateMask: string, Mask that identifies which fields on the student submission to update.
934This field is required to do an update. The update fails if invalid
935fields are specified.
936
937The following fields may be specified by teachers:
938
939* `draft_grade`
940* `assigned_grade`
941  x__xgafv: string, V1 error format.
942    Allowed values
943      1 - v1 error format
944      2 - v2 error format
945
946Returns:
947  An object of the form:
948
949    { # Student submission for course work.
950      #
951      # StudentSubmission items are generated when a CourseWork item is created.
952      #
953      # StudentSubmissions that have never been accessed (i.e. with `state` = NEW)
954      # may not have a creation time or update time.
955    "draftGrade": 3.14, # Optional pending grade. If unset, no grade was set.
956        # This value must be non-negative. Decimal (i.e. non-integer) values are
957        # allowed, but will be rounded to two decimal places.
958        #
959        # This is only visible to and modifiable by course teachers.
960    "updateTime": "A String", # Last update time of this submission.
961        # This may be unset if the student has not accessed this item.
962        #
963        # Read-only.
964    "userId": "A String", # Identifier for the student that owns this submission.
965        #
966        # Read-only.
967    "alternateLink": "A String", # Absolute link to the submission in the Classroom web UI.
968        #
969        # Read-only.
970    "courseId": "A String", # Identifier of the course.
971        #
972        # Read-only.
973    "multipleChoiceSubmission": { # Student work for a multiple-choice question. # Submission content when course_work_type is MULTIPLE_CHOICE_QUESTION.
974      "answer": "A String", # Student's select choice.
975    },
976    "creationTime": "A String", # Creation time of this submission.
977        # This may be unset if the student has not accessed this item.
978        #
979        # Read-only.
980    "submissionHistory": [ # The history of the submission (includes state and grade histories).
981        #
982        # Read-only.
983      { # The history of the submission. This currently includes state and grade
984          # histories.
985        "stateHistory": { # The history of each state this submission has been in. # The state history information of the submission, if present.
986          "state": "A String", # The workflow pipeline stage.
987          "actorUserId": "A String", # The teacher or student who made the change
988          "stateTimestamp": "A String", # When the submission entered this state.
989        },
990        "gradeHistory": { # The history of each grade on this submission. # The grade history information of the submission, if present.
991          "gradeTimestamp": "A String", # When the grade of the submission was changed.
992          "maxPoints": 3.14, # The denominator of the grade at this time in the submission grade
993              # history.
994          "pointsEarned": 3.14, # The numerator of the grade at this time in the submission grade history.
995          "actorUserId": "A String", # The teacher who made the grade change.
996          "gradeChangeType": "A String", # The type of grade change at this time in the submission grade history.
997        },
998      },
999    ],
1000    "shortAnswerSubmission": { # Student work for a short answer question. # Submission content when course_work_type is SHORT_ANSWER_QUESTION.
1001      "answer": "A String", # Student response to a short-answer question.
1002    },
1003    "late": True or False, # Whether this submission is late.
1004        #
1005        # Read-only.
1006    "state": "A String", # State of this submission.
1007        #
1008        # Read-only.
1009    "courseWorkId": "A String", # Identifier for the course work this corresponds to.
1010        #
1011        # Read-only.
1012    "courseWorkType": "A String", # Type of course work this submission is for.
1013        #
1014        # Read-only.
1015    "assignedGrade": 3.14, # Optional grade. If unset, no grade was set.
1016        # This value must be non-negative. Decimal (i.e. non-integer) values are
1017        # allowed, but will be rounded to two decimal places.
1018        #
1019        # This may be modified only by course teachers.
1020    "assignmentSubmission": { # Student work for an assignment. # Submission content when course_work_type is ASSIGNMENT.
1021        #
1022        # Students can modify this content using
1023        # google.classroom.Work.ModifyAttachments.
1024      "attachments": [ # Attachments added by the student.
1025          # Drive files that correspond to materials with a share mode of
1026          # STUDENT_COPY may not exist yet if the student has not accessed the
1027          # assignment in Classroom.
1028          #
1029          # Some attachment metadata is only populated if the requesting user has
1030          # permission to access it. Identifier and alternate_link fields are always
1031          # available, but others (e.g. title) may not be.
1032        { # Attachment added to student assignment work.
1033            #
1034            # When creating attachments, setting the `form` field is not supported.
1035          "link": { # URL item. # Link attachment.
1036            "url": "A String", # URL to link to.
1037                # This must be a valid UTF-8 string containing between 1 and 2024 characters.
1038            "thumbnailUrl": "A String", # URL of a thumbnail image of the target URL.
1039                #
1040                # Read-only.
1041            "title": "A String", # Title of the target of the URL.
1042                #
1043                # Read-only.
1044          },
1045          "driveFile": { # Representation of a Google Drive file. # Google Drive file attachment.
1046            "thumbnailUrl": "A String", # URL of a thumbnail image of the Drive item.
1047                #
1048                # Read-only.
1049            "alternateLink": "A String", # URL that can be used to access the Drive item.
1050                #
1051                # Read-only.
1052            "id": "A String", # Drive API resource ID.
1053            "title": "A String", # Title of the Drive item.
1054                #
1055                # Read-only.
1056          },
1057          "youTubeVideo": { # YouTube video item. # Youtube video attachment.
1058            "alternateLink": "A String", # URL that can be used to view the YouTube video.
1059                #
1060                # Read-only.
1061            "thumbnailUrl": "A String", # URL of a thumbnail image of the YouTube video.
1062                #
1063                # Read-only.
1064            "id": "A String", # YouTube API resource ID.
1065            "title": "A String", # Title of the YouTube video.
1066                #
1067                # Read-only.
1068          },
1069          "form": { # Google Forms item. # Google Forms attachment.
1070            "formUrl": "A String", # URL of the form.
1071            "thumbnailUrl": "A String", # URL of a thumbnail image of the Form.
1072                #
1073                # Read-only.
1074            "responseUrl": "A String", # URL of the form responses document.
1075                # Only set if respsonses have been recorded and only when the
1076                # requesting user is an editor of the form.
1077                #
1078                # Read-only.
1079            "title": "A String", # Title of the Form.
1080                #
1081                # Read-only.
1082          },
1083        },
1084      ],
1085    },
1086    "id": "A String", # Classroom-assigned Identifier for the student submission.
1087        # This is unique among submissions for the relevant course work.
1088        #
1089        # Read-only.
1090    "associatedWithDeveloper": True or False, # Whether this student submission is associated with the Developer Console
1091        # project making the request.
1092        #
1093        # See google.classroom.Work.CreateCourseWork for more
1094        # details.
1095        #
1096        # Read-only.
1097  }</pre>
1098</div>
1099
1100<div class="method">
1101    <code class="details" id="reclaim">reclaim(courseId, courseWorkId, id, body=None, x__xgafv=None)</code>
1102  <pre>Reclaims a student submission on behalf of the student that owns it.
1103
1104Reclaiming a student submission transfers ownership of attached Drive
1105files to the student and updates the submission state.
1106
1107Only the student that owns the requested student submission may call this
1108method, and only for a student submission that has been turned in.
1109
1110This request must be made by the Developer Console project of the
1111[OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
1112create the corresponding course work item.
1113
1114This method returns the following error codes:
1115
1116* `PERMISSION_DENIED` if the requesting user is not permitted to access the
1117requested course or course work, unsubmit the requested student submission,
1118or for access errors.
1119* `FAILED_PRECONDITION` if the student submission has not been turned in.
1120* `INVALID_ARGUMENT` if the request is malformed.
1121* `NOT_FOUND` if the requested course, course work, or student submission
1122does not exist.
1123
1124Args:
1125  courseId: string, Identifier of the course.
1126This identifier can be either the Classroom-assigned identifier or an
1127alias. (required)
1128  courseWorkId: string, Identifier of the course work. (required)
1129  id: string, Identifier of the student submission. (required)
1130  body: object, The request body.
1131    The object takes the form of:
1132
1133{ # Request to reclaim a student submission.
1134  }
1135
1136  x__xgafv: string, V1 error format.
1137    Allowed values
1138      1 - v1 error format
1139      2 - v2 error format
1140
1141Returns:
1142  An object of the form:
1143
1144    { # A generic empty message that you can re-use to avoid defining duplicated
1145      # empty messages in your APIs. A typical example is to use it as the request
1146      # or the response type of an API method. For instance:
1147      #
1148      #     service Foo {
1149      #       rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
1150      #     }
1151      #
1152      # The JSON representation for `Empty` is empty JSON object `{}`.
1153  }</pre>
1154</div>
1155
1156<div class="method">
1157    <code class="details" id="return_">return_(courseId, courseWorkId, id, body=None, x__xgafv=None)</code>
1158  <pre>Returns a student submission.
1159
1160Returning a student submission transfers ownership of attached Drive
1161files to the student and may also update the submission state.
1162Unlike the Classroom application, returning a student submission does not
1163set assignedGrade to the draftGrade value.
1164
1165Only a teacher of the course that contains the requested student submission
1166may call this method.
1167
1168This request must be made by the Developer Console project of the
1169[OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
1170create the corresponding course work item.
1171
1172This method returns the following error codes:
1173
1174* `PERMISSION_DENIED` if the requesting user is not permitted to access the
1175requested course or course work, return the requested student submission,
1176or for access errors.
1177* `INVALID_ARGUMENT` if the request is malformed.
1178* `NOT_FOUND` if the requested course, course work, or student submission
1179does not exist.
1180
1181Args:
1182  courseId: string, Identifier of the course.
1183This identifier can be either the Classroom-assigned identifier or an
1184alias. (required)
1185  courseWorkId: string, Identifier of the course work. (required)
1186  id: string, Identifier of the student submission. (required)
1187  body: object, The request body.
1188    The object takes the form of:
1189
1190{ # Request to return a student submission.
1191  }
1192
1193  x__xgafv: string, V1 error format.
1194    Allowed values
1195      1 - v1 error format
1196      2 - v2 error format
1197
1198Returns:
1199  An object of the form:
1200
1201    { # A generic empty message that you can re-use to avoid defining duplicated
1202      # empty messages in your APIs. A typical example is to use it as the request
1203      # or the response type of an API method. For instance:
1204      #
1205      #     service Foo {
1206      #       rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
1207      #     }
1208      #
1209      # The JSON representation for `Empty` is empty JSON object `{}`.
1210  }</pre>
1211</div>
1212
1213<div class="method">
1214    <code class="details" id="turnIn">turnIn(courseId, courseWorkId, id, body=None, x__xgafv=None)</code>
1215  <pre>Turns in a student submission.
1216
1217Turning in a student submission transfers ownership of attached Drive
1218files to the teacher and may also update the submission state.
1219
1220This may only be called by the student that owns the specified student
1221submission.
1222
1223This request must be made by the Developer Console project of the
1224[OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
1225create the corresponding course work item.
1226
1227This method returns the following error codes:
1228
1229* `PERMISSION_DENIED` if the requesting user is not permitted to access the
1230requested course or course work, turn in the requested student submission,
1231or for access errors.
1232* `INVALID_ARGUMENT` if the request is malformed.
1233* `NOT_FOUND` if the requested course, course work, or student submission
1234does not exist.
1235
1236Args:
1237  courseId: string, Identifier of the course.
1238This identifier can be either the Classroom-assigned identifier or an
1239alias. (required)
1240  courseWorkId: string, Identifier of the course work. (required)
1241  id: string, Identifier of the student submission. (required)
1242  body: object, The request body.
1243    The object takes the form of:
1244
1245{ # Request to turn in a student submission.
1246  }
1247
1248  x__xgafv: string, V1 error format.
1249    Allowed values
1250      1 - v1 error format
1251      2 - v2 error format
1252
1253Returns:
1254  An object of the form:
1255
1256    { # A generic empty message that you can re-use to avoid defining duplicated
1257      # empty messages in your APIs. A typical example is to use it as the request
1258      # or the response type of an API method. For instance:
1259      #
1260      #     service Foo {
1261      #       rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
1262      #     }
1263      #
1264      # The JSON representation for `Empty` is empty JSON object `{}`.
1265  }</pre>
1266</div>
1267
1268</body></html>