The Instructure Community will enter a read-only state on November 22, 2025 as we prepare to migrate to our new Community platform in early December. Read our blog post for more info about this change.
Found this content helpful? Log in or sign up to leave a like!
Hi everyone,
I'm trying to update the use_rubric_for_grading parameter to using the Canvas API, but my changes don't seem to take effect.true
Does anyone know why this might be happening? Could it be a bug on this parameter, or something else I might be overlooking?
I appreciate any guidance or suggestions you can provide.
Thanks in advance!
I,m using this endpoint
Solved! Go to Solution.
Your association type is Course instead of Assignment. It doesn't make sense, and Canvas doesn't allow you, to enable use_for_grading for a course. The option for use_for_grading cannot be turned on from the rubrics page, only for individual assignments.
You need to associate the rubric with an assignment and then look for association_type="Assignment" and association_id = that_assignment_id.
Here's what my association property from the get a single rubric endpoint looks like.
{
"associations": [
{
"id": 7202340,
"rubric_id": 3529130,
"association_id": 28442386,
"association_type": "Assignment",
"use_for_grading": true,
"summary_data": null,
"purpose": "grading",
"hide_score_total": false,
"hide_points": false,
"hide_outcome_results": false
}
]
}
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
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.
Hello,
Thank you for your response! I followed your advice and was able to retrieve the rubric associations using the parameter include[]=assignment_associations.
However, I’m still unable to update the use_for_grading parameter, even after sending the required parameters. Below is a snippet of the test code I’m using:
HEADERS = {
"Authorization": f"Bearer {API_TOKEN}",
"Content-Type": "application/json"
}
params = {
"rubric_association": {
"use_for_grading": True,
}
}
response = requests.put(f"{BASE_URL}/courses/{course_id}/rubric_associations/{rubric_asoc}", headers=HEADERS, json=params)
I don't use Python much and have never used its requests library, so anything I would say on that part would only show my ignorance.
I did test things before I gave it to you to confirm that it changed. I reconfirmed it now. However, I made the change using a REST client rather than through a program.
The only thing I see is that what you have for your actual request isn't valid JSON (you cannot have a trailing comma). But since I don't know Python much, it probably converts it to a proper JSON string. Since you're getting a 200 status, it's obviously not complaining about a malformed request.
How are you determining that the use_for_grading is unchanged? Are you looking at the object returned or by reloading the assignment in Canvas and then editing the rubric? If you're checking through Canvas, are you sure that you have the correct rubric_association_id? That is, did you verify that the code that grabs the ID is grabbing the correct one. You might inadvertently be changing the wrong assignment.
Another possibility is that you're making changes to one instance but checking another. If the use_for_grading is changed in the object returned by your put, but not in Canvas, that could be a case of the wrong assignment (previous paragraph) or the wrong instance. By that, I mean perhaps you're testing in beta but checking the assignment in production.
Thank you for your help—it’s much appreciated!
I’ve been inspecting the response object returned from the PUT request to check if use_for_grading reflects the update. Additionally, I’ve reloaded the assignment in Canvas, edited the rubric, and verified whether the change has been applied. I’ve also used Postman to double-check for any updates.
However, in every case, the value remains unchanged.
I’ve also verified that the rubric_association_id being used is correct. I retrieved it using a GET request with the include[]=assignment_associations parameter, and the ID matches the association for the specific assignment I’m working on.
Finally, I can confirm that I’m testing everything within the same environment (not switching between beta and production).
Your association type is Course instead of Assignment. It doesn't make sense, and Canvas doesn't allow you, to enable use_for_grading for a course. The option for use_for_grading cannot be turned on from the rubrics page, only for individual assignments.
You need to associate the rubric with an assignment and then look for association_type="Assignment" and association_id = that_assignment_id.
Here's what my association property from the get a single rubric endpoint looks like.
{
"associations": [
{
"id": 7202340,
"rubric_id": 3529130,
"association_id": 28442386,
"association_type": "Assignment",
"use_for_grading": true,
"summary_data": null,
"purpose": "grading",
"hide_score_total": false,
"hide_points": false,
"hide_outcome_results": false
}
]
}
Community helpTo 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