💡 If you are teaching at the University of British Columbia, you may also be interested in the tool
Threadz
which provides visualizations and data from your Canvas discussion forums through a user interface in Canvas. You can learn more about the tool and how to request access in your course from the LTHub Instructor Guide.Threadz
was developed by Eastern Washington University.
This project pulls data via the Canvas API the discussions for the specified Canvas course(s) and exports the results as CSV. The columns exported are:
- 'topic_id',
- 'topic_title',
- 'topic_message',
- 'topic_author_id',
- 'topic_author_name',
- 'topic_timestamp',
- 'post_author_id',
- 'post_author_name',
- 'post_id',
- 'post_parent_id',
- 'post_message',
- 'post_likes',
- 'post_timestamp'
Where a topic
corresponds to a discussion_topic
and post
refers to replies to the discussion_topic
. If a discussion_topic
has no posts then you will see the topic_
columns filled with no corresponding post_
data. A post
may have a post_parent_id
if it is part of a threaded response.
These instructions will get you a copy of the project up and running on your local machine for use with your own API tokens and Canvas domains.
- Install Node 10 or greater.
- Install Git.
-
Clone this repo.
git clone https://github.com/ubccapico/canvas-discussion.git
-
Then cd into the repo.
cd canvas-discussion
-
Run the installation script.
npm install
(If you seebabel-node: command not found
, you've missed this step.) -
Generate Canvas API token and copy it to clipboard
- See Get Started with the Canvas API for more information.
⚠️ Your Canvas API token is the equivalent to your username and password and must be treated as such (following any security guidelines of your home institution).
-
Create a
.env
file. -
Add the following:
CANVAS_API_TOKEN={YOUR API TOKEN}
,CANVAS_API_DOMAIN={YOUR API DOMAIN}
,COURSE_IDS={YOUR COURSE ID(s)}
. > - At UBC theCANVAS_API_DOMAIN
ishttps://ubc.instructure.com/api/v1
- At another institution it might be something like
https://{school}.instructure.com/api/v1
Your .env file should look like
CANVAS_API_TOKEN=22322... CANVAS_API_DOMAIN=https://ubc.instructure.com/api/v1 COURSE_IDS=1111,1112
- At another institution it might be something like
-
Run the script.
npm start
. -
A
{course_id}-discussion.csv
file should be generated with discussion data in the output folder for each provided course_id.
- justin0022 - Justin Lee <justin.lee@ubc.ca>
This project is licensed under the GNU General Public License v3.0.