Canvas API: calendar events, assignments, discussions
updated: 12/22/2020
David W. Lyons
lyons (at) lvc.edu
These pages share some code and some notes on using the Canvas API to
create and delete calendar events, assignments, and discussions.
Disclaimer: The code is slow
and crude. It can probably be
improved. The code is quirky and specific to my course
design. Real programmers will probably run screaming.
I will be happy to discuss and collaborate with anyone who
thinks they can make this work better. I can offer limited or
nonexistent support to anyone who wants to modify my quirky code for a
different course set-up.
Files
Course set-up scheme
- Each class day is labelled by a title like "2.1" or "Review Chapter 2"
or "Exam Chapter 2".
- Each class meeting either has a homework
assignment or not. If a homework assignment is due for a class
meeting, it is due before midnight on the day preceding the class
meeting.
- Each class meeting either has a Canvas discussion
associated to it or
not. Discussions are opened at 5pm two days before the class
meeting.
Usage
- Edit the text input file "sample_creation_input.txt". Get your
Canvas course id number by logging in to Canvas. Navigate to the
course you want to work on and look at the address bar in your
browser to see the course code. That goes in the top line of the
input file.
- Each row after the top row has a date and title. These are
required. Optional elements in each row are flags for homework
assignments and discussions. See the file for how to format. Blank
lines or lines that do not contain dates and titles are ignored, so
you can put in comments or blank lines for your own convenience.
- Run the creation script with "python3 gesso.py input_filename"
at the command line.
- See the file "sample_deletion_input.txt" and make the
obvious edits. Run the deletion script with "python3
palimpsest.py input_filename".