Poll¶
-
class
canvasapi.poll.
Poll
(requester, attributes)¶ Parameters: - requester (
canvasapi.requester.Requester
) – The requester to pass HTTP requests through. - attributes (dict) – The JSON object to build this object with.
-
create_choice
(poll_choice, **kwargs)¶ Create a new choice for the current poll.
Calls: POST /api/v1/polls/:poll_id/poll_choices Parameters: poll_choice (list) – ‘text’ is required, ‘is_correct’ and ‘position’ are optional. Return type: canvasapi.poll_choice.PollChoice
-
create_session
(poll_session, **kwargs)¶ Create a new poll session for this poll
Calls: POST /api/v1/polls/:poll_id/poll_sessions Parameters: poll_session (list) – List of arguments. course_id (required): id of the course for the session, course_section_id (optional): id of the course section for this session, has_public_results (optional): whether the results are viewable by students. Return type: canvasapi.poll_session.PollSession
-
delete
(**kwargs)¶ Delete a single poll, based on the poll id.
Calls: DELETE /api/v1/polls/:id Returns: True if the deletion was successful, false otherwise. Return type: bool
-
get_choice
(poll_choice, **kwargs)¶ Returns the poll choice with the given id.
Calls: GET /api/v1/polls/:poll_id/poll_choices/:id Return type: canvasapi.poll_choice.PollChoice
-
get_choices
(**kwargs)¶ Returns a paginated list of PollChoices of a poll, based on poll id.
Calls: GET /api/v1/polls/:poll_id/poll_choices Return type: canvasapi.paginated_list.PaginatedList
ofcanvasapi.poll_choice.PollChoice
-
get_session
(poll_session, **kwargs)¶ Returns the poll session with the given id.
Calls: GET /api/v1/polls/:poll_id/poll_sessions/:id Parameters: poll_session – List of arguments. Takes a poll session id (int) or poll session object. Return type: canvasapi.poll_session.PollSession
-
get_sessions
(**kwargs)¶ Returns the paginated list of PollSessions in a poll.
Calls: GET /api/v1/polls/:poll_id/poll_sessions Return type: canvasapi.paginated_lsit.Paginated List
ofcanvasapi.poll_session.PollSession
-
update
(poll, **kwargs)¶ Update an existing poll belonging to the current user.
Calls: PUT /api/v1/polls/:id Parameters: poll (list) – List of arguments. ‘Question’ is required and ‘Description’ is optional Return type: canvasapi.poll.Poll
- requester (