Google 课堂插件现已面向开发者正式推出!如需了解详情,请参阅
插件文档。
AddOnContext
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
特定帖子中与 Google 课堂插件相关的附件元数据。
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 的标识符。
|
supportsStudentWork |
boolean
可选。帖子是否允许教师查看学生作业和传回成绩。
|
联合字段 context 。 context 只能是下列其中一项:
|
studentContext |
object (StudentContext )
与请求用户的学生角色对应的插件上下文。其存在表示请求的用户是该课程的学生。
|
teacherContext |
object (TeacherContext )
与请求用户的教师角色对应的插件上下文。其存在表示发出请求的用户是该课程的教师。
|
StudentContext
JSON 表示法 |
{
"submissionId": string
} |
字段 |
submissionId |
string
请求使用用户的提交 ID 来传回成绩,并在向教师显示学生作业时识别学生。此值仅在 supportsStudentWork 为 true 时设置。
|
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[],[],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."]]