Auflisten von Kursaufgaben

Namespace: microsoft.graph

Wichtig

Die APIs unter der /beta Version in Microsoft Graph können sich ändern. Die Verwendung dieser APIs in Produktionsanwendungen wird nicht unterstützt. Um festzustellen, ob eine API in v1.0 verfügbar ist, verwenden Sie die Version Selektor.

Rufen Sie eine Liste der educationAssignment-Objekte ab. Nur Lehrer, Schüler/Studenten und Anwendungen mit Anwendungsberechtigungen können diesen Vorgang ausführen.

Ein Lehrer oder eine Anwendung, die mit Anwendungsberechtigungen ausgeführt wird, kann alle Aufgabenobjekte für den Kurs sehen. Kursteilnehmer können nur Aufgaben sehen, die ihnen zugewiesen sind.

API-Verfügbarkeit

Diese API ist in den folgenden nationalen Cloudbereitstellungen verfügbar.

Weltweiter Service US Government L4 US Government L5 (DOD) China, betrieben von 21Vianet
✅ ❌ ❌ ❌

Berechtigungen

Wählen Sie die Berechtigungen aus, die für diese API als am wenigsten privilegiert markiert sind. Verwenden Sie eine höhere Berechtigung oder Berechtigungen nur, wenn Ihre App dies erfordert. Ausführliche Informationen zu delegierten Berechtigungen und Anwendungsberechtigungen finden Sie unter Berechtigungstypen. Weitere Informationen zu diesen Berechtigungen finden Sie in der Berechtigungsreferenz.

Berechtigungstyp Berechtigungen mit den geringsten Berechtigungen Berechtigungen mit höheren Berechtigungen
Delegiert (Geschäfts-, Schul- oder Unikonto) EduAssignments.ReadBasic EduAssignments.Read, EduAssignments.ReadWrite, EduAssignments.ReadWriteBasic
Delegiert (persönliches Microsoft-Konto) Nicht unterstützt Nicht unterstützt
Application EduAssignments.ReadBasic.All EduAssignments.Read.All, EduAssignments.ReadWrite.All, EduAssignments.ReadWriteBasic.All

HTTP-Anforderung

GET /education/classes/{id}/assignments

Optionale Abfrageparameter

Diese Methode unterstützt den $expandOData-Abfrageparameter , um die Antwort anzupassen.

Für diese Methode stehen die folgenden $expand Optionen zur Verfügung: categories, resources, rubric, submissionsund *, die alle vorherigen Optionen enthält.

Alle Eigenschaften werden für die Abfrageparameter $filter und $orderbyunterstützt.

Anforderungsheader

Kopfzeile Wert
Authorization Bearer {token}. Erforderlich. Erfahren Sie mehr über Authentifizierung und Autorisierung.

Anforderungstext

Geben Sie keinen Anforderungstext für diese Methode an.

Antwort

Bei erfolgreicher Ausführung gibt diese Methode einen 200 OK Antwortcode und eine Auflistung von educationAssignment-Objekten im Antworttext zurück.

Beispiele

Beispiel 1: Aufgaben abrufen

Anforderung

Das folgende Beispiel zeigt eine Anfrage.

GET https://graph.microsoft.com/beta/education/classes/ce2cd7da-e41b-4e66-8390-c9251e4c3a40/assignments

Antwort

Das folgende Beispiel zeigt die Antwort.

Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.

HTTP/1.1 200 OK
Content-type: application/json

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#education/classes('ce2cd7da-e41b-4e66-8390-c9251e4c3a40')/assignments",
    "@odata.nextLink": "https://graph.microsoft.com/beta/education/classes/ce2cd7da-e41b-4e66-8390-c9251e4c3a40/assignments?$skiptoken=MyZRVkZCUVVGQlFVRlNRVUZCUVVGQlFVRkJRWGxCUVVGQlNDczVLMmRqVWpsWWEyVlhWV3BwVkVrd09EUk1aejA5",
    "@microsoft.graph.tips": "Use $select to choose only the properties your app needs, as this can lead to performance improvements. For example: GET education/classes('<guid>')/assignments?$select=addedStudentAction,addToCalendarAction",
    "value": [
        {
            "classId": "ce2cd7da-e41b-4e66-8390-c9251e4c3a40",
            "displayName": "New assignment",
            "closeDateTime": null,
            "dueDateTime": "2025-05-09T00:00:00Z",
            "assignDateTime": null,
            "assignedDateTime": null,
            "allowLateSubmissions": true,
            "resourcesFolderUrl": null,
            "feedbackResourcesFolderUrl": null,
            "createdDateTime": "2025-05-07T18:17:06.2831309Z",
            "lastModifiedDateTime": "2025-05-07T18:17:06.4526679Z",
            "allowStudentsToAddResourcesToSubmission": false,
            "status": "draft",
            "notificationChannelUrl": null,
            "webUrl": "https://teams.microsoft.com/l/entity/66aeee93-507d-479a-a3ef-8f494af43945/classroom?context=%7B%22subEntityId%22%3A%22%7B%5C%22version%5C%22%3A%5C%221.0%5C%22,%5C%22config%5C%22%3A%7B%5C%22classes%5C%22%3A%5B%7B%5C%22id%5C%22%3A%5C%22ce2cd7da-e41b-4e66-8390-c9251e4c3a40%5C%22,%5C%22assignmentIds%5C%22%3A%5B%5C%22f5e60dc1-d084-4ca4-a3b4-025f11023059%5C%22%5D%7D%5D%7D,%5C%22action%5C%22%3A%5C%22navigate%5C%22,%5C%22view%5C%22%3A%5C%22assignment-viewer%5C%22,%5C%22appId%5C%22%3A%5C%22de8bc8b5-d9f9-48b1-a8ad-b748da725064%5C%22%7D%22,%22channelId%22%3Anull%7D",
            "addToCalendarAction": "none",
            "addedStudentAction": "none",
            "languageTag": "en-US",
            "moduleUrl": null,
            "id": "f5e60dc1-d084-4ca4-a3b4-025f11023059",
            "grading": null,
            "instructions": {
                "content": null,
                "contentType": "text"
            },
            "assignTo": {
                "@odata.type": "#microsoft.graph.educationAssignmentClassRecipient"
            },
            "createdBy": {
                "application": null,
                "device": null,
                "user": {
                    "id": "fffafb29-e8bc-4de3-8106-be76ed2ad499",
                    "displayName": null
                }
            },
            "lastModifiedBy": {
                "application": null,
                "device": null,
                "user": {
                    "id": "fffafb29-e8bc-4de3-8106-be76ed2ad499",
                    "displayName": null
                }
            }
        }
    ]
}

Beispiel 2: Abrufen von Aufgaben mit $expand Optionen

Anforderung

Das folgende Beispiel zeigt eine Anfrage.

GET https://graph.microsoft.com/beta/education/classes/ce2cd7da-e41b-4e66-8390-c9251e4c3a40/assignments?$expand=resources

Antwort

Das folgende Beispiel zeigt die Antwort. Die Antwort enthält die Liste der Ressourcen für jede Aufgabe.

Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.

HTTP/1.1 200 OK
Content-type: application/json
Content-length: 344

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#education/classes('ce2cd7da-e41b-4e66-8390-c9251e4c3a40')/assignments(resources())",
    "@odata.nextLink": "https://graph.microsoft.com/beta/education/classes/ce2cd7da-e41b-4e66-8390-c9251e4c3a40/assignments?$expand=resources&$skiptoken=MyZRVkZCUVVGQlFVRlNRVUZCUVVGQlFVRkJRWGxCUVVGQmRFY3lhVXgwV20xWVZYbDZOMHhqY1ZKckswMXBkejA5",
    "@microsoft.graph.tips": "Use $select to choose only the properties your app needs, as this can lead to performance improvements. For example: GET education/classes('<guid>')/assignments?$select=addedStudentAction,addToCalendarAction",
    "value": [
        {
            "classId": "ce2cd7da-e41b-4e66-8390-c9251e4c3a40",
            "displayName": "New assignment",
            "closeDateTime": null,
            "dueDateTime": "2025-05-09T00:00:00Z",
            "assignDateTime": null,
            "assignedDateTime": null,
            "allowLateSubmissions": true,
            "resourcesFolderUrl": null,
            "feedbackResourcesFolderUrl": null,
            "createdDateTime": "2025-05-07T18:17:06.2831309Z",
            "lastModifiedDateTime": "2025-05-07T18:17:06.4526679Z",
            "allowStudentsToAddResourcesToSubmission": false,
            "status": "draft",
            "notificationChannelUrl": null,
            "webUrl": "https://teams.microsoft.com/l/entity/66aeee93-507d-479a-a3ef-8f494af43945/classroom?context=%7B%22subEntityId%22%3A%22%7B%5C%22version%5C%22%3A%5C%221.0%5C%22,%5C%22config%5C%22%3A%7B%5C%22classes%5C%22%3A%5B%7B%5C%22id%5C%22%3A%5C%22ce2cd7da-e41b-4e66-8390-c9251e4c3a40%5C%22,%5C%22assignmentIds%5C%22%3A%5B%5C%22f5e60dc1-d084-4ca4-a3b4-025f11023059%5C%22%5D%7D%5D%7D,%5C%22action%5C%22%3A%5C%22navigate%5C%22,%5C%22view%5C%22%3A%5C%22assignment-viewer%5C%22,%5C%22appId%5C%22%3A%5C%22de8bc8b5-d9f9-48b1-a8ad-b748da725064%5C%22%7D%22,%22channelId%22%3Anull%7D",
            "addToCalendarAction": "none",
            "addedStudentAction": "none",
            "languageTag": "en-US",
            "moduleUrl": null,
            "id": "f5e60dc1-d084-4ca4-a3b4-025f11023059",
            "grading": null,
            "instructions": {
                "content": null,
                "contentType": "text"
            },
            "assignTo": {
                "@odata.type": "#microsoft.graph.educationAssignmentClassRecipient"
            },
            "createdBy": {
                "application": null,
                "device": null,
                "user": {
                    "id": "fffafb29-e8bc-4de3-8106-be76ed2ad499",
                    "displayName": null
                }
            },
            "lastModifiedBy": {
                "application": null,
                "device": null,
                "user": {
                    "id": "fffafb29-e8bc-4de3-8106-be76ed2ad499",
                    "displayName": null
                }
            },
            "resources@odata.context": "https://graph.microsoft.com/beta/$metadata#education/classes('ce2cd7da-e41b-4e66-8390-c9251e4c3a40')/assignments('f5e60dc1-d084-4ca4-a3b4-025f11023059')/resources",
            "resources": []
        }
    ]
}

Beispiel 3: Verwenden $filter zum Abrufen von Aufgaben

Anforderung

Das folgende Beispiel zeigt eine Anfrage.

GET https://graph.microsoft.com/beta/education/classes/ce2cd7da-e41b-4e66-8390-c9251e4c3a40/assignments?$filter=status eq 'assigned'

Antwort

Das folgende Beispiel zeigt die Antwort.

Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.

