Google Classroom アドオンの一般提供が開始されました。詳しくは、
アドオンのドキュメントをご覧ください。
AddOnContext
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
特定の投稿のコンテキストにおける Classroom アドオンの添付ファイルに関連するメタデータ。
JSON 表現 |
{
"courseId": string,
"postId": string,
"itemId": string,
"supportsStudentWork": boolean,
// Union field context can be only one of the following:
"studentContext": {
object (StudentContext )
},
"teacherContext": {
object (TeacherContext )
}
// End of list of possible types for union field context .
} |
フィールド |
courseId |
string
変更不可。コースの識別子。
|
postId (deprecated) |
string
変更不可。非推奨。代わりに itemId を使用してください。
|
itemId |
string
変更不可。添付ファイルが接続されている Announcement 、CourseWork 、CourseWorkMaterial の ID。
|
supportsStudentWork |
boolean
省略可。教師が投稿で生徒の課題を確認して成績を返却できるかどうか。
|
共用体フィールド context 。 context は次のいずれかになります。
|
studentContext |
object (StudentContext )
リクエスト元のユーザーの生徒としてのロールに対応するアドオン コンテキスト。この値が存在する場合、リクエスト元のユーザーがコースの生徒であることを示します。
|
teacherContext |
object (TeacherContext )
リクエスト元のユーザーの教師としてのロールに対応するアドオン コンテキスト。このパラメータが存在する場合、リクエスト元のユーザーがコースの教師であることを示します。
|
StudentContext
リクエスト元のユーザーが生徒の場合のロール固有のコンテキスト。
JSON 表現 |
{
"submissionId": string
} |
フィールド |
submissionId |
string
生徒の提出物を見せるときに生徒を特定し、採点結果の受け渡しにも使用されるユーザーの送信 ID をリクエストします。これは、supportsStudentWork が true のときに設定されます。
|
TeacherContext
この型にはフィールドがありません。
リクエスト元のユーザーが教師である場合のロール固有のコンテキスト。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-25 UTC。
[null,null,["最終更新日 2025-07-25 UTC。"],[],[],null,["# AddOnContext\n\n- [JSON representation](#SCHEMA_REPRESENTATION)\n- [StudentContext](#StudentContext)\n - [JSON representation](#StudentContext.SCHEMA_REPRESENTATION)\n- [TeacherContext](#TeacherContext)\n\nAttachment-relevant metadata for Classroom add-ons in the context of a specific post.\n\n| JSON representation |\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"courseId\": string, \"postId\": string, \"itemId\": string, \"supportsStudentWork\": boolean, // Union field `context` can be only one of the following: \"studentContext\": { object (/workspace/classroom/reference/rest/v1/AddOnContext#StudentContext) }, \"teacherContext\": { object (/workspace/classroom/reference/rest/v1/AddOnContext#TeacherContext) } // End of list of possible types for union field `context`. } ``` |\n\n| Fields ||\n|---------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `courseId` | `string` Immutable. Identifier of the course. |\n| `postId` **(deprecated)** | `string` | This item is deprecated! Immutable. Deprecated, use `itemId` instead. |\n| `itemId` | `string` Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached. |\n| `supportsStudentWork` | `boolean` Optional. Whether the post allows the teacher to see student work and passback grades. |\n| Union field `context`. `context` can be only one of the following: ||\n| `studentContext` | `object (`[StudentContext](/workspace/classroom/reference/rest/v1/AddOnContext#StudentContext)`)` Add-on context corresponding to the requesting user's role as a student. Its presence implies that the requesting user is a student in the course. |\n| `teacherContext` | `object (`[TeacherContext](/workspace/classroom/reference/rest/v1/AddOnContext#TeacherContext)`)` Add-on context corresponding to the requesting user's role as a teacher. Its presence implies that the requesting user is a teacher in the course. |\n\nStudentContext\n--------------\n\nRole-specific context if the requesting user is a student.\n\n| JSON representation |\n|------------------------------------|\n| ``` { \"submissionId\": string } ``` |\n\n| Fields ||\n|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `submissionId` | `string` Requesting user's submission id to be used for grade passback and to identify the student when showing student work to the teacher. This is set exactly when `supportsStudentWork` is `true`. |\n\nTeacherContext\n--------------\n\nThis type has no fields.\nRole-specific context if the requesting user is a teacher."]]