action flat_create_submission { label: "Create or edit a submission" description: "Use this method as a student to create, update and submit a submission related to an assignment.\nStudents can only set `attachments` and `submit`.\nTeachers can use `PUT /classes/{class}/assignments/{assignment}/submissions/{submission}` to update a submission by id.\n" provider: flat method: PUT path: "/classes/{class}/assignments/{assignment}/submissions" encoding: json input: { type: "object" description: "Assignment Submission creation" properties: { attachments: { type: "array" items: { type: "object" description: "Attachment creation for an assignment or stream post.\nThis attachment must contain a `score` or an `url`, all the details of this one will be resolved and returned as `ClassAttachment` once the assignment or stream post is created.\n" properties: { googleDriveFileId: { type: "string" description: "The ID of the Google Drive File" } lockScoreTemplate: { type: "boolean" description: "To be used with a score attached in `sharingMode` `copy` (score used as template). If true, students won't be able to change the original notes of the template." } score: { type: "string" description: "A unique Flat score identifier. The user creating the assignment must at least have read access to the document. If the user has admin rights, new group permissions will be automatically added for the\nteachers and students of the class.\n" } sharingMode: { type: "string" description: "The sharing mode of the score for classes post and assignments" enum: ["read", "write", "copy", "performance"] } type: { type: "string" description: "The type of the attachment posted" enum: ["flat", "link", "googleDrive", "worksheet"] } url: { type: "string" description: "The URL of the attachment." } worksheet: { type: "string" description: "An unique worksheet identifier" } } } } comments: { type: "object" properties: { total: { type: "number" description: "The total number of comments added to the submission" } unread: { type: "number" description: "The number of unread comments for the current user" } } } draftGrade: { type: "number" description: "Optional grade. If unset, no grade was set. This value is only visible by the teacher, and we will be set to `grade` once the teacher returns the submission" } grade: { type: "number" description: "Optional grade. If unset, no grade was set." } return: { type: "boolean" description: "If `true`, the submission will be marked as done" } submit: { type: "boolean" description: "If `true`, the submission will be marked as done" } } } output: { type: "object" description: "Assignment Submission" properties: { assignment: { type: "string" description: "Unique identifier of the assignment" } attachments: { type: "array" items: { type: "object" description: "Media attachment. The API will automatically resolve the details, oEmbed,\nand media available if possible and return them in this object\n" properties: { authorName: { type: "string" description: "The resolved author name of the attachment" } authorUrl: { type: "string" description: "The resolved author url of the attachment" } description: { type: "string" description: "The resolved description of the attachment" } googleDriveFileId: { type: "string" description: "The ID of the Google Drive File" } html: { type: "string" description: "If the attachment type is `rich` or `video`, the HTML code of the\nmedia to display\n" } htmlHeight: { type: "string" description: "If the `html` is available, the height of the widget" } htmlWidth: { type: "string" description: "If the `html` is available, the width of the widget" } iconUrl: { type: "string" description: "The URL of the icon" } lockScoreTemplate: { type: "boolean" description: "To be used with a score attached in `sharingMode` `copy` (score used as template). If true, students won't be able to change the original notes of the template." } mimeType: { type: "string" description: "The mine type of the file" } revision: { type: "string" description: "An unique revision identifier of a score" } score: { type: "string" description: "An unique Flat score identifier" } sharingMode: { type: "string" description: "The sharing mode of the score for classes post and assignments" enum: ["read", "write", "copy", "performance"] } thumbnailHeight: { type: "integer" description: "If the `thumbnailUrl` is available, the width of the thumbnail\n" } thumbnailUrl: { type: "string" description: "If the attachment type is `rich`, `video`, `photo` or `link`, a\ndisplayable thumbnail for this attachment\n" } thumbnailWidth: { type: "integer" description: "If the `thumbnailUrl` is available, the width of the thumbnail\n" } title: { type: "string" description: "The resolved title of the attachment" } track: { type: "string" description: "A unique track identifier" } type: { type: "string" description: "The type of the assignment resolved:\n* `rich`, `photo`, `video` are attachment types that are automatically resolved from a `link` attachment.\n* A `flat` attachment is a score document where the unique identifier will be specified in the `score` property. Its sharing mode will be provided in the `sharingMode` property.\n" enum: ["rich", "photo", "video", "link", "flat", "googleDrive", "worksheet", "performance"] } url: { type: "string" description: "The url of the attachment" } worksheet: { type: "string" description: "An unique worksheet identifier" } } } } classroom: { type: "string" description: "Unique identifier of the classroom where the assignment was posted\n" } creationDate: { type: "string" description: "The date when the submission was created" } creator: { type: "string" description: "The User identifier of the student who created the submission" } draftGrade: { type: "number" description: "Optional grade. If unset, no grade was set. This value is only visible by the teacher, and we will be set to `grade` once the teacher returns the submission" } googleClassroom: { type: "object" description: "A coursework submission on Google Classroom" properties: { alternateLink: { type: "string" description: "Absolute link to this coursework in the Classroom web UI" } id: { type: "string" description: "Identifier of the coursework submission assigned by Classroom" } state: { type: "string" description: "State of the submission on Google Classroom" } } } grade: { type: "number" description: "Optional grade. If unset, no grade was set." } id: { type: "string" description: "Unique identifier of the submission" } maxPoints: { type: "number" description: "Optional max points for the grade. If set, a corresponding `draftGrade` or `grade` will be set." } microsoftGraph: { type: "object" description: "A Microsoft Teams submission" properties: { alternateLink: { type: "string" description: "Absolute link to this submission in the Microsoft Teams web UI" } id: { type: "string" description: "Identifier of the submission assigned by Microsoft Teams" } state: { type: "string" description: "State of the submission" } } } returnCreator: { type: "string" description: "The User unique identifier of the teacher who returned the submission\n" } returnDate: { type: "string" description: "The date when the teacher returned the work" } state: { type: "string" description: "State of the submission" enum: ["created", "turnedIn", "returned"] } submissionDate: { type: "string" description: "The date when the student submitted his work" } } } }