daranzolin / rcanvas

R Client for Canvas LMS API
Other
90 stars 43 forks source link

get_submissions() error #52

Open tormodb opened 3 years ago

tormodb commented 3 years ago

When I try to use the get_submissions for assignments with a type_id I am getting the following: Error in canvas_query(url, args, "GET") : Not Found (HTTP 404).

Are anyone else experiencing this issue? I am using the for by @rmtrane as that version seems to be most up to date.

dhicks commented 3 years ago

It looks like the URLs are constructed inconsistently across different functions. In get_submission() the URL is constructed as

url <- sprintf("%scourses/%s/%s/%s/submissions", canvas_url(), 
        course_id, type, type_id)

which leaves out a / between the result of canvas_url() and the course/:course_id/... part.

It looks like the helper function make_canvas_url() is intended to be used to construct URLs more simply and consistently, eg, in get_assignment_list():

url <- make_canvas_url("courses", course_id, "assignments")