Créez une ressource de commentaires pour une soumission. Seul un enseignant peut effectuer cette opération.
Pour créer une ressource basée sur un fichier, chargez le fichier dans le dossier des ressources de commentaires associé à l’affectation. Si le fichier n’existe pas ou ne se trouve pas dans ce dossier, la POST demande échoue.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new EducationFeedbackResourceOutcome
{
OdataType = "#microsoft.graph.educationFeedbackResourceOutcome",
FeedbackResource = new EducationWordResource
{
OdataType = "#microsoft.graph.educationWordResource",
DisplayName = "Document1.docx",
},
};
// 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.PostAsync(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()
feedbackResource := graphmodels.NewEducationWordResource()
displayName := "Document1.docx"
feedbackResource.SetDisplayName(&displayName)
requestBody.SetFeedbackResource(feedbackResource)
// 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().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
EducationFeedbackResourceOutcome educationOutcome = new EducationFeedbackResourceOutcome();
educationOutcome.setOdataType("#microsoft.graph.educationFeedbackResourceOutcome");
EducationWordResource feedbackResource = new EducationWordResource();
feedbackResource.setOdataType("#microsoft.graph.educationWordResource");
feedbackResource.setDisplayName("Document1.docx");
educationOutcome.setFeedbackResource(feedbackResource);
EducationOutcome result = graphClient.education().classes().byEducationClassId("{educationClass-id}").assignments().byEducationAssignmentId("{educationAssignment-id}").submissions().byEducationSubmissionId("{educationSubmission-id}").outcomes().post(educationOutcome);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\EducationFeedbackResourceOutcome;
use Microsoft\Graph\Generated\Models\EducationWordResource;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new EducationFeedbackResourceOutcome();
$requestBody->setOdataType('#microsoft.graph.educationFeedbackResourceOutcome');
$feedbackResource = new EducationWordResource();
$feedbackResource->setOdataType('#microsoft.graph.educationWordResource');
$feedbackResource->setDisplayName('Document1.docx');
$requestBody->setFeedbackResource($feedbackResource);
$result = $graphServiceClient->education()->classes()->byEducationClassId('educationClass-id')->assignments()->byEducationAssignmentId('educationAssignment-id')->submissions()->byEducationSubmissionId('educationSubmission-id')->outcomes()->post($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_feedback_resource_outcome import EducationFeedbackResourceOutcome
from msgraph.generated.models.education_word_resource import EducationWordResource
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = EducationFeedbackResourceOutcome(
odata_type = "#microsoft.graph.educationFeedbackResourceOutcome",
feedback_resource = EducationWordResource(
odata_type = "#microsoft.graph.educationWordResource",
display_name = "Document1.docx",
),
)
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.post(request_body)