Is there a way that we can query assignment submission grades released after certain date/time?
Seems there is this API:
Which does a similar output, but it doesn't have a way to filter on results released date.
Also we need to pass Course Ids.
Intention is to integration to kick in only when there is any assignment grade results available for students.
Any help to workaround would be greatly appreciated.
Solved! Go to Solution.
The ability to filter by release date is not in the API. You can download all of the events and filter after you have downloaded.
You can filter by submission time and by graded time using the submitted_since and graded_since parameters.
Using Canvas Data Services, you can get a push whenever a submission is created (student submits) or updated (student resubmits or teacher grades). I do not know whether posting triggers this. It is not documented that way and there is no mention of post at all in the documentation.
You can also use the GraphQL interface to get a list of the submission data -- faster than you can by going through the REST API submissions without using the submitted_since or graded_since parameters. I say faster, not because you can filter, but because you can restrict the information returned to just be what you want. They have a posted field, which is true or false as well as the postedAt datetime.
Here's what I would do if I was tasked with this.
- I would keep a local database of submissions. I would use the API to get the submitted_since and again to get the graded_since for each course. This call is quick, although it needs made for every course. I would do this at least a couple of times a day. Let's say at 8 am, 12 noon, 4 pm, and 8 pm. It depends on when your staff is working.
- For the submissions that are already posted, I would go ahead and process those as normal.
- For the submissions that are submitted, but not posted, I would queue those individual assignments more frequently; say every hour.
This doesn't provide instant notification, but it gets it down to within an hour during normal working hours.
If the Data Services Data Streaming panned out, I would do it that way. I don't have that set up though to test. I heard someone say they were using the Amazon SQS queue and their first months bill was so low that the IT department billing got confused by it. You can also set up your own server to receive the streams.
I'm not sure what your integration is that needs to kick in and whether it is time sensitive. If once or twice a day is sufficient, you could back off on the frequency of things.