名前空間: microsoft.graph
重要
Microsoft Graph の /beta バージョンの API は変更される可能性があります。 実稼働アプリケーションでこれらの API を使用することは、サポートされていません。 v1.0 で API を使用できるかどうかを確認するには、Version セレクターを使用します。
educationAssignment オブジェクトを更新します。
これを行うことができるのは、クラスの教師だけです。 PATCH 要求を使用して 割り当ての状態を変更することはできません。
割り当ての状態を変更するには、発行アクションを使用します。
この API は、次の国内クラウド展開で使用できます。
| グローバル サービス |
米国政府機関 L4 |
米国政府機関 L5 (DOD) |
21Vianet が運営する中国 |
| ✅ |
❌ |
❌ |
❌ |
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。
アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、「アクセス許可のリファレンス」を参照してください。
| アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
| 委任 (職場または学校のアカウント) |
EduAssignments.ReadWriteBasic |
EduAssignments.ReadWrite |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
| アプリケーション |
EduAssignments.ReadWriteBasic.All |
EduAssignments.ReadWrite.All |
HTTP 要求
PATCH /education/classes/{class-id}/assignments/{assignment-id}
| ヘッダー |
値 |
| Authorization |
ベアラー {token}。 必須です。
認証と認可についての詳細をご覧ください。 |
| Content-Type |
application/json |
要求本文
要求本文で、更新する関連フィールドの値を指定します。 要求本文に含まれていない既存のプロパティは、以前の値を維持するか、他のプロパティ値の変更に基づいて再計算されます。 最適なパフォーマンスを得るために、変更されていない既存の値を含めないでください。
| プロパティ |
型 |
説明 |
| addedStudentAction |
文字列 |
課題の発行後に追加される学生の動作を制御します。 |
| addToCalendarAction |
educationAddToCalendarOptions |
課題の発行時に学生と教師の予定表に課題を追加するための割り当ての動作を制御する省略可能なフィールド。 使用可能な値: none、studentsAndPublisher、studentsAndTeamOwners、studentsOnly、unknownFutureValue。 既定値は、none です。 割り当てが published 状態の場合は変更できません。 |
| allowLateSubmissions |
ブール型 |
提出を期日より後に送信できるかどうかを指定します。 |
| allowStudentsToAddResourcesToSubmission |
ブール型 |
学生が申請にリソースを追加できるかどうか。 申請の唯一の項目が割り当てリソースの一覧からのものかどうかを示しました。 |
| assignDateTime |
DateTimeOffset |
課題を学生に公開する日付。 割り当てが発行されたときに編集できません。 |
| assignTo |
educationAssignmentRecipient |
課題を取得する学生。 |
| closeDateTime |
DateTimeOffset |
申請の割り当てが終了した日付。 これは省略可能なフィールドで、割り当てが AllowLateSubmissions を許可しない場合、または closeDateTime が dueDateTime と同じであるが、指定した場合は dueDateTime 以上である必要があります。 |
| displayName |
文字列 |
割り当ての名前。 |
| dueDateTime |
DateTimeOffset |
日付の割り当てが期限です。 |
| 採点 |
educationAssignmentGradeType |
課題の採点方法。 |
| 指示 |
itemBody |
課題と共に生徒に与えられる指示。 |
| languageTag |
文字列 |
割り当ての UI 通知を表示する言語を指定します。
languageTag が指定されていない場合、既定の言語はen-US。 省略可能。 |
| notificationChannelUrl |
文字列 |
割り当ての発行通知を投稿するチャネル。 割り当てが発行された後、チャネル URL の更新は許可されません。 assignTo 値が educationAssignmentClassRecipient の場合にのみ許可されます。 |
応答
成功した場合、このメソッドは応答コード 200 OK と、応答本文で更新された educationAssignment オブジェクトを返します。
例
要求
次の例は要求を示しています。
PATCH https://graph.microsoft.com/beta/education/classes/72a7baec-c3e9-4213-a850-f62de0adad5f/assignments/4679bc1b-90c5-45af-ae1a-d5357672ed39
Content-type: application/json
{
"displayName": "Reading and review test 09.03 #5",
"instructions": {
"contentType": "text",
"content": "Read chapter 5 and write your review"
},
"dueDateTime": "2021-09-10T00:00:00Z",
"addedStudentAction": "none",
"languageTag": "pt-BR",
"addToCalendarAction": "studentsAndPublisher"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new EducationAssignment
{
DisplayName = "Reading and review test 09.03 #5",
Instructions = new EducationItemBody
{
ContentType = BodyType.Text,
Content = "Read chapter 5 and write your review",
},
DueDateTime = DateTimeOffset.Parse("2021-09-10T00:00:00Z"),
AddedStudentAction = EducationAddedStudentAction.None,
LanguageTag = "pt-BR",
AddToCalendarAction = EducationAddToCalendarOptions.StudentsAndPublisher,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Education.Classes["{educationClass-id}"].Assignments["{educationAssignment-id}"].PatchAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
"time"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewEducationAssignment()
displayName := "Reading and review test 09.03 #5"
requestBody.SetDisplayName(&displayName)
instructions := graphmodels.NewEducationItemBody()
contentType := graphmodels.TEXT_BODYTYPE
instructions.SetContentType(&contentType)
content := "Read chapter 5 and write your review"
instructions.SetContent(&content)
requestBody.SetInstructions(instructions)
dueDateTime , err := time.Parse(time.RFC3339, "2021-09-10T00:00:00Z")
requestBody.SetDueDateTime(&dueDateTime)
addedStudentAction := graphmodels.NONE_EDUCATIONADDEDSTUDENTACTION
requestBody.SetAddedStudentAction(&addedStudentAction)
languageTag := "pt-BR"
requestBody.SetLanguageTag(&languageTag)
addToCalendarAction := graphmodels.STUDENTSANDPUBLISHER_EDUCATIONADDTOCALENDAROPTIONS
requestBody.SetAddToCalendarAction(&addToCalendarAction)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
assignments, err := graphClient.Education().Classes().ByEducationClassId("educationClass-id").Assignments().ByEducationAssignmentId("educationAssignment-id").Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
EducationAssignment educationAssignment = new EducationAssignment();
educationAssignment.setDisplayName("Reading and review test 09.03 #5");
EducationItemBody instructions = new EducationItemBody();
instructions.setContentType(BodyType.Text);
instructions.setContent("Read chapter 5 and write your review");
educationAssignment.setInstructions(instructions);
OffsetDateTime dueDateTime = OffsetDateTime.parse("2021-09-10T00:00:00Z");
educationAssignment.setDueDateTime(dueDateTime);
educationAssignment.setAddedStudentAction(EducationAddedStudentAction.None);
educationAssignment.setLanguageTag("pt-BR");
educationAssignment.setAddToCalendarAction(EducationAddToCalendarOptions.StudentsAndPublisher);
EducationAssignment result = graphClient.education().classes().byEducationClassId("{educationClass-id}").assignments().byEducationAssignmentId("{educationAssignment-id}").patch(educationAssignment);
const options = {
authProvider,
};
const client = Client.init(options);
const educationAssignment = {
displayName: 'Reading and review test 09.03 #5',
instructions: {
contentType: 'text',
content: 'Read chapter 5 and write your review'
},
dueDateTime: '2021-09-10T00:00:00Z',
addedStudentAction: 'none',
languageTag: 'pt-BR',
addToCalendarAction: 'studentsAndPublisher'
};
await client.api('/education/classes/72a7baec-c3e9-4213-a850-f62de0adad5f/assignments/4679bc1b-90c5-45af-ae1a-d5357672ed39')
.version('beta')
.update(educationAssignment);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\EducationAssignment;
use Microsoft\Graph\Beta\Generated\Models\EducationItemBody;
use Microsoft\Graph\Beta\Generated\Models\BodyType;
use Microsoft\Graph\Beta\Generated\Models\EducationAddedStudentAction;
use Microsoft\Graph\Beta\Generated\Models\EducationAddToCalendarOptions;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new EducationAssignment();
$requestBody->setDisplayName('Reading and review test 09.03 #5');
$instructions = new EducationItemBody();
$instructions->setContentType(new BodyType('text'));
$instructions->setContent('Read chapter 5 and write your review');
$requestBody->setInstructions($instructions);
$requestBody->setDueDateTime(new \DateTime('2021-09-10T00:00:00Z'));
$requestBody->setAddedStudentAction(new EducationAddedStudentAction('none'));
$requestBody->setLanguageTag('pt-BR');
$requestBody->setAddToCalendarAction(new EducationAddToCalendarOptions('studentsAndPublisher'));
$result = $graphServiceClient->education()->classes()->byEducationClassId('educationClass-id')->assignments()->byEducationAssignmentId('educationAssignment-id')->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Education
$params = @{
displayName = "Reading and review test 09.03 #5"
instructions = @{
contentType = "text"
content = "Read chapter 5 and write your review"
}
dueDateTime = [System.DateTime]::Parse("2021-09-10T00:00:00Z")
addedStudentAction = "none"
languageTag = "pt-BR"
addToCalendarAction = "studentsAndPublisher"
}
Update-MgBetaEducationClassAssignment -EducationClassId $educationClassId -EducationAssignmentId $educationAssignmentId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.education_assignment import EducationAssignment
from msgraph_beta.generated.models.education_item_body import EducationItemBody
from msgraph_beta.generated.models.body_type import BodyType
from msgraph_beta.generated.models.education_added_student_action import EducationAddedStudentAction
from msgraph_beta.generated.models.education_add_to_calendar_options import EducationAddToCalendarOptions
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = EducationAssignment(
display_name = "Reading and review test 09.03 #5",
instructions = EducationItemBody(
content_type = BodyType.Text,
content = "Read chapter 5 and write your review",
),
due_date_time = "2021-09-10T00:00:00Z",
added_student_action = EducationAddedStudentAction.None,
language_tag = "pt-BR",
add_to_calendar_action = EducationAddToCalendarOptions.StudentsAndPublisher,
)
result = await graph_client.education.classes.by_education_class_id('educationClass-id').assignments.by_education_assignment_id('educationAssignment-id').patch(request_body)
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#education/classes('72a7baec-c3e9-4213-a850-f62de0adad5f')/assignments/$entity",
"classId": "72a7baec-c3e9-4213-a850-f62de0adad5f",
"displayName": "Reading and review test 09.03 #5",
"closeDateTime": null,
"dueDateTime": "2021-09-10T00:00:00Z",
"assignDateTime": null,
"assignedDateTime": null,
"allowLateSubmissions": true,
"resourcesFolderUrl": null,
"createdDateTime": "2021-09-03T23:57:14.6088791Z",
"lastModifiedDateTime": "2021-09-04T15:01:35.3361649Z",
"allowStudentsToAddResourcesToSubmission": true,
"status": "draft",
"notificationChannelUrl": null,
"webUrl": "https://teams.microsoft.com/l/entity/66aeee93-507d-479a-a3ef-8f494af43945/classroom?context=%7B%22subEntityId%22%3A%22%7B%5C%22version%5C%22%3A%5C%221.0%5C%22,%5C%22config%5C%22%3A%7B%5C%22classes%5C%22%3A%5B%7B%5C%22id%5C%22%3A%5C%2272a7baec-c3e9-4213-a850-f62de0adad5f%5C%22,%5C%22displayName%5C%22%3Anull,%5C%22assignmentIds%5C%22%3A%5B%5C%224679bc1b-90c5-45af-ae1a-d5357672ed39%5C%22%5D%7D%5D%7D,%5C%22action%5C%22%3A%5C%22navigate%5C%22,%5C%22view%5C%22%3A%5C%22assignment-viewer%5C%22%7D%22,%22channelId%22%3Anull%7D",
"addToCalendarAction": "studentsAndPublisher",
"addedStudentAction": "none",
"languageTag": "pt-BR",
"id": "4679bc1b-90c5-45af-ae1a-d5357672ed39",
"instructions": {
"content": "Read chapter 5 and write your review",
"contentType": "text"
},
"grading": {
"@odata.type": "#microsoft.graph.educationAssignmentPointsGradeType",
"maxPoints": 50
},
"assignTo": {
"@odata.type": "#microsoft.graph.educationAssignmentClassRecipient"
},
"createdBy": {
"application": null,
"device": null,
"user": {
"id": "f3a5344e-dbde-48b0-be24-b5b62a243836",
"displayName": null
}
},
"lastModifiedBy": {
"application": null,
"device": null,
"user": {
"id": "f3a5344e-dbde-48b0-be24-b5b62a243836",
"displayName": null
}
}
}
関連コンテンツ