Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get sections from course #28

Open
nelis73 opened this issue Sep 6, 2018 · 1 comment
Open

get sections from course #28

nelis73 opened this issue Sep 6, 2018 · 1 comment

Comments

@nelis73
Copy link

nelis73 commented Sep 6, 2018

Hi,

Users may want to split up outcomes for sections (instead of groups). Perhaps something like the following could be added? (which seem to work.) These are just get functions, but I can imagine that people also may want to use create functions...

get_sections <- function(course_id){
url <- paste0(rcanvas:::canvas_url(), paste("courses", course_id, "sections",
sep = "/"))
args <- list(per_page = 100)
include <- rcanvas:::iter_args_list(NULL, "include[]")
args <- c(args, include)
rcanvas:::process_response(url, args)
}

get_section_users <- function (section_id){
url <- paste0(rcanvas:::canvas_url(), paste( "sections", section_id, "enrollments",
sep = "/"))
args <- list(per_page = 100)
include <- rcanvas:::iter_args_list(NULL, "include[]")
args <- c(args, include)
rcanvas:::process_response(url, args)
}

@daranzolin
Copy link
Owner

@nelis73 I agree--I think there's admittedly some disharmony in rcanvas with how we/I named functions and controlled how users interact with different end points. Should we have an explicitly named function get_section_students? or a more generic get_course_items where you can pass "enrollments" and filter students, teachers, TAs, etc. If we started over, I think we'd do it a little different.

I think the 'sections' end points are relatively new--they weren't there when I was working with rcanvas earlier. Thanks for letting me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants