Hiện tại, các nhà phát triển đã có thể sử dụng rộng rãi tiện ích bổ sung của Google Lớp học! Vui lòng xem tài liệu về tiện ích bổ sung để biết thêm thông tin.
Siêu dữ liệu liên quan đến tệp đính kèm cho các tiện ích bổ sung của Lớp học trong bối cảnh của một bài đăng cụ thể.
Biểu diễn dưới dạng 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.}
Trường
courseId
string
Không thể thay đổi. Giá trị nhận dạng của khoá học.
postId (deprecated)
string
Không thể thay đổi. Không dùng nữa, hãy sử dụng itemId.
itemId
string
Không thể thay đổi. Giá trị nhận dạng của Announcement, CourseWork hoặc CourseWorkMaterial trong đó tệp đính kèm được đính kèm.
supportsStudentWork
boolean
Không bắt buộc. Liệu bài đăng có cho phép giáo viên xem bài tập của học viên và trả bài hay không.
Ngữ cảnh của tiện ích bổ sung tương ứng với vai trò của người dùng yêu cầu là học viên. Sự hiện diện của thuộc tính này ngụ ý rằng người dùng yêu cầu là học viên trong khoá học.
Ngữ cảnh của tiện ích bổ sung tương ứng với vai trò của người dùng yêu cầu là giáo viên. Việc có mã này cho biết rằng người dùng yêu cầu là giáo viên trong khoá học.
StudentContext
Ngữ cảnh theo vai trò nếu người dùng yêu cầu là học viên.
Biểu diễn dưới dạng JSON
{"submissionId": string}
Trường
submissionId
string
Yêu cầu sử dụng mã bài nộp của người dùng để chuyển điểm và xác định học viên khi hiển thị bài tập của học viên cho giáo viên. Giá trị này được đặt chính xác khi supportsStudentWork là true.
TeacherContext
Loại này không có trường nào.
Ngữ cảnh theo vai trò nếu người dùng yêu cầu là giáo viên.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 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."]]