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, pageToken=None, late=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, 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, 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, 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 must be a non-negative integer value. 135 # 136 # This is only visible to and modifiable by course teachers. 137 "updateTime": "A String", # Last update time of this submission. 138 # This may be unset if the student has not accessed this item. 139 # 140 # Read-only. 141 "alternateLink": "A String", # Absolute link to the submission in the Classroom web UI. 142 # 143 # Read-only. 144 "courseId": "A String", # Identifier of the course. 145 # 146 # Read-only. 147 "multipleChoiceSubmission": { # Student work for a multiple-choice question. # Submission content when course_work_type is MULTIPLE_CHOICE_QUESTION. 148 "answer": "A String", # Student's select choice. 149 }, 150 "userId": "A String", # Identifier for the student that owns this submission. 151 # 152 # Read-only. 153 "shortAnswerSubmission": { # Student work for a short answer question. # Submission content when course_work_type is SHORT_ANSWER_QUESTION. 154 "answer": "A String", # Student response to a short-answer question. 155 }, 156 "associatedWithDeveloper": True or False, # Whether this student submission is associated with the Developer Console 157 # project making the request. 158 # 159 # See google.classroom.Work.CreateCourseWork for more 160 # details. 161 # 162 # Read-only. 163 "late": True or False, # Whether this submission is late. 164 # 165 # Read-only. 166 "state": "A String", # State of this submission. 167 # 168 # Read-only. 169 "courseWorkId": "A String", # Identifier for the course work this corresponds to. 170 # 171 # Read-only. 172 "courseWorkType": "A String", # Type of course work this submission is for. 173 # 174 # Read-only. 175 "assignedGrade": 3.14, # Optional grade. If unset, no grade was set. 176 # This must be a non-negative integer value. 177 # 178 # This may be modified only by course teachers. 179 "creationTime": "A String", # Creation time of this submission. 180 # This may be unset if the student has not accessed this item. 181 # 182 # Read-only. 183 "assignmentSubmission": { # Student work for an assignment. # Submission content when course_work_type is ASSIGNMENT . 184 "attachments": [ # Attachments added by the student. 185 # Drive files that correspond to materials with a share mode of 186 # STUDENT_COPY may not exist yet if the student has not accessed the 187 # assignment in Classroom. 188 # 189 # Some attachment metadata is only populated if the requesting user has 190 # permission to access it. Identifier and alternate_link fields are always 191 # available, but others (e.g. title) may not be. 192 { # Attachment added to student assignment work. 193 # 194 # When creating attachments, setting the `form` field is not supported. 195 "link": { # URL item. # Link attachment. 196 "url": "A String", # URL to link to. 197 # This must be a valid UTF-8 string containing between 1 and 2024 characters. 198 "thumbnailUrl": "A String", # URL of a thumbnail image of the target URL. 199 # 200 # Read-only. 201 "title": "A String", # Title of the target of the URL. 202 # 203 # Read-only. 204 }, 205 "driveFile": { # Representation of a Google Drive file. # Google Drive file attachment. 206 "thumbnailUrl": "A String", # URL of a thumbnail image of the Drive item. 207 # 208 # Read-only. 209 "alternateLink": "A String", # URL that can be used to access the Drive item. 210 # 211 # Read-only. 212 "id": "A String", # Drive API resource ID. 213 "title": "A String", # Title of the Drive item. 214 # 215 # Read-only. 216 }, 217 "youTubeVideo": { # YouTube video item. # Youtube video attachment. 218 "thumbnailUrl": "A String", # URL of a thumbnail image of the YouTube video. 219 # 220 # Read-only. 221 "alternateLink": "A String", # URL that can be used to view the YouTube video. 222 # 223 # Read-only. 224 "id": "A String", # YouTube API resource ID. 225 "title": "A String", # Title of the YouTube video. 226 # 227 # Read-only. 228 }, 229 "form": { # Google Forms item. # Google Forms attachment. 230 "formUrl": "A String", # URL of the form. 231 "thumbnailUrl": "A String", # URL of a thumbnail image of the Form. 232 # 233 # Read-only. 234 "responseUrl": "A String", # URL of the form responses document. 235 # Only set if respsonses have been recorded and only when the 236 # requesting user is an editor of the form. 237 # 238 # Read-only. 239 "title": "A String", # Title of the Form. 240 # 241 # Read-only. 242 }, 243 }, 244 ], 245 }, 246 "id": "A String", # Classroom-assigned Identifier for the student submission. 247 # This is unique among submissions for the relevant course work. 248 # 249 # Read-only. 250 }</pre> 251</div> 252 253<div class="method"> 254 <code class="details" id="list">list(courseId, courseWorkId, pageSize=None, userId=None, states=None, x__xgafv=None, pageToken=None, late=None)</code> 255 <pre>Returns a list of student submissions that the requester is permitted to 256view, factoring in the OAuth scopes of the request. 257`-` may be specified as the `course_work_id` to include student 258submissions for multiple course work items. 259 260Course students may only view their own work. Course teachers 261and domain administrators may view all student submissions. 262 263This method returns the following error codes: 264 265* `PERMISSION_DENIED` if the requesting user is not permitted to access the 266requested course or course work, or for access errors. 267* `INVALID_ARGUMENT` if the request is malformed. 268* `NOT_FOUND` if the requested course does not exist. 269 270Args: 271 courseId: string, Identifier of the course. 272This identifier can be either the Classroom-assigned identifier or an 273alias. (required) 274 courseWorkId: string, Identifer of the student work to request. 275This may be set to the string literal `"-"` to request student work for 276all course work in the specified course. (required) 277 pageSize: integer, Maximum number of items to return. Zero or unspecified indicates that the 278server may assign a maximum. 279 280The server may return fewer than the specified number of results. 281 userId: string, Optional argument to restrict returned student work to those owned by the 282student with the specified identifier. The identifier can be one of the 283following: 284 285* the numeric identifier for the user 286* the email address of the user 287* the string literal `"me"`, indicating the requesting user 288 states: string, Requested submission states. If specified, returned student submissions 289match one of the specified submission states. (repeated) 290 x__xgafv: string, V1 error format. 291 Allowed values 292 1 - v1 error format 293 2 - v2 error format 294 pageToken: string, nextPageToken 295value returned from a previous 296list call, 297indicating that the subsequent page of results should be returned. 298 299The list request 300must be otherwise identical to the one that resulted in this token. 301 late: string, Requested lateness value. If specified, returned student submissions are 302restricted by the requested value. 303If unspecified, submissions are returned regardless of `late` value. 304 305Returns: 306 An object of the form: 307 308 { # Response when listing student submissions. 309 "nextPageToken": "A String", # Token identifying the next page of results to return. If empty, no further 310 # results are available. 311 "studentSubmissions": [ # Student work that matches the request. 312 { # Student submission for course work. 313 # 314 # StudentSubmission items are generated when a CourseWork item is created. 315 # 316 # StudentSubmissions that have never been accessed (i.e. with `state` = NEW) 317 # may not have a creation time or update time. 318 "draftGrade": 3.14, # Optional pending grade. If unset, no grade was set. 319 # This must be a non-negative integer value. 320 # 321 # This is only visible to and modifiable by course teachers. 322 "updateTime": "A String", # Last update time of this submission. 323 # This may be unset if the student has not accessed this item. 324 # 325 # Read-only. 326 "alternateLink": "A String", # Absolute link to the submission in the Classroom web UI. 327 # 328 # Read-only. 329 "courseId": "A String", # Identifier of the course. 330 # 331 # Read-only. 332 "multipleChoiceSubmission": { # Student work for a multiple-choice question. # Submission content when course_work_type is MULTIPLE_CHOICE_QUESTION. 333 "answer": "A String", # Student's select choice. 334 }, 335 "userId": "A String", # Identifier for the student that owns this submission. 336 # 337 # Read-only. 338 "shortAnswerSubmission": { # Student work for a short answer question. # Submission content when course_work_type is SHORT_ANSWER_QUESTION. 339 "answer": "A String", # Student response to a short-answer question. 340 }, 341 "associatedWithDeveloper": True or False, # Whether this student submission is associated with the Developer Console 342 # project making the request. 343 # 344 # See google.classroom.Work.CreateCourseWork for more 345 # details. 346 # 347 # Read-only. 348 "late": True or False, # Whether this submission is late. 349 # 350 # Read-only. 351 "state": "A String", # State of this submission. 352 # 353 # Read-only. 354 "courseWorkId": "A String", # Identifier for the course work this corresponds to. 355 # 356 # Read-only. 357 "courseWorkType": "A String", # Type of course work this submission is for. 358 # 359 # Read-only. 360 "assignedGrade": 3.14, # Optional grade. If unset, no grade was set. 361 # This must be a non-negative integer value. 362 # 363 # This may be modified only by course teachers. 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 "assignmentSubmission": { # Student work for an assignment. # Submission content when course_work_type is ASSIGNMENT . 369 "attachments": [ # Attachments added by the student. 370 # Drive files that correspond to materials with a share mode of 371 # STUDENT_COPY may not exist yet if the student has not accessed the 372 # assignment in Classroom. 373 # 374 # Some attachment metadata is only populated if the requesting user has 375 # permission to access it. Identifier and alternate_link fields are always 376 # available, but others (e.g. title) may not be. 377 { # Attachment added to student assignment work. 378 # 379 # When creating attachments, setting the `form` field is not supported. 380 "link": { # URL item. # Link attachment. 381 "url": "A String", # URL to link to. 382 # This must be a valid UTF-8 string containing between 1 and 2024 characters. 383 "thumbnailUrl": "A String", # URL of a thumbnail image of the target URL. 384 # 385 # Read-only. 386 "title": "A String", # Title of the target of the URL. 387 # 388 # Read-only. 389 }, 390 "driveFile": { # Representation of a Google Drive file. # Google Drive file attachment. 391 "thumbnailUrl": "A String", # URL of a thumbnail image of the Drive item. 392 # 393 # Read-only. 394 "alternateLink": "A String", # URL that can be used to access the Drive item. 395 # 396 # Read-only. 397 "id": "A String", # Drive API resource ID. 398 "title": "A String", # Title of the Drive item. 399 # 400 # Read-only. 401 }, 402 "youTubeVideo": { # YouTube video item. # Youtube video attachment. 403 "thumbnailUrl": "A String", # URL of a thumbnail image of the YouTube video. 404 # 405 # Read-only. 406 "alternateLink": "A String", # URL that can be used to view the YouTube video. 407 # 408 # Read-only. 409 "id": "A String", # YouTube API resource ID. 410 "title": "A String", # Title of the YouTube video. 411 # 412 # Read-only. 413 }, 414 "form": { # Google Forms item. # Google Forms attachment. 415 "formUrl": "A String", # URL of the form. 416 "thumbnailUrl": "A String", # URL of a thumbnail image of the Form. 417 # 418 # Read-only. 419 "responseUrl": "A String", # URL of the form responses document. 420 # Only set if respsonses have been recorded and only when the 421 # requesting user is an editor of the form. 422 # 423 # Read-only. 424 "title": "A String", # Title of the Form. 425 # 426 # Read-only. 427 }, 428 }, 429 ], 430 }, 431 "id": "A String", # Classroom-assigned Identifier for the student submission. 432 # This is unique among submissions for the relevant course work. 433 # 434 # Read-only. 435 }, 436 ], 437 }</pre> 438</div> 439 440<div class="method"> 441 <code class="details" id="list_next">list_next(previous_request, previous_response)</code> 442 <pre>Retrieves the next page of results. 443 444Args: 445 previous_request: The request for the previous page. (required) 446 previous_response: The response from the request for the previous page. (required) 447 448Returns: 449 A request object that you can call 'execute()' on to request the next 450 page. Returns None if there are no more items in the collection. 451 </pre> 452</div> 453 454<div class="method"> 455 <code class="details" id="modifyAttachments">modifyAttachments(courseId, courseWorkId, id, body, x__xgafv=None)</code> 456 <pre>Modifies attachments of student submission. 457 458Attachments may only be added to student submissions belonging to course 459work objects with a `workType` of `ASSIGNMENT`. 460 461This request must be made by the Developer Console project of the 462[OAuth client ID](https://support.google.com/cloud/answer/6158849) used to 463create the corresponding course work item. 464 465This method returns the following error codes: 466 467* `PERMISSION_DENIED` if the requesting user is not permitted to access the 468requested course or course work, if the user is not permitted to modify 469attachments on the requested student submission, or for 470access errors. 471* `INVALID_ARGUMENT` if the request is malformed. 472* `NOT_FOUND` if the requested course, course work, or student submission 473does not exist. 474 475Args: 476 courseId: string, Identifier of the course. 477This identifier can be either the Classroom-assigned identifier or an 478alias. (required) 479 courseWorkId: string, Identifier of the course work. (required) 480 id: string, Identifier of the student submission. (required) 481 body: object, The request body. (required) 482 The object takes the form of: 483 484{ # Request to modify the attachments of a student submission. 485 "addAttachments": [ # Attachments to add. 486 # A student submission may not have more than 20 attachments. 487 # 488 # Form attachments are not supported. 489 { # Attachment added to student assignment work. 490 # 491 # When creating attachments, setting the `form` field is not supported. 492 "link": { # URL item. # Link attachment. 493 "url": "A String", # URL to link to. 494 # This must be a valid UTF-8 string containing between 1 and 2024 characters. 495 "thumbnailUrl": "A String", # URL of a thumbnail image of the target URL. 496 # 497 # Read-only. 498 "title": "A String", # Title of the target of the URL. 499 # 500 # Read-only. 501 }, 502 "driveFile": { # Representation of a Google Drive file. # Google Drive file attachment. 503 "thumbnailUrl": "A String", # URL of a thumbnail image of the Drive item. 504 # 505 # Read-only. 506 "alternateLink": "A String", # URL that can be used to access the Drive item. 507 # 508 # Read-only. 509 "id": "A String", # Drive API resource ID. 510 "title": "A String", # Title of the Drive item. 511 # 512 # Read-only. 513 }, 514 "youTubeVideo": { # YouTube video item. # Youtube video attachment. 515 "thumbnailUrl": "A String", # URL of a thumbnail image of the YouTube video. 516 # 517 # Read-only. 518 "alternateLink": "A String", # URL that can be used to view the YouTube video. 519 # 520 # Read-only. 521 "id": "A String", # YouTube API resource ID. 522 "title": "A String", # Title of the YouTube video. 523 # 524 # Read-only. 525 }, 526 "form": { # Google Forms item. # Google Forms attachment. 527 "formUrl": "A String", # URL of the form. 528 "thumbnailUrl": "A String", # URL of a thumbnail image of the Form. 529 # 530 # Read-only. 531 "responseUrl": "A String", # URL of the form responses document. 532 # Only set if respsonses have been recorded and only when the 533 # requesting user is an editor of the form. 534 # 535 # Read-only. 536 "title": "A String", # Title of the Form. 537 # 538 # Read-only. 539 }, 540 }, 541 ], 542 } 543 544 x__xgafv: string, V1 error format. 545 Allowed values 546 1 - v1 error format 547 2 - v2 error format 548 549Returns: 550 An object of the form: 551 552 { # Student submission for course work. 553 # 554 # StudentSubmission items are generated when a CourseWork item is created. 555 # 556 # StudentSubmissions that have never been accessed (i.e. with `state` = NEW) 557 # may not have a creation time or update time. 558 "draftGrade": 3.14, # Optional pending grade. If unset, no grade was set. 559 # This must be a non-negative integer value. 560 # 561 # This is only visible to and modifiable by course teachers. 562 "updateTime": "A String", # Last update time of this submission. 563 # This may be unset if the student has not accessed this item. 564 # 565 # Read-only. 566 "alternateLink": "A String", # Absolute link to the submission in the Classroom web UI. 567 # 568 # Read-only. 569 "courseId": "A String", # Identifier of the course. 570 # 571 # Read-only. 572 "multipleChoiceSubmission": { # Student work for a multiple-choice question. # Submission content when course_work_type is MULTIPLE_CHOICE_QUESTION. 573 "answer": "A String", # Student's select choice. 574 }, 575 "userId": "A String", # Identifier for the student that owns this submission. 576 # 577 # Read-only. 578 "shortAnswerSubmission": { # Student work for a short answer question. # Submission content when course_work_type is SHORT_ANSWER_QUESTION. 579 "answer": "A String", # Student response to a short-answer question. 580 }, 581 "associatedWithDeveloper": True or False, # Whether this student submission is associated with the Developer Console 582 # project making the request. 583 # 584 # See google.classroom.Work.CreateCourseWork for more 585 # details. 586 # 587 # Read-only. 588 "late": True or False, # Whether this submission is late. 589 # 590 # Read-only. 591 "state": "A String", # State of this submission. 592 # 593 # Read-only. 594 "courseWorkId": "A String", # Identifier for the course work this corresponds to. 595 # 596 # Read-only. 597 "courseWorkType": "A String", # Type of course work this submission is for. 598 # 599 # Read-only. 600 "assignedGrade": 3.14, # Optional grade. If unset, no grade was set. 601 # This must be a non-negative integer value. 602 # 603 # This may be modified only by course teachers. 604 "creationTime": "A String", # Creation time of this submission. 605 # This may be unset if the student has not accessed this item. 606 # 607 # Read-only. 608 "assignmentSubmission": { # Student work for an assignment. # Submission content when course_work_type is ASSIGNMENT . 609 "attachments": [ # Attachments added by the student. 610 # Drive files that correspond to materials with a share mode of 611 # STUDENT_COPY may not exist yet if the student has not accessed the 612 # assignment in Classroom. 613 # 614 # Some attachment metadata is only populated if the requesting user has 615 # permission to access it. Identifier and alternate_link fields are always 616 # available, but others (e.g. title) may not be. 617 { # Attachment added to student assignment work. 618 # 619 # When creating attachments, setting the `form` field is not supported. 620 "link": { # URL item. # Link attachment. 621 "url": "A String", # URL to link to. 622 # This must be a valid UTF-8 string containing between 1 and 2024 characters. 623 "thumbnailUrl": "A String", # URL of a thumbnail image of the target URL. 624 # 625 # Read-only. 626 "title": "A String", # Title of the target of the URL. 627 # 628 # Read-only. 629 }, 630 "driveFile": { # Representation of a Google Drive file. # Google Drive file attachment. 631 "thumbnailUrl": "A String", # URL of a thumbnail image of the Drive item. 632 # 633 # Read-only. 634 "alternateLink": "A String", # URL that can be used to access the Drive item. 635 # 636 # Read-only. 637 "id": "A String", # Drive API resource ID. 638 "title": "A String", # Title of the Drive item. 639 # 640 # Read-only. 641 }, 642 "youTubeVideo": { # YouTube video item. # Youtube video attachment. 643 "thumbnailUrl": "A String", # URL of a thumbnail image of the YouTube video. 644 # 645 # Read-only. 646 "alternateLink": "A String", # URL that can be used to view the YouTube video. 647 # 648 # Read-only. 649 "id": "A String", # YouTube API resource ID. 650 "title": "A String", # Title of the YouTube video. 651 # 652 # Read-only. 653 }, 654 "form": { # Google Forms item. # Google Forms attachment. 655 "formUrl": "A String", # URL of the form. 656 "thumbnailUrl": "A String", # URL of a thumbnail image of the Form. 657 # 658 # Read-only. 659 "responseUrl": "A String", # URL of the form responses document. 660 # Only set if respsonses have been recorded and only when the 661 # requesting user is an editor of the form. 662 # 663 # Read-only. 664 "title": "A String", # Title of the Form. 665 # 666 # Read-only. 667 }, 668 }, 669 ], 670 }, 671 "id": "A String", # Classroom-assigned Identifier for the student submission. 672 # This is unique among submissions for the relevant course work. 673 # 674 # Read-only. 675 }</pre> 676</div> 677 678<div class="method"> 679 <code class="details" id="patch">patch(courseId, courseWorkId, id, body, updateMask=None, x__xgafv=None)</code> 680 <pre>Updates one or more fields of a student submission. 681 682See google.classroom.v1.StudentSubmission for details 683of which fields may be updated and who may change them. 684 685This request must be made by the Developer Console project of the 686[OAuth client ID](https://support.google.com/cloud/answer/6158849) used to 687create the corresponding course work item. 688 689This method returns the following error codes: 690 691* `PERMISSION_DENIED` if the requesting developer project did not create 692the corresponding course work, if the user is not permitted to make the 693requested modification to the student submission, or for 694access errors. 695* `INVALID_ARGUMENT` if the request is malformed. 696* `NOT_FOUND` if the requested course, course work, or student submission 697does not exist. 698 699Args: 700 courseId: string, Identifier of the course. 701This identifier can be either the Classroom-assigned identifier or an 702alias. (required) 703 courseWorkId: string, Identifier of the course work. (required) 704 id: string, Identifier of the student submission. (required) 705 body: object, The request body. (required) 706 The object takes the form of: 707 708{ # Student submission for course work. 709 # 710 # StudentSubmission items are generated when a CourseWork item is created. 711 # 712 # StudentSubmissions that have never been accessed (i.e. with `state` = NEW) 713 # may not have a creation time or update time. 714 "draftGrade": 3.14, # Optional pending grade. If unset, no grade was set. 715 # This must be a non-negative integer value. 716 # 717 # This is only visible to and modifiable by course teachers. 718 "updateTime": "A String", # Last update time of this submission. 719 # This may be unset if the student has not accessed this item. 720 # 721 # Read-only. 722 "alternateLink": "A String", # Absolute link to the submission in the Classroom web UI. 723 # 724 # Read-only. 725 "courseId": "A String", # Identifier of the course. 726 # 727 # Read-only. 728 "multipleChoiceSubmission": { # Student work for a multiple-choice question. # Submission content when course_work_type is MULTIPLE_CHOICE_QUESTION. 729 "answer": "A String", # Student's select choice. 730 }, 731 "userId": "A String", # Identifier for the student that owns this submission. 732 # 733 # Read-only. 734 "shortAnswerSubmission": { # Student work for a short answer question. # Submission content when course_work_type is SHORT_ANSWER_QUESTION. 735 "answer": "A String", # Student response to a short-answer question. 736 }, 737 "associatedWithDeveloper": True or False, # Whether this student submission is associated with the Developer Console 738 # project making the request. 739 # 740 # See google.classroom.Work.CreateCourseWork for more 741 # details. 742 # 743 # Read-only. 744 "late": True or False, # Whether this submission is late. 745 # 746 # Read-only. 747 "state": "A String", # State of this submission. 748 # 749 # Read-only. 750 "courseWorkId": "A String", # Identifier for the course work this corresponds to. 751 # 752 # Read-only. 753 "courseWorkType": "A String", # Type of course work this submission is for. 754 # 755 # Read-only. 756 "assignedGrade": 3.14, # Optional grade. If unset, no grade was set. 757 # This must be a non-negative integer value. 758 # 759 # This may be modified only by course teachers. 760 "creationTime": "A String", # Creation time of this submission. 761 # This may be unset if the student has not accessed this item. 762 # 763 # Read-only. 764 "assignmentSubmission": { # Student work for an assignment. # Submission content when course_work_type is ASSIGNMENT . 765 "attachments": [ # Attachments added by the student. 766 # Drive files that correspond to materials with a share mode of 767 # STUDENT_COPY may not exist yet if the student has not accessed the 768 # assignment in Classroom. 769 # 770 # Some attachment metadata is only populated if the requesting user has 771 # permission to access it. Identifier and alternate_link fields are always 772 # available, but others (e.g. title) may not be. 773 { # Attachment added to student assignment work. 774 # 775 # When creating attachments, setting the `form` field is not supported. 776 "link": { # URL item. # Link attachment. 777 "url": "A String", # URL to link to. 778 # This must be a valid UTF-8 string containing between 1 and 2024 characters. 779 "thumbnailUrl": "A String", # URL of a thumbnail image of the target URL. 780 # 781 # Read-only. 782 "title": "A String", # Title of the target of the URL. 783 # 784 # Read-only. 785 }, 786 "driveFile": { # Representation of a Google Drive file. # Google Drive file attachment. 787 "thumbnailUrl": "A String", # URL of a thumbnail image of the Drive item. 788 # 789 # Read-only. 790 "alternateLink": "A String", # URL that can be used to access the Drive item. 791 # 792 # Read-only. 793 "id": "A String", # Drive API resource ID. 794 "title": "A String", # Title of the Drive item. 795 # 796 # Read-only. 797 }, 798 "youTubeVideo": { # YouTube video item. # Youtube video attachment. 799 "thumbnailUrl": "A String", # URL of a thumbnail image of the YouTube video. 800 # 801 # Read-only. 802 "alternateLink": "A String", # URL that can be used to view the YouTube video. 803 # 804 # Read-only. 805 "id": "A String", # YouTube API resource ID. 806 "title": "A String", # Title of the YouTube video. 807 # 808 # Read-only. 809 }, 810 "form": { # Google Forms item. # Google Forms attachment. 811 "formUrl": "A String", # URL of the form. 812 "thumbnailUrl": "A String", # URL of a thumbnail image of the Form. 813 # 814 # Read-only. 815 "responseUrl": "A String", # URL of the form responses document. 816 # Only set if respsonses have been recorded and only when the 817 # requesting user is an editor of the form. 818 # 819 # Read-only. 820 "title": "A String", # Title of the Form. 821 # 822 # Read-only. 823 }, 824 }, 825 ], 826 }, 827 "id": "A String", # Classroom-assigned Identifier for the student submission. 828 # This is unique among submissions for the relevant course work. 829 # 830 # Read-only. 831} 832 833 updateMask: string, Mask that identifies which fields on the student submission to update. 834This field is required to do an update. The update fails if invalid 835fields are specified. 836 837The following fields may be specified by teachers: 838* `draft_grade` 839* `assigned_grade` 840 x__xgafv: string, V1 error format. 841 Allowed values 842 1 - v1 error format 843 2 - v2 error format 844 845Returns: 846 An object of the form: 847 848 { # Student submission for course work. 849 # 850 # StudentSubmission items are generated when a CourseWork item is created. 851 # 852 # StudentSubmissions that have never been accessed (i.e. with `state` = NEW) 853 # may not have a creation time or update time. 854 "draftGrade": 3.14, # Optional pending grade. If unset, no grade was set. 855 # This must be a non-negative integer value. 856 # 857 # This is only visible to and modifiable by course teachers. 858 "updateTime": "A String", # Last update time of this submission. 859 # This may be unset if the student has not accessed this item. 860 # 861 # Read-only. 862 "alternateLink": "A String", # Absolute link to the submission in the Classroom web UI. 863 # 864 # Read-only. 865 "courseId": "A String", # Identifier of the course. 866 # 867 # Read-only. 868 "multipleChoiceSubmission": { # Student work for a multiple-choice question. # Submission content when course_work_type is MULTIPLE_CHOICE_QUESTION. 869 "answer": "A String", # Student's select choice. 870 }, 871 "userId": "A String", # Identifier for the student that owns this submission. 872 # 873 # Read-only. 874 "shortAnswerSubmission": { # Student work for a short answer question. # Submission content when course_work_type is SHORT_ANSWER_QUESTION. 875 "answer": "A String", # Student response to a short-answer question. 876 }, 877 "associatedWithDeveloper": True or False, # Whether this student submission is associated with the Developer Console 878 # project making the request. 879 # 880 # See google.classroom.Work.CreateCourseWork for more 881 # details. 882 # 883 # Read-only. 884 "late": True or False, # Whether this submission is late. 885 # 886 # Read-only. 887 "state": "A String", # State of this submission. 888 # 889 # Read-only. 890 "courseWorkId": "A String", # Identifier for the course work this corresponds to. 891 # 892 # Read-only. 893 "courseWorkType": "A String", # Type of course work this submission is for. 894 # 895 # Read-only. 896 "assignedGrade": 3.14, # Optional grade. If unset, no grade was set. 897 # This must be a non-negative integer value. 898 # 899 # This may be modified only by course teachers. 900 "creationTime": "A String", # Creation time of this submission. 901 # This may be unset if the student has not accessed this item. 902 # 903 # Read-only. 904 "assignmentSubmission": { # Student work for an assignment. # Submission content when course_work_type is ASSIGNMENT . 905 "attachments": [ # Attachments added by the student. 906 # Drive files that correspond to materials with a share mode of 907 # STUDENT_COPY may not exist yet if the student has not accessed the 908 # assignment in Classroom. 909 # 910 # Some attachment metadata is only populated if the requesting user has 911 # permission to access it. Identifier and alternate_link fields are always 912 # available, but others (e.g. title) may not be. 913 { # Attachment added to student assignment work. 914 # 915 # When creating attachments, setting the `form` field is not supported. 916 "link": { # URL item. # Link attachment. 917 "url": "A String", # URL to link to. 918 # This must be a valid UTF-8 string containing between 1 and 2024 characters. 919 "thumbnailUrl": "A String", # URL of a thumbnail image of the target URL. 920 # 921 # Read-only. 922 "title": "A String", # Title of the target of the URL. 923 # 924 # Read-only. 925 }, 926 "driveFile": { # Representation of a Google Drive file. # Google Drive file attachment. 927 "thumbnailUrl": "A String", # URL of a thumbnail image of the Drive item. 928 # 929 # Read-only. 930 "alternateLink": "A String", # URL that can be used to access the Drive item. 931 # 932 # Read-only. 933 "id": "A String", # Drive API resource ID. 934 "title": "A String", # Title of the Drive item. 935 # 936 # Read-only. 937 }, 938 "youTubeVideo": { # YouTube video item. # Youtube video attachment. 939 "thumbnailUrl": "A String", # URL of a thumbnail image of the YouTube video. 940 # 941 # Read-only. 942 "alternateLink": "A String", # URL that can be used to view the YouTube video. 943 # 944 # Read-only. 945 "id": "A String", # YouTube API resource ID. 946 "title": "A String", # Title of the YouTube video. 947 # 948 # Read-only. 949 }, 950 "form": { # Google Forms item. # Google Forms attachment. 951 "formUrl": "A String", # URL of the form. 952 "thumbnailUrl": "A String", # URL of a thumbnail image of the Form. 953 # 954 # Read-only. 955 "responseUrl": "A String", # URL of the form responses document. 956 # Only set if respsonses have been recorded and only when the 957 # requesting user is an editor of the form. 958 # 959 # Read-only. 960 "title": "A String", # Title of the Form. 961 # 962 # Read-only. 963 }, 964 }, 965 ], 966 }, 967 "id": "A String", # Classroom-assigned Identifier for the student submission. 968 # This is unique among submissions for the relevant course work. 969 # 970 # Read-only. 971 }</pre> 972</div> 973 974<div class="method"> 975 <code class="details" id="reclaim">reclaim(courseId, courseWorkId, id, body, x__xgafv=None)</code> 976 <pre>Reclaims a student submission on behalf of the student that owns it. 977 978Reclaiming a student submission transfers ownership of attached Drive 979files to the student and update the submission state. 980 981Only the student that owns the requested student submission may call this 982method, and only for a student submission that has been turned in. 983 984This request must be made by the Developer Console project of the 985[OAuth client ID](https://support.google.com/cloud/answer/6158849) used to 986create the corresponding course work item. 987 988This method returns the following error codes: 989 990* `PERMISSION_DENIED` if the requesting user is not permitted to access the 991requested course or course work, unsubmit the requested student submission, 992or for access errors. 993* `FAILED_PRECONDITION` if the student submission has not been turned in. 994* `INVALID_ARGUMENT` if the request is malformed. 995* `NOT_FOUND` if the requested course, course work, or student submission 996does not exist. 997 998Args: 999 courseId: string, Identifier of the course. 1000This identifier can be either the Classroom-assigned identifier or an 1001alias. (required) 1002 courseWorkId: string, Identifier of the course work. (required) 1003 id: string, Identifier of the student submission. (required) 1004 body: object, The request body. (required) 1005 The object takes the form of: 1006 1007{ # Request to reclaim a student submission. 1008 } 1009 1010 x__xgafv: string, V1 error format. 1011 Allowed values 1012 1 - v1 error format 1013 2 - v2 error format 1014 1015Returns: 1016 An object of the form: 1017 1018 { # A generic empty message that you can re-use to avoid defining duplicated 1019 # empty messages in your APIs. A typical example is to use it as the request 1020 # or the response type of an API method. For instance: 1021 # 1022 # service Foo { 1023 # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); 1024 # } 1025 # 1026 # The JSON representation for `Empty` is empty JSON object `{}`. 1027 }</pre> 1028</div> 1029 1030<div class="method"> 1031 <code class="details" id="return_">return_(courseId, courseWorkId, id, body, x__xgafv=None)</code> 1032 <pre>Returns a student submission. 1033 1034Returning a student submission transfers ownership of attached Drive 1035files to the student and may also update the submission state. 1036Unlike the Classroom application, returning a student submission does not 1037set assignedGrade to the draftGrade value. 1038 1039Only a teacher of the course that contains the requested student submission 1040may call this method. 1041 1042This request must be made by the Developer Console project of the 1043[OAuth client ID](https://support.google.com/cloud/answer/6158849) used to 1044create the corresponding course work item. 1045 1046This method returns the following error codes: 1047 1048* `PERMISSION_DENIED` if the requesting user is not permitted to access the 1049requested course or course work, return the requested student submission, 1050or for access errors. 1051* `INVALID_ARGUMENT` if the request is malformed. 1052* `NOT_FOUND` if the requested course, course work, or student submission 1053does not exist. 1054 1055Args: 1056 courseId: string, Identifier of the course. 1057This identifier can be either the Classroom-assigned identifier or an 1058alias. (required) 1059 courseWorkId: string, Identifier of the course work. (required) 1060 id: string, Identifier of the student submission. (required) 1061 body: object, The request body. (required) 1062 The object takes the form of: 1063 1064{ # Request to return a student submission. 1065 } 1066 1067 x__xgafv: string, V1 error format. 1068 Allowed values 1069 1 - v1 error format 1070 2 - v2 error format 1071 1072Returns: 1073 An object of the form: 1074 1075 { # A generic empty message that you can re-use to avoid defining duplicated 1076 # empty messages in your APIs. A typical example is to use it as the request 1077 # or the response type of an API method. For instance: 1078 # 1079 # service Foo { 1080 # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); 1081 # } 1082 # 1083 # The JSON representation for `Empty` is empty JSON object `{}`. 1084 }</pre> 1085</div> 1086 1087<div class="method"> 1088 <code class="details" id="turnIn">turnIn(courseId, courseWorkId, id, body, x__xgafv=None)</code> 1089 <pre>Turns in a student submission. 1090 1091Turning in a student submission transfers ownership of attached Drive 1092files to the teacher and may also update the submission state. 1093 1094This may only be called by the student that owns the specified student 1095submission. 1096 1097This request must be made by the Developer Console project of the 1098[OAuth client ID](https://support.google.com/cloud/answer/6158849) used to 1099create the corresponding course work item. 1100 1101This method returns the following error codes: 1102 1103* `PERMISSION_DENIED` if the requesting user is not permitted to access the 1104requested course or course work, turn in the requested student submission, 1105or for access errors. 1106* `INVALID_ARGUMENT` if the request is malformed. 1107* `NOT_FOUND` if the requested course, course work, or student submission 1108does not exist. 1109 1110Args: 1111 courseId: string, Identifier of the course. 1112This identifier can be either the Classroom-assigned identifier or an 1113alias. (required) 1114 courseWorkId: string, Identifier of the course work. (required) 1115 id: string, Identifier of the student submission. (required) 1116 body: object, The request body. (required) 1117 The object takes the form of: 1118 1119{ # Request to turn in a student submission. 1120 } 1121 1122 x__xgafv: string, V1 error format. 1123 Allowed values 1124 1 - v1 error format 1125 2 - v2 error format 1126 1127Returns: 1128 An object of the form: 1129 1130 { # A generic empty message that you can re-use to avoid defining duplicated 1131 # empty messages in your APIs. A typical example is to use it as the request 1132 # or the response type of an API method. For instance: 1133 # 1134 # service Foo { 1135 # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); 1136 # } 1137 # 1138 # The JSON representation for `Empty` is empty JSON object `{}`. 1139 }</pre> 1140</div> 1141 1142</body></html>