AnsweredAssumed Answered

How to make an assignment visible to certain students via the API?

Question asked by Lars Jensen on Sep 21, 2016
Latest reply on Sep 26, 2016 by Lars Jensen


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".

Outcomes