@instruccional2
First, when you look at the assignment object example at the top of the documentation, those are items returned with a GET, but not all of those are supported with a PUT or a POST. In the edit an assignment section,you don't see use_rubric_for_grading. In fact, you don't see anything about rubrics in the edit an assignment section.
That's because rubric use managed by the rubrics controller rather than the assignments controller. There is a rubric that you want to use and there is a rubric_association that tells it which assignment you want to associate it with. On the Rubrics API documentation page, you see three sections: Rubrics, RubricAssessments, and RubricAssociations.
If you already have a rubric associated with an assignment, then you would want to look at the Update a RubricAssociation endpoint. There, you see rubric_association[use_for_grading], which controls whether to use the rubric for grading. Note that it is "use_for_grading" not "use_rubric_for_grading" because it's part of the rubric object and not part of the assignment object, so saying "rubric" would be redundant at this point.
Along the way, the id field in the path is the ID of the rubric association, not the ID of the assignment or the ID of the rubric.
Let's assume I have these IDs
- course_id: 896851
- assignment_id: 28442386
- rubric_id: 3529130
- rubric_association_id: 7202340
To update the rubric to use for grading, you could use
PUT /api/v1/courses/896851/rubric_associations/7202340
The object to send is
{
"rubric_association": {
"use_for_grading": true
}
}
You might encounter problems finding the rubric_association_id. It is not delivered as part of the assignment object. The get assignment endpoint allows you to specify which associations you want with the include[] parameter, but rubric is not one of the options.
The get assignments endpoint does give you the rubric_id under rubric_settings property.
You can use the get a single rubric endpoint with the query parameter include[]=associations or, if you know it's an assignment, include[]=assignment_associations. You then search through the associations property to get the id that matches your association_type="Assignment" and association_id=28442386.
Now that you have the rubric_association_id, you can update the assignment.
If you don't have a rubric already associated with an assignment, then you can associate the rubric and tell it to use_for_grading in a single step using the Create a RubricAssociation endpoint.