Searching for an old original assignment

Jump to solution
Rcrodriguez1976
Community Novice

Hello Everybody,

I have a quick question for you: How can you search by an assignment that I created by name without having to go each individual past enrollment course? I don't remember which was the last course where I used it. Is there some kind of global search for assignments that is not course specific?

Thanks

Labels (1)
1 Solution
James
Community Champion

@Rcrodriguez1976 

Here's a quick answer. This is not directly supported.

The long version is that it might be possible if you had access to Canvas Data, which contains a copy of all assignments across all courses. That is generally reserved for tech-people as there is a lot of overhead to it.

The other way involves using the Canvas API to get a list of all your previous courses, then iterating through them one a time, fetching a list of all the assignments within that course, and then checking to see where the assignment exists. Again, not a quick answer.

Thankfully, there is a relatively quick answer that requires minimal programming (I give you the code) that is available to all users. That's to use the GraphQL interface. This is found by adding /graphiql (yes, there's an i in there) to the end of your Canvas dashboard URL.

Paste this code into the editor.

query assignmentSearch {
  allCourses {
    _id
    name
    assignmentsConnection {
      nodes {
        name
      }
    }
  }
}

Now click the Run (triangle) button.

On the third panel over, you'll get a list of all of your courses with their Canvas ID and name. Then it will have the name of each assignment listed within it. You can do a ctrl-f (cmd-f on a mac) and search for the name of your assignment. Then scroll up a little to get the name/ID of the course that it appears in.

Before someone shouts at me for ignoring the limitations Canvas said earlier this semester they were putting in place, as of right now -- and you wanted a quick answer -- this still returns all of the assignments for all of the courses I've ever taught and am still enrolled in.

Later, we may need to mess with pagination, but for right now, this is the best you're going to do.

View solution in original post