Assignment Groups API

API for accessing Assignment Group and Assignment information.

A GradingRules object looks like:

{
  // Number of lowest scores to be dropped for each user.
  "drop_lowest": 1,
  // Number of highest scores to be dropped for each user.
  "drop_highest": 1,
  // Assignment IDs that should never be dropped.
  "never_drop": [33, 17, 24]
}

An AssignmentGroup object looks like:

{
  // the id of the Assignment Group
  "id": 1,
  // the name of the Assignment Group
  "name": "group2",
  // the position of the Assignment Group
  "position": 7,
  // the weight of the Assignment Group
  "group_weight": 20,
  // the sis source id of the Assignment Group
  "sis_source_id": "1234",
  // the integration data of the Assignment Group
  "integration_data": {"5678":"0954"},
  // the assignments in this Assignment Group (see the Assignment API for a detailed
  // list of fields)
  "assignments": [],
  // the grading rules that this Assignment Group has
  "rules": null
}

List assignment groups AssignmentGroupsController#index

GET /api/v1/courses/:course_id/assignment_groups

Scope: url:GET|/api/v1/courses/:course_id/assignment_groups

Returns the paginated list of assignment groups for the current context. The returned groups are sorted by their position field.

Request Parameters:

Parameter Type Description
include[] string

Associations to include with the group. “discussion_topic”, “all_dates” “assignment_visibility” & “submission” are only valid if “assignments” is also included. The “assignment_visibility” option additionally requires that the Differentiated Assignments course feature be turned on.

Allowed values: assignments, discussion_topic, all_dates, assignment_visibility, overrides, submission

exclude_assignment_submission_types[] string

If “assignments” are included, those with the specified submission types will be excluded from the assignment groups.

Allowed values: online_quiz, discussion_topic, wiki_page, external_tool

override_assignment_dates boolean

Apply assignment overrides for each assignment, defaults to true.

grading_period_id integer

The id of the grading period in which assignment groups are being requested (Requires grading periods to exist.)

scope_assignments_to_student boolean

If true, all assignments returned will apply to the current user in the specified grading period. If assignments apply to other students in the specified grading period, but not the current user, they will not be returned. (Requires the grading_period_id argument and grading periods to exist. In addition, the current user must be a student.)

Returns a list of AssignmentGroups

Get an Assignment Group AssignmentGroupsApiController#show

GET /api/v1/courses/:course_id/assignment_groups/:assignment_group_id

Scope: url:GET|/api/v1/courses/:course_id/assignment_groups/:assignment_group_id

Returns the assignment group with the given id.

Request Parameters:

Parameter Type Description
include[] string

Associations to include with the group. “discussion_topic” and “assignment_visibility” and “submission” are only valid if “assignments” is also included. The “assignment_visibility” option additionally requires that the Differentiated Assignments course feature be turned on.

Allowed values: assignments, discussion_topic, assignment_visibility, submission

override_assignment_dates boolean

Apply assignment overrides for each assignment, defaults to true.

grading_period_id integer

The id of the grading period in which assignment groups are being requested (Requires grading periods to exist on the account)

Returns a AssignmentGroup

Create an Assignment Group AssignmentGroupsApiController#create

POST /api/v1/courses/:course_id/assignment_groups

Scope: url:POST|/api/v1/courses/:course_id/assignment_groups

Create a new assignment group for this course.

Request Parameters:

Parameter Type Description
name string

The assignment group's name

position integer

The position of this assignment group in relation to the other assignment groups

group_weight number

The percent of the total grade that this assignment group represents

sis_source_id string

The sis source id of the Assignment Group

integration_data Object

The integration data of the Assignment Group

rules string

The grading rules that are applied within this assignment group See the Assignment Group object definition for format

Returns a AssignmentGroup

Edit an Assignment Group AssignmentGroupsApiController#update

PUT /api/v1/courses/:course_id/assignment_groups/:assignment_group_id

Scope: url:PUT|/api/v1/courses/:course_id/assignment_groups/:assignment_group_id

Modify an existing Assignment Group. Accepts the same parameters as Assignment Group creation

Returns a AssignmentGroup

Destroy an Assignment Group AssignmentGroupsApiController#destroy

DELETE /api/v1/courses/:course_id/assignment_groups/:assignment_group_id

Scope: url:DELETE|/api/v1/courses/:course_id/assignment_groups/:assignment_group_id

Deletes the assignment group with the given id.

Request Parameters:

Parameter Type Description
move_assignments_to integer

The ID of an active Assignment Group to which the assignments that are currently assigned to the destroyed Assignment Group will be assigned. NOTE: If this argument is not provided, any assignments in this Assignment Group will be deleted.

Returns a AssignmentGroup