ubc / iPeer

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

Canvas Instructors / TAs imported as students #591

Closed kitsook closed 6 years ago

kitsook commented 6 years ago

When sending a parameter with multiple values to Canvas GET API using URI encoding, the parameter name need to has square brackets [] added, e.g.

https://github.com/ubc/iPeer/blob/e54b7f4b2efd5fd5b0477b18ade6aee6be60b84c/app/controllers/components/canvas_course.php#L151-L152

With the change e54b7f4, GET parameters are now sent as request body. Seems that the [] are not needed any more.

So when the iPeer import function tried to get students from Canvas with enrollment_type[]={student}, Canvas ignored the parameter because of the [] and returned everyone in the course. Hence the instructors / TAs are imported as student.

Need to confirm: (1) Should we send GET requests with body (reference: https://stackoverflow.com/questions/978061/http-get-with-request-body) and remove those []; (2) Or, should we limit the change e54b7f4 to POST requests only