The Instructure Community will enter a read-only state on November 22, 2025 as we prepare to migrate to our new Community platform in early December. Read our blog post for more info about this change.
Found this content helpful? Log in or sign up to leave a like!
I'll start with a very specific question with an example:
How exactly are the buckets computed? What are the actual values being used to choose something for the unsubmitted bucket? I can't find info on this...look at my reference section below for all I've found.
As an example to reinforce my question, Why is the following assignment not showing up when I request unsubmitted bucket when it appears to be a valid unsubmitted assignment. (Coincidentally, it does show up on Dashboard List view on the due date, but doesn't show anywhere on the calendar...related?):
{
"id": 691750,
"description": "",
"due_at": "2020-09-28T04:59:59Z",
"unlock_at": "2020-09-16T05:00:00Z",
"lock_at": "2020-09-28T04:59:59Z",
"points_possible": 100,
"grading_type": "points",
"assignment_group_id": 72079,
"grading_standard_id": null,
"created_at": "2020-09-16T18:16:39Z",
"updated_at": "2020-09-16T20:56:30Z",
"peer_reviews": false,
"automatic_peer_reviews": false,
"position": 20,
"grade_group_students_individually": false,
"anonymous_peer_reviews": false,
"group_category_id": null,
"post_to_sis": true,
"moderated_grading": false,
"omit_from_final_grade": false,
"intra_group_peer_reviews": false,
"anonymous_instructor_annotations": false,
"anonymous_grading": false,
"graders_anonymous_to_graders": false,
"grader_count": 0,
"grader_comments_visible_to_graders": true,
"final_grader_id": null,
"grader_names_visible_to_final_grader": true,
"allowed_attempts": -1,
"secure_params": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..tto7HMlkxBn0LE0NjBeGlEopongCj9zPHlv0DL2BgCk",
"course_id": 41166,
"name": "ckla 23.2 Adjectives 9/21",
"submission_types": [
"external_tool"
],
"has_submitted_submissions": false,
"due_date_required": true,
"max_name_length": 30,
"in_closed_grading_period": false,
"is_quiz_assignment": false,
"can_duplicate": false,
"original_course_id": null,
"original_assignment_id": null,
"original_assignment_name": null,
"original_quiz_id": null,
"workflow_state": "published",
"external_tool_tag_attributes": {
"url": "https://google-drive-lti-iad-prod.instructure.com/lti/content-view/cloud-assignment/XXXXXXXXX",
"new_tab": false,
"resource_link_id": "e4ccdc12f13a78d8ebb1b27f45237e7e5f695445",
"external_data": "",
"content_type": "ContextExternalTool",
"content_id": 58
},
"muted": true,
"html_url": "https://XXXXXXXXX.instructure.com/courses/41166/assignments/691750",
"url": "https://XXXXXXXXX.instructure.com/api/v1/courses/41166/external_tools/sessionless_launch?assignment_id=691750&launch_type=assessment",
"published": true,
"only_visible_to_overrides": false,
"locked_for_user": false,
"submissions_download_url": "https://XXXXXXXXX.instructure.com/courses/41166/assignments/691750/submissions?zip=1",
"post_manually": false,
"anonymize_students": false,
"require_lockdown_browser": false
}
MORE INFO:
I'm trying to write a script for myself and other parents at my school because it is simply too difficult for our elementary grade children to find all their assignment, especially unsubmitted ones. Idiosyncrasies like the above make me question that the APIs are returning the true number of assignments the kids need to do as I see things in their dashboards that contradict what the API returns like the above.
When I query for:
/api/v1/courses/41166/assignments?bucket=unsubmitted
it returns an empty list:
[]
even though there is a published assignment showing in their dashboard a week away they have not submitted.
REFERENCE
According to the docs, the assignments API call(s):
GET /api/v1/courses/:course_id/assignments
is supposed to support the following buckets:
If included, only return certain assignments depending on due date and submission status. Allowed values:past, overdue, undated, ungraded, unsubmitted, upcoming, future |
However there is no description of how these are computed. I found this page which describes some of them:
But many are not discussed, including unsubmitted.
So, How exactly are these buckets computed?
I've done some work that relies on missing assignments and going through the Assignments endpoint has proved tricky. I think the submission field is looking at whether or not there have been any submissions, not returning students who have not submitted.
It's much more reliable to go through the Submission endpoint to get that kind of information. Instead of looking at assignments and trying to figure out who hasn't submitted, query the Submission endpoint for all students (or individuals if you have a list of their IDs already) and filter by submission status.
GET /api/v1/courses/:course_id/students/submissions?workflow_state=unsubmitted&student_ids[]=all&grouped=true
Note that you have to specify 'all' in the student_ids[] param or else only your missing assignments are returned. The grouped param returns by User object rather than a flat list of missing assignments.
Thanks. Not exactly what I was looking for, but hopefully you can be of some assistance.
First, it sounds like there is *no* published documentation as to how this really works? We are both making some assumptions as to how/what that unsubmitted bucket it supposed to do, but no one from Canvas wants to actually tell us?
Next, to be clear I'm writing this script from the perspective of a single student. So I am logged in with a token with just the authority to see assignments for one student - and that is what I want. To me, the unsubmitted bucket for the currently authenticated token should show any published assignments without a submission.
What I have found myself having to do is something along these lines:
In essence, what I am trying to accomplish is a view that combines a list of all assignments (like Grades does), but actually shows full submission and date details and does this in a single view for all course.
Here is another part of the problem I'm dealing with trying to find this out. The API documentation seems to be incomplete/incorrect, so I'm not sure how we are supposed to reliably do *anything*
I hear you on the manual processing.
Since the assignments endpoint isn't returning buckets correctly (I confirmed with a dummy class today signed in as a student) you can still do the same by gathering all submissions and then culling the list based on the submission workflow status and then submission history.
This example is using Python to process because there's a really good library I lean on to do the API calls.
from config import PROD_URL, PROD_KEY
from canvasapi import Canvas
def get_course(canvas, id):
course = canvas.get_course(id)
return course
def get_my_missing(submissions):
# Take all submissions and interpolate a list of missing work
missing = [item.assignment['name'] for item in submissions if
item.workflow_state == "unsubmitted" and
item.excused is not True and
item.submitted_at is None
]
return missing
def main():
# set up the Canvas object
canvas = Canvas(PROD_URL, PROD_KEY)
# get the user's course
course_id = input('What course are you looking for? ')
course = get_course(canvas, course_id)
# The endpoint looks for assignment IDs. If you don't supply any, it gets
# submissions for every assignment in the class.
#
# Include the "assignment" param to get the assignment name easily.
# Include the "submission_history"
submissions = course.get_multiple_submissions(include=["assignment"])
missing = get_my_missing(submissions)
# Display the assignment name
for assignment in missing:
print(assignment)
if __name__ == "__main__":
main()
Hello, I was wondering if you found a solution to this. I have the same problem where I want a bucket that only shows upcoming assignments, but some assignments which are upcoming show up while others don't.
Community helpTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign inTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign in