It could still be a pagination issue. It's the outer results that are limited, so if it's grouped by student, then you would get 10 students, but perhaps many items for each of those students.
I don't know how to code R, but there are a couple of places I see that it might go.
Here's the link to the source code file for that function: rcanvas/get_course_gradebook.R
Inside of that is this code (starting at line 18)
get_assignment_submissions <- function(course_id, assignment_id) {
url <- sprintf("%s/courses/%s/assignments/%s/submissions",
canvas_url(), course_id, assignment_id)
# process_response(url, args = list(access_token = check_token()))
httr::GET(url, query = list(access_token = check_token())) %>%
httr::content("text") %>%
jsonlite::fromJSON(flatten = TRUE)
}
In the line that has URL, you could add ?per_page=100 after the submissions (change line 1 to line 2)
url <- sprintf("%s/courses/%s/assignments/%s/submissions",
url <- sprintf("%s/courses/%s/assignments/%s/submissions?per_page=100",
However, I suspect that a better place would be on the line that has the query = (line 5 in what I quoted). Again, change line 1 to line 2. Also realize that I don't know R and this may not work, but it sounds reasonable.
httr::GET(url, query = list(access_token = check_token())) %>%
httr::GET(url, query = list(access_token = check_token(), per_page = 100)) %>%
Three notes.
The first is that it will only get you 100 items and if you have 200 students, then it's not going to work beyond the first 100. You'll need to run it as is, then modify the code to add a page=2 and run the code, then modify it to have page=3 and run it and so on until you've gotten all of the students.
The second is that what really needs to happen is that the maintainer of the software needs to handle pagination. They seem to be aware of the issue as one was filed about your exact problem back in May. get_course_gradebook(course_id) shows maximum 10 entries per assignment_id · Issue #13
The person found a work-around and the problem was never fixed, but you should try to reach out to the developers on GitHub.
The third is that passing the access_token in the query string is not the preferred way of sending it. According to the API documentation, Canvas LMS REST API Documentation (emphasis mine).
API authentication is done with OAuth2. If possible, using the HTTP Authorization header is recommended. Sending the access token in the query string or POST parameters is also supported.
They do go on to show an example of how to do it with the query string, but the header is the preferred way. That's not your issue since you're using someone else's library, but you might be concerned with security or possibly mention it to them. I'm not sure what R allows or doesn't allow, but I thought I'd mention it.