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.
Method: courses.courseWork.delete
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Xoá bài tập trong khoá học.
Yêu cầu này phải được thực hiện bằng dự án Developer Console của mã ứng dụng khách OAuth dùng để tạo mục bài tập tương ứng.
Phương thức này trả về các mã lỗi sau:
PERMISSION_DENIED
nếu dự án nhà phát triển yêu cầu không tạo bài tập tương ứng, nếu người dùng yêu cầu không được phép xoá khoá học được yêu cầu hoặc do lỗi truy cập.
FAILED_PRECONDITION
nếu bài tập trong khoá học mà bạn yêu cầu đã bị xoá.
NOT_FOUND
nếu không có khoá học nào có mã nhận dạng được yêu cầu.
Yêu cầu HTTP
DELETE https://classroom.googleapis.com/v1/courses/{courseId}/courseWork/{id}
URL sử dụng cú pháp Chuyển mã gRPC.
Tham số đường dẫn
Thông số |
courseId |
string
Giá trị nhận dạng của khoá học. Giá trị nhận dạng này có thể là giá trị nhận dạng do Lớp học chỉ định hoặc alias .
|
id |
string
Giá trị nhận dạng của bài tập trong khoá học cần xoá. Giá trị nhận dạng này là giá trị nhận dạng do Lớp học chỉ định.
|
Nội dung yêu cầu
Nội dung yêu cầu phải trống.
Nội dung phản hồi
Nếu thành công, nội dung phản hồi sẽ là một đối tượng JSON trống.
Phạm vi uỷ quyền
Yêu cầu phạm vi OAuth sau:
https://www.googleapis.com/auth/classroom.coursework.students
Để biết thêm thông tin, hãy xem Hướng dẫn uỷ quyền.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[],[],null,["# Method: courses.courseWork.delete\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nDeletes a course work.\n\nThis request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item.\n\nThis method returns the following error codes:\n\n- `PERMISSION_DENIED` if the requesting developer project did not create the corresponding course work, if the requesting user is not permitted to delete the requested course or for [access errors](/workspace/classroom/reference/Access.Errors).\n- `FAILED_PRECONDITION` if the requested course work has already been deleted.\n- `NOT_FOUND` if no course exists with the requested ID.\n\n### HTTP request\n\n`DELETE https://classroom.googleapis.com/v1/courses/{courseId}/courseWork/{id}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `courseId` | `string` Identifier of the course. This identifier can be either the Classroom-assigned identifier or an [alias](/workspace/classroom/reference/rest/v1/courses.aliases#CourseAlias). |\n| `id` | `string` Identifier of the course work to delete. This identifier is a Classroom-assigned identifier. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body is an empty JSON object.\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/classroom.coursework.students`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]