ส่วนเสริมของ Google Classroom พร้อมให้บริการแก่นักพัฒนาซอฟต์แวร์แล้ว โปรดดูข้อมูลเพิ่มเติมใน
เอกสารส่วนเสริม
Method: courses.updateGradingPeriodSettings
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
อัปเดตการตั้งค่าระยะเวลาการให้คะแนนของหลักสูตร
คุณเพิ่ม นําออก หรือแก้ไขระยะเวลาการให้คะแนนแต่ละรายการได้โดยใช้วิธีนี้
ผู้ใช้ที่ส่งคำขอและเจ้าของหลักสูตรต้องมีสิทธิ์แก้ไขระยะเวลาการให้คะแนน โปรดดูรายละเอียดที่หัวข้อข้อกำหนดในการอนุญาตให้ใช้สิทธิ
วิธีการนี้จะแสดงรหัสข้อผิดพลาดต่อไปนี้
PERMISSION_DENIED
หากผู้ใช้ที่ส่งคำขอไม่ได้รับอนุญาตให้แก้ไขการตั้งค่าระยะเวลาการให้คะแนนในหลักสูตรหรือเกิดข้อผิดพลาดในการเข้าถึง ระบบจะดำเนินการดังนี้
- UserIneligibleToUpdateGradingPeriodSettings
INVALID_ARGUMENT
หากคำขอมีรูปแบบไม่ถูกต้อง
NOT_FOUND
หากไม่มีหลักสูตรที่ขอ
คำขอ HTTP
PATCH https://classroom.googleapis.com/v1/courses/{courseId}/gradingPeriodSettings
URL ใช้ไวยากรณ์การแปลง gRPC
พารามิเตอร์เส้นทาง
พารามิเตอร์ |
courseId |
string
ต้องระบุ ตัวระบุของหลักสูตร
|
พารามิเตอร์การค้นหา
พารามิเตอร์ |
updateMask |
string (FieldMask format)
มาสก์ที่ระบุฟิลด์ใน GradingPeriodSettings ที่จะอัปเดต ระบบจะแทนที่รายการ GradingPeriodSettings gradingPeriods ด้วยระยะเวลาการให้คะแนนที่ระบุในคำขออัปเดตโดยสมบูรณ์ เช่น
- ระยะเวลาการให้คะแนนที่รวมอยู่ในรายการโดยไม่มีรหัสจะถือว่าเป็นการเพิ่ม และระบบจะกำหนดรหัสใหม่เมื่อมีการร้องขอ
- ระบบจะถือว่าระยะเวลาการให้คะแนนที่มีอยู่ในปัจจุบันแต่ไม่มีอยู่ในคำขอเป็นการลบ
- ระยะเวลาการให้คะแนนที่มีรหัสและข้อมูลที่แก้ไขแล้วจะถือว่าเป็นการแก้ไข ระบบจะไม่แก้ไขข้อมูลที่ไม่มีการแก้ไข
- ระยะเวลาการให้คะแนนที่รวมรหัสที่ไม่รู้จักจะทำให้เกิดข้อผิดพลาด
คุณสามารถระบุฟิลด์ต่อไปนี้
gradingPeriods
applyToExistingCoursework
ซึ่งเป็นรายการชื่อฟิลด์ที่สมบูรณ์ในตัวเองที่คั่นด้วยคอมมา ตัวอย่าง: "user.displayName,photo"
|
previewVersion |
enum (PreviewVersion )
ไม่บังคับ API เวอร์ชันตัวอย่าง คุณต้องตั้งค่านี้เพื่อเข้าถึงความสามารถใหม่ๆ ของ API ที่พร้อมให้บริการแก่นักพัฒนาแอปในโปรแกรมเวอร์ชันตัวอย่าง
|
เนื้อความของคำขอ
เนื้อความของคำขอมีอินสแตนซ์ของ GradingPeriodSettings
เนื้อหาการตอบกลับ
หากทำสำเร็จ เนื้อหาการตอบกลับจะมีอินสแตนซ์ GradingPeriodSettings
ขอบเขตการให้สิทธิ์
ต้องใช้ขอบเขต OAuth ต่อไปนี้
https://www.googleapis.com/auth/classroom.courses
ดูข้อมูลเพิ่มเติมได้ที่คู่มือการให้สิทธิ์
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 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)."]]