In my previous post I mentioned off-handedly the task of updating the dates on my syllabi as I transition from the Fall to the Spring to the Summer semesters. I figured I would post some of the code to help out with this tiny little mini-project. (All the code for this is available in the following repository.)

I have a pretty simple Canvas main page that has all the dates, readings, and assignments laid out in a simple little table—all on one main page:

sample_table_from_canvas_page

If the only thing about the syllabus that changes from semester to semester is the dates in the “Day/Date” column of the table, then we might want to write a little bit of code that’ll help us generate a Markdown (.md) file with only the dates changed. We can then feed that .md file to pandoc and have it converted to a simple html file that we can use in the Canvas LMS. Simple enough. Here’s a simple [Jupyter notebook] that shows the logic to just get the dates changed. For those that read my previous post, they’ll notice that the code in cell #4 was generated by ChatGPT. :)

We thus get a really nice little Markdown file that converts to an equally nice little html file:

html_rendered_from_markdown_via_pandoc

Further tweaks could be made if you’ve got other information that needs to be changed from semester to semester (i.e. assignments, due dates, etc.) I haven’t yet gotten the Canvas shell ported over from the previous semester, but it would be nice to also provide all of the links (to the readings or to the assignment pages) within the Markdown file as well. A task for another day, for sure!

I suppose—now that I think about it—I should actually go and see if there’s a way to handle all of this natively from within the Canvas LMS. That said, I like to do it on my own first, so even if there’s a way to do all from within Canvas, it’s fun to try out solutions of one’s own to the problem even when the system might already have a way to handle it. That too is no doubt a little journey for another time as well. I would imagine there’s some setting when the courses are migrated from one semester shell to another to handle the date changes, but since this information is stored in an actual “page” of its own within the shell, I’m not sure if there’s a function to deal with that. I know there’s a function to shift the “due dates” for assignments, but this content in the “Reading Schedule” table is in a slightly different spot … Ah, as I say: further sleuthing is in order!

(Update as of December 27th, 2022: A fuller treatment of all of the the above—including changes to the assignment links in the table—is available in a Jupyter notebook here.