ubc / iPeer

Peer Evaluation System
http://ipeer.ctlt.ubc.ca
Other
17 stars 18 forks source link

Canvas assignment API changes #622

Closed kitsook closed 4 years ago

kitsook commented 5 years ago

A Canvas API change will remove the muted parameter from the Assignment Creation API.

iPeer sets this parameter to true when creating a new assignment on Canvas so that the assignment is hidden on gradebook. Will need code change before the parameter is deprecated (Jan 2020).

https://github.com/ubc/iPeer/blob/53bbb6290d88d4e684d49766f16b39963c8ae2aa/app/controllers/evaluations_controller.php#L505-L514

kitsook commented 4 years ago

Initial analysis. With the new gradebook, instead of using the deprecated muted parameter to hide grades, there are three ways to hide them. The "manual posting for an assignment" approach is probably the one we want: instructors need to manually release the synchronized grades on Canvas.

The corresponding Assignment attribute for this is post_manually. However, this attribute is not listed as one of the parameters in Canvas Assignment API. Need to test it out.

kitsook commented 4 years ago

Tried to change the assignment post policy using Canvas web UI. It doesn't use the Assignment API at all. Instead, it uses the new Canvas GraphQL API (POST on /api/graphql):

{
  "operationName": "SetAssignmentPostPolicy",
  "variables": {
    "assignmentId": "xxxx",
    "postManually": true
  },
  "query": "mutation SetAssignmentPostPolicy($assignmentId: ID!, $postManually: Boolean!) {\n  setAssignmentPostPolicy(input: {assignmentId: $assignmentId, postManually: $postManually}) {\n    postPolicy {\n      postManually\n      __typename\n    }\n    errors {\n      attribute\n      message\n      __typename\n    }\n    __typename\n  }\n}\n"
}
timkato commented 4 years ago

Confirming that the "manual posting for an assignment" approach is best