We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Any interest in a contributed function that queries discussion threads to obtain all responses and they're author, e.g. get the full topic?
remove_html_tags <- function(x) { gsub("<.*?>", "", x) } get_discussion_thread = function (discussion_id, object_id, object_type = "courses") { stopifnot(object_type %in% c("courses", "groups")) url <- paste0(rcanvas:::canvas_url(), paste(object_type, object_id, "discussion_topics", discussion_id, "view", sep = "/")) args <- list(per_page = 100) include <- rcanvas:::iter_args_list(NULL, "include[]") args <- c(args, include) # Workaround for process_request issue. resp <- rcanvas:::canvas_query(url, args, "GET") resp = rcanvas:::paginate(resp) %>% purrr::map(httr::content, "text") %>% purrr::map(jsonlite::fromJSON, flatten = TRUE) # Merge two responses together msg_data = dplyr::inner_join(resp[[1]]$view, resp[[1]]$participants, by = c("user_id" = "id")) # Remove html formatting for text msg_data$message = remove_html_tags(msg_data$message) # Release discussion thread information msg_data }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Any interest in a contributed function that queries discussion threads to obtain all responses and they're author, e.g. get the full topic?
The text was updated successfully, but these errors were encountered: