Hello,
I am trying to update the end dates for my Canvas courses. I am using the Canvas API module imported to Python.
Looking at this, I assumed that I would be able to just use the update method. Based on this documentation, I thought that I could do so by passing course{end_at] = [date] as a parameter. So, my code looks like this:
course = canvas.get_course(course_id)
course.update(course[end_at] = [date])
This gives me the error: SyntaxError: expression cannot contain assignment, perhaps you meant "=="?
So, then I thought to try the following:
course.update(end_at = date)
This works without any errors, but doesn't actually change the course end date. I tried passing the date as both a string and DateTime object, but had no success.
I could really appreciate some help here. I found posts like this. However, I don't understand how to translate the JSON into the appropriate formatting for this update method in the Python module that I am using. I have no previous experience with coding; I am a History teacher and just started learning to be able to work more quickly in Canvas. So, if you are able to help, please just assume that I don't know anything.