No corpo da solicitação, fornece apenas os valores dos campos que você deseja atualizar.
Propriedades existentes que não estão incluídas no corpo da solicitação terão seus valores anteriores mantidos ou serão recalculadas com base nas alterações a outros valores de propriedade. Para alcançar o melhor desempenho, não inclua valores existentes que não foram alterados.
O objeto educationOutcome será um dos seguintes tipos derivados: educationPointsOutcome, educationFeedbackOutcome ou educationRubricOutcome. Fornecer as propriedades específicas relevantes para o tipo de resultado que você está atualizando.
Todos os tipos de resultado derivados têm uma propriedade regular e "publicada" apropriada para esse tipo de resultado; por exemplo, pontos epublishedPoints, comentários e publishedFeedback. Não atualize a propriedade "publicado"; é para uso interno. Por exemplo, para atribuir pontos a um educationPointsOutcome, atualize a propriedade points, mas não atualize publishedPoints.
Resposta
Se tiver êxito, este método retornará um código de resposta e um 200 OKobjeto educationOutcome atualizado no corpo da resposta.
Se pointsGradeType e points são atualizados para um valor negativo ou infinito, o método retorna uma 400 mensagem de erro.
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."
}
}
}
Se uma ID de resultado inválida for especificada, um 404 Not Found erro será retornado.
HTTP/1.1 404 Not Found
Content-type: application/json
{
"error": {
"code": "20241",
"message": "Entity not found. Outcome id: 05d0f76c-1dfa-4442-926c-1b094828b505"
}
}
Exemplos
Exemplo 1: atualizar um resultado de comentários
Solicitação
O exemplo a seguir mostra uma solicitação para atualizar um resultado de feedback.
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"
}
}
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var educationOutcome = new EducationFeedbackOutcome
{
Feedback = new EducationFeedback
{
Text = new EducationItemBody
{
Content = "This is feedback for the assignment as a whole.",
ContentType = BodyType.Text
}
}
};
await graphClient.Education.Classes["{educationClass-id}"].Assignments["{educationAssignment-id}"].Submissions["{educationSubmission-id}"].Outcomes["{educationOutcome-id}"]
.Request()
.UpdateAsync(educationOutcome);
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
EducationFeedbackOutcome educationOutcome = new EducationFeedbackOutcome();
EducationFeedback feedback = new EducationFeedback();
EducationItemBody text = new EducationItemBody();
text.content = "This is feedback for the assignment as a whole.";
text.contentType = BodyType.TEXT;
feedback.text = text;
educationOutcome.feedback = feedback;
graphClient.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")
.buildRequest()
.patch(educationOutcome);
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"
}
]
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var educationOutcome = new 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"
}
}
};
await graphClient.Education.Classes["{educationClass-id}"].Assignments["{educationAssignment-id}"].Submissions["{educationSubmission-id}"].Outcomes["{educationOutcome-id}"]
.Request()
.UpdateAsync(educationOutcome);
Observação: o objeto de resposta mostrado aqui pode ser encurtado para legibilidade.
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"
}
]
}