Google Classroom 外掛程式現已全面開放開發人員使用!詳情請參閱
外掛程式說明文件。
Method: courses.updateGradingPeriodSettings
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
更新課程的評分期間設定。
您可以使用這項方法新增、移除或修改個別評分期間。
提出要求的使用者和課程擁有者必須具備修改評分期間的資格。詳情請參閱授權規定。
這個方法會傳回下列錯誤代碼:
PERMISSION_DENIED
如果要求使用者無法修改課程的評分期間設定,或因存取錯誤而無法修改:
- UserIneligibleToUpdateGradingPeriodSettings
INVALID_ARGUMENT
:如果要求格式錯誤。
NOT_FOUND
,如果要求的課程不存在。
HTTP 要求
PATCH https://classroom.googleapis.com/v1/courses/{courseId}/gradingPeriodSettings
這個網址使用 gRPC 轉碼語法。
路徑參數
參數 |
courseId |
string
必要欄位。課程的 ID。
|
查詢參數
參數 |
updateMask |
string (FieldMask format)
用於標示要更新的 GradingPeriodSettings 欄位。 更新要求中指定的評分期間會完全取代 GradingPeriodSettings gradingPeriods 清單。例如:
- 清單中未附上 ID 的評分期間會視為新增項目,並在提出要求時指派新的 ID。
- 目前存在但在要求中缺少的評分期間,會視為刪除。
- 系統會將具有現有 ID 且資料經過修改的評分期間視為編輯。未修改的資料將維持原狀。
- 如果評分期間包含不明 ID,系統會發生錯誤。
您可以指定下列欄位:
gradingPeriods
applyToExistingCoursework
這是以半形逗號分隔的完整欄位名稱清單。範例:"user.displayName,photo" 。
|
previewVersion |
enum (PreviewVersion )
選用設定。API 的預覽版。如要存取預覽計畫中提供給開發人員的新 API 功能,必須設定這個值。
|
回應主體
如果成功,回應主體會包含 GradingPeriodSettings
的執行例項。
授權範圍
需要下列 OAuth 範圍:
https://www.googleapis.com/auth/classroom.courses
詳情請參閱授權指南。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[],[],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)."]]