Dans le corps de la demande, fournissez uniquement les valeurs des champs que vous souhaitez mettre à jour.
Les propriétés existantes qui ne sont pas incluses dans le corps de la demande conserveront leurs valeurs précédentes ou seront recalculées en fonction des modifications apportées à d’autres valeurs des propriétés. Pour de meilleures performances, n’incluez pas de valeurs existantes qui n’ont pas été modifiées.
L’objet educationOutcome sera l’un des types dérivés suivants : educationPointsOutcome, educationFeedbackOutcome ou educationRubricOutcome. Fournissez les propriétés spécifiques pertinentes pour le type de résultat que vous mettez à jour.
Tous les types de résultats dérivés ont une propriété régulière et une propriété « publiée » appropriée à ce type de résultat ; par exemple, points et points publiés, commentaires et publishedFeedback. Ne mettez pas à jour la propriété « publiée » ; il est destiné à un usage interne. Par exemple, pour affecter des points à un educationPointsOutcome, mettez à jour la propriété points , mais ne mettez pas à jour les points publiés.
Réponse
Si elle réussit, cette méthode renvoie un 200 OK code de réponse et un objet educationOutcome mis à jour dans le corps de la réponse.
Si pointsGradeType et points sont mis à jour vers une valeur négative ou infinie, la méthode retourne un 400 message d’erreur.
HTTP/1.1 400 Bad Request
Content-type: application/json
{
"error": {
"code": "badRequest",
"message": "Bad request.",
"innerError": {
"code": "invalidGrading",
"message": "Points must be less than 9999999 when using PointsGradeType."
}
}
}
Si un ID de résultat non valide est spécifié, une 404 Not Found erreur est retournée.
HTTP/1.1 404 Not Found
Content-type: application/json
{
"error": {
"code": "20241",
"message": "Entity not found. Outcome id: 05d0f76c-1dfa-4442-926c-1b094828b505"
}
}
Exemples
Exemple 1 : Mettre à jour un résultat de commentaires
Demande
L’exemple suivant montre une demande de mise à jour d’un résultat de commentaires.
PATCH https://graph.microsoft.com/v1.0/education/classes/acdefc6b-2dc6-4e71-b1e9-6d9810ab1793/assignments/cf6005fc-9e13-44a2-a6ac-a53322006454/submissions/d1bee293-d8bb-48d4-af3e-c8cb0e3c7fe7/outcomes/9c0f2850-ff8f-4fd6-b3ac-e23077b59141
Content-type: application/json
{
"@odata.type":"#microsoft.graph.educationFeedbackOutcome",
"feedback":{
"text":{
"content":"This is feedback for the assignment as a whole.",
"contentType":"text"
}
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new EducationFeedbackOutcome
{
OdataType = "#microsoft.graph.educationFeedbackOutcome",
Feedback = new EducationFeedback
{
Text = new EducationItemBody
{
Content = "This is feedback for the assignment as a whole.",
ContentType = BodyType.Text,
},
},
};
// 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}"].Submissions["{educationSubmission-id}"].Outcomes["{educationOutcome-id}"].PatchAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewEducationOutcome()
feedback := graphmodels.NewEducationFeedback()
text := graphmodels.NewEducationItemBody()
content := "This is feedback for the assignment as a whole."
text.SetContent(&content)
contentType := graphmodels.TEXT_BODYTYPE
text.SetContentType(&contentType)
feedback.SetText(text)
requestBody.SetFeedback(feedback)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
outcomes, err := graphClient.Education().Classes().ByEducationClassId("educationClass-id").Assignments().ByEducationAssignmentId("educationAssignment-id").Submissions().ByEducationSubmissionId("educationSubmission-id").Outcomes().ByEducationOutcomeId("educationOutcome-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);
EducationFeedbackOutcome educationOutcome = new EducationFeedbackOutcome();
educationOutcome.setOdataType("#microsoft.graph.educationFeedbackOutcome");
EducationFeedback feedback = new EducationFeedback();
EducationItemBody text = new EducationItemBody();
text.setContent("This is feedback for the assignment as a whole.");
text.setContentType(BodyType.Text);
feedback.setText(text);
educationOutcome.setFeedback(feedback);
EducationOutcome result = graphClient.education().classes().byEducationClassId("{educationClass-id}").assignments().byEducationAssignmentId("{educationAssignment-id}").submissions().byEducationSubmissionId("{educationSubmission-id}").outcomes().byEducationOutcomeId("{educationOutcome-id}").patch(educationOutcome);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\EducationFeedbackOutcome;
use Microsoft\Graph\Generated\Models\EducationFeedback;
use Microsoft\Graph\Generated\Models\EducationItemBody;
use Microsoft\Graph\Generated\Models\BodyType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new EducationFeedbackOutcome();
$requestBody->setOdataType('#microsoft.graph.educationFeedbackOutcome');
$feedback = new EducationFeedback();
$feedbackText = new EducationItemBody();
$feedbackText->setContent('This is feedback for the assignment as a whole.');
$feedbackText->setContentType(new BodyType('text'));
$feedback->setText($feedbackText);
$requestBody->setFeedback($feedback);
$result = $graphServiceClient->education()->classes()->byEducationClassId('educationClass-id')->assignments()->byEducationAssignmentId('educationAssignment-id')->submissions()->byEducationSubmissionId('educationSubmission-id')->outcomes()->byEducationOutcomeId('educationOutcome-id')->patch($requestBody)->wait();
from msgraph import GraphServiceClient
from msgraph.generated.models.education_feedback_outcome import EducationFeedbackOutcome
from msgraph.generated.models.education_feedback import EducationFeedback
from msgraph.generated.models.education_item_body import EducationItemBody
from msgraph.generated.models.body_type import BodyType
graph_client = GraphServiceClient(credentials, scopes)
request_body = EducationFeedbackOutcome(
odata_type = "#microsoft.graph.educationFeedbackOutcome",
feedback = EducationFeedback(
text = EducationItemBody(
content = "This is feedback for the assignment as a whole.",
content_type = BodyType.Text,
),
),
)
result = await graph_client.education.classes.by_education_class_id('educationClass-id').assignments.by_education_assignment_id('educationAssignment-id').submissions.by_education_submission_id('educationSubmission-id').outcomes.by_education_outcome_id('educationOutcome-id').patch(request_body)
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new EducationPointsOutcome
{
OdataType = "#microsoft.graph.educationPointsOutcome",
Points = new EducationAssignmentPointsGrade
{
OdataType = "#microsoft.graph.educationAssignmentPointsGrade",
Points = 85.0f,
},
};
// 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}"].Submissions["{educationSubmission-id}"].Outcomes["{educationOutcome-id}"].PatchAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewEducationOutcome()
points := graphmodels.NewEducationAssignmentPointsGrade()
points := float32(85.0)
points.SetPoints(&points)
requestBody.SetPoints(points)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
outcomes, err := graphClient.Education().Classes().ByEducationClassId("educationClass-id").Assignments().ByEducationAssignmentId("educationAssignment-id").Submissions().ByEducationSubmissionId("educationSubmission-id").Outcomes().ByEducationOutcomeId("educationOutcome-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);
EducationPointsOutcome educationOutcome = new EducationPointsOutcome();
educationOutcome.setOdataType("#microsoft.graph.educationPointsOutcome");
EducationAssignmentPointsGrade points = new EducationAssignmentPointsGrade();
points.setOdataType("#microsoft.graph.educationAssignmentPointsGrade");
points.setPoints(85.0f);
educationOutcome.setPoints(points);
EducationOutcome result = graphClient.education().classes().byEducationClassId("{educationClass-id}").assignments().byEducationAssignmentId("{educationAssignment-id}").submissions().byEducationSubmissionId("{educationSubmission-id}").outcomes().byEducationOutcomeId("{educationOutcome-id}").patch(educationOutcome);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\EducationPointsOutcome;
use Microsoft\Graph\Generated\Models\EducationAssignmentPointsGrade;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new EducationPointsOutcome();
$requestBody->setOdataType('#microsoft.graph.educationPointsOutcome');
$points = new EducationAssignmentPointsGrade();
$points->setOdataType('#microsoft.graph.educationAssignmentPointsGrade');
$points->setPoints(85.0);
$requestBody->setPoints($points);
$result = $graphServiceClient->education()->classes()->byEducationClassId('educationClass-id')->assignments()->byEducationAssignmentId('educationAssignment-id')->submissions()->byEducationSubmissionId('educationSubmission-id')->outcomes()->byEducationOutcomeId('educationOutcome-id')->patch($requestBody)->wait();
PATCH https://graph.microsoft.com/v1.0/education/classes/acdefc6b-2dc6-4e71-b1e9-6d9810ab1793/assignments/cf6005fc-9e13-44a2-a6ac-a53322006454/submissions/d1bee293-d8bb-48d4-af3e-c8cb0e3c7fe7/outcomes/9c0f2850-ff8f-4fd6-b3ac-e23077b59141
Content-type: application/json
{
"@odata.type":"#microsoft.graph.educationRubricOutcome",
"rubricQualityFeedback":[
{
"qualityId":"9a145aa8-f3d9-43a1-8f77-5387ff0693f2",
"feedback":{
"content":"This is feedback specific to the first quality of the rubric.",
"contentType":"text"
}
},
{
"qualityId":"d2331fb2-2761-402e-8de6-93e0afaa076e",
"feedback":{
"content":"This is feedback specific to the second quality of the rubric.",
"contentType":"text"
}
}
],
"rubricQualitySelectedLevels":[
{
"qualityId":"9a145aa8-f3d9-43a1-8f77-5387ff0693f2",
"columnId":"4fb17a1d-5681-46c2-a295-4e305c3eae23"
},
{
"qualityId":"d2331fb2-2761-402e-8de6-93e0afaa076e",
"columnId":"aac076bf-51ba-48c5-a2e0-ee235b0b9740"
}
]
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new EducationRubricOutcome
{
OdataType = "#microsoft.graph.educationRubricOutcome",
RubricQualityFeedback = new List<RubricQualityFeedbackModel>
{
new RubricQualityFeedbackModel
{
QualityId = "9a145aa8-f3d9-43a1-8f77-5387ff0693f2",
Feedback = new EducationItemBody
{
Content = "This is feedback specific to the first quality of the rubric.",
ContentType = BodyType.Text,
},
},
new RubricQualityFeedbackModel
{
QualityId = "d2331fb2-2761-402e-8de6-93e0afaa076e",
Feedback = new EducationItemBody
{
Content = "This is feedback specific to the second quality of the rubric.",
ContentType = BodyType.Text,
},
},
},
RubricQualitySelectedLevels = new List<RubricQualitySelectedColumnModel>
{
new RubricQualitySelectedColumnModel
{
QualityId = "9a145aa8-f3d9-43a1-8f77-5387ff0693f2",
ColumnId = "4fb17a1d-5681-46c2-a295-4e305c3eae23",
},
new RubricQualitySelectedColumnModel
{
QualityId = "d2331fb2-2761-402e-8de6-93e0afaa076e",
ColumnId = "aac076bf-51ba-48c5-a2e0-ee235b0b9740",
},
},
};
// 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}"].Submissions["{educationSubmission-id}"].Outcomes["{educationOutcome-id}"].PatchAsync(requestBody);
mgc education classes assignments submissions outcomes patch --education-class-id {educationClass-id} --education-assignment-id {educationAssignment-id} --education-submission-id {educationSubmission-id} --education-outcome-id {educationOutcome-id} --body '{\
"@odata.type":"#microsoft.graph.educationRubricOutcome",\
"rubricQualityFeedback":[\
{\
"qualityId":"9a145aa8-f3d9-43a1-8f77-5387ff0693f2",\
"feedback":{\
"content":"This is feedback specific to the first quality of the rubric.",\
"contentType":"text"\
}\
},\
{\
"qualityId":"d2331fb2-2761-402e-8de6-93e0afaa076e",\
"feedback":{\
"content":"This is feedback specific to the second quality of the rubric.",\
"contentType":"text"\
}\
}\
],\
"rubricQualitySelectedLevels":[\
{\
"qualityId":"9a145aa8-f3d9-43a1-8f77-5387ff0693f2",\
"columnId":"4fb17a1d-5681-46c2-a295-4e305c3eae23"\
},\
{\
"qualityId":"d2331fb2-2761-402e-8de6-93e0afaa076e",\
"columnId":"aac076bf-51ba-48c5-a2e0-ee235b0b9740"\
}\
]\
}\
'
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
EducationRubricOutcome educationOutcome = new EducationRubricOutcome();
educationOutcome.setOdataType("#microsoft.graph.educationRubricOutcome");
LinkedList<RubricQualityFeedbackModel> rubricQualityFeedback = new LinkedList<RubricQualityFeedbackModel>();
RubricQualityFeedbackModel rubricQualityFeedbackModel = new RubricQualityFeedbackModel();
rubricQualityFeedbackModel.setQualityId("9a145aa8-f3d9-43a1-8f77-5387ff0693f2");
EducationItemBody feedback = new EducationItemBody();
feedback.setContent("This is feedback specific to the first quality of the rubric.");
feedback.setContentType(BodyType.Text);
rubricQualityFeedbackModel.setFeedback(feedback);
rubricQualityFeedback.add(rubricQualityFeedbackModel);
RubricQualityFeedbackModel rubricQualityFeedbackModel1 = new RubricQualityFeedbackModel();
rubricQualityFeedbackModel1.setQualityId("d2331fb2-2761-402e-8de6-93e0afaa076e");
EducationItemBody feedback1 = new EducationItemBody();
feedback1.setContent("This is feedback specific to the second quality of the rubric.");
feedback1.setContentType(BodyType.Text);
rubricQualityFeedbackModel1.setFeedback(feedback1);
rubricQualityFeedback.add(rubricQualityFeedbackModel1);
educationOutcome.setRubricQualityFeedback(rubricQualityFeedback);
LinkedList<RubricQualitySelectedColumnModel> rubricQualitySelectedLevels = new LinkedList<RubricQualitySelectedColumnModel>();
RubricQualitySelectedColumnModel rubricQualitySelectedColumnModel = new RubricQualitySelectedColumnModel();
rubricQualitySelectedColumnModel.setQualityId("9a145aa8-f3d9-43a1-8f77-5387ff0693f2");
rubricQualitySelectedColumnModel.setColumnId("4fb17a1d-5681-46c2-a295-4e305c3eae23");
rubricQualitySelectedLevels.add(rubricQualitySelectedColumnModel);
RubricQualitySelectedColumnModel rubricQualitySelectedColumnModel1 = new RubricQualitySelectedColumnModel();
rubricQualitySelectedColumnModel1.setQualityId("d2331fb2-2761-402e-8de6-93e0afaa076e");
rubricQualitySelectedColumnModel1.setColumnId("aac076bf-51ba-48c5-a2e0-ee235b0b9740");
rubricQualitySelectedLevels.add(rubricQualitySelectedColumnModel1);
educationOutcome.setRubricQualitySelectedLevels(rubricQualitySelectedLevels);
EducationOutcome result = graphClient.education().classes().byEducationClassId("{educationClass-id}").assignments().byEducationAssignmentId("{educationAssignment-id}").submissions().byEducationSubmissionId("{educationSubmission-id}").outcomes().byEducationOutcomeId("{educationOutcome-id}").patch(educationOutcome);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\EducationRubricOutcome;
use Microsoft\Graph\Generated\Models\RubricQualityFeedbackModel;
use Microsoft\Graph\Generated\Models\EducationItemBody;
use Microsoft\Graph\Generated\Models\BodyType;
use Microsoft\Graph\Generated\Models\RubricQualitySelectedColumnModel;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new EducationRubricOutcome();
$requestBody->setOdataType('#microsoft.graph.educationRubricOutcome');
$rubricQualityFeedbackRubricQualityFeedbackModel1 = new RubricQualityFeedbackModel();
$rubricQualityFeedbackRubricQualityFeedbackModel1->setQualityId('9a145aa8-f3d9-43a1-8f77-5387ff0693f2');
$rubricQualityFeedbackRubricQualityFeedbackModel1Feedback = new EducationItemBody();
$rubricQualityFeedbackRubricQualityFeedbackModel1Feedback->setContent('This is feedback specific to the first quality of the rubric.');
$rubricQualityFeedbackRubricQualityFeedbackModel1Feedback->setContentType(new BodyType('text'));
$rubricQualityFeedbackRubricQualityFeedbackModel1->setFeedback($rubricQualityFeedbackRubricQualityFeedbackModel1Feedback);
$rubricQualityFeedbackArray []= $rubricQualityFeedbackRubricQualityFeedbackModel1;
$rubricQualityFeedbackRubricQualityFeedbackModel2 = new RubricQualityFeedbackModel();
$rubricQualityFeedbackRubricQualityFeedbackModel2->setQualityId('d2331fb2-2761-402e-8de6-93e0afaa076e');
$rubricQualityFeedbackRubricQualityFeedbackModel2Feedback = new EducationItemBody();
$rubricQualityFeedbackRubricQualityFeedbackModel2Feedback->setContent('This is feedback specific to the second quality of the rubric.');
$rubricQualityFeedbackRubricQualityFeedbackModel2Feedback->setContentType(new BodyType('text'));
$rubricQualityFeedbackRubricQualityFeedbackModel2->setFeedback($rubricQualityFeedbackRubricQualityFeedbackModel2Feedback);
$rubricQualityFeedbackArray []= $rubricQualityFeedbackRubricQualityFeedbackModel2;
$requestBody->setRubricQualityFeedback($rubricQualityFeedbackArray);
$rubricQualitySelectedLevelsRubricQualitySelectedColumnModel1 = new RubricQualitySelectedColumnModel();
$rubricQualitySelectedLevelsRubricQualitySelectedColumnModel1->setQualityId('9a145aa8-f3d9-43a1-8f77-5387ff0693f2');
$rubricQualitySelectedLevelsRubricQualitySelectedColumnModel1->setColumnId('4fb17a1d-5681-46c2-a295-4e305c3eae23');
$rubricQualitySelectedLevelsArray []= $rubricQualitySelectedLevelsRubricQualitySelectedColumnModel1;
$rubricQualitySelectedLevelsRubricQualitySelectedColumnModel2 = new RubricQualitySelectedColumnModel();
$rubricQualitySelectedLevelsRubricQualitySelectedColumnModel2->setQualityId('d2331fb2-2761-402e-8de6-93e0afaa076e');
$rubricQualitySelectedLevelsRubricQualitySelectedColumnModel2->setColumnId('aac076bf-51ba-48c5-a2e0-ee235b0b9740');
$rubricQualitySelectedLevelsArray []= $rubricQualitySelectedLevelsRubricQualitySelectedColumnModel2;
$requestBody->setRubricQualitySelectedLevels($rubricQualitySelectedLevelsArray);
$result = $graphServiceClient->education()->classes()->byEducationClassId('educationClass-id')->assignments()->byEducationAssignmentId('educationAssignment-id')->submissions()->byEducationSubmissionId('educationSubmission-id')->outcomes()->byEducationOutcomeId('educationOutcome-id')->patch($requestBody)->wait();
Remarque : l’objet de réponse affiché ci-après peut être raccourci pour plus de lisibilité.
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.type": "#microsoft.graph.educationRubricOutcome",
"id": "65a46d78-1a2b-4a7e-bcf8-78a22ac2611b",
"rubricQualityFeedback": [
{
"qualityId": "9a145aa8-f3d9-43a1-8f77-5387ff0693f2",
"feedback": {
"content": "This is feedback specific to the first quality of the rubric.",
"contentType": "text"
}
},
{
"qualityId": "d2331fb2-2761-402e-8de6-93e0afaa076e",
"feedback": {
"content": "This is feedback specific to the second quality of the rubric.",
"contentType": "text"
}
}
],
"rubricQualitySelectedLevels": [
{
"qualityId": "9a145aa8-f3d9-43a1-8f77-5387ff0693f2",
"columnId": "4fb17a1d-5681-46c2-a295-4e305c3eae23"
},
{
"qualityId": "d2331fb2-2761-402e-8de6-93e0afaa076e",
"columnId": "aac076bf-51ba-48c5-a2e0-ee235b0b9740"
}
]
}
Bientôt disponible : Tout au long de 2024, nous allons supprimer progressivement GitHub Issues comme mécanisme de commentaires pour le contenu et le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultez https://aka.ms/ContentUserFeedback.