Assignments API: Create assignment assigned to one student?

troy-carroll
Community Explorer

Using the assignments API, I can create an assignment with all of the details that I need (name, submission type, points possible, due_at, etc.). But what I need to do is only assign one user to the assignment.

I'm able to create the assignment, then run against the create an assignment override API to add an override for a specific student, but I can't seem to get rid of 'everyone' or 'everyone else'. 

Based on another thread I found here, I should be using overrides instead of assignment_visibility, correct?

SO my main question is...can I generate the override while creating the assignment? If so, what am I missing in the request. I've tried many variations and can't seem to get it to work. This is what I have right now:

https://ourdomain.test.instructure.com/api/v1/courses/:course_id/assignments?assignment[name]=My New Assignment&assignment[submission_types]=none&assignment[points_possible]=1&assignment[grading_type]=points&assignment[due_at]=2020-01-25T00:00:00Z&assignment[description]=This is a test&assignment[published]=true&assignment[has_overrides]=true&assignment_override[student_ids][]=82

The response shown below doesn't show overrides. Or, do I have to do this as 2 separate calls, and create the override after? If so...how do I remove 'everyone' or 'everyone else' from the assignment?

{
"id": 122773,
"description": "This is a test",
"due_at": "2020-01-25T00:00:00Z",
"unlock_at": null,
"lock_at": null,
"points_possible": 1.0,
"grading_type": "points",
"assignment_group_id": 39003,
"grading_standard_id": null,
"created_at": "2020-01-22T18:21:20Z",
"updated_at": "2020-01-22T18:21:20Z",
"peer_reviews": false,
"automatic_peer_reviews": false,
"position": 33,
"grade_group_students_individually": false,
"anonymous_peer_reviews": false,
"group_category_id": null,
"post_to_sis": false,
"moderated_grading": false,
"omit_from_final_grade": false,
"intra_group_peer_reviews": false,
"anonymous_instructor_annotations": false,
"anonymous_grading": false,
"graders_anonymous_to_graders": false,
"grader_count": 0,
"grader_comments_visible_to_graders": true,
"final_grader_id": null,
"grader_names_visible_to_final_grader": true,
"allowed_attempts": -1,
"secure_params": "sdfgsgfdsdfg",
"course_id": 7893,
"name": "My New Assignment",
"submission_types": [
"none"
],
"has_submitted_submissions": false,
"due_date_required": false,
"max_name_length": 255,
"in_closed_grading_period": false,
"is_quiz_assignment": false,
"can_duplicate": true,
"original_course_id": null,
"original_assignment_id": null,
"original_assignment_name": null,
"original_quiz_id": null,
"workflow_state": "published",
"muted": true,
"html_url": "https://ourdomain.test.instructure.com/courses/7893/assignments/122773",
"has_overrides": false,
"needs_grading_count": 0,
"sis_assignment_id": null,
"integration_id": null,
"integration_data": {},
"published": true,
"unpublishable": true,
"only_visible_to_overrides": false,
"locked_for_user": false,
"submissions_download_url": "https://ourdomain.test.instructure.com/courses/7893/assignments/122773/submissions?zip=1",
"post_manually": false,
"anonymize_students": false
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

 

Labels (1)