rcanvas continues to grow. Thanks to the recent contributions from Chris Hua, getting user groups, announcements, and discussions from your institution’s Canvas instance has never been easier. More collaborators are welcome!
By my lights, R package development should be attuned to the tidyverse. Piping output into a sequence of clear, logical functions not only makes for clean, readable code, but is an undeniably damned good time.
The remainder of this post will showcase the interplay between the tidyverse and various rcanvas functions.
With the data in hand, you can filter by any relevant criteria. Say, for example, you want to know which students have been inactive for more than a week:
library(lubridate) students %>% mutate(inactive_days = as.numeric(round(difftime(ymd(Sys.Date()), ymd_hms(last_activity_at), units = c("days"))))) %>% filter(inactive_days >= 7)
Getting Missing Assignments
Here's how to get all missing assignments for a course, multiple courses, students, or multiple students. Again, the code flow is intuitive. First, get the courses. Second, filter the course(s) you want. Third, pipe the course ids into `purrr::map_df`, and fourth, extend the pipe with user ids into `get_user_items`.
In sum, getting lots of data very quickly is just a matter of piping the course and user ids into various functions and letting the tidyverse do its thing.
What else can I get?
Lots! User page views, profiles, avatars, and observees, or course discussion topics, assignments, files, modules, pages, quizzes, folders, todos, settings, and more. If it’s in the API docs, we’ve tried to include it.