HTTP/1.1 200 OK
Content-type: application/json

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#education/classes('ce2cd7da-e41b-4e66-8390-c9251e4c3a40')/assignments(resources())",
    "@odata.nextLink": "https://graph.microsoft.com/beta/education/classes/ce2cd7da-e41b-4e66-8390-c9251e4c3a40/assignments?$expand=resources&$skiptoken=MyZRVkZCUVVGQlFVRlNRVUZCUVVGQlFVRkJRWGxCUVVGQlozTk9VVEZCWmpCS01IRm5ZMHBzTVhGT0szY3JkejA5",
    "@microsoft.graph.tips": "Use $select to choose only the properties your app needs, as this can lead to performance improvements. For example: GET education/classes('<guid>')/assignments?$select=addedStudentAction,addToCalendarAction",
    "value": [
        {
            "classId": "ce2cd7da-e41b-4e66-8390-c9251e4c3a40",
            "displayName": "New assignment",
            "closeDateTime": null,
            "dueDateTime": "2025-05-09T00:00:00Z",
            "assignDateTime": null,
            "assignedDateTime": null,
            "allowLateSubmissions": true,
            "resourcesFolderUrl": null,
            "feedbackResourcesFolderUrl": null,
            "createdDateTime": "2025-05-07T18:17:06.2831309Z",
            "lastModifiedDateTime": "2025-05-07T18:17:06.4526679Z",
            "allowStudentsToAddResourcesToSubmission": false,
            "status": "assigned",
            "notificationChannelUrl": null,
            "webUrl": "https://teams.microsoft.com/l/entity/66aeee93-507d-479a-a3ef-8f494af43945/classroom?context=%7B%22subEntityId%22%3A%22%7B%5C%22version%5C%22%3A%5C%221.0%5C%22,%5C%22config%5C%22%3A%7B%5C%22classes%5C%22%3A%5B%7B%5C%22id%5C%22%3A%5C%22ce2cd7da-e41b-4e66-8390-c9251e4c3a40%5C%22,%5C%22assignmentIds%5C%22%3A%5B%5C%22f5e60dc1-d084-4ca4-a3b4-025f11023059%5C%22%5D%7D%5D%7D,%5C%22action%5C%22%3A%5C%22navigate%5C%22,%5C%22view%5C%22%3A%5C%22assignment-viewer%5C%22,%5C%22appId%5C%22%3A%5C%22de8bc8b5-d9f9-48b1-a8ad-b748da725064%5C%22%7D%22,%22channelId%22%3Anull%7D",
            "addToCalendarAction": "none",
            "addedStudentAction": "none",
            "languageTag": "en-US",
            "moduleUrl": null,
            "id": "f5e60dc1-d084-4ca4-a3b4-025f11023059",
            "grading": null,
            "instructions": {
                "content": null,
                "contentType": "text"
            },
            "assignTo": {
                "@odata.type": "#microsoft.graph.educationAssignmentClassRecipient"
            },
            "createdBy": {
                "application": null,
                "device": null,
                "user": {
                    "id": "fffafb29-e8bc-4de3-8106-be76ed2ad499",
                    "displayName": null
                }
            },
            "lastModifiedBy": {
                "application": null,
                "device": null,
                "user": {
                    "id": "fffafb29-e8bc-4de3-8106-be76ed2ad499",
                    "displayName": null
                }
            },
            "resources@odata.context": "https://graph.microsoft.com/beta/$metadata#education/classes('ce2cd7da-e41b-4e66-8390-c9251e4c3a40')/assignments('f5e60dc1-d084-4ca4-a3b4-025f11023059')/resources",
            "resources": []
        }
    ]
}

Beispiel 4: Verwenden $orderby zum Abrufen von Aufgaben

Anforderung

Das folgende Beispiel zeigt eine Anfrage.

GET https://graph.microsoft.com/beta/education/classes/ce2cd7da-e41b-4e66-8390-c9251e4c3a40/assignments?$ordeby= id

Antwort

Das folgende Beispiel zeigt die Antwort.

Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.

