Nur Lehrer in einem Kurs können eine Aufgabe erstellen. Aufgaben beginnen im Entwurf status, was bedeutet, dass die Kursteilnehmer die Aufgabe erst sehen können, wenn sie veröffentlicht wurde.
Wählen Sie für diese API die Als am wenigsten privilegierten Berechtigungen gekennzeichneten Berechtigungen aus. Verwenden Sie nur dann eine Berechtigung mit höheren Berechtigungen , wenn dies für Ihre App erforderlich ist. Ausführliche Informationen zu delegierten Berechtigungen und Anwendungsberechtigungen finden Sie unter Berechtigungstypen. Weitere Informationen zu diesen Berechtigungen finden Sie in der Berechtigungsreferenz.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new EducationAssignment
{
DueDateTime = DateTimeOffset.Parse("2022-09-16T00:00:00Z"),
DisplayName = "Reading test 09.14",
Instructions = new EducationItemBody
{
ContentType = BodyType.Text,
Content = "Read chapter 4",
},
Grading = new EducationAssignmentPointsGradeType
{
OdataType = "#microsoft.graph.educationAssignmentPointsGradeType",
MaxPoints = 50f,
},
AssignTo = new EducationAssignmentClassRecipient
{
OdataType = "#microsoft.graph.educationAssignmentClassRecipient",
},
Status = EducationAssignmentStatus.Draft,
AllowStudentsToAddResourcesToSubmission = true,
};
// 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.PostAsync(requestBody);
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
EducationAssignment educationAssignment = new EducationAssignment();
OffsetDateTime dueDateTime = OffsetDateTime.parse("2022-09-16T00:00:00Z");
educationAssignment.setDueDateTime(dueDateTime);
educationAssignment.setDisplayName("Reading test 09.14");
EducationItemBody instructions = new EducationItemBody();
instructions.setContentType(BodyType.Text);
instructions.setContent("Read chapter 4");
educationAssignment.setInstructions(instructions);
EducationAssignmentPointsGradeType grading = new EducationAssignmentPointsGradeType();
grading.setOdataType("#microsoft.graph.educationAssignmentPointsGradeType");
grading.setMaxPoints(50f);
educationAssignment.setGrading(grading);
EducationAssignmentClassRecipient assignTo = new EducationAssignmentClassRecipient();
assignTo.setOdataType("#microsoft.graph.educationAssignmentClassRecipient");
educationAssignment.setAssignTo(assignTo);
educationAssignment.setStatus(EducationAssignmentStatus.Draft);
educationAssignment.setAllowStudentsToAddResourcesToSubmission(true);
EducationAssignment result = graphClient.education().classes().byEducationClassId("{educationClass-id}").assignments().post(educationAssignment);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\EducationAssignment;
use Microsoft\Graph\Generated\Models\EducationItemBody;
use Microsoft\Graph\Generated\Models\ContentType;
use Microsoft\Graph\Generated\Models\EducationAssignmentPointsGradeType;
use Microsoft\Graph\Generated\Models\EducationAssignmentClassRecipient;
use Microsoft\Graph\Generated\Models\Status;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new EducationAssignment();
$requestBody->setDueDateTime(new \DateTime('2022-09-16T00:00:00Z'));
$requestBody->setDisplayName('Reading test 09.14');
$instructions = new EducationItemBody();
$instructions->setContentType(new BodyType('text'));
$instructions->setContent('Read chapter 4');
$requestBody->setInstructions($instructions);
$grading = new EducationAssignmentPointsGradeType();
$grading->setOdataType('#microsoft.graph.educationAssignmentPointsGradeType');
$grading->setMaxPoints(50);
$requestBody->setGrading($grading);
$assignTo = new EducationAssignmentClassRecipient();
$assignTo->setOdataType('#microsoft.graph.educationAssignmentClassRecipient');
$requestBody->setAssignTo($assignTo);
$requestBody->setStatus(new EducationAssignmentStatus('draft'));
$requestBody->setAllowStudentsToAddResourcesToSubmission(true);
$result = $graphServiceClient->education()->classes()->byEducationClassId('educationClass-id')->assignments()->post($requestBody)->wait();
Bald verfügbar: Im Laufe des Jahres 2024 werden wir GitHub-Tickets als Feedbackmechanismus für Inhalte auslaufen lassen und es durch ein neues Feedbacksystem ersetzen. Weitere Informationen finden Sie unter: https://aka.ms/ContentUserFeedback.