Section¶
-
class
canvasapi.section.
Section
(requester, attributes)¶ Parameters: - requester (
canvasapi.requester.Requester
) – The requester to pass HTTP requests through. - attributes (dict) – The JSON object to build this object with.
-
cross_list_section
(new_course)¶ Move the Section to another course.
Calls: POST /api/v1/sections/:id/crosslist/:new_course_id Parameters: new_course ( canvasapi.course.Course
or int) – The object or ID of the new course.Return type: canvasapi.section.Section
-
decross_list_section
()¶ Undo cross-listing of a section.
Calls: DELETE /api/v1/sections/:id/crosslist Return type: canvasapi.section.Section
-
delete
()¶ Delete a target section.
Calls: DELETE /api/v1/sections/:id Return type: canvasapi.section.Section
-
edit
()¶ Edit contents of a target section.
Calls: PUT /api/v1/sections/:id Return type: canvasapi.section.Section
-
get_enrollments
(**kwargs)¶ List all of the enrollments for the current user.
Calls: GET /api/v1/sections/:section_id/enrollments Return type: canvasapi.paginated_list.PaginatedList
ofcanvasapi.enrollment.Enrollment
-
get_submission
(assignment, user, **kwargs)¶ Get a single submission, based on user id.
Calls: GET /api/v1/sections/:section_id/assignments/:assignment_id/submissions/:user_id
Parameters: - assignment (
canvasapi.assignment.Assignment
or int) – The object or ID of the assignment. - user (
canvasapi.user.User
or int or str) – The object or ID of the user.
Return type: - assignment (
-
list_multiple_submissions
(**kwargs)¶ List submissions for multiple assignments. Get all existing submissions for a given set of students and assignments.
Calls: GET /api/v1/sections/:section_id/students/submissions Return type: canvasapi.paginated_list.PaginatedList
ofcanvasapi.submission.Submission
-
list_submissions
(assignment, **kwargs)¶ Get all existing submissions for an assignment.
Calls: GET /api/v1/sections/:section_id/assignments/:assignment_id/submissions Parameters: assignment ( canvasapi.assignment.Assignment
or int) – The object or ID of the assignment.Return type: canvasapi.paginated_list.PaginatedList
ofcanvasapi.submission.Submission
-
mark_submission_as_read
(assignment, user)¶ Mark submission as read. No request fields are necessary.
Calls: PUT /api/v1/sections/:section_id/assignments/:assignment_id/submissions/:user_id/read
Parameters: - assignment (
canvasapi.assignment.Assignment
or int) – The object or ID of the assignment. - user (
canvasapi.user.User
or int or str) – The object or ID of the user.
Return type: bool
- assignment (
-
mark_submission_as_unread
(assignment, user)¶ Mark submission as unread. No request fields are necessary.
Calls: DELETE /api/v1/sections/:section_id/assignments/:assignment_id/submissions/:user_id/read
Parameters: - assignment (
canvasapi.assignment.Assignment
or int) – The object or ID of the assignment. - user (
canvasapi.user.User
or int or str) – The object or ID of the user.
Return type: bool
- assignment (
-
submit_assignment
(assignment, submission, **kwargs)¶ Makes a submission for an assignment.
Calls: POST /api/v1/sections/:section_id/assignments/:assignment_id/submissions
Parameters: - assignment (
canvasapi.assignment.Assignment
or int) – The object or ID of the assignment. - submission (dict) – The attributes of the submission.
Return type: - assignment (
-
update_submission
(assignment, user, **kwargs)¶ Comment on and/or update the grading for a student’s assignment submission.
Calls: PUT /api/v1/sections/:section_id/assignments/:assignment_id/submissions/:user_id
Parameters: - assignment (
canvasapi.assignment.Assignment
or int) – The object or ID of the assignment. - user (
canvasapi.user.User
or int or str) – The object or ID of the user.
Return type: - assignment (
- requester (