Your Community is getting an upgrade!
Read about our partnership with Higher Logic and how we will build the next generation of the Instructure Community.
Found this content helpful? Log in or sign up to leave a like!
We have a process to create assignments via the API and we would like to further expand upon it to make the assignments only visible to certain students.
There appears to be two potential ways to do this via the API:
1) When creating/updating an assignment, you can pass an array of student ids in the "assignment_visibility" field.
2) You can create an "assignment override" and pass in an array of student ids in the "student_ids" field.
I have tried both of these methods and I can never get them to work when doing a POST or PUT. However, if I assign the assignment to an individual student via the web interface, I can see the data when I do a GET. Once again though, if I update the id to a different valid student id and do a PUT, the id is never updated.
Does anyone have an example of doing this successfully?
Right now I am just submitting the data via Postman/Chrome, here is an example of trying to update an existing override with a new student id:
URL:
/courses/84939/assignments/175908/overrides/15277
PUT:
{
"id": 15277,
"assignment_id": 175908,
"title": "1 Student",
"due_at": null,
"all_day": null,
"all_day_date": null,
"unlock_at": null,
"lock_at": null,
"student_ids": [
319823
]
}
Response:
{
"id": 15277,
"assignment_id": 175908,
"title": "No Students",
"student_ids": [
282489
]
}
Note that the student_ids field did not get updated and the title strangely says "No Students".
If you are trying to assign the assignment to a give student or section, then an assignment override is the correct way to go. However, it looks like there are a few problems with your request. The endpoint looks great (assuming that assignment has already been created). The body should look more like this:
"assignment[due_at]": "2016-08-24T18:00:00Z",
"assignment_override[student_ids][]": [
"119776",
"124562"
]
}
All the allowed fields are detailed here.
Hope this helps,
AC
Thanks, that got me on the right path.
To interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign InTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign In