Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
In the request body, supply only the values of the fields you want to update.
Existing properties that aren't included in the request body maintains their previous values or be recalculated based on changes to other property values. For best performance, don't include existing values that haven't changed.
Property
Type
Description
addedStudentAction
String
Describes if the assignment should be distributed to students who are added after the assignment publication date.
addToCalendarAction
educationAddToCalendarOptions
Optional field to control the assignment behavior for adding assignments to students' and teachers' calendars when the assignment is published. The possible values are: none, studentsAndPublisher, studentsAndTeamOwners, unknownFutureValue, studentsOnly. You must use the Prefer: include - unknown -enum-members request header to get the following value(s) in this evolvable enum: studentsOnly. Optional.
allowLateSubmissions
Boolean
Whether students can send submission after the due date.
allowStudentsToAddResourcesToSubmission
Boolean
Whether a student can add resources to a submission or not. Also, indicates whether all resources in the submission correspond to the assignment resource list.
assignDateTime
DateTimeOffset
Indicates the date to publish the assignment to students. Can't be edited when the assignment is published.
Date when the assignment is closed for submissions. This is an optional field that can be null if the assignment doesn't allowLateSubmissions or the closeDateTime is the same as the dueDateTime but if specified, it must be greater than or equal to the dueDateTime.
Instructions to be given to the students along with the assignment.
notificationChannelUrl
String
The channel to communicate notifications related to the assignment. To change the URL, set the assignTo value to educationAssignmentClassRecipient. The channel URL can't change after the publication of the assignment.
Response
If successful, this method returns a 200 OK response code and an updated educationAssignment object in the response body.
PATCH https://graph.microsoft.com/v1.0/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"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.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,
};
// 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 $v1.*
// Dependencies
import (
"context"
"time"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-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)
// 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 result = graphClient.education().classes().byEducationClassId("{educationClass-id}").assignments().byEducationAssignmentId("{educationAssignment-id}").patch(educationAssignment);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\EducationAssignment;
use Microsoft\Graph\Generated\Models\EducationItemBody;
use Microsoft\Graph\Generated\Models\BodyType;
use Microsoft\Graph\Generated\Models\EducationAddedStudentAction;
$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'));
$result = $graphServiceClient->education()->classes()->byEducationClassId('educationClass-id')->assignments()->byEducationAssignmentId('educationAssignment-id')->patch($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.education_assignment import EducationAssignment
from msgraph.generated.models.education_item_body import EducationItemBody
from msgraph.generated.models.body_type import BodyType
from msgraph.generated.models.education_added_student_action import EducationAddedStudentAction
# 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,
)
result = await graph_client.education.classes.by_education_class_id('educationClass-id').assignments.by_education_assignment_id('educationAssignment-id').patch(request_body)