Greg, in our case, we had a faculty who was posting assignments without warning and then expecting them to be done the same day. When the students complained to the dean, he wanted to know when details.
@MarkosZaranis
There may be some ways to get when the assignment was published. I'm going to give you four that I can think of. The first two are relatively easy (compared to the others) but not guaranteed to give an answer. The last two are more difficult to set up, but can pinpoint it with pretty good accuracy if available. The last one can make it downright easy to answer this question in the future, but cannot go back in time.
In my examples, I'll assume that I'm trying to track down assignment 44308608 in course 3903130 and the teacher's login was "james". Those will obviously need to change.
Assignments API
When an assignment is published, it changes the "updated_at" property of the assignment. So do other things, such as modifying the description, changing the due date, etc.
You can use the get a single assignment endpoint of the Assignments API to get that information. If the API is too complicated, you can take any assignment and insert /api/v1 before the course portion of the pathname.
<instance>/courses/3903130/assignments/44308608 becomes <instance>/api/v1/courses/3903130/assignments/44308608.
You will likely need to paste that into some program that formats the JSON, although Firefox might do it for you.
There is also a created_at date which is when the assignment was first created. It may or may not be helpful, but you can know that it could not be published before it was created.
Page Views
If you want to know when something was published, an admin can go to the User Account Details page and at least see when they looked at the assignment. You may have to do a lot of searching and there's nothing there that indicates that it was changed, but it's hard to change it without accessing it. You're looking for a URL like <instance>/courses/3903130/assignments/44308608.
Canvas Data
If you have Canvas Data 2 (CD2), then you can request an incremental table by specifying the --since and --until parameters. The --since is limited to 2023-03-29 for us. I think that's when they enabled CD2 for our institution. I'm not sure if it's turned on for everyone or if you have to have your CSM turn it on. But as long as CD2 is available, you could get the information you want.
The --since and --until filter off the updated_at field and you would want to make sure the --until ISO8601 timestamp was prior to when you think it was published.
For example, if I think an assignment was published early in February 2024 and I know from the created_date that it was published on January 16, I try might try to verify that it was unpublished at the end of January. I'm in US Central Time, but you can probably just use T00:00:00Z and get close enough.
dap incremental --namespace canvas --table assignments --format tsv \
--since 2024-01-16T05:00:00Z --until 2024-02-01T04:59:59Z
This generates a tab separated file for the assignments that were updated between when it was created and the end of January. Column 1 contains the Canvas Assignment ID, column 5 contains the updated_at date and column 6 contains the workflow_state (published or unpublished). Column 55 contains the title, but it's easier to search from the ID number if you have it.
The file goes into the downloads folder and then there is a job_<really long code>. You'll need to go into that folder.
Keeping with the assignment 44308608 , you could do something like this on a Linux system.
zgrep -h 44308608 part-*.gz | cut -f5,6
It shows me something like this, which lets me know that on January 26 it was updated, but it's still unpublished.
2024-01-26T15:02:04.119Z unpublished
Then you can download the assignments with a different set of --since and --until timestamps until you find when it switched from unpublished to published.
In practice, I would probably start with something just before the updated_at date that showed up in the API request at the beginning. We know it was published at that time, so backing up a little bit would let me see if that was when it was published or some other change happened.
If it was published before the last update, then you can use the bisection method between the created_at and updated_at dates to narrow down. If I know it was published by Feb 23 and created on Jan 16, then I would split the difference and try Feb 4. If it's showing published on Feb 4, then I would go half-way between Jan 16 and Feb 4. If it's showing unpublished on Feb 4, then I would go half-way between Feb 4 and Feb 23. Keep that up until you can narrow down when it was published.
Live Events
If you use Canvas Live Events (Data Services under the Admin menu), then you can have Canvas send a notification every time certain events happen. Under the Assignment grouping, there is a notification for assignment_updated. You can have it send that notification to an AWS SQS queue and then you will need to query those periodically. When I set mine up (the cheapest version that costs me less than $2 a month, but we're a small school), I think items would only stay in the queue for 14 days. You would need to download it to a local database where you could then query things.
I can probably get the information from the asset notifications, which is what I use. I originally set it up so that I could tell when users were accessing things. The Access Report is not available through the API but this gives me a reasonable proxy. I also turned on things like conversations, discussions, logging in/out, taking a quiz, leaving a submission comment and submitting assignments. I do not have turned on when assignments were updated, but I do have when they were accessed.
I've customized my tables to make them easier to query and I'm using MySQL but you might be able to do something like this. I'm querying for when I viewed assignment 44308608 within course 3903130.
SELECT FROM_UNIXTIME(sent_ts/1000) AS dt
FROM sqs_queue
WHERE body->>'$.metadata.event_name' = 'asset_accessed'
AND body->>'$.metadata.user_login' = 'james'
AND body->>'$.metadata.context_role' = 'TeacherEnrollment'
AND body->>'$.metadata.context_type' = 'Course'
AND body->>'$.metadata.url' LIKE '%/courses/3903130/assignments/44308608'
ORDER BY dt;
I see that I accessed that assignment at these times.
+--------------------------+
| dt |
+--------------------------+
| 2024-03-08 09:51:11.4930 |
| 2024-03-08 09:51:25.4710 |
| 2024-03-08 09:52:49.6410 |
+--------------------------+
Those are the candidates for when it might have changed from published to unpublished. You cannot tell from asset_accessed what happend. The teacher might have just opened the page or they might have modified the page.
For that, you would want the assignment_updated event notification. I don't have it enabled, so I cannot give a precise example, but it includes a $.body.workflow_state that gives the state (deleted, duplicating, failed_to_import, failed_to_duplicate, failed_to_migrate, importing, published, unpublished) and then you would be able to exactly pinpoint when an assignment was published.
There are a couple of concerns with Canvas Live Events.
- Canvas puts for a best effort to send the notification. If there are network issues or server congestion, then it may not get sent. Still, this is going to be the best way to track when an instructor publishes an assignment.
- Most important of all, you cannot get this data retroactively. It's only good moving forward. If you didn't already have it set up when the assignment was published, it's not going to help you now. But it can in the future.
Like I said, we're a small institution. Since Amazon gives you 1M free requests per month, my monthly charges have never been over $2 and are usually under $1. We only had 2.7M notifications in February. If you're only looking at when assignments were updated, there would be a lot fewer notifications and it might end up being free.