HTTP/1.1 200 OK
Content-type: application/json

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#education/classes('ce2cd7da-e41b-4e66-8390-c9251e4c3a40')/assignments",
    "@odata.nextLink": "https://graph.microsoft.com/beta/education/classes/ce2cd7da-e41b-4e66-8390-c9251e4c3a40/assignments?$filter=status+eq+%27assigned%27&$skiptoken=MyZRVkZCUVVGQlFVRlJkMEZCUVVGQlFVRkJRWGxCUVVGQllWbFdhVlF5UVdWcVZYbEZNRXB0TUhWVFRYUXpkejA5",
    "@microsoft.graph.tips": "Use $select to choose only the properties your app needs, as this can lead to performance improvements. For example: GET education/classes('<guid>')/assignments?$select=addedStudentAction,addToCalendarAction",
    "value": [
        {
            "classId": "ce2cd7da-e41b-4e66-8390-c9251e4c3a40",
            "displayName": "Physics",
            "closeDateTime": null,
            "dueDateTime": "2024-07-05T18:29:00Z",
            "assignDateTime": null,
            "assignedDateTime": "2024-07-04T10:13:55.7459728Z",
            "allowLateSubmissions": true,
            "resourcesFolderUrl": null,
            "feedbackResourcesFolderUrl": "https://graph.microsoft.com/v1.0/drives/b!uf0jSRLkbEOG04PymQ5PtqVEDwHjP_xMlkkpCG-1CkLPLpFkTfqZR5sy80gMS-VY/items/01VPGD5VLEUC5G56NOFVDKD6POMN4LGKVD",
            "createdDateTime": "2024-07-04T08:46:19.8896923Z",
            "lastModifiedDateTime": "2024-07-04T10:13:59.8878321Z",
            "allowStudentsToAddResourcesToSubmission": true,
            "status": "assigned",
            "notificationChannelUrl": null,
            "webUrl": "https://teams.microsoft.com/l/entity/66aeee93-507d-479a-a3ef-8f494af43945/classroom?context=%7B%22subEntityId%22%3A%22%7B%5C%22version%5C%22%3A%5C%221.0%5C%22,%5C%22config%5C%22%3A%7B%5C%22classes%5C%22%3A%5B%7B%5C%22id%5C%22%3A%5C%22ce2cd7da-e41b-4e66-8390-c9251e4c3a40%5C%22,%5C%22assignmentIds%5C%22%3A%5B%5C%22cb190e9f-650d-4798-b8d0-6d00079a4c4b%5C%22%5D%7D%5D%7D,%5C%22action%5C%22%3A%5C%22navigate%5C%22,%5C%22view%5C%22%3A%5C%22assignment-viewer%5C%22,%5C%22appId%5C%22%3A%5C%22de8bc8b5-d9f9-48b1-a8ad-b748da725064%5C%22%7D%22,%22channelId%22%3Anull%7D",
            "addToCalendarAction": "studentsAndPublisher",
            "addedStudentAction": "none",
            "languageTag": "en-US",
            "moduleUrl": null,
            "id": "cb190e9f-650d-4798-b8d0-6d00079a4c4b",
            "instructions": {
                "content": "<div>Screw guage</div>",
                "contentType": "html"
            },
            "grading": {
                "@odata.type": "#microsoft.graph.educationAssignmentPointsGradeType",
                "maxPoints": 100
            },
            "assignTo": {
                "@odata.type": "#microsoft.graph.educationAssignmentClassRecipient"
            },
            "createdBy": {
                "application": null,
                "device": null,
                "user": {
                    "id": "0dcb98c3-8c7c-4f7a-a10d-7ed76e03e38f",
                    "displayName": null
                }
            },
            "lastModifiedBy": {
                "application": null,
                "device": null,
                "user": {
                    "id": "5e3ce6c0-2b1f-4285-8d4b-75ee78787346",
                    "displayName": null
                }
            }
        }
    ]
}

Beispiel 5: Verwenden Sie $expand zum Abrufen des Notenschemas für eine Aufgabe

Anforderung

Das folgende Beispiel zeigt eine Anfrage.

GET https://graph.microsoft.com/beta/education/classes/37d99af7-cfc5-4e3b-8566-f7d40e4a2070/assignments?&expand=gradingScheme

Antwort

Das folgende Beispiel zeigt die Antwort.

Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.

