groups: Groups

groupsR Documentation

Groups

Description

Groups serve as the data for a few different ideas in Canvas. The first is that they can be a community in the canvas network. The second is that they can be organized by students in a course, for study or communication (but not grading). The third is that they can be organized by teachers or account administrators for the purpose of projects, assignments, and grading. This last kind of group is always part of a group category, which adds the restriction that a user may only be a member of one group per category. All of these types of groups function similarly, and can be the parent context for many other types of functionality and interaction, such as collections, discussions, wikis, and shared files. Group memberships are the objects that tie users and groups together.

Add one or more users to a group (or multiple groups). group_id can be a single group ID, in which case all users are added to that group. It can also be a vector of group IDs of the same length as user IDs, in which case each user will be added to the corresponding group

Creates one or more new groups in an existing group set (category)

Usage

get_groups_self()

get_groups_context(object_id, object_type = "courses")

get_group_users(group_id, group_name)

add_group_user(group_id, user_id)

add_group_users(group_id, user_ids)

get_group_categories(course_id)

add_group(category, name, description, join_level)

add_groups(
  category,
  name,
  description,
  join_level = c("parent_context_auto_join", "parent_context_request", "invitation_only")
)

Arguments

object_id

id for given type

object_type

course or account

group_id

the group ID or IDs

group_name

Optional, a name for the group. To be used when you know the name of the group to use. This is generally of form "Group 13", and is what is exposed to you via the Canvas UI. This is noticeably more user-friendly than the group ID number.

user_id

the user ID

user_ids

the users IDS to add to the group

course_id

the Course ID to get the group sets for

category

the ID of the group category (group set)

name

the name(s) of the new group

description

Description(s) of the new group

join_level

Join level of the new group (who can join the group)

Value

users in a group

a tibble with one group set per row

Examples

## Not run: get_groups_self
## Not run: get_groups_context(27)
## Not run: get_group_users(27314)
## Not run: add_group_users(group_id=23, user_ids=327))
## Not run: add_multiple_group_users(group_id=23, user_ids=c(327, 328))
## Not run: add_multiple_group_users(group_id=c(23, 24), user_ids=c(327, 328))
## Not run: get_group_categories(361)
## Not run: add_group(category=128,name="group name", description="description", join_level="invitation_only")

## Not run: add_group(category=128,name=paste('group', 1:2), description="test groups", join_level="invitation_only")

daranzolin/rcanvas documentation built on May 18, 2024, 2:33 p.m.