次の方法で共有


educationassignment を更新する

名前空間: 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 課題の発行時に学生と教師の予定表に課題を追加するための割り当ての動作を制御する省略可能なフィールド。 使用可能な値: nonestudentsAndPublisherstudentsAndTeamOwnersstudentsOnlyunknownFutureValue。 既定値は、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"
}

応答

次の例は応答を示しています。

注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。

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
        }
    }
}