HTTP/1.1 200 OK
Content-type: application/json

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#education/classes('37d99af7-cfc5-4e3b-8566-f7d40e4a2070')/assignments(gradingScheme())",
    "@odata.nextLink": "https://graph.microsoft.com/beta/education/classes/37d99af7-cfc5-4e3b-8566-f7d40e4a2070/assignments?expand=gradingScheme&$skiptoken=MyZRVkZCUVVGQlFVRmtRVVZCUVVGQlFVRkJRWGxCUVVGQmNubDJiblZOYzBnNVJWTndkbEJHVTNKVlVuVmlRVDA5",
    "@microsoft.graph.tips": "Use $select to choose only the properties your app needs, as this can lead to performance improvements. For example: GET education/classes('<guid>')/assignments?$select=addedStudentAction,addToCalendarAction",
    "value": [
        {
            "classId": "37d99af7-cfc5-4e3b-8566-f7d40e4a2070",
            "displayName": "new submission",
            "closeDateTime": null,
            "dueDateTime": "2025-04-29T18:29:00Z",
            "assignDateTime": null,
            "assignedDateTime": "2025-04-29T14:53:05.2974529Z",
            "allowLateSubmissions": true,
            "resourcesFolderUrl": null,
            "feedbackResourcesFolderUrl": "https://graph.microsoft.com/v1.0/drives/b!-Ik2sRPLDEWy_bR8l75jfeDcpXQcRKVOmcml10NQLQ1F8CNZWU38SarWxPyWM7jx/items/01VANVJQ7ONF5UOYTXZVEKCZE43FTQRH2S",
            "createdDateTime": "2025-04-29T14:52:15.4472281Z",
            "lastModifiedDateTime": "2025-05-07T21:28:57.6756103Z",
            "allowStudentsToAddResourcesToSubmission": true,
            "status": "assigned",
            "notificationChannelUrl": "https://graph.microsoft.com/v1.0/teams/37d99af7-cfc5-4e3b-8566-f7d40e4a2070/channels/37d99af7-cfc5-4e3b-8566-f7d40e4a2070",
            "webUrl": "https://teams.microsoft.com/l/entity/66aeee93-507d-479a-a3ef-8f494af43945/classroom?context=%7B%22subEntityId%22%3A%22%7B%5C%22version%5C%22%3A%5C%221.0%5C%22,%5C%22config%5C%22%3A%7B%5C%22classes%5C%22%3A%5B%7B%5C%22id%5C%22%3A%5C%2237d99af7-cfc5-4e3b-8566-f7d40e4a2070%5C%22,%5C%22assignmentIds%5C%22%3A%5B%5C%22ed33a213-f67f-4eb8-bfea-f45e6cba041f%5C%22%5D%7D%5D%7D,%5C%22action%5C%22%3A%5C%22navigate%5C%22,%5C%22view%5C%22%3A%5C%22assignment-viewer%5C%22,%5C%22appId%5C%22%3A%5C%22de8bc8b5-d9f9-48b1-a8ad-b748da725064%5C%22%7D%22,%22channelId%22%3Anull%7D",
            "addToCalendarAction": "studentsAndTeamOwners",
            "addedStudentAction": "assignIfOpen",
            "languageTag": "en-US",
            "moduleUrl": "https://graph.microsoft.com/v1.0/education/classes/37d99af7-cfc5-4e3b-8566-f7d40e4a2070/modules/1b9a03b6-dcc5-4ff1-8226-b92e25072f43/",
            "id": "ed33a213-f67f-4eb8-bfea-f45e6cba041f",
            "instructions": {
                "content": "new submission",
                "contentType": "html"
            },
            "grading": {
                "@odata.type": "#microsoft.graph.educationAssignmentPointsGradeType",
                "maxPoints": 100
            },
            "assignTo": {
                "@odata.type": "#microsoft.graph.educationAssignmentClassRecipient"
            },
            "createdBy": {
                "application": null,
                "device": null,
                "user": {
                    "id": "fffafb29-e8bc-4de3-8106-be76ed2ad499",
                    "displayName": null
                }
            },
            "lastModifiedBy": {
                "application": null,
                "device": null,
                "user": {
                    "id": "fffafb29-e8bc-4de3-8106-be76ed2ad499",
                    "displayName": null
                }
            },
            "gradingScheme": {
                "id": "696290ba-1925-490e-a5d2-026bad0dbdc1",
                "displayName": "New name for Pass/Fail Scheme",
                "hidePointsDuringGrading": false,
                "grades": [
                    {
                        "displayName": "Pass",
                        "minPercentage": 60,
                        "defaultPercentage": 100
                    },
                    {
                        "displayName": "Fail",
                        "minPercentage": 0,
                        "defaultPercentage": 0
                    }
                ]
            }
        }
    ]
}