Assignment Group API shows inactive Assignment Groups

Jump to solution
JohnWatts1
Community Member

Hi All,

I have maybe a newbie question.  I've been using the Canvas APIs to do some data replication and ran into an issue that has me stumped.  We have one course where Assignment Groups (Weighted Grades) were specified and then later removed, however the api still returns the same assignment group information.

If I hit a course with assignment groups that are currently active, I get:

[{"id":72,"name":"Discussions","position":1,"group_weight":25.0,"sis_source_id":null,"integration_data":{},"rules":{}},{"id":73,"name":"Assignment 1","position":2,"group_weight":15.0,"sis_source_id":null,"integration_data":{},"rules":{}},{"id":74,"name":"Assignment 2","position":3,"group_weight":20.0,"sis_source_id":null,"integration_data":{},"rules":{}},{"id":75,"name":"Assignment 3","position":4,"group_weight":20.0,"sis_source_id":null,"integration_data":{},"rules":{}},{"id":76,"name":"Assignment 4","position":5,"group_weight":18.0,"sis_source_id":null,"integration_data":{},"rules":{}},{"id":77,"name":"Graduate Survey","position":6,"group_weight":2.0,"sis_source_id":null,"integration_data":{},"rules":{}}]

If I hit a course with an assignment group that has been removed, I get:

[{"id":84,"name":"Assignments","position":1,"group_weight":55.0,"sis_source_id":null,"integration_data":{},"rules":{}},{"id":85,"name":"Discussions","position":2,"group_weight":33.0,"sis_source_id":null,"integration_data":{},"rules":{}},{"id":86,"name":"Daily Bonus","position":3,"group_weight":5.0,"sis_source_id":null,"integration_data":{},"rules":{}},{"id":87,"name":"Activities","position":4,"group_weight":12.0,"sis_source_id":null,"integration_data":{},"rules":{}},{"id":88,"name":"Imported Assignments","position":5,"group_weight":0.0,"sis_source_id":null,"integration_data":{},"rules":{}}]

 

Is there a different API or parameter that allows me to determine if the assignment group is currently in use?  I've checked a few different APIs and read a decent amount of documentation, but I seem to be missing this information and could really use some guidance.

Labels (1)
0 Likes
1 Solution
chriscas
Community Coach
Community Coach

Hi @JohnWatts1,

After reading your post a couple times, I think what you're asking is for a way to know if the assignment group weighing is actually enabled, correct?  As you're seeing, even if the weighing feature is turned off, Canvas still stores and returns the group weights in case the teacher re-enabled the feature again.  To check if they are active, you can use the courses API and look at the apply_assignment_group_weights parameter (it'll be true if weighing is enabled, false if it is not).

Hope this helps, but if I've totally misunderstood the question, please let me know!

-Chris

View solution in original post