Hello everybody,
I use graph education API to "add work" (files) to an assignment in Teams for Education.
This does not work anymore for assignments created since last week because creating an assignment in Teams no longer creates the directories for the students to upload their work. These are now only created when a student uploads a file in the Teams App.
Using graph API and asking for the educationSubmissions of the assignment, the resourcesFolderUrl is null. So I cannot upload a file and I cannot find a way to create the folders using graph API.
I am happy about any help!
Steps to reproduce:
- Create an Assignment in Teams for Education and assign it to a Team
- Get ID of team and assignment via https://graph.microsoft.com/beta/education/me/classes and https://graph.microsoft.com/beta/education/classes/[id]/assignments.
- Get submissions of assignment via https://graph.microsoft.com/beta/education/classes/[id]/assignments/[id]/submissions. Each resourcesFolderUrl is null until the corresponding user uploads a file in Teams App.
I am not receiving any error, but educationSubmission.resourcesFolderUrl always is null for new assignments. And so I cannot upload any files there.
Yes, I can repro this using Graph Explorer.
Just create and assign an assignment and then check https://graph.microsoft.com/beta/education/classes/[id]/assignments/[id]/submissions using Graph Explorer. You will find each submission with "resourcesFolderUrl": null
.
For assignments created at least two weeks ago, educationSubmission.resourcesFolderUrl still has a correct value like "resourcesFolderUrl": "https://graph.microsoft.com/v1.0/drives/b!3egbNkfJ_ky"
For new assignments these folders are not created at all, even if the assignment is created using the Teams App. So there are two options:
- This is an error in the creation of assignments
- This is intended behavior and there is an undocumented extra command to create the resource folders (Teams App creates the folder on upload but I don't know how to do this from my app).
For an explanation of the accepted answer see my last comment. The key is this new Graph Call: https://learn.microsoft.com/en-us/graph/api/educationsubmission-setupresourcesfolder