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.updateGradingPeriodSettings
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.
Cập nhật chế độ cài đặt giai đoạn chấm điểm của một khoá học.
Bạn có thể thêm, xoá hoặc sửa đổi từng giai đoạn chấm điểm bằng phương thức này.
Người dùng gửi yêu cầu và chủ sở hữu khoá học phải đủ điều kiện để sửa đổi Kỳ chấm điểm. Để biết thông tin chi tiết, hãy xem các yêu cầu về việc cấp phép.
Phương thức này trả về các mã lỗi sau:
PERMISSION_DENIED
nếu người dùng yêu cầu không được phép sửa đổi chế độ cài đặt giai đoạn chấm điểm trong một khoá học hoặc do lỗi truy cập:
- UserIneligibleToUpdateGradingPeriodSettings
INVALID_ARGUMENT
nếu yêu cầu không đúng định dạng.
NOT_FOUND
nếu khoá học được yêu cầu không tồn tại.
Yêu cầu HTTP
PATCH https://classroom.googleapis.com/v1/courses/{courseId}/gradingPeriodSettings
URL sử dụng cú pháp Chuyển mã gRPC.
Tham số đường dẫn
Thông số |
courseId |
string
Bắt buộc. Giá trị nhận dạng của khoá học.
|
Tham số truy vấn
Thông số |
updateMask |
string (FieldMask format)
Mặt nạ xác định những trường trong GradingPeriodSettings cần cập nhật. Danh sách GradingPeriodSettings gradingPeriods sẽ được thay thế hoàn toàn bằng các khoảng thời gian chấm điểm được chỉ định trong yêu cầu cập nhật. Ví dụ:
- Các kỳ chấm điểm có trong danh sách nhưng không có mã sẽ được coi là nội dung bổ sung và mã mới sẽ được chỉ định khi bạn gửi yêu cầu.
- Các giai đoạn chấm điểm hiện có nhưng bị thiếu trong yêu cầu sẽ được coi là bị xoá.
- Các giai đoạn chấm điểm có mã nhận dạng hiện có và dữ liệu đã sửa đổi được coi là nội dung chỉnh sửa. Dữ liệu chưa sửa đổi sẽ được giữ nguyên.
- Các giai đoạn chấm điểm có mã nhận dạng không xác định sẽ dẫn đến lỗi.
Bạn có thể chỉ định các trường sau:
gradingPeriods
applyToExistingCoursework
Đây là danh sách tên trường đủ điều kiện được phân tách bằng dấu phẩy. Ví dụ: "user.displayName,photo"
|
previewVersion |
enum (PreviewVersion )
Không bắt buộc. Phiên bản xem trước của API. Bạn phải đặt giá trị này để truy cập vào các tính năng API mới được cung cấp cho nhà phát triển trong Chương trình xem trước.
|
Nội dung yêu cầu
Nội dung yêu cầu chứa một bản sao của GradingPeriodSettings
.
Nội dung phản hồi
Nếu thành công, nội dung phản hồi sẽ chứa một phiên bản của GradingPeriodSettings
.
Phạm vi uỷ quyền
Yêu cầu phạm vi OAuth sau:
https://www.googleapis.com/auth/classroom.courses
Để 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.updateGradingPeriodSettings\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nUpdates grading period settings of a course.\n\nIndividual grading periods can be added, removed, or modified using this method.\n\nThe requesting user and course owner must be eligible to modify Grading Periods. For details, see [licensing requirements](https://developers.google.com/workspace/classroom/grading-periods/manage-grading-periods#licensing_requirements).\n\nThis method returns the following error codes:\n\n- `PERMISSION_DENIED` if the requesting user is not permitted to modify the grading period settings in a course or for [access errors](/workspace/classroom/reference/Access.Errors):\n - UserIneligibleToUpdateGradingPeriodSettings\n- `INVALID_ARGUMENT` if the request is malformed.\n- `NOT_FOUND` if the requested course does not exist.\n\n### HTTP request\n\n`PATCH https://classroom.googleapis.com/v1/courses/{courseId}/gradingPeriodSettings`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|------------|--------------------------------------------------|\n| `courseId` | `string` Required. The identifier of the course. |\n\n### Query parameters\n\n| Parameters ||\n|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `updateMask` | `string (`[FieldMask](https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask)` format)` Mask that identifies which fields in the GradingPeriodSettings to update. The GradingPeriodSettings `gradingPeriods` list will be fully replaced by the grading periods specified in the update request. For example: - Grading periods included in the list without an ID are considered additions, and a new ID will be assigned when the request is made. - Grading periods that currently exist, but are missing from the request will be considered deletions. - Grading periods with an existing ID and modified data are considered edits. Unmodified data will be left as is. - Grading periods included with an unknown ID will result in an error. The following fields may be specified: - `gradingPeriods` - `applyToExistingCoursework` This is a comma-separated list of fully qualified names of fields. Example: `\"user.displayName,photo\"`. |\n| `previewVersion` | `enum (`[PreviewVersion](/workspace/classroom/reference/rest/v1/PreviewVersion)`)` Optional. The preview version of the API. This must be set in order to access new API capabilities made available to developers in the Preview Program. |\n\n### Request body\n\nThe request body contains an instance of [GradingPeriodSettings](/workspace/classroom/reference/rest/v1/GradingPeriodSettings).\n\n### Response body\n\nIf successful, the response body contains an instance of [GradingPeriodSettings](/workspace/classroom/reference/rest/v1/GradingPeriodSettings).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/classroom.courses`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]