This page provides a brief overview of key interactions between your add-on web application and the Google Classroom add-ons API.
Attachment Discovery iframe
The Attachment Discovery iframe is the landing page for teachers in your add-on. Consider taking the following actions regarding this view:
- When the Attachment Discovery iframe opens, make a
courseWork.GetAddOnContextRequest
,courseWorkMaterials.GetAddOnContextRequest
orannouncements.GetAddOnContextRequest
based on theitemType
to validate user role and get thesupportsStudentWork
value. - Show your content discovery or creation UI. You might omit activity-type
attachments based on the value of
supportsStudentWork
from the launch validation response. - Based on teacher selections, make one or more add-on
create
requests to add attachments to the assignment.
Other iframes
The Student View iframe, Student Work Review iframe, and Teacher View iframe are all intended to present content to the user rather than modifying a Classroom assignment. Consider taking the following actions regarding these views:
When an iframe opens, get the user's OAuth consent and then validate their role and attachment ID.
- If the current user is a student, associate the
submissionId
from the response with the student work. This is required for passing back grades and for showing student work to teachers in the grading tool; thesubmissionIds
match across views. - If the
attachmentId
is already known to the add-on, show the appropriate attachment UI. - Otherwise, it must be the case that the parent post of this attachment
was copied from another post or course. Use
copyHistory
to identify the most recent copy that the add-on is aware of and copy the settings from it to create a new corresponding model of the attachment on the add-on side. Then, show the appropriate attachment UI.
- If the current user is a student, associate the